export declare abstract class WebComponent extends window.HTMLElement { static TAG: string; TAG: string; /** * Declare boolean attributes that should be reflected as properties. * The base class auto-generates getters/setters and includes these in * `observedAttributes`. Framework property assignment (e.g. Preact's * `el.disabled = true`) will then correctly set the attribute. */ static reflectedBooleanAttributes: string[]; /** * Declare string attributes that should be reflected as properties. * Getter returns `string|null` (null when attribute is absent). * Setting `null` or `undefined` removes the attribute. */ static reflectedStringAttributes: string[]; /** * Auto-derived from `reflectedBooleanAttributes` and * `reflectedStringAttributes`. Override with `super.observedAttributes` * to add non-reflected observed attributes: * * ```ts * static get observedAttributes () { * return [...super.observedAttributes, 'aria-label'] * } * ``` */ static get observedAttributes(): string[]; static match(el: HTMLElement): HTMLElement | null; /** * Store global wildcard listeners (listen to all events) * Triggered by ALL events dispatched through this element * @private */ private _globalWildcardListeners; /** * Store namespaced wildcard listeners (listen to 'component-name:*') * Triggered by events from emit() that match this component's namespace * @private */ private _namespacedWildcardListeners; static create(elementName: string): typeof WebComponent & { new (...args: any[]): WebComponent; TAG: string; define: typeof WebComponent.define; event: typeof WebComponent.event; }; static define(this: T): void; /** * Runs when the value of an attribute is changed. * * Depends on `static observedAttributes`. * * Should name methods like `handleChange_disabled`. * * @param {string} name The attribute name * @param {string} oldValue The old attribute value * @param {string} newValue The new attribute value */ attributeChangedCallback(name: string, oldValue: string, newValue: string): Promise; /** * Enhanced addEventListener that supports wildcards: * - Component.event('*') - Listen to all namespaced events for this * component (e.g., 'my-component:*') * - '*' - Listen to ALL events (namespaced and non-namespaced, including * normal DOM events) * * @param type - Event type, Component.event('*') for namespaced wildcard, * or '*' for global wildcard * @param listener - Event listener function or object * @param options - Event listener options */ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; /** * Notify namespaced wildcard listeners of an event * Only fires for events that match this component's namespace * * @param event - The event to dispatch to namespaced wildcard listeners * @private */ private _notifyNamespacedWildcardListeners; /** * Notify global wildcard listeners of an event * Fires for ALL events dispatched through this element * * @param event - The event to dispatch to global wildcard listeners * @private */ private _notifyGlobalWildcardListeners; connectedCallback(): void; abstract render(): any; qs(selector: K): HTMLElementTagNameMap[K] | null; qs(selector: string): E | null; qsa(selector: K): HTMLElementTagNameMap[K] | null; qsa(selector: string): E | null; /** * Take a non-namepsaced event name, return namespace event name. * * @param {string} evType The non-namespace event name * @returns {string} Namespaced event name, eg, `my-component:click` */ static event(evType: string): string; /** * Emit a namespaced event. * * @param type (non-namespaced) event type string * @param opts `bubbles`, `detail`, and `cancelable`. Default is * `{ bubbles: true, cancelable: true }` * @returns {boolean} */ emit(type: string, opts?: Partial<{ bubbles: boolean; cancelable: boolean; detail: CustomEvent['detail']; }>): boolean; /** * Override dispatchEvent to notify global wildcard listeners * This ensures that '**' listeners catch ALL events * * @param event - The event to dispatch * @returns true if the event was not cancelled */ dispatchEvent(event: Event): boolean; /** * Create and emit an event, no namespacing. */ dispatch(type: string, opts?: Partial<{ bubbles: boolean; cancelable: boolean; detail: CustomEvent['detail']; }>): boolean; /** * Listen for namespaced events. */ on(evName: string, handler: (ev: T) => any, options?: boolean | AddEventListenerOptions): void; on(evName: string, handler: EventListenerObject, options?: boolean | AddEventListenerOptions): void; /** * Remove a namespaced event listener. */ off(evName: string, handler: (ev: T) => any, options?: boolean | EventListenerOptions): void; off(evName: string, handler: EventListenerObject, options?: boolean | EventListenerOptions): void; /** * Enhanced removeEventListener that supports wildcards: * - Component.event('*') - Remove namespaced wildcard listener * - '*' - Remove global wildcard listener * * @param type - Event type, Component.event('*') for namespaced, or '*' * for global * @param listener - Event listener function or object to remove * @param options - Event listener options */ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } /** * Check if the given tag name has been registered. * * @see {@link https://stackoverflow.com/a/28210364 stackoverflow} * @param {string} elName The custom element tag name. * @returns {boolean} True if the given name has been registered already. */ export declare function isRegistered(elName: string): boolean; export declare function define(name: string, element: CustomElementConstructor): void; //# sourceMappingURL=index.d.ts.map