system_display.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. // Copyright 2021 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.system.display.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
  10. // This was modified to add 'chrome.system = {};'
  11. // If the above tool that generates this file removes it, please readd it or
  12. // the closure compiler will fail.
  13. /** @fileoverview Externs generated from namespace: system.display */
  14. /** @const */
  15. chrome.system = {};
  16. /** @const */
  17. chrome.system.display = {};
  18. /**
  19. * @typedef {{
  20. * left: number,
  21. * top: number,
  22. * width: number,
  23. * height: number
  24. * }}
  25. * @see https://developer.chrome.com/extensions/system.display#type-Bounds
  26. */
  27. chrome.system.display.Bounds;
  28. /**
  29. * @typedef {{
  30. * left: number,
  31. * top: number,
  32. * right: number,
  33. * bottom: number
  34. * }}
  35. * @see https://developer.chrome.com/extensions/system.display#type-Insets
  36. */
  37. chrome.system.display.Insets;
  38. /**
  39. * @typedef {{
  40. * x: number,
  41. * y: number
  42. * }}
  43. * @see https://developer.chrome.com/extensions/system.display#type-Point
  44. */
  45. chrome.system.display.Point;
  46. /**
  47. * @typedef {{
  48. * displayPoint: !chrome.system.display.Point,
  49. * touchPoint: !chrome.system.display.Point
  50. * }}
  51. * @see https://developer.chrome.com/extensions/system.display#type-TouchCalibrationPair
  52. */
  53. chrome.system.display.TouchCalibrationPair;
  54. /**
  55. * @typedef {{
  56. * pair1: !chrome.system.display.TouchCalibrationPair,
  57. * pair2: !chrome.system.display.TouchCalibrationPair,
  58. * pair3: !chrome.system.display.TouchCalibrationPair,
  59. * pair4: !chrome.system.display.TouchCalibrationPair
  60. * }}
  61. * @see https://developer.chrome.com/extensions/system.display#type-TouchCalibrationPairQuad
  62. */
  63. chrome.system.display.TouchCalibrationPairQuad;
  64. /**
  65. * @typedef {{
  66. * width: number,
  67. * height: number,
  68. * widthInNativePixels: number,
  69. * heightInNativePixels: number,
  70. * uiScale: (number|undefined),
  71. * deviceScaleFactor: number,
  72. * refreshRate: number,
  73. * isNative: boolean,
  74. * isSelected: boolean,
  75. * isInterlaced: (boolean|undefined)
  76. * }}
  77. * @see https://developer.chrome.com/extensions/system.display#type-DisplayMode
  78. */
  79. chrome.system.display.DisplayMode;
  80. /**
  81. * @enum {string}
  82. * @see https://developer.chrome.com/extensions/system.display#type-LayoutPosition
  83. */
  84. chrome.system.display.LayoutPosition = {
  85. TOP: 'top',
  86. RIGHT: 'right',
  87. BOTTOM: 'bottom',
  88. LEFT: 'left',
  89. };
  90. /**
  91. * @typedef {{
  92. * id: string,
  93. * parentId: string,
  94. * position: !chrome.system.display.LayoutPosition,
  95. * offset: number
  96. * }}
  97. * @see https://developer.chrome.com/extensions/system.display#type-DisplayLayout
  98. */
  99. chrome.system.display.DisplayLayout;
  100. /**
  101. * @typedef {{
  102. * manufacturerId: string,
  103. * productId: string,
  104. * yearOfManufacture: number
  105. * }}
  106. * @see https://developer.chrome.com/extensions/system.display#type-Edid
  107. */
  108. chrome.system.display.Edid;
  109. /**
  110. * @typedef {{
  111. * id: string,
  112. * name: string,
  113. * edid: (!chrome.system.display.Edid|undefined),
  114. * mirroringSourceId: string,
  115. * mirroringDestinationIds: !Array<string>,
  116. * isPrimary: boolean,
  117. * isInternal: boolean,
  118. * isEnabled: boolean,
  119. * isUnified: boolean,
  120. * isAutoRotationAllowed: (boolean|undefined),
  121. * dpiX: number,
  122. * dpiY: number,
  123. * rotation: number,
  124. * bounds: !chrome.system.display.Bounds,
  125. * overscan: !chrome.system.display.Insets,
  126. * workArea: !chrome.system.display.Bounds,
  127. * modes: !Array<!chrome.system.display.DisplayMode>,
  128. * hasTouchSupport: boolean,
  129. * hasAccelerometerSupport: boolean,
  130. * availableDisplayZoomFactors: !Array<number>,
  131. * displayZoomFactor: number
  132. * }}
  133. * @see https://developer.chrome.com/extensions/system.display#type-DisplayUnitInfo
  134. */
  135. chrome.system.display.DisplayUnitInfo;
  136. /**
  137. * @typedef {{
  138. * isUnified: (boolean|undefined),
  139. * mirroringSourceId: (string|undefined),
  140. * isPrimary: (boolean|undefined),
  141. * overscan: (!chrome.system.display.Insets|undefined),
  142. * rotation: (number|undefined),
  143. * boundsOriginX: (number|undefined),
  144. * boundsOriginY: (number|undefined),
  145. * displayMode: (!chrome.system.display.DisplayMode|undefined),
  146. * displayZoomFactor: (number|undefined)
  147. * }}
  148. * @see https://developer.chrome.com/extensions/system.display#type-DisplayProperties
  149. */
  150. chrome.system.display.DisplayProperties;
  151. /**
  152. * @typedef {{
  153. * singleUnified: (boolean|undefined)
  154. * }}
  155. * @see https://developer.chrome.com/extensions/system.display#type-GetInfoFlags
  156. */
  157. chrome.system.display.GetInfoFlags;
  158. /**
  159. * @enum {string}
  160. * @see https://developer.chrome.com/extensions/system.display#type-MirrorMode
  161. */
  162. chrome.system.display.MirrorMode = {
  163. OFF: 'off',
  164. NORMAL: 'normal',
  165. MIXED: 'mixed',
  166. };
  167. /**
  168. * @typedef {{
  169. * mode: !chrome.system.display.MirrorMode,
  170. * mirroringSourceId: (string|undefined),
  171. * mirroringDestinationIds: (!Array<string>|undefined)
  172. * }}
  173. * @see https://developer.chrome.com/extensions/system.display#type-MirrorModeInfo
  174. */
  175. chrome.system.display.MirrorModeInfo;
  176. /**
  177. * Requests the information for all attached display devices.
  178. * @param {?chrome.system.display.GetInfoFlags|undefined} flags Options
  179. * affecting how the information is returned.
  180. * @param {function(!Array<!chrome.system.display.DisplayUnitInfo>): void}
  181. * callback The callback to invoke with the results.
  182. * @see https://developer.chrome.com/extensions/system.display#method-getInfo
  183. */
  184. chrome.system.display.getInfo = function(flags, callback) {};
  185. /**
  186. * Requests the layout info for all displays. NOTE: This is only available to
  187. * Chrome OS Kiosk apps and Web UI.
  188. * @param {function(!Array<!chrome.system.display.DisplayLayout>): void}
  189. * callback The callback to invoke with the results.
  190. * @see https://developer.chrome.com/extensions/system.display#method-getDisplayLayout
  191. */
  192. chrome.system.display.getDisplayLayout = function(callback) {};
  193. /**
  194. * Updates the properties for the display specified by |id|, according to the
  195. * information provided in |info|. On failure, $(ref:runtime.lastError) will be
  196. * set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  197. * @param {string} id The display's unique identifier.
  198. * @param {!chrome.system.display.DisplayProperties} info The information about
  199. * display properties that should be changed. A property will be changed
  200. * only if a new value for it is specified in |info|.
  201. * @param {function(): void=} callback Empty function called when the function
  202. * finishes. To find out whether the function succeeded,
  203. * $(ref:runtime.lastError) should be queried.
  204. * @see https://developer.chrome.com/extensions/system.display#method-setDisplayProperties
  205. */
  206. chrome.system.display.setDisplayProperties = function(id, info, callback) {};
  207. /**
  208. * Set the layout for all displays. Any display not included will use the
  209. * default layout. If a layout would overlap or be otherwise invalid it will be
  210. * adjusted to a valid layout. After layout is resolved, an onDisplayChanged
  211. * event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps
  212. * and Web UI.
  213. * @param {!Array<!chrome.system.display.DisplayLayout>} layouts The layout
  214. * information, required for all displays except the primary display.
  215. * @param {function(): void=} callback Empty function called when the function
  216. * finishes. To find out whether the function succeeded,
  217. * $(ref:runtime.lastError) should be queried.
  218. * @see https://developer.chrome.com/extensions/system.display#method-setDisplayLayout
  219. */
  220. chrome.system.display.setDisplayLayout = function(layouts, callback) {};
  221. /**
  222. * Enables/disables the unified desktop feature. If enabled while mirroring is
  223. * active, the desktop mode will not change until mirroring is turned off.
  224. * Otherwise, the desktop mode will switch to unified immediately. NOTE: This is
  225. * only available to Chrome OS Kiosk apps and Web UI.
  226. * @param {boolean} enabled True if unified desktop should be enabled.
  227. * @see https://developer.chrome.com/extensions/system.display#method-enableUnifiedDesktop
  228. */
  229. chrome.system.display.enableUnifiedDesktop = function(enabled) {};
  230. /**
  231. * Starts overscan calibration for a display. This will show an overlay on the
  232. * screen indicating the current overscan insets. If overscan calibration for
  233. * display |id| is in progress this will reset calibration.
  234. * @param {string} id The display's unique identifier.
  235. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationStart
  236. */
  237. chrome.system.display.overscanCalibrationStart = function(id) {};
  238. /**
  239. * Adjusts the current overscan insets for a display. Typically this should
  240. * either move the display along an axis (e.g. left+right have the same value)
  241. * or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust
  242. * call is cumulative with previous calls since Start.
  243. * @param {string} id The display's unique identifier.
  244. * @param {!chrome.system.display.Insets} delta The amount to change the
  245. * overscan insets.
  246. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationAdjust
  247. */
  248. chrome.system.display.overscanCalibrationAdjust = function(id, delta) {};
  249. /**
  250. * Resets the overscan insets for a display to the last saved value (i.e before
  251. * Start was called).
  252. * @param {string} id The display's unique identifier.
  253. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationReset
  254. */
  255. chrome.system.display.overscanCalibrationReset = function(id) {};
  256. /**
  257. * Complete overscan adjustments for a display by saving the current values and
  258. * hiding the overlay.
  259. * @param {string} id The display's unique identifier.
  260. * @see https://developer.chrome.com/extensions/system.display#method-overscanCalibrationComplete
  261. */
  262. chrome.system.display.overscanCalibrationComplete = function(id) {};
  263. /**
  264. * Displays the native touch calibration UX for the display with |id| as display
  265. * id. This will show an overlay on the screen with required instructions on how
  266. * to proceed. The callback will be invoked in case of successful calibration
  267. * only. If the calibration fails, this will throw an error.
  268. * @param {string} id The display's unique identifier.
  269. * @param {function(boolean): void=} callback Optional callback to inform the
  270. * caller that the touch calibration has ended. The argument of the
  271. * callback informs if the calibration was a success or not.
  272. * @see https://developer.chrome.com/extensions/system.display#method-showNativeTouchCalibration
  273. */
  274. chrome.system.display.showNativeTouchCalibration = function(id, callback) {};
  275. /**
  276. * Starts custom touch calibration for a display. This should be called when
  277. * using a custom UX for collecting calibration data. If another touch
  278. * calibration is already in progress this will throw an error.
  279. * @param {string} id The display's unique identifier.
  280. * @see https://developer.chrome.com/extensions/system.display#method-startCustomTouchCalibration
  281. */
  282. chrome.system.display.startCustomTouchCalibration = function(id) {};
  283. /**
  284. * Sets the touch calibration pairs for a display. These |pairs| would be used
  285. * to calibrate the touch screen for display with |id| called in
  286. * startCustomTouchCalibration(). Always call |startCustomTouchCalibration|
  287. * before calling this method. If another touch calibration is already in
  288. * progress this will throw an error.
  289. * @param {!chrome.system.display.TouchCalibrationPairQuad} pairs The pairs of
  290. * point used to calibrate the display.
  291. * @param {!chrome.system.display.Bounds} bounds Bounds of the display when the
  292. * touch calibration was performed. |bounds.left| and |bounds.top|
  293. * values are ignored.
  294. * @see https://developer.chrome.com/extensions/system.display#method-completeCustomTouchCalibration
  295. */
  296. chrome.system.display.completeCustomTouchCalibration = function(pairs, bounds) {};
  297. /**
  298. * Resets the touch calibration for the display and brings it back to its
  299. * default state by clearing any touch calibration data associated with the
  300. * display.
  301. * @param {string} id The display's unique identifier.
  302. * @see https://developer.chrome.com/extensions/system.display#method-clearTouchCalibration
  303. */
  304. chrome.system.display.clearTouchCalibration = function(id) {};
  305. /**
  306. * Sets the display mode to the specified mirror mode. Each call resets the
  307. * state from previous calls. Calling setDisplayProperties() will fail for the
  308. * mirroring destination displays. NOTE: This is only available to Chrome OS
  309. * Kiosk apps and Web UI.
  310. * @param {!chrome.system.display.MirrorModeInfo} info The information of the
  311. * mirror mode that should be applied to the display mode.
  312. * @param {function(): void=} callback Empty function called when the function
  313. * finishes. To find out whether the function succeeded,
  314. * $(ref:runtime.lastError) should be queried.
  315. * @see https://developer.chrome.com/extensions/system.display#method-setMirrorMode
  316. */
  317. chrome.system.display.setMirrorMode = function(info, callback) {};
  318. /**
  319. * Fired when anything changes to the display configuration.
  320. * @type {!ChromeEvent}
  321. * @see https://developer.chrome.com/extensions/system.display#event-onDisplayChanged
  322. */
  323. chrome.system.display.onDisplayChanged;