@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.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +70 -24
  3. 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: Wed, 01 Jul 2026 06:54:58 GMT
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
- interface TabIconDetails {
183
- /** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be 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}' */
184
- path?: string | { [index: number]: string } | undefined;
185
- /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
186
- tabId?: number | undefined;
187
- /** Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be 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}' */
188
- imageData?: ImageData | { [index: number]: ImageData } | undefined;
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
- interface AlarmCreateInfo {
385
- /** Length of time in minutes after which the {@link onAlarm} event should fire. */
386
- delayInMinutes?: number | undefined;
387
- /** 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. */
388
- periodInMinutes?: number | undefined;
389
- /** Time at which the alarm should fire, in milliseconds past the epoch (e.g. `Date.now() + n`). */
390
- when?: number | undefined;
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 in Manifest V3.
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 in Manifest V3.
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 in Manifest V3.
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?: number | undefined;
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(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
11687
- function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void;
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.1",
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": "7763ec07b62aff736c7f9dd7975ea465f5f3c00a938b55bb4db3e91c89ac0647",
97
+ "typesPublisherContentHash": "ff9fd6a75d5a0fb1a820459a7cb327ab7a136081a6541208dd3710ddff3bbff2",
98
98
  "typeScriptVersion": "5.6"
99
99
  }