import { type Mountable } from './build-context.js'; import type { SignalComponentDef } from './component.js'; import type { Renderable } from './element.js'; export interface SignalLazyOptions { /** async loader — typically `() => import('./Chart').then(m => m.default)`. The * loaded component's S/M/E are inferred, so `initialState` is typed and no cast * is needed at the call site. */ loader: () => Promise>; /** nodes rendered (reactively, in the current build) while loading */ fallback: () => Renderable; /** nodes rendered if the loader rejects (nothing if omitted) */ error?: (err: Error) => Renderable; /** seed state for the loaded component, overriding its `init()` result */ initialState?: LS; } /** * Load a signal component asynchronously. Renders `fallback()` immediately as * siblings of an anchor comment (built in the CURRENT build, so the fallback is * reactive). When `loader()` resolves, the fallback region is removed and the * loaded component is mounted via `mountSignalComponent({ anchor, mode:'append' })` * — reusing the anchor-mount infra (nodes inserted after the anchor, bracketed by * an `llui-mount-end` sentinel; its handle owns that region's update loop and * dispose). If the loader rejects, `error(err)` is swapped in (or nothing). * * If the surrounding build is torn down before the loader settles, a cancelled * flag skips the deferred mount; any already-mounted child handle is disposed. */ export declare function signalLazy(opts: SignalLazyOptions): Mountable; //# sourceMappingURL=lazy.d.ts.map