mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* provides alignment with the latest RSocket-JS * provides alignment with the latest RSocket-JS Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
25 lines
851 B
TypeScript
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;
|
|
}
|