/** * Represents a wire: directive parsed from Blade/Edge templates * Equivalent to PHP's WireDirective class * * @example * ```typescript * // For a directive like wire:model.live="name" * const directive = new WireDirective('model', 'wire:model.live', 'name') * directive.name() // 'model' * directive.value() // 'name' * directive.modifiers() // ['live'] * directive.hasModifier('live') // true * ``` */ export declare class WireDirective { /** * The directive name (e.g., 'model', 'click', 'submit') */ readonly _name: string; /** * The full directive string (e.g., 'wire:model.live', 'wire:click.prevent') */ readonly _directive: string; /** * The directive value (e.g., 'name', 'save', 'handleSubmit') */ readonly _value: string; constructor( /** * The directive name (e.g., 'model', 'click', 'submit') */ _name: string, /** * The full directive string (e.g., 'wire:model.live', 'wire:click.prevent') */ _directive: string, /** * The directive value (e.g., 'name', 'save', 'handleSubmit') */ _value: string); /** * Get the directive name * * @example * // wire:model.live="name" -> 'model' */ name(): string; /** * Get the full directive string * * @example * // wire:model.live="name" -> 'wire:model.live' */ directive(): string; /** * Get the directive value * * @example * // wire:model.live="name" -> 'name' */ value(): string; /** * Get all modifiers applied to the directive * * @example * // wire:model.live.debounce.500ms -> ['live', 'debounce', '500ms'] * // wire:click.prevent.stop -> ['prevent', 'stop'] */ modifiers(): string[]; /** * Check if the directive has a specific modifier * * @param modifier - The modifier to check for * * @example * // wire:model.live.debounce="name" * directive.hasModifier('live') // true * directive.hasModifier('debounce') // true * directive.hasModifier('blur') // false */ hasModifier(modifier: string): boolean; /** * Convert to HTML attribute string * * @example * // wire:model.live="name" -> ' wire:model.live="name"' */ toHtml(): string; /** * Convert to string (returns the value) */ toString(): string; /** * Escape HTML special characters in a string */ private escapeHtml; /** * Create a WireDirective from an attribute string * * @param attributeName - The full attribute name (e.g., 'wire:model.live') * @param value - The attribute value * * @example * const directive = WireDirective.fromAttribute('wire:model.live', 'name') */ static fromAttribute(attributeName: string, value: string): WireDirective | null; /** * Parse all wire directives from an attributes object * * @param attributes - Object containing HTML attributes * * @example * const directives = WireDirective.parseAll({ * 'wire:model.live': 'name', * 'wire:click': 'save', * 'class': 'btn' * }) * // Returns [WireDirective(model), WireDirective(click)] */ static parseAll(attributes: Record): WireDirective[]; }