terminal_private.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file was generated by:
  5. // tools/json_schema_compiler/compiler.py.
  6. // NOTE: The format of types has changed. 'FooType' is now
  7. // 'chrome.terminalPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: terminalPrivate */
  11. /** @const */
  12. chrome.terminalPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.terminalPrivate.OutputType = {
  17. STDOUT: 'stdout',
  18. STDERR: 'stderr',
  19. EXIT: 'exit',
  20. };
  21. /**
  22. * Starts new process.
  23. * @param {string} processName Name of the process to open. May be 'crosh' or
  24. * 'vmshell'.
  25. * @param {?Array<string>|undefined} args Command line arguments to pass to the
  26. * process.
  27. * @param {function(string): void} callback Returns id of the launched process.
  28. * If no process was launched returns -1.
  29. */
  30. chrome.terminalPrivate.openTerminalProcess = function(processName, args, callback) {};
  31. /**
  32. * Starts new vmshell process.
  33. * @param {?Array<string>|undefined} args Command line arguments to pass to
  34. * vmshell.
  35. * @param {function(string): void} callback Returns id of the launched vmshell
  36. * process. If no process was launched returns -1.
  37. */
  38. chrome.terminalPrivate.openVmshellProcess = function(args, callback) {};
  39. /**
  40. * Closes previously opened process from either openTerminalProcess or
  41. * openVmshellProcess.
  42. * @param {string} id Unique id of the process we want to close.
  43. * @param {function(boolean): void=} callback Function that gets called when
  44. * close operation is started for the process. Returns success of the
  45. * function.
  46. */
  47. chrome.terminalPrivate.closeTerminalProcess = function(id, callback) {};
  48. /**
  49. * Sends input that will be routed to stdin of the process with the specified
  50. * id.
  51. * @param {string} id The id of the process to which we want to send input.
  52. * @param {string} input Input we are sending to the process.
  53. * @param {function(boolean): void=} callback Callback that will be called when
  54. * sendInput method ends. Returns success.
  55. */
  56. chrome.terminalPrivate.sendInput = function(id, input, callback) {};
  57. /**
  58. * Notify the process with the id id that terminal window size has changed.
  59. * @param {string} id The id of the process.
  60. * @param {number} width New window width (as column count).
  61. * @param {number} height New window height (as row count).
  62. * @param {function(boolean): void=} callback Callback that will be called when
  63. * sendInput method ends. Returns success.
  64. */
  65. chrome.terminalPrivate.onTerminalResize = function(id, width, height, callback) {};
  66. /**
  67. * Called from |onProcessOutput| when the event is dispatched to terminal
  68. * extension. Observing the terminal process output will be paused after
  69. * |onProcessOutput| is dispatched until this method is called.
  70. * @param {string} id The id of the process to which |onProcessOutput| was
  71. * dispatched.
  72. */
  73. chrome.terminalPrivate.ackOutput = function(id) {};
  74. /**
  75. * Open a Terminal app window/tab
  76. * @param {{
  77. * url: (string|undefined),
  78. * asTab: (boolean|undefined)
  79. * }=} data
  80. */
  81. chrome.terminalPrivate.openWindow = function(data) {};
  82. /**
  83. * Open the Terminal Settings page.
  84. * @param {function(): void} callback Callback that will be called when
  85. * complete.
  86. */
  87. chrome.terminalPrivate.openOptionsPage = function(callback) {};
  88. /**
  89. * Open the System Settings at the specified subpage.
  90. * @param {string} subpage Name of subpage to open. Currently only 'crostini'
  91. * supported.
  92. * @param {function(): void} callback Callback that will be called when
  93. * complete.
  94. */
  95. chrome.terminalPrivate.openSettingsSubpage = function(subpage, callback) {};
  96. /**
  97. * Returns an object containing info about ChromeOS settings that affect the
  98. * Terminal, e.g. which feature flags are enabled.
  99. * @param {function({
  100. * alternative_emulator: boolean,
  101. * multi_profile: boolean,
  102. * tmux_integration: boolean
  103. * }): void} callback Callback that will be called with the info object.
  104. */
  105. chrome.terminalPrivate.getOSInfo = function(callback) {};
  106. /**
  107. * Returns specified pref values, ignoring any not in allowlist.
  108. * @param {!Array<string>} paths Paths of prefs to fetch.
  109. * @param {function(Object): void} callback Callback that will be called with
  110. * prefs.
  111. */
  112. chrome.terminalPrivate.getPrefs = function(paths, callback) {};
  113. /**
  114. * Sets specified prefs, ignoring any not in allowlist.
  115. * @param {Object} prefs Prefs to update keyed by paths.
  116. * @param {function(): void} callback Callback that will be called when
  117. * complete.
  118. */
  119. chrome.terminalPrivate.setPrefs = function(prefs, callback) {};
  120. /**
  121. * Fired when an opened process writes something to its output. Observing
  122. * further process output will be blocked until |ackOutput| for the terminal is
  123. * called. Internally, first event argument will be ID of the tab that contains
  124. * terminal instance for which this event is intended. This argument will be
  125. * stripped before passing the event to the extension.
  126. * @type {!ChromeEvent}
  127. */
  128. chrome.terminalPrivate.onProcessOutput;
  129. /**
  130. * Fired when pref changes.
  131. * @type {!ChromeEvent}
  132. */
  133. chrome.terminalPrivate.onPrefChanged;