You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Whether the group is collapsed. A collapsed group is one whose tabs are hidden. */
12235
12246
collapsed: boolean;
12236
12247
/** The group's color. */
12237
-
color: ColorEnum;
12248
+
color: `${Color}`;
12238
12249
/** The ID of the group. Group IDs are unique within a browser session. */
12239
12250
id: number;
12240
-
/** Optional. The title of the group. */
12241
-
title?: string | undefined;
12251
+
/** The title of the group. */
12252
+
title?: string;
12242
12253
/** The ID of the window that contains the group. */
12243
12254
windowId: number;
12244
12255
}
12245
12256
12246
12257
export interface MoveProperties {
12247
-
/** The position to move the group to. Use -1 to place the group at the end of the window. */
12258
+
/** The position to move the group to. Use `-1` to place the group at the end of the window. */
12248
12259
index: number;
12249
-
/** Optional. The window to move the group to. Defaults to the window the group is currently in. Note that groups can only be moved to and from windows with chrome.windows.WindowType type "normal". */
12250
-
windowId?: number | undefined;
12260
+
/** The window to move the group to. Defaults to the window the group is currently in. Note that groups can only be moved to and from windows with {@link windows.windowTypeEnum windows.windowType} type `"normal"`. */
12261
+
windowId?: number;
12251
12262
}
12252
12263
12253
12264
export interface QueryInfo {
12254
-
/** Optional. Whether the groups are collapsed. */
12255
-
collapsed?: boolean | undefined;
12256
-
/** Optional. The color of the groups. */
12257
-
color?: ColorEnum | undefined;
12258
-
/** Optional. Match group titles against a pattern. */
12259
-
title?: string | undefined;
12260
-
/** Optional. The ID of the window that contains the group. */
12261
-
windowId?: number | undefined;
12265
+
/** Whether the groups are collapsed. */
12266
+
collapsed?: boolean;
12267
+
/** The color of the groups. */
12268
+
color?: `${Color}`;
12269
+
/** Match group titles against a pattern. */
12270
+
title?: string;
12271
+
/** The ID of the parent window, or {@link windows.WINDOW_ID_CURRENT} for the current window. */
12272
+
windowId?: number;
12262
12273
}
12263
12274
12264
12275
export interface UpdateProperties {
12265
-
/** Optional. Whether the group should be collapsed. */
12266
-
collapsed?: boolean | undefined;
12267
-
/** Optional. The color of the group. */
12268
-
color?: ColorEnum | undefined;
12269
-
/** Optional. The title of the group. */
12270
-
title?: string | undefined;
12276
+
/** Whether the group should be collapsed. */
12277
+
collapsed?: boolean;
12278
+
/** The color of the group. */
12279
+
color?: `${Color}`;
12280
+
/** The title of the group. */
12281
+
title?: string;
12271
12282
}
12272
12283
12273
12284
/**
12274
12285
* Retrieves details about the specified group.
12275
-
* @param groupId The ID of the tab group.
12276
-
* @param callback Called with the retrieved tab group.
12277
-
*/
12278
-
export function get(groupId: number, callback: (group: TabGroup) => void): void;
12279
-
12280
-
/**
12281
-
* Retrieves details about the specified group.
12282
-
* @param groupId The ID of the tab group.
12283
-
* @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
12286
+
*
12287
+
* Can return its result via Promise since Chrome 90.
12284
12288
*/
12285
12289
export function get(groupId: number): Promise<TabGroup>;
12290
+
export function get(groupId: number, callback: (group: TabGroup) => void): void;
12286
12291
12287
12292
/**
12288
12293
* Moves the group and all its tabs within its window, or to a new window.
12289
12294
* @param groupId The ID of the group to move.
12290
-
* @param moveProperties Information on how to move the group.
12291
-
* @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only).
12292
-
*/
12293
-
export function move(groupId: number, moveProperties: MoveProperties): Promise<TabGroup>;
12294
-
12295
-
/**
12296
-
* Moves the group and all its tabs within its window, or to a new window.
12297
-
* @param groupId The ID of the group to move.
12298
-
* @param moveProperties Information on how to move the group.
12299
-
* @param callback Optional.
12295
+
*
12296
+
* Can return its result via Promise since Chrome 90.
12300
12297
*/
12298
+
export function move(groupId: number, moveProperties: MoveProperties): Promise<TabGroup | undefined>;
12301
12299
export function move(
12302
12300
groupId: number,
12303
12301
moveProperties: MoveProperties,
12304
-
callback: (group: TabGroup) => void,
12302
+
callback: (group?: TabGroup) => void,
12305
12303
): void;
12306
12304
12307
12305
/**
12308
12306
* Gets all groups that have the specified properties, or all groups if no properties are specified.
12309
-
* @param queryInfo Object with search parameters.
12310
-
* @param callback Called with retrieved tab groups.
12311
-
*/
12312
-
export function query(queryInfo: QueryInfo, callback: (result: TabGroup[]) => void): void;
12313
-
12314
-
/**
12315
-
* Gets all groups that have the specified properties, or all groups if no properties are specified.
12316
-
* @param queryInfo Object with search parameters.
12317
-
* @return The `query` method provides its result via callback or returned as a `Promise` (MV3 only).
12307
+
*
12308
+
* Can return its result via Promise since Chrome 90.
12318
12309
*/
12319
12310
export function query(queryInfo: QueryInfo): Promise<TabGroup[]>;
12311
+
export function query(queryInfo: QueryInfo, callback: (result: TabGroup[]) => void): void;
12320
12312
12321
12313
/**
12322
-
* Modifies the properties of a group. Properties that are not specified in updateProperties are not modified.
12323
-
* @param groupId The ID of the group to modify.
12324
-
* @param updateProperties Information on how to update the group.
12325
-
* @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only).
12326
-
*/
12327
-
export function update(groupId: number, updateProperties: UpdateProperties): Promise<TabGroup>;
12328
-
12329
-
/**
12330
-
* Modifies the properties of a group. Properties that are not specified in updateProperties are not modified.
12314
+
* Modifies the properties of a group. Properties that are not specified in `updateProperties` are not modified.
12331
12315
* @param groupId The ID of the group to modify.
12332
-
* @param updateProperties Information on how to update the group.
12333
-
* @param callback Optional.
12316
+
*
12317
+
* Can return its result via Promise since Chrome 90.
12334
12318
*/
12319
+
export function update(groupId: number, updateProperties: UpdateProperties): Promise<TabGroup | undefined>;
/** Fired when a group is moved within a window. Move events are still fired for the individual tabs within the group, as well as for the group itself. This event is not fired when a group is moved between windows; instead, it will be removed from one window and created in another. */
12349
-
export var onMoved: TabGroupMovedEvent;
12350
-
/** Fired when a group is closed, either directly by the user or automatically because it contained zero. */
0 commit comments