import { RpcClient, RpcKernel } from '@deepkit/rpc'; import { HttpRouter } from '@deepkit/http'; import { BaseEvent, EventDispatcher, EventToken } from '@deepkit/event'; import { InjectorContext } from '@deepkit/injector'; import { FrameworkConfig } from './module.config.js'; import { LoggerInterface } from '@deepkit/logger'; import { WebWorker, WebWorkerFactory } from './worker.js'; import { RpcControllers } from './rpc.js'; import '@deepkit/type'; export declare class ServerBootstrapEvent extends BaseEvent { } /** * Called only once for application server bootstrap (for main process and workers) */ export declare const onServerBootstrap: EventToken; /** * Called only once for application server bootstrap (for main process and workers) * as soon as the application server has started */ export declare const onServerBootstrapDone: EventToken; /** * Called only once for application server bootstrap (in the main process) * as soon as the application server starts. */ export declare const onServerMainBootstrap: EventToken; /** * Called only once for application server bootstrap (in the main process) * as soon as the application server has started. */ export declare const onServerMainBootstrapDone: EventToken; /** * Called for each worker as soon as the worker bootstraps. */ export declare const onServerWorkerBootstrap: EventToken; /** * Called only once for application server bootstrap (in the worker process) * as soon as the application server has started. */ export declare const onServerWorkerBootstrapDone: EventToken; export declare class ServerShutdownEvent extends BaseEvent { } /** * Called when application server shuts down (in master process and each worker). */ export declare const onServerShutdown: EventToken; /** * Called when application server shuts down in the main process. */ export declare const onServerMainShutdown: EventToken; /** * Called when application server shuts down in the worker process. */ export declare const onServerWorkerShutdown: EventToken; type ApplicationServerConfig = Pick; export declare class LogStartupListener { protected logger: LoggerInterface; protected rpcControllers: RpcControllers; protected router: HttpRouter; protected config: ApplicationServerConfig; protected server: ApplicationServer; constructor(logger: LoggerInterface, rpcControllers: RpcControllers, router: HttpRouter, config: ApplicationServerConfig, server: ApplicationServer); onBootstrapDone(): void; } export interface ApplicationServerOptions { listenOnSignals?: boolean; startHttpServer?: boolean; } export declare class ApplicationServer { protected logger: LoggerInterface; protected webWorkerFactory: WebWorkerFactory; protected eventDispatcher: EventDispatcher; protected rootScopedContext: InjectorContext; config: ApplicationServerConfig; protected rpcControllers: RpcControllers; protected rpcKernel: RpcKernel; protected router: HttpRouter; protected httpWorker?: WebWorker; protected started: boolean; protected stopping: boolean; protected onlineWorkers: number; protected needsHttpWorker: boolean; onStop: Promise; protected stopResolver: () => void; constructor(logger: LoggerInterface, webWorkerFactory: WebWorkerFactory, eventDispatcher: EventDispatcher, rootScopedContext: InjectorContext, config: ApplicationServerConfig, rpcControllers: RpcControllers, rpcKernel: RpcKernel, router: HttpRouter); getHttpWorker(): WebWorker; /** * Closes all server listener and triggers shutdown events. This is only used for integration tests. */ close(graceful?: boolean): Promise; protected stopWorkers(): Promise; start(optionsOrListenOnSignal?: boolean | ApplicationServerOptions): Promise; getHttpHost(): string | undefined; getWorker(): WebWorker; createClient(): RpcClient; } export declare class InMemoryApplicationServer extends ApplicationServer { } export {}; export declare type __ΩApplicationServerOptions = any[];