@types/chrome 0.2.1 → 0.2.3
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 +70 -24
- 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: Fri, 31 Jul 2026 18:57:11 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
|
@@ -179,14 +179,25 @@ declare namespace chrome {
|
|
|
179
179
|
popup: string;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
type TabIconDetails =
|
|
183
|
+
& {
|
|
184
|
+
/** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
|
|
185
|
+
tabId?: number | null | undefined;
|
|
186
|
+
}
|
|
187
|
+
& (
|
|
188
|
+
| {
|
|
189
|
+
/** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */
|
|
190
|
+
imageData: ImageData | { [index: number]: ImageData };
|
|
191
|
+
/** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
|
|
192
|
+
path?: string | { [index: string]: string } | undefined;
|
|
193
|
+
}
|
|
194
|
+
| {
|
|
195
|
+
/** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */
|
|
196
|
+
imageData?: ImageData | { [index: number]: ImageData } | undefined;
|
|
197
|
+
/** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */
|
|
198
|
+
path: string | { [index: string]: string };
|
|
199
|
+
}
|
|
200
|
+
);
|
|
190
201
|
|
|
191
202
|
/** @since Chrome 99 */
|
|
192
203
|
interface OpenPopupOptions {
|
|
@@ -381,22 +392,53 @@ declare namespace chrome {
|
|
|
381
392
|
* Permissions: "alarms"
|
|
382
393
|
*/
|
|
383
394
|
export namespace alarms {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
395
|
+
type AlarmCreateInfo =
|
|
396
|
+
& {
|
|
397
|
+
/**
|
|
398
|
+
* Whether the alarm should persist across sessions (browser restarts). In Chrome, this defaults to true to match historical behavior, but you should set this explicitly to maximize compatibility across browsers.
|
|
399
|
+
* @since Chrome 150
|
|
400
|
+
*/
|
|
401
|
+
persistAcrossSessions?: boolean | undefined;
|
|
402
|
+
}
|
|
403
|
+
& (
|
|
404
|
+
| {
|
|
405
|
+
/** Length of time in minutes after which the {@link onAlarm} event should fire. */
|
|
406
|
+
delayInMinutes: number;
|
|
407
|
+
/** If set, the onAlarm event should fire every `periodInMinutes` minutes after the initial event specified by `when` or `delayInMinutes`. If not set, the alarm will only fire once. */
|
|
408
|
+
periodInMinutes?: number | undefined;
|
|
409
|
+
/** Time at which the alarm should fire, in milliseconds past the epoch (e.g. `Date.now() + n`). */
|
|
410
|
+
when?: never | undefined;
|
|
411
|
+
}
|
|
412
|
+
| {
|
|
413
|
+
/** Length of time in minutes after which the {@link onAlarm} event should fire. */
|
|
414
|
+
delayInMinutes?: number | undefined;
|
|
415
|
+
/** If set, the onAlarm event should fire every `periodInMinutes` minutes after the initial event specified by `when` or `delayInMinutes`. If not set, the alarm will only fire once. */
|
|
416
|
+
periodInMinutes: number;
|
|
417
|
+
/** Time at which the alarm should fire, in milliseconds past the epoch (e.g. `Date.now() + n`). */
|
|
418
|
+
when?: number | undefined;
|
|
419
|
+
}
|
|
420
|
+
| {
|
|
421
|
+
/** Length of time in minutes after which the {@link onAlarm} event should fire. */
|
|
422
|
+
delayInMinutes?: never | undefined;
|
|
423
|
+
/** If set, the onAlarm event should fire every `periodInMinutes` minutes after the initial event specified by `when` or `delayInMinutes`. If not set, the alarm will only fire once. */
|
|
424
|
+
periodInMinutes?: number | undefined;
|
|
425
|
+
/** Time at which the alarm should fire, in milliseconds past the epoch (e.g. `Date.now() + n`). */
|
|
426
|
+
when: number;
|
|
427
|
+
}
|
|
428
|
+
);
|
|
392
429
|
|
|
393
430
|
interface Alarm {
|
|
431
|
+
/** Name of this alarm. */
|
|
432
|
+
name: string;
|
|
394
433
|
/** If not null, the alarm is a repeating alarm and will fire again in `periodInMinutes` minutes. */
|
|
395
434
|
periodInMinutes?: number;
|
|
435
|
+
/**
|
|
436
|
+
* Whether the alarm should persist across sessions (browser restarts).
|
|
437
|
+
* @since Chrome 150
|
|
438
|
+
*/
|
|
439
|
+
persistAcrossSessions: boolean;
|
|
396
440
|
/** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. `Date.now() + n`). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */
|
|
397
441
|
scheduledTime: number;
|
|
398
|
-
/** Name of this alarm. */
|
|
399
|
-
name: string;
|
|
400
442
|
}
|
|
401
443
|
|
|
402
444
|
/**
|
|
@@ -7604,7 +7646,7 @@ declare namespace chrome {
|
|
|
7604
7646
|
* Creates a new offscreen document for the extension.
|
|
7605
7647
|
* @param parameters The parameters describing the offscreen document to create.
|
|
7606
7648
|
*
|
|
7607
|
-
* Can return its result via Promise
|
|
7649
|
+
* Can return its result via Promise.
|
|
7608
7650
|
*/
|
|
7609
7651
|
function createDocument(parameters: CreateParameters): Promise<void>;
|
|
7610
7652
|
function createDocument(parameters: CreateParameters, callback: () => void): void;
|
|
@@ -7612,7 +7654,7 @@ declare namespace chrome {
|
|
|
7612
7654
|
/**
|
|
7613
7655
|
* Closes the currently-open offscreen document for the extension.
|
|
7614
7656
|
*
|
|
7615
|
-
* Can return its result via Promise
|
|
7657
|
+
* Can return its result via Promise.
|
|
7616
7658
|
*/
|
|
7617
7659
|
function closeDocument(): Promise<void>;
|
|
7618
7660
|
function closeDocument(callback: () => void): void;
|
|
@@ -7620,7 +7662,8 @@ declare namespace chrome {
|
|
|
7620
7662
|
/**
|
|
7621
7663
|
* Determines whether the extension has an active document.
|
|
7622
7664
|
*
|
|
7623
|
-
* Can return its result via Promise
|
|
7665
|
+
* Can return its result via Promise.
|
|
7666
|
+
* @since Chrome 150
|
|
7624
7667
|
*/
|
|
7625
7668
|
function hasDocument(): Promise<boolean>;
|
|
7626
7669
|
function hasDocument(callback: (result: boolean) => void): void;
|
|
@@ -11113,7 +11156,7 @@ declare namespace chrome {
|
|
|
11113
11156
|
* The last time the tab became active in its window as the number of milliseconds since epoch.
|
|
11114
11157
|
* @since Chrome 121
|
|
11115
11158
|
*/
|
|
11116
|
-
lastAccessed
|
|
11159
|
+
lastAccessed: number;
|
|
11117
11160
|
}
|
|
11118
11161
|
|
|
11119
11162
|
/** The tab's loading status. */
|
|
@@ -11683,8 +11726,11 @@ declare namespace chrome {
|
|
|
11683
11726
|
function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
|
|
11684
11727
|
function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
|
|
11685
11728
|
function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void;
|
|
11686
|
-
function insertCSS(
|
|
11687
|
-
|
|
11729
|
+
function insertCSS(
|
|
11730
|
+
tabId: number | undefined,
|
|
11731
|
+
details: extensionTypes.InjectDetails,
|
|
11732
|
+
callback: () => void,
|
|
11733
|
+
): void;
|
|
11688
11734
|
|
|
11689
11735
|
/**
|
|
11690
11736
|
* Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active.
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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": "ff9fd6a75d5a0fb1a820459a7cb327ab7a136081a6541208dd3710ddff3bbff2",
|
|
98
98
|
"typeScriptVersion": "5.6"
|
|
99
99
|
}
|