UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

38 lines (36 loc) • 1.32 kB
import { Component, ComponentReturnType } from './component-class'; import { Cell } from './reactive'; import { IfCondition } from './control-flow/if'; import { SuspenseContext } from './suspense-utils'; export { SUSPENSE_CONTEXT, followPromise, type SuspenseContext, } from './suspense-utils'; export declare function lazy<T>(factory: () => Promise<{ default: T; }>): T; /** * Props for the Suspense component */ export type SuspenseArgs = { Args: { /** Component to render while async content is loading */ fallback: ComponentReturnType; }; Blocks: { /** Default block containing async content */ default: []; }; }; /** * Suspense boundary component that shows a fallback while async children are loading. * Implements SuspenseContext to track pending async operations. */ export declare class Suspense extends Component<SuspenseArgs> implements SuspenseContext { constructor(); pendingAmountCell: Cell<number>; isReleasedCell: Cell<boolean>; get pendingAmount(): number; get isReleased(): boolean; start(): void; end(): void; get fallback(): ComponentReturnType; _template(): Component<any> | IfCondition | import('./control-flow/list').AsyncListComponent<any> | import('./control-flow/list').SyncListComponent<any>; }