<?php

declare(strict_types=1);

namespace App\Framework\LiveComponents\Contracts;

use App\Application\LiveComponents\LiveComponentState;
use App\Framework\LiveComponents\ValueObjects\ComponentData;

interface Pollable
{
    /**
     * Poll for new data
     *
     * @return ComponentData Updated component data
     */
    public function poll(): LiveComponentState;

    /**
     * Get polling interval in milliseconds
     */
    public function getPollInterval(): int;
}
