@askrjs/askr/boot
Exports from the declarations published in @askrjs/askr. Signatures reflect the published artifact.
Exports
This entrypoint publishes 11 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.
cleanupApptype
cleanupApp: (root: Element | string) => voidTear down the app mounted at root: runs its cleanup callbacks, clears
route state if it was the last routed root, and removes bookkeeping for
the root element.
createIslandtype
createIsland: (config: IslandConfig) => voidcreateIsland: Enhances existing DOM (no router, mounts once)
createIslandstype
createIslands: (config: IslandsConfig) => voidcreateIslands: Enhances one or more existing DOM roots (no router). The only public islands constructor.
createSPAtype
createSPA: (config: SPAConfig) => Promise<void>createSPA: Initializes the router and mounts the app with an explicit route registry.
``ts
import { createRouteRegistry } from '@askrjs/askr/router';
const registry = createRouteRegistry(() => { ... });
await createSPA({ root: '#app', registry });
hasApptype
hasApp: (root: Element | string) => booleanCheck whether an app instance is currently mounted at root.
hydrateSPAtype
hydrateSPA: (config: HydrateSPAConfig) => Promise<void>hydrateSPA: Hydrate server-rendered HTML with an explicit route registry.
HydrateSPAConfigtype
HydrateSPAConfig: BootRouteSource & {
root: Element | string;
cspNonce?: string;
dataRuntime?: DataRuntime;
/** Auth resolution and redirect options; defaults to the registry's `auth`. */
auth?: RouteAuthOptions;
scrollRestoration?: boolean | ScrollRestorationOptions;
cleanupStrict?: boolean;
hydrate?: {
verifyMarkup?: boolean;
deferUntilIdle?: boolean;
deferBelowFold?: boolean;
foldThreshold?: number;
skipSelectors?: string[];
};
}Configuration for {@link hydrateSPA}.
IslandConfigtype
IslandConfig: {
root: Element | string;
component: ComponentFunction;
cspNonce?: string;
/** Optional data runtime owned by this island's render and event lifecycle. */
dataRuntime?: DataRuntime;
cleanupStrict?: boolean;
routes?: never;
}Configuration for {@link createIsland}: mounts one component onto existing DOM.
IslandsConfigtype
IslandsConfig: {
islands: IslandConfig[];
cspNonce?: string;
}Configuration for {@link createIslands}: mounts several islands at once.
replaceDataRuntimetype
replaceDataRuntime: (root: Element | string, next: DataRuntime) => voidReplace the data owner of a live app without remounting or disposing the previous runtime.
SPAConfigtype
SPAConfig: BootRouteSource & {
root: Element | string;
cspNonce?: string;
/** Optional data runtime, primarily for routed test fixtures. */
dataRuntime?: DataRuntime;
/** Auth resolution and redirect options; defaults to the registry's `auth`. */
auth?: RouteAuthOptions;
scrollRestoration?: boolean | ScrollRestorationOptions;
cleanupStrict?: boolean;
component?: never;
}Configuration for {@link createSPA}.