/** * @module init-orchestration * * Shared web orchestration functions for booting ibgib-based frontend apps. * * ## what belongs here * * Functions that define the startup sequence and are identical across all * ibgib apps. These depend only on the IbGibAmbientContextConfig seam. * App-specific logic (typed globalThis accessors, component helpers) belongs * in each app's own helpers.web.mts. */ import { IbGibDynamicComponentMetaCtorOpts } from "../ui/component/component-types.mjs"; import { IbGibAmbientContextConfig, IbGibGlobalThis_Common, IbGibGlobalThis_IbGibApp } from "./types.mjs"; /** * Initializes the IndexedDB stores required by an ibgib app. * * Call once on DOMContentLoaded, before the bootstrap script is dynamically * loaded. This ensures storage is available when the metaspace initializes. */ export declare function initIbGibStorage(config: IbGibAmbientContextConfig): Promise; /** * Sets up globalThis.ibgib.[globalThisKey] for the given app config. * * Idempotent — safe to call multiple times. The root `globalThis.ibgib` object * is created if it doesn't exist, then the per-app sub-key is populated. * * @param config The app's ambient context config. * @param globalThisKey The snake_case key for this app's namespace under * `globalThis.ibgib` (e.g. `'my_app'`, `'cool_new_thing'`). * @param version Optional semver string (from AUTO_GENERATED_VERSION). */ export declare function initIbGibGlobalThis(config: IbGibAmbientContextConfig, globalThisKey: string, version?: string): void; /** * Returns the raw IbGibGlobalThis_Common for the given key. * Typed as the Common base — use the app-specific typed accessor for * full-type access. */ export declare function getIbGibGlobalThis_Common(globalThisKey: string): IbGibGlobalThis_Common; /** * Returns the IbGibGlobalThis_IbGibApp for the given key, initializing it * from config if not yet present. */ export declare function getIbGibGlobalThis_IbGibApp(globalThisKey: string, config?: IbGibAmbientContextConfig, version?: string): IbGibGlobalThis_IbGibApp; /** * Returns a function that retrieves the AI API key from storage at call time. * The globalThisKey links back to the per-app namespace for DB/store/key names. */ export declare function getDefaultFnGetAPIKey(globalThisKey: string): () => Promise; /** * Dynamically imports the bootstrap module at the given path and calls the * named export bootstrap function. * * Called after DOMContentLoaded so the heavy ibgib import graph does not block * first paint. * * @param path Path to bootstrap.mjs (relative to the app's index.mts). * @param bootstrapFnName The exported async function to call. Defaults to * `'bootstrapApp'` — override with the app-specific function name * (e.g. `'bootstrapMyAppApp'`). */ export declare function dynamicallyLoadBootstrapScript(path: string, bootstrapFnName?: string): Promise; /** * Returns the standard ctor options object for IbGib dynamic components. * * Provides two things components need at construction time: * 1. `fnGetMetaspace` — accesses the global metaspace once initialized * 2. `bootstrapPromise` — components can await this to defer their own init * until the App witness and metaspace are fully ready * * @param globalThisKey The per-app namespace key used to find the bootstrap * promise on globalThis. */ export declare function getComponentCtorArg(globalThisKey?: string): IbGibDynamicComponentMetaCtorOpts; //# sourceMappingURL=init-orchestration.d.mts.map