summaryrefslogtreecommitdiff
path: root/chromium/chrome/common/extensions/api/terminal_private.json
blob: 316a04c189876a051c56c6bb1f69fb50f17b9e37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "terminalPrivate",
    "compiler_options": {
      "implemented_in": "chrome/browser/extensions/api/terminal/terminal_private_api.h"
    },
    "description": "none",
    "types": [
      {
        "id": "OutputType",
        "type": "string",
        "enum": ["stdout", "stderr", "exit"],
        "description": "Type of the output stream from which output came. When process exits, output type will be set to exit"
      }
    ],
    "functions": [
      {
        "name": "openTerminalProcess",
        "type": "function",
        "description": "Starts new process.",
        "parameters": [
          {
            "type": "string",
            "name": "processName",
            "description": "Name of the process to open. May be 'crosh' or 'vmshell'."
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "name": "args",
            "optional": true,
            "description": "Command line arguments to pass to the process."
          }
        ],
        "returns_async": {
          "name": "callback",
          "description": "Returns id of the launched process. If no process was launched returns -1.",
          "parameters": [
            {
              "name": "id",
              "description": "Id of the launched process.",
              "type": "string"
            }
          ]
        }
      },
      {
        "name": "openVmshellProcess",
        "type": "function",
        "description": "Starts new vmshell process.",
        "parameters": [
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "name": "args",
            "optional": true,
            "description": "Command line arguments to pass to vmshell."
          }
        ],
        "returns_async": {
          "name": "callback",
          "description": "Returns id of the launched vmshell process. If no process was launched returns -1.",
          "parameters": [
            {
              "name": "id",
              "description": "Id of the launched vmshell process.",
              "type": "string"
            }
          ]
        }
      },
      {
        "name": "closeTerminalProcess",
        "type": "function",
        "description": "Closes previously opened process from either openTerminalProcess or openVmshellProcess.",
        "parameters": [
          {
            "name": "id",
            "type": "string",
            "description": "Unique id of the process we want to close."
          }
        ],
        "returns_async": {
          "name": "callback",
          "optional": true,
          "description": "Function that gets called when close operation is started for the process. Returns success of the function.",
          "parameters": [
            {
              "name": "success",
              "type": "boolean"
            }
          ]
        }
      },
      {
        "name": "sendInput",
        "type": "function",
        "description": "Sends input that will be routed to stdin of the process with the specified id.",
        "parameters": [
          {
            "name": "id",
            "type": "string",
            "description": "The id of the process to which we want to send input."
          },
          {
            "name": "input",
            "type": "string",
            "description": "Input we are sending to the process."
          }
        ],
        "returns_async": {
          "name": "callback",
          "optional": true,
          "description": "Callback that will be called when sendInput method ends. Returns success.",
          "parameters": [
            {
              "name": "success",
              "type": "boolean"
            }
          ]
        }
      },
      {
        "name": "onTerminalResize",
        "type": "function",
        "description": "Notify the process with the id id that terminal window size has changed.",
        "parameters": [
          {
            "name": "id",
            "type": "string",
            "description": "The id of the process."
          },
          {
            "name": "width",
            "type": "integer",
            "description": "New window width (as column count)."
          },
          {
            "name": "height",
            "type": "integer",
            "description": "New window height (as row count)."
          }
        ],
        "returns_async": {
          "name": "callback",
          "optional": true,
          "description": "Callback that will be called when sendInput method ends. Returns success.",
          "parameters": [
            {
              "name": "success",
              "type": "boolean"
            }
          ]
        }
      },
      {
        "name": "ackOutput",
        "type": "function",
        "description": "Called from |onProcessOutput| when the event is dispatched to terminal extension. Observing the terminal process output will be paused after |onProcessOutput| is dispatched until this method is called.",
        "parameters": [
          {
            "name": "id",
            "type": "string",
            "description": "The id of the process to which |onProcessOutput| was dispatched."
          }
        ]
      },
      {
        "name": "openWindow",
        "type": "function",
        "description": "Open a Terminal app window/tab",
        "parameters": [
          {
            "name": "data",
            "type": "object",
	    "optional": true,
            "properties": {
              "url": {
                "description": "The url for the new Terminal window.",
                "optional": true,
		"type": "string"
              },
	      "asTab": {
		"description": "Instead of openning a new window, open it as a new tab in the current app window.",
                "optional": true,
		"type": "boolean"
	      }
	    }
          }
        ]
      },
      {
        "name": "openOptionsPage",
        "type": "function",
        "description": "Open the Terminal Settings page.",
        "parameters": [],
        "returns_async": {
          "name": "callback",
          "description": "Callback that will be called when complete.",
          "parameters": []
        }
      },
      {
        "name": "openSettingsSubpage",
        "type": "function",
        "description": "Open the System Settings at the specified subpage.",
        "parameters": [
          {
            "type": "string",
            "name": "subpage",
            "description": "Name of subpage to open.  Currently only 'crostini' supported."
          }
        ],
        "returns_async": {
          "name": "callback",
          "description": "Callback that will be called when complete.",
          "parameters": []
        }
      },
      {
        "name": "getOSInfo",
        "type": "function",
        "description": "Returns an object containing info about ChromeOS settings that affect the Terminal, e.g. which feature flags are enabled.",
        "parameters": [],
        "returns_async": {
          "name": "callback",
          "description": "Callback that will be called with the info object.",
          "parameters": [
            {
              "name": "info",
              "type": "object",
              "properties": {
                "multi_profile": {
                  "description": "True if multi profile settings is enabled.",
                  "type": "boolean"
                },
                "tmux_integration": {
                  "description": "True if tmux control mode integration is enabled.",
                  "type": "boolean"
                }
              },
              "description": "Information about which features are enabled."
            }
          ]
        }
      },
      {
        "name": "getPrefs",
        "type": "function",
        "description": "Returns specified pref values, ignoring any not in allowlist.",
        "parameters": [
          {
            "name": "paths",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Paths of prefs to fetch."
          }
        ],
        "returns_async": {
          "name": "callback",
          "description": "Callback that will be called with prefs.",
          "parameters": [
            {
              "name": "prefs",
              "type": "object",
              "additionalProperties":
                {
                  "type": "any" ,
                  "preserveNull": true
                },
              "description": "prefs keyed by paths.",
              "preserveNull": true
            }
          ]
        }
      },
      {
        "name": "setPrefs",
        "type": "function",
        "description": "Sets specified prefs, ignoring any not in allowlist.",
        "parameters": [
          {
            "name": "prefs",
            "type": "object",
            "description": "Prefs to update keyed by paths.",
            "additionalProperties":
              {
                "type": "any" ,
                "preserveNull": true
              },
            "preserveNull": true
          }
        ],
        "returns_async": {
          "name": "callback",
          "description": "Callback that will be called when complete.",
          "parameters": []
        }
      }
    ],
    "events": [
      {
        "name": "onProcessOutput",
        "type": "function",
        "description": "Fired when an opened process writes something to its output. Observing further process output will be blocked until |ackOutput| for the terminal is called. Internally, first event argument will be ID of the tab that contains terminal instance for which this event is intended. This argument will be stripped before passing the event to the extension.",
        "parameters": [
          {
            "name": "id",
            "type": "string",
            "description": "Id of the process from which the output came."
          },
          {
            "name": "type",
            "$ref": "OutputType",
            "description": "Type of the output stream from which output came. When process exits, output type will be set to exit"
          },
          {
            "name": "data",
            "type": "binary",
            "description": "Data that was written to the output stream."
          }
        ]
      },
      {
        "name": "onPrefChanged",
        "type": "function",
        "description": "Fired when pref changes.",
        "parameters": [
          {
            "name": "prefs",
            "type": "object",
            "description": "Prefs keyed by paths.",
            "additionalProperties":
              {
                "type": "any" ,
                "preserveNull": true
              },
            "preserveNull": true
          }
        ]
      }
    ]
  }
]