import { IConfigOptions, IOptions } from '@allgemein/config'; import { IActivator } from './api/IActivator'; import { IModule } from './api/IModule'; import { Storage } from './libs/storage/Storage'; import { IBootstrap } from './api/IBootstrap'; import { ITypexsOptions } from './libs/ITypexsOptions'; import { Invoker } from './base/Invoker'; import { ICommand } from './libs/commands/ICommand'; import { Injector } from './libs/di/Injector'; import { IRuntimeLoader } from './libs/core/IRuntimeLoader'; import { ConfigLoader } from './libs/config/ConfigLoader'; /** * Bootstrap controls the stages of application startup. From configuration to full startup for passed command. * * Stages: * - set configuration file load order * - load configuration from config files * - TODO: first schema validation? * - get modules list (paths are passed through initial configuration) * - load config.schema.json or config.schema.js or maybe passed through Activator? * - TODO: extend config schema for validation * - validate current given configuration, if fails abort startup, else proceed to next stage * - initialise Activator's for specific lib startup or other modul specific initialisations * - */ export declare class Bootstrap { private constructor(); private static $self; private nodeId; private configLoader; private VERBOSE_DONE; private runtimeLoader; private activators; private bootstraps; private storage; private running; static _(options?: ITypexsOptions): Bootstrap; static reset(): void; static getNodeId(): string; static verbose(c: any): void; static addConfigOptions(options: IOptions): IOptions; static getContainer(): typeof Injector; static configure(options?: ITypexsOptions): Bootstrap; static setConfigSources(sources: IConfigOptions[]): Bootstrap; static prepareInvoker(i: Invoker, loader: IRuntimeLoader): void; getNodeId(): string; /** * Returns the typexs declared configuration. */ getConfiguration(): ITypexsOptions; getConfigLoader(): ConfigLoader; /** * Activate the logger. */ activateLogger(): Bootstrap; /** * Activate error handling for unhandledRejection, uncaughtException and warnings. */ activateErrorHandling(): Bootstrap; /** * Prepare and activate storage. */ activateStorage(): Promise; throwedUnhandledRejection(reason: any, err: Error): Promise; throwedUncaughtException(err: Error): Promise; configure(c?: any): this; /** * Initialise the runtime modul loader through current configuration. * - Also instance activators */ prepareRuntime(): Promise; private addShutdownEvents; private createSystemInfo; private createActivatorInstances; private createBootstrapInstances; /** * Run activation lifecycle with command.beforeStartup if exists * * @param command */ activate(command?: ICommand): Promise; startup(command?: ICommand): Promise; execCommand(clazz: Function, argv: any): Promise; shutdown(exitCode?: number): Promise; getActivators(): IActivator[]; getModulBootstraps(): IBootstrap[]; getCommands(withInject?: boolean): ICommand[]; /** * Return the path of the app */ getAppPath(): any; getModules(): IModule[]; /** * Return RuntimeLoader object */ getLoader(): IRuntimeLoader; /** * Return Storage object */ getStorage(): Storage; }