<?php
declare(strict_types=1);
namespace PpPhp\Packages\Ui\Ppui\Foundation\Definitions;
final class ComponentDefinition extends AbstractDefinition
{
    public function category(): string { return (string)($this->metadata['category'] ?? 'general'); }
    public function properties(): array { return is_array($this->metadata['properties'] ?? null) ? $this->metadata['properties'] : []; }
    public function events(): array { return is_array($this->metadata['events'] ?? null) ? $this->metadata['events'] : []; }
    public function slots(): array { return is_array($this->metadata['slots'] ?? null) ? $this->metadata['slots'] : []; }
    public function template(): ?string { return isset($this->metadata['template']) ? (string)$this->metadata['template'] : null; }
}
