forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterminal_private.js
153 lines (135 loc) · 5.2 KB
/
terminal_private.js
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
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.terminalPrivate.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
/**
* @fileoverview Externs generated from namespace: terminalPrivate
* @externs
*/
/** @const */
chrome.terminalPrivate = {};
/**
* @enum {string}
*/
chrome.terminalPrivate.OutputType = {
STDOUT: 'stdout',
STDERR: 'stderr',
EXIT: 'exit',
};
/**
* Starts new process.
* @param {string} processName Name of the process to open. May be 'crosh' or
* 'vmshell'.
* @param {?Array<string>|undefined} args Command line arguments to pass to the
* process.
* @param {function(string): void} callback Returns id of the launched process.
* If no process was launched returns -1.
*/
chrome.terminalPrivate.openTerminalProcess = function(processName, args, callback) {};
/**
* Starts new vmshell process.
* @param {?Array<string>|undefined} args Command line arguments to pass to
* vmshell.
* @param {function(string): void} callback Returns id of the launched vmshell
* process. If no process was launched returns -1.
*/
chrome.terminalPrivate.openVmshellProcess = function(args, callback) {};
/**
* Closes previously opened process from either openTerminalProcess or
* openVmshellProcess.
* @param {string} id Unique id of the process we want to close.
* @param {function(boolean): void=} callback Function that gets called when
* close operation is started for the process. Returns success of the
* function.
*/
chrome.terminalPrivate.closeTerminalProcess = function(id, callback) {};
/**
* Sends input that will be routed to stdin of the process with the specified
* id.
* @param {string} id The id of the process to which we want to send input.
* @param {string} input Input we are sending to the process.
* @param {function(boolean): void=} callback Callback that will be called when
* sendInput method ends. Returns success.
*/
chrome.terminalPrivate.sendInput = function(id, input, callback) {};
/**
* Notify the process with the id id that terminal window size has changed.
* @param {string} id The id of the process.
* @param {number} width New window width (as column count).
* @param {number} height New window height (as row count).
* @param {function(boolean): void=} callback Callback that will be called when
* sendInput method ends. Returns success.
*/
chrome.terminalPrivate.onTerminalResize = function(id, width, height, callback) {};
/**
* 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.
* @param {string} id The id of the process to which |onProcessOutput| was
* dispatched.
*/
chrome.terminalPrivate.ackOutput = function(id) {};
/**
* Open a Terminal app window/tab
* @param {{
* url: (string|undefined),
* asTab: (boolean|undefined)
* }=} data
*/
chrome.terminalPrivate.openWindow = function(data) {};
/**
* Open the Terminal Settings page.
* @param {function(): void} callback Callback that will be called when
* complete.
*/
chrome.terminalPrivate.openOptionsPage = function(callback) {};
/**
* Open the System Settings at the specified subpage.
* @param {string} subpage Name of subpage to open. Currently only 'crostini'
* supported.
* @param {function(): void} callback Callback that will be called when
* complete.
*/
chrome.terminalPrivate.openSettingsSubpage = function(subpage, callback) {};
/**
* Returns an object containing info about ChromeOS settings that affect the
* Terminal, e.g. which feature flags are enabled.
* @param {function({
* alternative_emulator: boolean,
* tast: boolean
* }): void} callback Callback that will be called with the info object.
*/
chrome.terminalPrivate.getOSInfo = function(callback) {};
/**
* Returns specified pref values, ignoring any not in allowlist.
* @param {!Array<string>} paths Paths of prefs to fetch.
* @param {function(Object): void} callback Callback that will be called with
* prefs.
*/
chrome.terminalPrivate.getPrefs = function(paths, callback) {};
/**
* Sets specified prefs, ignoring any not in allowlist.
* @param {Object} prefs Prefs to update keyed by paths.
* @param {function(): void} callback Callback that will be called when
* complete.
*/
chrome.terminalPrivate.setPrefs = function(prefs, callback) {};
/**
* 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.
* @type {!ChromeEvent}
*/
chrome.terminalPrivate.onProcessOutput;
/**
* Fired when pref changes.
* @type {!ChromeEvent}
*/
chrome.terminalPrivate.onPrefChanged;