<?php
declare(strict_types=1);
namespace PpPhp\Packages\Ui\Ppui\Foundation;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\ComponentRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\EventRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\IconRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\LayoutRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\PropertyRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\ThemeRegistry;
use PpPhp\Packages\Ui\Ppui\Foundation\Registries\TokenRegistry;
final class Runtime
{
    public readonly ComponentRegistry $components;
    public readonly PropertyRegistry $properties;
    public readonly TokenRegistry $tokens;
    public readonly ThemeRegistry $themes;
    public readonly IconRegistry $icons;
    public readonly LayoutRegistry $layouts;
    public readonly EventRegistry $events;
    public readonly Renderer $renderer;
    public readonly Validator $validator;
    public function __construct()
    {
        $this->components = new ComponentRegistry();
        $this->properties = new PropertyRegistry();
        $this->tokens = new TokenRegistry();
        $this->themes = new ThemeRegistry();
        $this->icons = new IconRegistry();
        $this->layouts = new LayoutRegistry();
        $this->events = new EventRegistry();
        $this->renderer = new Renderer($this->components);
        $this->validator = new Validator();
    }
    public static function boot(): self { return new self(); }
    public function registries(): array
    {
        return ['components'=>$this->components,'properties'=>$this->properties,'tokens'=>$this->tokens,'themes'=>$this->themes,'icons'=>$this->icons,'layouts'=>$this->layouts,'events'=>$this->events];
    }
}
