UNPKG

@knyt/luthier

Version:

A library for building standardized, type-safe native web components with full SSR and hydration support.

38 lines 1.43 kB
import { type Observer, type Reference } from "@knyt/artisan"; import { type ReactiveController, type ReactiveControllerHost } from "@knyt/tasker"; /** * A controller that manages deferred content rendering based on the state of associated promises. * * @remarks * * The controller tracks promises registered through and updates its loading state accordingly. * Through context, it can coordinate with parent controllers to propagate loading states, * and defers to parent controllers when available. * * @internal scope: package */ export declare class DeferredContentNotifier implements ReactiveController, Observer<Promise<any> | undefined> { #private; /** * @internal scope: package */ readonly isLoading$: Reference.Readonly<boolean>; constructor(host: ReactiveControllerHost & HTMLElement); registerPromise<T extends Promise<any>>(promise: T): T; unregisterPromise<T extends Promise<any>>(promise: T): T; /** * A next handler that accepts a promise or undefined. * * @remarks * * This handler allows the class to be used as an observer * that can react to changes in promise references. */ next(data: Promise<any> | undefined): void; hostConnected?: () => void; /** * Cleans up resources used by the controller and removes it from the host. */ destroy(): void; } //# sourceMappingURL=DeferredContentNotifier.d.ts.map