tab_groups.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. // Copyright 2020 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.tabGroups.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: tabGroups */
  11. /** @const */
  12. chrome.tabGroups = {};
  13. /**
  14. * @enum {string}
  15. * @see https://developer.chrome.com/extensions/tabGroups#type-Color
  16. */
  17. chrome.tabGroups.Color = {
  18. GREY: 'grey',
  19. BLUE: 'blue',
  20. RED: 'red',
  21. YELLOW: 'yellow',
  22. GREEN: 'green',
  23. PINK: 'pink',
  24. PURPLE: 'purple',
  25. CYAN: 'cyan',
  26. };
  27. /**
  28. * @typedef {{
  29. * id: number,
  30. * collapsed: boolean,
  31. * color: !chrome.tabGroups.Color,
  32. * title: (string|undefined),
  33. * windowId: number
  34. * }}
  35. * @see https://developer.chrome.com/extensions/tabGroups#type-TabGroup
  36. */
  37. chrome.tabGroups.TabGroup;
  38. /**
  39. * An ID that represents the absence of a group.
  40. * @type {number}
  41. * @see https://developer.chrome.com/extensions/tabGroups#type-TAB_GROUP_ID_NONE
  42. */
  43. chrome.tabGroups.TAB_GROUP_ID_NONE;
  44. /**
  45. * Retrieves details about the specified group.
  46. * @param {number} groupId
  47. * @param {function(!chrome.tabGroups.TabGroup): void} callback
  48. * @see https://developer.chrome.com/extensions/tabGroups#method-get
  49. */
  50. chrome.tabGroups.get = function(groupId, callback) {};
  51. /**
  52. * Gets all groups that have the specified properties, or all groups if no
  53. * properties are specified.
  54. * @param {{
  55. * collapsed: (boolean|undefined),
  56. * color: (!chrome.tabGroups.Color|undefined),
  57. * title: (string|undefined),
  58. * windowId: (number|undefined)
  59. * }} queryInfo
  60. * @param {function(!Array<!chrome.tabGroups.TabGroup>): void} callback
  61. * @see https://developer.chrome.com/extensions/tabGroups#method-query
  62. */
  63. chrome.tabGroups.query = function(queryInfo, callback) {};
  64. /**
  65. * Modifies the properties of a group. Properties that are not specified in
  66. * <var>updateProperties</var> are not modified.
  67. * @param {number} groupId The ID of the group to modify.
  68. * @param {{
  69. * collapsed: (boolean|undefined),
  70. * color: (!chrome.tabGroups.Color|undefined),
  71. * title: (string|undefined)
  72. * }} updateProperties
  73. * @param {function((!chrome.tabGroups.TabGroup|undefined)): void=} callback
  74. * @see https://developer.chrome.com/extensions/tabGroups#method-update
  75. */
  76. chrome.tabGroups.update = function(groupId, updateProperties, callback) {};
  77. /**
  78. * Moves the group and all its tabs within its window, or to a new window.
  79. * @param {number} groupId The ID of the group to move.
  80. * @param {{
  81. * windowId: (number|undefined),
  82. * index: number
  83. * }} moveProperties
  84. * @param {function((!chrome.tabGroups.TabGroup|undefined)): void=} callback
  85. * @see https://developer.chrome.com/extensions/tabGroups#method-move
  86. */
  87. chrome.tabGroups.move = function(groupId, moveProperties, callback) {};
  88. /**
  89. * Fired when a group is created.
  90. * @type {!ChromeEvent}
  91. * @see https://developer.chrome.com/extensions/tabGroups#event-onCreated
  92. */
  93. chrome.tabGroups.onCreated;
  94. /**
  95. * Fired when a group is updated.
  96. * @type {!ChromeEvent}
  97. * @see https://developer.chrome.com/extensions/tabGroups#event-onUpdated
  98. */
  99. chrome.tabGroups.onUpdated;
  100. /**
  101. * Fired when a group is moved within a window. Move events are still fired for
  102. * the individual tabs within the group, as well as for the group itself. This
  103. * event is not fired when a group is moved between windows; instead, it will be
  104. * removed from one window and created in another.
  105. * @type {!ChromeEvent}
  106. * @see https://developer.chrome.com/extensions/tabGroups#event-onMoved
  107. */
  108. chrome.tabGroups.onMoved;
  109. /**
  110. * Fired when a group is closed, either directly by the user or automatically
  111. * because it contained zero tabs.
  112. * @type {!ChromeEvent}
  113. * @see https://developer.chrome.com/extensions/tabGroups#event-onRemoved
  114. */
  115. chrome.tabGroups.onRemoved;