@types/chrome 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chrome/README.md +1 -1
- chrome/index.d.ts +74 -163
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Wed, 01 Oct 2025 18:39:47 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -7587,15 +7587,11 @@ declare namespace chrome {
|
|
7587
7587
|
|
7588
7588
|
/**
|
7589
7589
|
* Saves the content of the tab with given id as MHTML.
|
7590
|
-
*
|
7591
|
-
*
|
7592
|
-
*/
|
7593
|
-
export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
|
7594
|
-
/**
|
7595
|
-
* Saves the content of the tab with given id as MHTML.
|
7596
|
-
* @since Chrome 116 MV3
|
7590
|
+
*
|
7591
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
|
7597
7592
|
*/
|
7598
7593
|
export function saveAsMHTML(details: SaveDetails): Promise<Blob | undefined>;
|
7594
|
+
export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
|
7599
7595
|
}
|
7600
7596
|
|
7601
7597
|
////////////////////
|
@@ -8503,57 +8499,48 @@ declare namespace chrome {
|
|
8503
8499
|
|
8504
8500
|
/**
|
8505
8501
|
* Adds an entry to the reading list if it does not exist.
|
8506
|
-
*
|
8502
|
+
*
|
8503
|
+
* Can return its result via Promise.
|
8507
8504
|
* @param entry The entry to add to the reading list.
|
8508
|
-
* @param callback
|
8509
8505
|
*/
|
8510
8506
|
export function addEntry(entry: AddEntryOptions): Promise<void>;
|
8511
8507
|
export function addEntry(entry: AddEntryOptions, callback: () => void): void;
|
8512
8508
|
|
8513
8509
|
/**
|
8514
8510
|
* Retrieves all entries that match the `QueryInfo` properties. Properties that are not provided will not be matched.
|
8515
|
-
*
|
8511
|
+
*
|
8512
|
+
* Can return its result via Promise.
|
8516
8513
|
* @param info The properties to search for.
|
8517
|
-
* @param callback
|
8518
8514
|
*/
|
8519
8515
|
export function query(info: QueryInfo): Promise<ReadingListEntry[]>;
|
8520
8516
|
export function query(info: QueryInfo, callback: (entries: ReadingListEntry[]) => void): void;
|
8521
8517
|
|
8522
8518
|
/**
|
8523
8519
|
* Removes an entry from the reading list if it exists.
|
8524
|
-
*
|
8520
|
+
*
|
8521
|
+
* Can return its result via Promise.
|
8525
8522
|
* @param info The entry to remove from the reading list.
|
8526
|
-
* @param callback
|
8527
8523
|
*/
|
8528
8524
|
export function removeEntry(info: RemoveOptions): Promise<void>;
|
8529
8525
|
export function removeEntry(info: RemoveOptions, callback: () => void): void;
|
8530
8526
|
|
8531
8527
|
/**
|
8532
8528
|
* Updates a reading list entry if it exists.
|
8533
|
-
*
|
8529
|
+
*
|
8530
|
+
* Can return its result via Promise.
|
8534
8531
|
* @param info The entry to update.
|
8535
|
-
* @param callback
|
8536
8532
|
*/
|
8537
8533
|
export function updateEntry(info: UpdateEntryOptions): Promise<void>;
|
8538
8534
|
export function updateEntry(info: UpdateEntryOptions, callback: () => void): void;
|
8539
8535
|
|
8540
|
-
/**
|
8541
|
-
|
8542
|
-
* @since Chrome 120, MV3
|
8543
|
-
*/
|
8544
|
-
export const onEntryAdded: chrome.events.Event<(entry: ReadingListEntry) => void>;
|
8536
|
+
/** Triggered when a `ReadingListEntry` is added to the reading list. */
|
8537
|
+
export const onEntryAdded: events.Event<(entry: ReadingListEntry) => void>;
|
8545
8538
|
|
8546
|
-
/**
|
8547
|
-
|
8548
|
-
* @since Chrome 120, MV3
|
8549
|
-
*/
|
8550
|
-
export const onEntryRemoved: chrome.events.Event<(entry: ReadingListEntry) => void>;
|
8539
|
+
/** Triggered when a `ReadingListEntry` is removed from the reading list. */
|
8540
|
+
export const onEntryRemoved: events.Event<(entry: ReadingListEntry) => void>;
|
8551
8541
|
|
8552
|
-
/**
|
8553
|
-
|
8554
|
-
* @since Chrome 120, MV3
|
8555
|
-
*/
|
8556
|
-
export const onEntryUpdated: chrome.events.Event<(entry: ReadingListEntry) => void>;
|
8542
|
+
/** Triggered when a `ReadingListEntry` is updated in the reading list. */
|
8543
|
+
export const onEntryUpdated: events.Event<(entry: ReadingListEntry) => void>;
|
8557
8544
|
}
|
8558
8545
|
|
8559
8546
|
////////////////////
|
@@ -9738,25 +9725,16 @@ declare namespace chrome {
|
|
9738
9725
|
*/
|
9739
9726
|
export namespace sessions {
|
9740
9727
|
export interface Filter {
|
9741
|
-
/**
|
9742
|
-
* Optional.
|
9743
|
-
* The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS).
|
9744
|
-
*/
|
9728
|
+
/** The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ({@link sessions.MAX_SESSION_RESULTS}). */
|
9745
9729
|
maxResults?: number | undefined;
|
9746
9730
|
}
|
9747
9731
|
|
9748
9732
|
export interface Session {
|
9749
9733
|
/** The time when the window or tab was closed or modified, represented in seconds since the epoch. */
|
9750
9734
|
lastModified: number;
|
9751
|
-
/**
|
9752
|
-
* Optional.
|
9753
|
-
* The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set.
|
9754
|
-
*/
|
9735
|
+
/** The {@link tabs.Tab}, if this entry describes a tab. Either this or {@link sessions.Session.window} will be set. */
|
9755
9736
|
tab?: tabs.Tab | undefined;
|
9756
|
-
/**
|
9757
|
-
* Optional.
|
9758
|
-
* The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set.
|
9759
|
-
*/
|
9737
|
+
/** The {@link windows.Window}, if this entry describes a window. Either this or {@link sessions.Session.tab} will be set. */
|
9760
9738
|
window?: windows.Window | undefined;
|
9761
9739
|
}
|
9762
9740
|
|
@@ -9767,69 +9745,39 @@ declare namespace chrome {
|
|
9767
9745
|
sessions: Session[];
|
9768
9746
|
}
|
9769
9747
|
|
9770
|
-
|
9771
|
-
|
9772
|
-
/** The maximum number of sessions.Session that will be included in a requested list. */
|
9773
|
-
export var MAX_SESSION_RESULTS: number;
|
9748
|
+
/** The maximum number of {@link sessions.Session} that will be included in a requested list. */
|
9749
|
+
export const MAX_SESSION_RESULTS: 25;
|
9774
9750
|
|
9775
9751
|
/**
|
9776
9752
|
* Gets the list of recently closed tabs and/or windows.
|
9777
|
-
*
|
9753
|
+
*
|
9754
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
9778
9755
|
*/
|
9779
9756
|
export function getRecentlyClosed(filter?: Filter): Promise<Session[]>;
|
9780
|
-
/**
|
9781
|
-
* Gets the list of recently closed tabs and/or windows.
|
9782
|
-
* @param callback
|
9783
|
-
* Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
|
9784
|
-
*/
|
9785
|
-
export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void;
|
9786
|
-
/**
|
9787
|
-
* Gets the list of recently closed tabs and/or windows.
|
9788
|
-
* @param callback
|
9789
|
-
* Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
|
9790
|
-
*/
|
9791
9757
|
export function getRecentlyClosed(callback: (sessions: Session[]) => void): void;
|
9758
|
+
export function getRecentlyClosed(filter: Filter | undefined, callback: (sessions: Session[]) => void): void;
|
9759
|
+
|
9792
9760
|
/**
|
9793
9761
|
* Retrieves all devices with synced sessions.
|
9794
|
-
*
|
9762
|
+
*
|
9763
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
9795
9764
|
*/
|
9796
9765
|
export function getDevices(filter?: Filter): Promise<Device[]>;
|
9797
|
-
/**
|
9798
|
-
* Retrieves all devices with synced sessions.
|
9799
|
-
* @param callback
|
9800
|
-
* Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
|
9801
|
-
*/
|
9802
|
-
export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void;
|
9803
|
-
/**
|
9804
|
-
* Retrieves all devices with synced sessions.
|
9805
|
-
* @param callback
|
9806
|
-
* Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
|
9807
|
-
*/
|
9808
9766
|
export function getDevices(callback: (devices: Device[]) => void): void;
|
9767
|
+
export function getDevices(filter: Filter | undefined, callback: (devices: Device[]) => void): void;
|
9768
|
+
|
9809
9769
|
/**
|
9810
|
-
* Reopens a windows.Window or tabs.Tab.
|
9811
|
-
*
|
9812
|
-
*
|
9813
|
-
* @
|
9770
|
+
* Reopens a {@link windows.Window} or {@link tabs.Tab}, with an optional callback to run when the entry has been restored.
|
9771
|
+
*
|
9772
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
9773
|
+
* @param sessionId The {@link windows.Window.sessionId}, or {@link tabs.Tab.sessionId} to restore. If this parameter is not specified, the most recently closed session is restored.
|
9814
9774
|
*/
|
9815
9775
|
export function restore(sessionId?: string): Promise<Session>;
|
9816
|
-
/**
|
9817
|
-
* Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
|
9818
|
-
* @param sessionId Optional.
|
9819
|
-
* The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
|
9820
|
-
* @param callback Optional.
|
9821
|
-
* Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
|
9822
|
-
*/
|
9823
|
-
export function restore(sessionId: string, callback: (restoredSession: Session) => void): void;
|
9824
|
-
/**
|
9825
|
-
* Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
|
9826
|
-
* @param callback Optional.
|
9827
|
-
* Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
|
9828
|
-
*/
|
9829
9776
|
export function restore(callback: (restoredSession: Session) => void): void;
|
9777
|
+
export function restore(sessionId: string | undefined, callback: (restoredSession: Session) => void): void;
|
9830
9778
|
|
9831
9779
|
/** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */
|
9832
|
-
export
|
9780
|
+
export const onChanged: events.Event<() => void>;
|
9833
9781
|
}
|
9834
9782
|
|
9835
9783
|
////////////////////
|
@@ -14155,27 +14103,26 @@ declare namespace chrome {
|
|
14155
14103
|
* If specified, the side panel options for the given tab will be returned.
|
14156
14104
|
* Otherwise, returns the default side panel options (used for any tab that doesn't have specific settings).
|
14157
14105
|
*/
|
14158
|
-
tabId?: number;
|
14106
|
+
tabId?: number | undefined;
|
14159
14107
|
}
|
14160
14108
|
|
14161
|
-
/**
|
14162
|
-
* @since Chrome 116
|
14163
|
-
*/
|
14109
|
+
/** @since Chrome 116 */
|
14164
14110
|
export type OpenOptions =
|
14165
14111
|
& {
|
14166
|
-
/**
|
14112
|
+
/**
|
14113
|
+
* The tab in which to open the side panel.
|
14167
14114
|
* If the corresponding tab has a tab-specific side panel, the panel will only be open for that tab.
|
14168
14115
|
* If there is not a tab-specific panel, the global panel will be open in the specified tab and any other tabs without a currently-open tab- specific panel.
|
14169
14116
|
* This will override any currently-active side panel (global or tab-specific) in the corresponding tab.
|
14170
|
-
* At least one of this and windowId must be provided. */
|
14171
|
-
tabId?: number;
|
14117
|
+
* At least one of this and `windowId` must be provided. */
|
14118
|
+
tabId?: number | undefined;
|
14172
14119
|
/**
|
14173
14120
|
* The window in which to open the side panel.
|
14174
|
-
* This is only applicable if the extension has a global (non-tab-specific) side panel or tabId is also specified.
|
14121
|
+
* This is only applicable if the extension has a global (non-tab-specific) side panel or `tabId` is also specified.
|
14175
14122
|
* This will override any currently-active global side panel the user has open in the given window.
|
14176
|
-
* At least one of this and tabId must be provided.
|
14123
|
+
* At least one of this and `tabId` must be provided.
|
14177
14124
|
*/
|
14178
|
-
windowId?: number;
|
14125
|
+
windowId?: number | undefined;
|
14179
14126
|
}
|
14180
14127
|
& ({
|
14181
14128
|
tabId: number;
|
@@ -14185,7 +14132,7 @@ declare namespace chrome {
|
|
14185
14132
|
|
14186
14133
|
export interface PanelBehavior {
|
14187
14134
|
/** Whether clicking the extension's icon will toggle showing the extension's entry in the side panel. Defaults to false. */
|
14188
|
-
openPanelOnActionClick?: boolean;
|
14135
|
+
openPanelOnActionClick?: boolean | undefined;
|
14189
14136
|
}
|
14190
14137
|
|
14191
14138
|
/** @since Chrome 140 */
|
@@ -14195,15 +14142,15 @@ declare namespace chrome {
|
|
14195
14142
|
|
14196
14143
|
export interface PanelOptions {
|
14197
14144
|
/** Whether the side panel should be enabled. This is optional. The default value is true. */
|
14198
|
-
enabled?: boolean;
|
14145
|
+
enabled?: boolean | undefined;
|
14199
14146
|
/** The path to the side panel HTML file to use. This must be a local resource within the extension package. */
|
14200
|
-
path?: string;
|
14147
|
+
path?: string | undefined;
|
14201
14148
|
/**
|
14202
14149
|
* If specified, the side panel options will only apply to the tab with this id.
|
14203
14150
|
* If omitted, these options set the default behavior (used for any tab that doesn't have specific settings).
|
14204
14151
|
* Note: if the same path is set for this tabId and the default tabId, then the panel for this tabId will be a different instance than the panel for the default tabId.
|
14205
14152
|
*/
|
14206
|
-
tabId?: number;
|
14153
|
+
tabId?: number | undefined;
|
14207
14154
|
}
|
14208
14155
|
|
14209
14156
|
/**
|
@@ -14229,84 +14176,48 @@ declare namespace chrome {
|
|
14229
14176
|
|
14230
14177
|
/**
|
14231
14178
|
* Returns the active panel configuration.
|
14232
|
-
*
|
14233
|
-
*
|
14234
|
-
*
|
14235
|
-
*/
|
14236
|
-
export function getOptions(
|
14237
|
-
|
14238
|
-
options: GetPanelOptions,
|
14239
|
-
callback: (options: PanelOptions) => void,
|
14240
|
-
): void;
|
14241
|
-
|
14242
|
-
export function getOptions(
|
14243
|
-
/** Specifies the context to return the configuration for. */
|
14244
|
-
options: GetPanelOptions,
|
14245
|
-
): Promise<PanelOptions>;
|
14179
|
+
*
|
14180
|
+
* Can return its result via Promise.
|
14181
|
+
* @param options Specifies the context to return the configuration for.
|
14182
|
+
*/
|
14183
|
+
export function getOptions(options: GetPanelOptions): Promise<PanelOptions>;
|
14184
|
+
export function getOptions(options: GetPanelOptions, callback: (options: PanelOptions) => void): void;
|
14246
14185
|
|
14247
14186
|
/**
|
14248
14187
|
* Returns the extension's current side panel behavior.
|
14249
|
-
*
|
14250
|
-
*
|
14251
|
-
* The promise resolves with the same type that is passed to the callback.
|
14188
|
+
*
|
14189
|
+
* Can return its result via Promise.
|
14252
14190
|
*/
|
14253
|
-
export function getPanelBehavior(
|
14254
|
-
callback: (behavior: PanelBehavior) => void,
|
14255
|
-
): void;
|
14256
|
-
|
14257
14191
|
export function getPanelBehavior(): Promise<PanelBehavior>;
|
14192
|
+
export function getPanelBehavior(callback: (behavior: PanelBehavior) => void): void;
|
14258
14193
|
|
14259
14194
|
/**
|
14260
|
-
* @since Chrome 116
|
14261
14195
|
* Opens the side panel for the extension. This may only be called in response to a user action.
|
14262
|
-
*
|
14263
|
-
*
|
14264
|
-
*
|
14196
|
+
*
|
14197
|
+
* Can return its result via Promise.
|
14198
|
+
* @param options Specifies the context in which to open the side panel.
|
14199
|
+
* @since Chrome 116
|
14265
14200
|
*/
|
14266
|
-
export function open(
|
14267
|
-
|
14268
|
-
options: OpenOptions,
|
14269
|
-
callback: () => void,
|
14270
|
-
): void;
|
14271
|
-
|
14272
|
-
export function open(
|
14273
|
-
/** Specifies the context in which to open the side panel. */
|
14274
|
-
options: OpenOptions,
|
14275
|
-
): Promise<void>;
|
14201
|
+
export function open(options: OpenOptions): Promise<void>;
|
14202
|
+
export function open(options: OpenOptions, callback: () => void): void;
|
14276
14203
|
|
14277
14204
|
/**
|
14278
14205
|
* Configures the side panel.
|
14279
|
-
*
|
14280
|
-
*
|
14281
|
-
*
|
14206
|
+
*
|
14207
|
+
* Can return its result via Promise.
|
14208
|
+
* @param options The configuration options to apply to the panel.
|
14282
14209
|
*/
|
14283
|
-
export function setOptions(
|
14284
|
-
|
14285
|
-
options: PanelOptions,
|
14286
|
-
callback: () => void,
|
14287
|
-
): void;
|
14288
|
-
|
14289
|
-
export function setOptions(
|
14290
|
-
/** The configuration options to apply to the panel. */
|
14291
|
-
options: PanelOptions,
|
14292
|
-
): Promise<void>;
|
14210
|
+
export function setOptions(options: PanelOptions): Promise<void>;
|
14211
|
+
export function setOptions(options: PanelOptions, callback: () => void): void;
|
14293
14212
|
|
14294
14213
|
/**
|
14295
14214
|
* Configures the extension's side panel behavior. This is an upsert operation.
|
14296
|
-
*
|
14297
|
-
*
|
14298
|
-
*
|
14215
|
+
*
|
14216
|
+
* Can return its result via Promise.
|
14217
|
+
* @param behavior The new behavior to be set.
|
14299
14218
|
*/
|
14300
|
-
export function setPanelBehavior(
|
14301
|
-
|
14302
|
-
behavior: PanelBehavior,
|
14303
|
-
callback: () => void,
|
14304
|
-
): void;
|
14305
|
-
|
14306
|
-
export function setPanelBehavior(
|
14307
|
-
/** The new behavior to be set. */
|
14308
|
-
behavior: PanelBehavior,
|
14309
|
-
): Promise<void>;
|
14219
|
+
export function setPanelBehavior(behavior: PanelBehavior): Promise<void>;
|
14220
|
+
export function setPanelBehavior(behavior: PanelBehavior, callback: () => void): void;
|
14310
14221
|
}
|
14311
14222
|
|
14312
14223
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.17",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -94,6 +94,6 @@
|
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
96
|
"peerDependencies": {},
|
97
|
-
"typesPublisherContentHash": "
|
97
|
+
"typesPublisherContentHash": "6611bcded842c02d684735a90b3b71391663330da30a91d85cffb859330dabea",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|