*/ public const HOOK_TO_LOCATION = [ Asset::HOOK_FRONTEND => Asset::FRONTEND, Asset::HOOK_BACKEND => Asset::BACKEND, Asset::HOOK_LOGIN => Asset::LOGIN, Asset::HOOK_CUSTOMIZER => Asset::CUSTOMIZER, Asset::HOOK_CUSTOMIZER_PREVIEW => Asset::CUSTOMIZER_PREVIEW, Asset::HOOK_BLOCK_ASSETS => Asset::BLOCK_ASSETS, Asset::HOOK_BLOCK_EDITOR_ASSETS => Asset::BLOCK_EDITOR_ASSETS, Asset::HOOK_ACTIVATE => Asset::ACTIVATE, ]; /** * Contains the full url to file. * * @return string */ public function url(): string; /** * Returns the full file path to the asset. * * @return string */ public function filePath(): string; /** * Define the full filePath to the Asset. * * @param string $filePath * * @return static */ public function withFilePath(string $filePath): Asset; /** * Name of the given asset. * * @return string */ public function handle(): string; /** * A list of handle-dependencies. * * @return string[] */ public function dependencies(): array; /** * @param string ...$dependencies * * @return static */ public function withDependencies(string ...$dependencies): Asset; /** * The current version of the asset. * * @return string|null */ public function version(): ?string; /** * @param string $version * * @return static */ public function withVersion(string $version): Asset; /** * @return bool */ public function enqueue(): bool; /** * @param bool|callable $enqueue * * @return static * * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType */ public function canEnqueue($enqueue): Asset; /** * Location where the asset is enqueued. * * @return int * * @example Asset::FRONTEND | Asset::BACKEND * @example Asset::FRONTEND */ public function location(): int; /** * Define a location based on Asset location types. * * @param int $location * * @return static */ public function forLocation(int $location): Asset; /** * A list of assigned output filters to change the rendered tag. * * @return callable[]|AssetOutputFilter[]|class-string[] */ public function filters(): array; /** * @param callable|class-string ...$filters * * @return static */ public function withFilters(...$filters): Asset; /** * Name of the handler class to register and enqueue the asset. * * @return class-string */ public function handler(): string; /** * @param class-string $handler * * @return static */ public function useHandler(string $handler): Asset; /** * @return array */ public function data(): array; /** * Add a conditional tag for your Asset. * * @param string $condition * * @return static * * @see https://developer.wordpress.org/reference/functions/wp_script_add_data/#comment-1007 */ public function withCondition(string $condition): Asset; /** * @return array */ public function attributes(): array; /** * @param array $attributes * * @return Asset */ public function withAttributes(array $attributes): Asset; }