export declare class ImpulseElement extends HTMLElement { /** * Set to `true` once you have migrated target connected callbacks to `whenInitialized()` to silence the deprecation * warning about the implicit descendant-definition wait. Set it on `ImpulseElement` to opt out globally, or on a * specific element class to opt out per class. */ static migratedToWhenInitialized: boolean; private property; private target; private action; connectedCallback(): void; static get observedAttributes(): string[]; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; disconnectedCallback(): void; connected(): void; disconnected(): void; /** * Emits a custom event from the element, prefixed with the element's identifier so listeners can tell one element's * events from another's: `this.emit('copied')` on a `` dispatches `clip-board:copied`. * * Takes the same options as the standalone {@link emit}, plus `prefix` (a different prefix, or `false` for the bare * event name) and `target` (what to dispatch from, defaulting to the element). */ emit>(name: string, { target, prefix, ...rest }?: CustomEventInit & { target?: Element | Window | Document; prefix?: boolean | string; }): CustomEvent; get identifier(): string; private _resolveUndefinedElements; } /** * Returns whether `element` is an Impulse element that is initialized right now: its properties, targets, and actions * have started, and it has not been disconnected since. It is `true` from just before `connected()` runs until the * element's teardown begins, just before `disconnected()`. A method that can be called at any time can check it before * reaching for the element's targets. * * Standard HTML elements and non-Impulse custom elements never initialize, so they return `false`, even once * `whenInitialized` has resolved for them. A `data-impulse-element` attribute that was copied by `cloneNode` or * hand-written rather than set by the element itself does not count. * * @param element - The element to check. * @returns `true` if `element` is an initialized Impulse element. * * @example * ```ts * show() { * if (!isInitialized(this)) { * // Not wired up yet: `connected()` opens the dialog once it runs. * this.open = true; * return; * } * this.dialog.showModal(); * } * ``` */ export declare function isInitialized(element: Element): boolean; /** * Returns a promise that resolves once the element is ready to be interacted with. For an Impulse element that means * once its properties, targets, and actions have started. * * This mirrors the familiar `customElements.whenDefined()` pattern, but for an Impulse element resolves on full * initialization rather than mere definition. * * - **Standard HTML elements** (a tag name without a hyphen can never be a custom element) resolve immediately — * there is nothing to initialize. * - **Impulse custom elements** resolve once they have initialized. A `data-impulse-element` attribute that was copied * by `cloneNode` or hand-written rather than set by the element itself does not count. * - **Non-Impulse custom elements** never initialize, so they resolve as soon as their class is defined * (equivalent to `customElements.whenDefined`) — making this safe to use on any target element. * * By default there is no deadline: like `customElements.whenDefined`, the promise stays pending until the element is * ready, so a never-registered (e.g. mistyped) tag never resolves and surfaces as code after the `await` that never * runs. Pass `timeout` to reject after a number of milliseconds you choose — an acceptable wait depends on your bundle * size and your users' network, which only the application can know, so the library does not guess one for you. * * @param element - The element to wait for. * @param options - Optional settings. * @param options.timeout - Milliseconds to wait before rejecting. Omit (or pass `Infinity`) to wait indefinitely. * @returns A promise that resolves with the same element once it is ready. * * @example * ```ts * const select = await whenInitialized(this.select); * select.doSomething(); * * // Bail out after a deadline you choose: * const panel = await whenInitialized(this.panel, { timeout: 5000 }); * ``` */ export declare function whenInitialized(element: T, { timeout }?: { timeout?: number; }): Promise; //# sourceMappingURL=element.d.ts.map