import type { Fn } from "@thi.ng/api"; import type { ComponentLike, IComponent, NumOrElement } from "./api.js"; import { Component } from "./component.js"; /** * Simple component wrapper for {@link ComponentLike} promises. When this * component mounts it will `await` the given promise or if it fails, compile * the result of the given (optional) `error` handler as component body. * * @example * ```ts * import { $promise, type ComponentLike } from "@thi.ng/rdom"; * * const prom = Promise.resolve( * ["div", {}, "Resolved!"] * ); * * $promise(prom).mount(document.body); * ``` * * @param prom - * @param error - */ export declare const $promise: (prom: Promise, error?: Fn) => $Promise; export declare class $Promise extends Component { protected promise: Promise; protected error: Fn; inner?: IComponent; constructor(promise: Promise, error?: Fn); mount(parent: ParentNode, index: NumOrElement): Promise; unmount(): Promise; } //# sourceMappingURL=promise.d.ts.map