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

39 lines
960 B
TypeScript
Raw Normal View History

import * as jspb from "google-protobuf";
2019-01-12 03:33:44 +08: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;
onDown(cb: () => void): void;
onUp(cb: () => void): void;
2019-01-12 03:33:44 +08:00
close(): void;
}
export enum OperatingSystem {
Windows,
Linux,
Mac,
}
export interface InitData {
readonly os: OperatingSystem;
readonly dataDirectory: string;
readonly workingDirectory: string;
readonly homeDirectory: string;
readonly tmpDirectory: string;
readonly shell: string;
readonly extensionsDirectory: string;
readonly builtInExtensionsDirectory: string;
readonly extraExtensionDirectories: string[];
readonly extraBuiltinExtensionDirectories: string[];
readonly env: jspb.Map<string, string>;
2019-01-19 08:04:24 +08:00
}
export interface SharedProcessData {
2019-01-19 08:04:24 +08:00
readonly socketPath: string;
readonly logPath: string;
2019-01-19 08:04:24 +08:00
}