code-server-2/packages/protocol/src/common/connection.ts

10 lines
256 B
TypeScript
Raw Normal View History

2019-01-11 19:33:44 +00:00
export interface SendableConnection {
send(data: Buffer | Uint8Array): void;
}
export interface ReadWriteConnection extends SendableConnection {
onMessage(cb: (data: Uint8Array | Buffer) => void): void;
onClose(cb: () => void): void;
close(): void;
}