<?php
/**
 * Template type constants.
 *
 * @package AuraBuilder
 */

declare(strict_types=1);

namespace AuraBuilder\Templates;

final class TemplateTypes {

	public const COMPONENT = 'component';
	public const PAGE      = 'page';
	public const HEADER    = 'header';
	public const FOOTER    = 'footer';
	public const KIT       = 'kit';

	public const SOURCE_CORE = 'core';
	public const SOURCE_USER = 'user';

	public const USER_OPTION        = 'aptb_user_templates';
	public const USER_OPTION_LEGACY = 'aura_builder_user_templates';

	/**
	 * @return list<string>
	 */
	public static function all(): array {
		return array(
			self::COMPONENT,
			self::PAGE,
			self::HEADER,
			self::FOOTER,
			self::KIT,
		);
	}

	public static function is_valid( string $type ): bool {
		return in_array( $type, self::all(), true );
	}
}
