import EnvoyContext from "./envoy-context";
/**
 * this will store the information of a node
 */
export declare class NodeInfo {
    /**
     * the reference count of this info,
     * init will be 1,
     * when this async execution trigger another execution,
     *  this will increase 1,
     * when this execution or one of its child execution is destroyed,
     *  this will decrease 1
     */
    referenceCount: number;
    /**
     * who trigger this async execution
     */
    readonly triggerAsyncId: number;
    /**
     * the context set in this execution
     */
    context?: EnvoyContext;
    constructor(triggerAsyncId: number);
}
/**
 * Eliminate Store
 * using two map for context storage, to avoid holding too many data
 * it will eliminate the old data
 */
export declare class EliminateStore {
    private old;
    private current;
    private lastEliminateTime;
    /**
     * get context
     * @param asyncId asyncId
     */
    get(asyncId: number): NodeInfo | undefined;
    /**
     * set context
     * @param asyncId asyncId
     * @param info context info
     */
    set(asyncId: number, info: NodeInfo): void;
    /**
     * delete context
     * @param asyncId asyncId
     */
    delete(asyncId: number): void;
    /**
     * clear all data
     */
    clear(): void;
    /**
     * eliminate the old data
     */
    eliminate(): void;
    /**
     * get last eliminate time
     */
    getLastEliminateTime(): number;
    /**
     * the current size
     */
    size(): number;
    /**
     * the old store size
     */
    oldSize(): number;
}
/**
 * set the store's eliminate interval, context data older than this and not
 * read will be eventually eliminated
 * @param interval time in milliseconds
 */
declare function setEliminateInterval(interval: number): void;
/**
 * get eliminate interval
 */
declare function getEliminateInterval(): number;
/**
 * Enable the context store,
 * you should call this function as early as possible,
 * i.e. put it in your application's start.
 */
declare function enable(): void;
/**
 * Disable the context store,
 * all data will be clean up as well.
 * This function is not intended to be call in the application life cycle.
 */
declare function disable(): void;
/**
 * According to the context store design, this function is required to be called exactly once for a request.
 * Setting multiple calls to this function will lead to context corruption.
 * @param context the context you want to set
 */
declare function set(context: EnvoyContext): void;
/**
 * get the context previous set in the store of the current execution
 */
declare function get(): EnvoyContext | undefined;
/**
 * return if the store is enabled
 */
declare function isEnabled(): boolean;
/**
 * return the instance of the store
 */
declare function getStoreImpl(): EliminateStore;
/**
 * return debug info about the store
 */
declare function getDebugInfo(): string;
declare const _default: {
    enable: typeof enable;
    disable: typeof disable;
    set: typeof set;
    get: typeof get;
    isEnabled: typeof isEnabled;
    getStoreImpl: typeof getStoreImpl;
    getEliminateInterval: typeof getEliminateInterval;
    setEliminateInterval: typeof setEliminateInterval;
    getDebugInfo: typeof getDebugInfo;
};
export default _default;
