@types/chrome 0.1.38 → 0.1.39

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 +33 -16
  3. chrome/package.json +3 -3
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: Mon, 16 Mar 2026 22:44:30 GMT
11
+ * Last updated: Fri, 03 Apr 2026 06:33:57 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
@@ -346,9 +346,10 @@ declare namespace chrome {
346
346
  export function setIcon(details: TabIconDetails, callback: () => void): void;
347
347
 
348
348
  /**
349
- * Sets the html document to be opened as a popup when the user clicks on the action's icon.
349
+ * Sets the HTML document to be opened as a popup when the user clicks on the action's icon.
350
350
  *
351
351
  * Can return its result via Promise.
352
+ * @since Chrome 96
352
353
  */
353
354
  export function setPopup(details: PopupDetails): Promise<void>;
354
355
  export function setPopup(details: PopupDetails, callback: () => void): void;
@@ -1165,6 +1166,7 @@ declare namespace chrome {
1165
1166
  * Clears websites' cache storage data.
1166
1167
  *
1167
1168
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1169
+ * @since Chrome 72
1168
1170
  */
1169
1171
  export function removeCacheStorage(options: RemovalOptions): Promise<void>;
1170
1172
  export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
@@ -2433,7 +2435,17 @@ declare namespace chrome {
2433
2435
  * Exactly one of `imageData` or `path` must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in `imageData` is an `ImageData` object; for example, from a `canvas` element, while the image representation in `path` is the path to an image file relative to the extension's manifest. If `scale` screen pixels fit into a device-independent pixel, the `scale * n` icon is used. If that scale is missing, another image is resized to the required size.
2434
2436
  */
2435
2437
  export class SetIcon {
2436
- constructor(options?: { imageData?: ImageData | { [size: string]: ImageData } | undefined });
2438
+ constructor(
2439
+ options:
2440
+ | {
2441
+ imageData: ImageData | { [index: number]: ImageData };
2442
+ path?: string | { [index: number]: string } | undefined;
2443
+ }
2444
+ | {
2445
+ imageData?: ImageData | { [index: number]: ImageData } | undefined;
2446
+ path: string | { [index: number]: string };
2447
+ },
2448
+ );
2437
2449
  }
2438
2450
 
2439
2451
  /** Provides the Declarative Event API consisting of {@link events.Event.addRules addRules}, {@link events.Event.removeRules removeRules}, and {@link events.Event.getRules getRules}. */
@@ -3330,7 +3342,7 @@ declare namespace chrome {
3330
3342
  /** Indicates the data type of the option. The requested data type must match the real data type of the underlying option. */
3331
3343
  type: `${OptionType}`;
3332
3344
  /** Indicates the value to set. Leave unset to request automatic setting for options that have `autoSettable` enabled. The data type supplied for `value` must match `type`. */
3333
- value?: string | number | boolean | number;
3345
+ value?: string | number | boolean | number[];
3334
3346
  }
3335
3347
 
3336
3348
  /**
@@ -3560,6 +3572,8 @@ declare namespace chrome {
3560
3572
  /**
3561
3573
  * Performs a document scan and returns a Promise that resolves with a {@link ScanResults} object. If a callback is passed to this function, the returned data is passed to it instead.
3562
3574
  * @param options An object containing scan parameters.
3575
+ *
3576
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
3563
3577
  */
3564
3578
  export function scan(options: ScanOptions): Promise<ScanResults>;
3565
3579
  export function scan(options: ScanOptions, callback: (result: ScanResults) => void): void;
@@ -4364,9 +4378,12 @@ declare namespace chrome {
4364
4378
  }
4365
4379
 
4366
4380
  /**
4367
- * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, runtime.lastError will be set with a failure reason.
4381
+ * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, {@link runtime.lastError} will be set with a failure reason.
4368
4382
  * @param callback Called with the device's default network's NetworkDetails.
4383
+ *
4384
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
4369
4385
  */
4386
+ export function getNetworkDetails(): Promise<NetworkDetails>;
4370
4387
  export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
4371
4388
  }
4372
4389
 
@@ -6308,7 +6325,7 @@ declare namespace chrome {
6308
6325
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
6309
6326
  * @param details Profile options.
6310
6327
  *
6311
- * Can return its result via Promise since Chrome 105.
6328
+ * Can return its result via Promise since Chrome 106.
6312
6329
  */
6313
6330
  export function getProfileUserInfo(details?: ProfileDetails): Promise<ProfileUserInfo>;
6314
6331
  export function getProfileUserInfo(
@@ -6323,7 +6340,7 @@ declare namespace chrome {
6323
6340
  * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with `getAuthToken`.
6324
6341
  * @param details Token information.
6325
6342
  *
6326
- * Can return its result via Promise since Chrome 105.
6343
+ * Can return its result via Promise since Chrome 106.
6327
6344
  */
6328
6345
  export function removeCachedAuthToken(details: InvalidTokenDetails): Promise<void>;
6329
6346
  export function removeCachedAuthToken(details: InvalidTokenDetails, callback: () => void): void;
@@ -7911,7 +7928,7 @@ declare namespace chrome {
7911
7928
 
7912
7929
  export enum ClientCertificateType {
7913
7930
  ECDSA_SIGN = "ecdsaSign",
7914
- RAS_SIGN = "rasSign",
7931
+ RSA_SIGN = "rsaSign",
7915
7932
  }
7916
7933
 
7917
7934
  export interface SelectDetails {
@@ -8806,7 +8823,7 @@ declare namespace chrome {
8806
8823
  export type QueryInfo =
8807
8824
  & {
8808
8825
  /** String to query with the default search provider. */
8809
- text?: string | undefined;
8826
+ text: string;
8810
8827
  }
8811
8828
  & (
8812
8829
  | {
@@ -12142,7 +12159,7 @@ declare namespace chrome {
12142
12159
  * Called when the list of {@link TtsVoice} that would be returned by getVoices has changed.
12143
12160
  * @since Chrome 124
12144
12161
  */
12145
- const onVoicesChanged: chrome.events.Event<() => void>;
12162
+ export const onVoicesChanged: chrome.events.Event<() => void>;
12146
12163
  }
12147
12164
 
12148
12165
  ////////////////////
@@ -13094,7 +13111,7 @@ declare namespace chrome {
13094
13111
  EXTRA_HEADERS = "extraHeaders",
13095
13112
  }
13096
13113
 
13097
- /** @since Chrome 44 */
13114
+ /** @since Chrome 79 */
13098
13115
  export enum OnErrorOccurredOptions {
13099
13116
  /** Specifies that headers can violate Cross-Origin Resource Sharing (CORS). */
13100
13117
  EXTRA_HEADERS = "extraHeaders",
@@ -13286,14 +13303,14 @@ declare namespace chrome {
13286
13303
  extends SetPartial<WebRequestDetails, "documentId" | "documentLifecycle" | "frameType">
13287
13304
  {
13288
13305
  /** Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. */
13289
- requestBody: {
13306
+ requestBody?: {
13290
13307
  /** Errors when obtaining request body data. */
13291
13308
  error?: string;
13292
13309
  /** If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': \['value1', 'value2'\]}. */
13293
13310
  formData?: { [key: string]: FormDataItem[] };
13294
13311
  /** If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. */
13295
13312
  raw?: UploadData[];
13296
- } | undefined;
13313
+ };
13297
13314
  }
13298
13315
 
13299
13316
  export interface OnBeforeSendHeadersDetails extends WebRequestDetails {
@@ -14345,7 +14362,7 @@ declare namespace chrome {
14345
14362
  * The headers provided by a hypothetical response if the request does not get blocked or redirected before it is sent. Represented as an object which maps a header name to a list of string values. If not specified, the hypothetical response would return empty response headers, which can match rules which match on the non-existence of headers. E.g. `{"content-type": ["text/html; charset=utf-8", "multipart/form-data"]}`
14346
14363
  * @since Chrome 129
14347
14364
  */
14348
- responseHeaders?: { [name: string]: unknown };
14365
+ responseHeaders?: { [name: string]: string[] };
14349
14366
  /** The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab. */
14350
14367
  tabId?: number;
14351
14368
  /**
@@ -14683,13 +14700,13 @@ declare namespace chrome {
14683
14700
  * Fired when the extension's side panel is closed.
14684
14701
  * @since Chrome 142
14685
14702
  */
14686
- const onClosed: events.Event<(info: PanelClosedInfo) => void>;
14703
+ export const onClosed: events.Event<(info: PanelClosedInfo) => void>;
14687
14704
 
14688
14705
  /**
14689
14706
  * Fired when the extension's side panel is opened.
14690
14707
  * @since Chrome 141
14691
14708
  */
14692
- const onOpened: events.Event<(info: PanelOpenedInfo) => void>;
14709
+ export const onOpened: events.Event<(info: PanelOpenedInfo) => void>;
14693
14710
  }
14694
14711
 
14695
14712
  ////////////////////
@@ -14795,7 +14812,7 @@ declare namespace chrome {
14795
14812
  /** Specifies wildcard patterns for pages this user script will be injected into. */
14796
14813
  includeGlobs?: string[] | undefined;
14797
14814
  /** The list of ScriptSource objects defining sources of scripts to be injected into matching pages. This property must be specified for {@link register}, and when specified it must be a non-empty array.*/
14798
- js: ScriptSource[];
14815
+ js?: ScriptSource[] | undefined;
14799
14816
  /** Specifies which pages this user script will be injected into. See Match Patterns for more details on the syntax of these strings. This property must be specified for {@link register}. */
14800
14817
  matches?: string[] | undefined;
14801
14818
  /** Specifies when JavaScript files are injected into the web page. The preferred and default value is `document_idle` */
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
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": "c61640331b717ffedc21826f78c5f1415848bc89734b65b169e28ca4faff7337",
98
- "typeScriptVersion": "5.2"
97
+ "typesPublisherContentHash": "cc4b7880e79be5e7d9371832e77f1c91aa47682063b9d54a5e2e2b4055640aab",
98
+ "typeScriptVersion": "5.3"
99
99
  }