|
| 1 | +/** |
| 2 | + * External interfaces for integration into code-server over IPC. |
| 3 | + * This file exists in two locations: |
| 4 | + * - typings/ipc.d.ts |
| 5 | + * - lib/vscode/src/typings/ipc.d.ts |
| 6 | + * The second is a symlink to the first. |
| 7 | + */ |
| 8 | +export interface Options { |
| 9 | + base: string |
| 10 | + disableTelemetry: boolean |
| 11 | + disableUpdateCheck: boolean |
| 12 | +} |
| 13 | + |
| 14 | +export interface InitMessage { |
| 15 | + type: "init" |
| 16 | + id: string |
| 17 | + options: VscodeOptions |
| 18 | +} |
| 19 | + |
| 20 | +export type Query = { [key: string]: string | string[] | undefined | Query | Query[] } |
| 21 | + |
| 22 | +export interface SocketMessage { |
| 23 | + type: "socket" |
| 24 | + query: Query |
| 25 | + permessageDeflate: boolean |
| 26 | +} |
| 27 | + |
| 28 | +export interface CliMessage { |
| 29 | + type: "cli" |
| 30 | + args: Args |
| 31 | +} |
| 32 | + |
| 33 | +export interface OpenCommandPipeArgs { |
| 34 | + type: "open" |
| 35 | + fileURIs?: string[] |
| 36 | + folderURIs: string[] |
| 37 | + forceNewWindow?: boolean |
| 38 | + diffMode?: boolean |
| 39 | + addMode?: boolean |
| 40 | + gotoLineMode?: boolean |
| 41 | + forceReuseWindow?: boolean |
| 42 | + waitMarkerFilePath?: string |
| 43 | +} |
| 44 | + |
| 45 | +export type CodeServerMessage = InitMessage | SocketMessage | CliMessage |
| 46 | + |
| 47 | +export interface ReadyMessage { |
| 48 | + type: "ready" |
| 49 | +} |
| 50 | + |
| 51 | +export interface OptionsMessage { |
| 52 | + id: string |
| 53 | + type: "options" |
| 54 | + options: WorkbenchOptions |
| 55 | +} |
| 56 | + |
| 57 | +export type VscodeMessage = ReadyMessage | OptionsMessage |
| 58 | + |
| 59 | +export interface StartPath { |
| 60 | + url: string |
| 61 | + workspace: boolean |
| 62 | +} |
| 63 | + |
| 64 | +export interface Args { |
| 65 | + "user-data-dir"?: string |
| 66 | + |
| 67 | + "enable-proposed-api"?: string[] |
| 68 | + "extensions-dir"?: string |
| 69 | + "builtin-extensions-dir"?: string |
| 70 | + "extra-extensions-dir"?: string[] |
| 71 | + "extra-builtin-extensions-dir"?: string[] |
| 72 | + "ignore-last-opened"?: boolean |
| 73 | + |
| 74 | + locale?: string |
| 75 | + |
| 76 | + log?: string |
| 77 | + verbose?: boolean |
| 78 | + |
| 79 | + _: string[] |
| 80 | +} |
| 81 | + |
| 82 | +export interface VscodeOptions { |
| 83 | + readonly args: Args |
| 84 | + readonly remoteAuthority: string |
| 85 | + readonly startPath?: StartPath |
| 86 | +} |
| 87 | + |
| 88 | +export interface VscodeOptionsMessage extends VscodeOptions { |
| 89 | + readonly id: string |
| 90 | +} |
| 91 | + |
| 92 | +export interface UriComponents { |
| 93 | + readonly scheme: string |
| 94 | + readonly authority: string |
| 95 | + readonly path: string |
| 96 | + readonly query: string |
| 97 | + readonly fragment: string |
| 98 | +} |
| 99 | + |
| 100 | +export interface NLSConfiguration { |
| 101 | + locale: string |
| 102 | + availableLanguages: { |
| 103 | + [key: string]: string |
| 104 | + } |
| 105 | + pseudo?: boolean |
| 106 | + _languagePackSupport?: boolean |
| 107 | +} |
| 108 | + |
| 109 | +export interface WorkbenchOptions { |
| 110 | + readonly workbenchWebConfiguration: { |
| 111 | + readonly remoteAuthority?: string |
| 112 | + readonly folderUri?: UriComponents |
| 113 | + readonly workspaceUri?: UriComponents |
| 114 | + readonly logLevel?: number |
| 115 | + readonly workspaceProvider?: { |
| 116 | + payload: [["userDataPath", string], ["enableProposedApi", string]] |
| 117 | + } |
| 118 | + } |
| 119 | + readonly remoteUserDataUri: UriComponents |
| 120 | + readonly productConfiguration: { |
| 121 | + codeServerVersion?: string |
| 122 | + readonly extensionsGallery?: { |
| 123 | + readonly serviceUrl: string |
| 124 | + readonly itemUrl: string |
| 125 | + readonly controlUrl: string |
| 126 | + readonly recommendationsUrl: string |
| 127 | + } |
| 128 | + } |
| 129 | + readonly nlsConfiguration: NLSConfiguration |
| 130 | + readonly commit: string |
| 131 | +} |
| 132 | + |
| 133 | +export interface WorkbenchOptionsMessage { |
| 134 | + id: string |
| 135 | +} |
0 commit comments