This commit is contained in:
brycematheson1234
2019-08-21 07:49:17 +10:00
committed by Sheetal Nandi
parent 55d1833091
commit 70b782ba42
2 changed files with 16 additions and 8 deletions

View File

@@ -12,15 +12,22 @@ import {
} from 'rsocket-core';
import * as ws from 'ws';
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: ws.ClientOptions, encoders?: Encoders<any>)
close(): void;
connect(): void;
connectionStatus(): Flowable<ConnectionStatus>;
receive(): Flowable<Frame>;
sendOne(frame: Frame): void;
send(frames: Flowable<Frame>): void;
}
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;
}

View File

@@ -1,6 +1,7 @@
// Type definitions for rsocket-websocket-client 0.0
// Project: https://github.com/rsocket/rsocket-js/
// Definitions by: Adrian Hope-Bailie <https://github.com/adrianhopebailie>
// Bryce Matheson <https://github.com/brycematheson1234>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2