<?php

declare(strict_types=1);

namespace App\Framework\LiveComponents\Contracts;

use App\Application\LiveComponents\LiveComponentState;
use App\Framework\LiveComponents\ValueObjects\ComponentId;
use App\Framework\LiveComponents\ValueObjects\ComponentRenderData;

/**
 * LiveComponent Contract
 *
 * Defines the minimal interface for LiveComponents.
 *
 * Components have public readonly properties for id and state, so no getters needed.
 * Action handling is delegated to LiveComponentHandler (composition over inheritance).
 * Rendering is delegated to LiveComponentRenderer in the View module.
 */
interface LiveComponentContract
{
    public ComponentId $id {get;}
    public LiveComponentState $state {get;}


    /**
     * Get render data for the component
     *
     * Returns template path and data instead of rendered HTML.
     * Rendering is delegated to the View module (LiveComponentRenderer).
     */
    public function getRenderData(): ComponentRenderData;
}
