DefinitelyTyped/types/rsocket-websocket-client/RSocketWebSocketClient.d.ts
Oleh Dokuka 4d7955b2e9 Provides Aligning of RSocket-xxx definitions with the latest RSocket-JS release (#40580)
* provides alignment with the latest RSocket-JS

* provides alignment with the latest RSocket-JS

Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
2019-11-22 07:44:23 -08:00

25 lines
851 B
TypeScript

import { ConnectionStatus, DuplexConnection, Frame } from 'rsocket-types';
import { Flowable } from 'rsocket-flowable';
import { Encoders } from 'rsocket-core';
export interface ClientOptions {
url: string;
wsCreator?: (url: string) => WebSocket;
debug?: boolean;
lengthPrefixedFrames?: boolean;
}
/**
* A WebSocket transport client for use in browser environments.
*/
export default class RSocketWebSocketClient implements DuplexConnection {
constructor(options: ClientOptions, encoders?: Encoders<any>);
close(): void;
connect(): void;
connectionStatus(): Flowable<ConnectionStatus>;
receive(): Flowable<Frame>;
sendOne(frame: Frame): void;
send(frames: Flowable<Frame>): void;
}