/// <reference path="leaf.d.ts" />
declare namespace Leaf {
    type TStateDefaultEnum = "void" | "panic";
    class States<TStateEnum, TSignalEnum extends string> extends EventEmitter<string> {
        state: TStateEnum | TStateDefaultEnum;
        previousState: TStateEnum | TStateDefaultEnum;
        private sole;
        private soleEmitted;
        private lastException;
        private rescues;
        protected data: any;
        private feeds;
        private isDebugging;
        private clearHandler;
        readonly name: string;
        panicError: Error;
        panicState: TStateEnum | TStateDefaultEnum;
        constructor();
        reset(): void;
        setState(state: TStateEnum | TStateDefaultEnum, ...args: any[]): void;
        private _setState(state, ...args);
        error(err: Error): void;
        protected atPanic(): void;
        recover(recoverState?: TStateEnum | TStateDefaultEnum): {
            error: Error;
            state: TStateEnum | "void" | "panic";
        };
        respawn(): void;
        clear(handler?: {
            (): void;
        }): void;
        private ensureFeed(name);
        feed(name: TSignalEnum, signal?: any): void;
        consumeAll(name: string): number;
        hasFeed(name: string): boolean;
        consume(name: string): boolean | any;
        consumeWhenAvailableMergeToLast(name: TSignalEnum, callback: {
            (signal: any): void;
        }): void;
        consumeWhenAvailable(name: TSignalEnum, callback: {
            (signal: any): void;
        }): void;
        debug(option?: any): void;
        private debugStateHandler(option?, message?);
    }
}
