import { MiniProgramCore } from '../types';
export declare enum SingletonTaskStatus {
    WAITING = 0,
    PENDING = 1,
    RESOLVED = 2,
    REJECTED = 3
}
export interface ISingletonTask {
    key: string;
    getResult: () => Promise<any>;
    getResultCache: () => any;
}
export declare class SingletonTask implements ISingletonTask {
    private readonly executor;
    readonly key: string;
    private readonly timeout;
    private status;
    private result;
    private rejectedReason;
    private queue;
    private timer;
    constructor(executor: MiniProgramCore.FN<Promise<any>>, key?: string, timeout?: number);
    private _run;
    private _emit;
    get rejected(): boolean;
    private _resolve;
    private _reject;
    getResult(retryWhenRejected?: boolean, retryWhenResolved?: boolean): Promise<any>;
    getResultCache(): any;
}
