/// <reference types="node" />
import { EventEmitter } from 'events';
import { Logger } from '../log/LogManager';
export declare class LifecycleState {
    static all: LifecycleState[];
    static NOT_STARTED: LifecycleState;
    static STARTING: LifecycleState;
    static STARTED: LifecycleState;
    static STOPPING: LifecycleState;
    static STOPPED: LifecycleState;
    static getStatesBefore(val: LifecycleState): LifecycleState[];
    private value;
    private name;
    constructor(name: string, value: number);
    toString(): string;
    getName(): string;
    getValue(): number;
    isAfter(other: LifecycleState): boolean;
    isAtOrAfter(other: LifecycleState): boolean;
    isBefore(other: LifecycleState): boolean;
    isAtOrBefore(other: LifecycleState): boolean;
}
export declare class LifecycleException extends Error {
    private context;
    constructor(message: string, context?: Object);
    getContext(): Object;
}
export declare abstract class Lifecycle extends EventEmitter {
    protected startTime: number;
    protected name: string;
    protected logger: Logger;
    protected status: LifecycleState;
    protected stopTime: number;
    constructor(name: any, logger: any);
    /**
     * Initiates the lifecycle of this object.
     * This is the method you should call before using the object
     *
     * @return {Promise<void>} A promise that will resolve when this object's lifecycle has started
     */
    lcStart(): Promise<void>;
    lcStop(): Promise<void>;
    setStatus(newStatus: LifecycleState, eventPayload?: Object): boolean;
    getName(): string;
    onState(state: LifecycleState, callback: any): void;
    onStateOnce(state: LifecycleState, callback: any): void;
    assertState(state: LifecycleState): void;
    getLogger(): Logger;
    copy(): Lifecycle;
    getStatus(): LifecycleState;
    protected setLogger(logger: any): void;
    /**
     *
     * @return {Promise<void>}
     */
    protected abstract doStart(): Promise<void>;
    /**
     * Executes the actual logic necessary to stop the object
     * @return {Promise.<void>}
     */
    protected abstract doStop(): Promise<void>;
}
