import { MaybePromise } from '../utils/prioritizeable'; import { Deferred } from '../utils/promise-util'; import { Event } from '../utils/event'; import { Emitter } from '../utils/emitter'; import { Logger } from '../logger/logger-protocol'; export declare const ApplicationLifecycle: unique symbol; export declare const Application: unique symbol; export declare const ApplicationStateService: unique symbol; export declare const ApplicationProps: unique symbol; export interface ApplicationProps extends Record { } export interface ApplicationLifecycle { initialize?(): void; onStart?(app: T): MaybePromise; onStop?(app: T): void; } export interface Application { start(): Promise; stop(): Promise; } export declare abstract class AbstractApplication implements Application { protected readonly lifecycles: ApplicationLifecycle[]; abstract start(): Promise; abstract stop(): Promise; protected readonly logger: Logger; /** * Initialize and start the frontend application. */ protected doStart(): Promise; /** * Stop the frontend application lifecycle. */ protected doStop(): void; } export declare type ApplicationState = 'init' | 'started' | 'ready' | 'stoped'; export interface ApplicationStateService { state: T; readonly onStateChanged: Event; reachedState(state: T): Promise; reachedAnyState(...states: T[]): Promise; } export declare abstract class AbstractApplicationStateService implements ApplicationStateService { private _state; protected deferred: { [state: string]: Deferred; }; protected readonly stateChanged: Emitter; get state(): T; set state(state: T); get onStateChanged(): Event; reachedState(state: T): Promise; reachedAnyState(...states: T[]): Promise; } //# sourceMappingURL=application-protocol.d.ts.map