type OnMessage<T> = (event: MessageEvent, resolve: (value: T) => void, reject: (reason?: any) => void) => void;
export declare function websocket<T>(url: string, onMessage: OnMessage<T>): {
    promise: Promise<T>;
    close: () => void;
};
export {};
