1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-16 04:38:46 +00:00
code-server-2/packages/app/common/src/connection.ts

18 lines
430 B
TypeScript
Raw Normal View History

import { Event } from "@coder/events";
import { TunnelCloseEvent } from "@coder/tunnel/src/client";
export interface TcpHost {
listen(host: string, port: number): Promise<TcpServer>;
}
export interface TcpServer {
readonly onConnection: Event<TcpConnection>;
close(): Promise<void>;
}
export interface TcpConnection {
readonly onData: Event<ArrayBuffer>;
send(data: ArrayBuffer): Promise<void>;
close(): Promise<void>;
}