mirror of
https://github.com/yudai/gotty.git
synced 2026-01-03 08:08:50 +01:00
18 lines
496 B
TypeScript
18 lines
496 B
TypeScript
|
|
export declare class ConnectionFactory {
|
||
|
|
url: string;
|
||
|
|
protocols: string[];
|
||
|
|
constructor(url: string, protocols: string[]);
|
||
|
|
create(): Connection;
|
||
|
|
}
|
||
|
|
export declare class Connection {
|
||
|
|
bare: WebSocket;
|
||
|
|
constructor(url: string, protocols: string[]);
|
||
|
|
open(): void;
|
||
|
|
close(): void;
|
||
|
|
send(data: string): void;
|
||
|
|
isOpen(): boolean;
|
||
|
|
onOpen(callback: () => void): void;
|
||
|
|
onReceive(callback: (data: string) => void): void;
|
||
|
|
onClose(callback: () => void): void;
|
||
|
|
}
|