/**
 * Deferred promise object with exposed resolve and reject callbacks.
 */
interface Deferred<T = unknown> {
    promise: Promise<T>;
    onSuccess: (value: T) => void | Promise<void>;
    onError: (reason?: unknown) => void | Promise<void>;
}
/**
 * Configuration object for getWebSocket.
 */
interface GetWebSocketConfig {
    url?: string;
    protocols?: string[];
    options?: {
        ws?: {
            new (url: string, protocols?: string[], origin?: null, headers?: Record<string, string>, requestOptions?: Record<string, unknown>): WebSocket;
        };
        additionalHeaders?: Record<string, string>;
        wsRequestOptions?: Record<string, unknown>;
    };
    isBrowserMock?: boolean;
}
/** Get a WebSocket object according to the user's current environment */
declare function getWebSocket({ url, protocols, options, isBrowserMock }?: GetWebSocketConfig): WebSocket | null;
/** Create a new deferred promise with exposed resolve and reject callbacks */
declare function getNewPromise<T = unknown>(): Deferred<T>;

export { type Deferred, getNewPromise, getWebSocket };
