From 70b782ba42729be8ac8df2a3d784fa34479b4aeb Mon Sep 17 00:00:00 2001 From: brycematheson1234 Date: Wed, 21 Aug 2019 07:49:17 +1000 Subject: [PATCH] . (#37761) --- .../RSocketWebSocketClient.d.ts | 23 ++++++++++++------- types/rsocket-websocket-client/index.d.ts | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/types/rsocket-websocket-client/RSocketWebSocketClient.d.ts b/types/rsocket-websocket-client/RSocketWebSocketClient.d.ts index 65fd4db112..d1894fe8ff 100644 --- a/types/rsocket-websocket-client/RSocketWebSocketClient.d.ts +++ b/types/rsocket-websocket-client/RSocketWebSocketClient.d.ts @@ -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) - close(): void; - connect(): void; - connectionStatus(): Flowable; - receive(): Flowable; - sendOne(frame: Frame): void; - send(frames: Flowable): void; -} + constructor(options: ClientOptions, encoders?: Encoders); + close(): void; + connect(): void; + connectionStatus(): Flowable; + receive(): Flowable; + sendOne(frame: Frame): void; + send(frames: Flowable): void; + } diff --git a/types/rsocket-websocket-client/index.d.ts b/types/rsocket-websocket-client/index.d.ts index 0a78a0ad6b..31638e54b5 100644 --- a/types/rsocket-websocket-client/index.d.ts +++ b/types/rsocket-websocket-client/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for rsocket-websocket-client 0.0 // Project: https://github.com/rsocket/rsocket-js/ // Definitions by: Adrian Hope-Bailie +// Bryce Matheson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2