import { Serializable, StoredPromise } from '../types';
import { BaseMessage, DataType } from '../other/message';
import { ClusterManager } from '../core/clusterManager';
import { ClusterClient } from '../core/clusterClient';
/** Handles promises by storing them in a map and resolving them when the response is received. */
export declare class PromiseHandler {
    private instance;
    /** List of promises and their unique identifiers. */
    nonces: Map<string, StoredPromise>;
    /** Creates an instance of PromiseHandler. */
    constructor(instance: ClusterManager | ClusterClient);
    /** Resolves the promise with the data received. */
    resolve<D extends DataType, A = Serializable, P extends object = object>(message: BaseMessage<D, A, P>): void;
    /** Creates a promise and stores it in the map. */
    create<T>(nonce: string, timeout?: number): Promise<T>;
}
