export declare const sleep: (m: number) => Promise<void>;
export declare function isFunction<T>(value: Function | T): value is Function;
/**
 * A map of known error codes.
 */
export declare const KnownCodes: {
    TOKEN_EXPIRED: number;
    WS_CLOSED_SUCCESS: number;
    WS_CLOSED_ABRUPTLY: number;
    WS_POLICY_VIOLATION: number;
};
/**
 * retryInterval - A retry interval which increases acc to number of failures
 *
 * @return {number} Duration to wait in milliseconds
 */
export declare function retryInterval(numberOfFailures: number): number;
export declare function randomId(): string;
export declare function generateUUIDv4(): string;
/**
 * listenForConnectionChanges - Adds an event listener fired on browser going online or offline
 */
export declare function addConnectionEventListeners(cb: (e: Event) => void): void;
export declare function removeConnectionEventListeners(cb: (e: Event) => void): void;
export declare const streamDevToken: (userId: string) => string;
export interface DebouncedFunc<T extends (...args: any[]) => any> {
    /**
     * Call the original function, but applying the debounce rules.
     *
     * If the debounced function can be run immediately, this calls it and returns its return
     * value.
     *
     * Otherwise, it returns the return value of the last invocation, or undefined if the debounced
     * function was not invoked yet.
     */
    (...args: Parameters<T>): ReturnType<T> | undefined;
    /**
     * Throw away any pending invocation of the debounced function.
     */
    cancel(): void;
    /**
     * If there is a pending invocation of the debounced function, invoke it immediately and return
     * its return value.
     *
     * Otherwise, return the value from the last invocation, or undefined if the debounced function
     * was never invoked.
     */
    flush(): ReturnType<T> | undefined;
}
export declare const debounce: <T extends (...args: any[]) => any>(fn: T, timeout?: number, { leading, trailing, }?: {
    leading?: boolean;
    trailing?: boolean;
}) => DebouncedFunc<T>;
export declare const capitalize: <T extends string>(s: T) => Capitalize<T>;
