<?php
/**
 * Widget contract — registry entries implement this.
 *
 * @package AuraBuilder
 */

declare(strict_types=1);

namespace AuraBuilder\Widgets;

use AuraBuilder\Document\Node;

interface WidgetInterface {

	public function get_type(): string;

	public function get_title(): string;

	public function get_category(): string;

	public function get_icon(): string;

	/**
	 * @return array<string, mixed>
	 */
	public function get_defaults(): array;

	/**
	 * Control schema for the editor.
	 *
	 * @return list<array<string, mixed>>
	 */
	public function get_controls(): array;

	/**
	 * @param array<string, mixed> $settings
	 * @return array<string, mixed>
	 */
	public function sanitize_settings( array $settings ): array;

	/**
	 * Render HTML for frontend / preview.
	 *
	 * @param array<string, mixed> $context
	 */
	public function render( Node $node, array $context = array() ): string;

	/** Can hold children? section/container/root. */
	public function is_container(): bool;
}
