@kospa/bootstrap
Version:
Bootstrap component for kospa framework
20 lines (19 loc) • 1.1 kB
TypeScript
import * as composer from "@kospa/base/composer";
export declare type InitializeHandler = () => PromiseLike<any> | any;
export declare type InitializeModule = {
init: InitializeHandler;
};
export interface StartOptions extends composer.CompositionOptions {
container?: string | Node;
}
/**
* Initialize given module and compose the global application container.
*
* @param options Specify the composition options for the global application container.
* @param handlersOrModules Handlers or modules to initialize during startup:
* If a string: load module and initialize it (wait for Promise resolution ) ;
* If an object with a init function: run the init function and wait for Promise resolution ;
* If a function: run the function and wait for Promise resolution ;
* If a Promise: wait for Promise resolution.
*/
export declare function start(options: StartOptions, ...handlersOrModules: Array<string | InitializeModule | InitializeHandler | PromiseLike<any>>): Promise<Node>;