/** * @public * Symbol to start a component, used by Lifecycle */ export declare const START_COMPONENT: unique symbol; /** * @public * Symbol to stop a component, used by Lifecycle */ export declare const STOP_COMPONENT: unique symbol; /** * @public */ export declare namespace IBaseComponent { type ComponentStartOptions = { /** * Whether or not the application has started all its components */ started(): boolean; /** * Whether or not the application has started */ live(): boolean; /** * Get all the components from the application */ getComponents(): Record; }; } /** * Describes the lifecycle methods for all the components. Every * component could extend this interface. * @public */ export interface IBaseComponent { /** * starts the component, i.e. it connects the database or binds the port in a listener server * @deprecated - Use import \{ START_COMPONENT \} from '\@well-known-components/interfaces' */ start?: (startOptions: IBaseComponent.ComponentStartOptions) => Promise; /** * finishes pending work and/or releases all the resources (connections, bound ports, open file descriptors) * @deprecated - Use import \{ STOP_COMPONENT \} from '\@well-known-components/interfaces' */ stop?: () => Promise; /** * starts the component, i.e. it connects the database or binds the port in a listener server */ [START_COMPONENT]?: (startOptions: IBaseComponent.ComponentStartOptions) => Promise; /** * finishes pending work and/or releases all the resources (connections, bound ports, open file descriptors) */ [STOP_COMPONENT]?: () => Promise; } /** * Base interface to normalize adapters * @public */ export type IAdapterHandler = (context: Context) => Promise; /** * Base interface to normalize adapters that accept middlewares * @public */ export type IMiddlewareAdapterHandler = (context: Context, next: () => Promise) => Promise; //# sourceMappingURL=base-component.d.ts.map