@types/chrome 0.3.5 → 0.3.6

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 +2 -2
  2. chrome/index.d.ts +58 -46
  3. chrome/package.json +2 -3
chrome/README.md CHANGED
@@ -8,8 +8,8 @@ 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: Fri, 09 Oct 2026 18:42:20 GMT
12
- * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
11
+ * Last updated: Wed, 21 Oct 2026 06:51:40 GMT
12
+ * Dependencies: [@types/har-format](https://npmjs.com/package/@types/har-format)
13
13
 
14
14
  # Credits
15
15
  These definitions were written by [MatCarlson](https://github.com/MatCarlson), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Nicolas Rodriguez](https://github.com/nicolas377), [Ido Salomon](https://github.com/idosal), [Federico Brigante](https://github.com/fregante), and [Erwan Jugand](https://github.com/erwanjugand).
chrome/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="filesystem" />
2
1
  /// <reference path="./har-format/index.d.ts" />
3
2
  /// <reference path="./chrome-cast/index.d.ts" />
4
3
 
@@ -496,8 +495,8 @@ declare namespace chrome {
496
495
  *
497
496
  * Can return its result via Promise in Manifest V3 or later since Chrome 91.
498
497
  */
499
- function clearAll(): Promise<boolean>;
500
- function clearAll(callback: (wasCleared: boolean) => void): void;
498
+ function clearAll(): Promise<boolean | undefined>;
499
+ function clearAll(callback: (wasCleared?: boolean) => void): void;
501
500
 
502
501
  /**
503
502
  * Clears the alarm with the given name.
@@ -1961,10 +1960,16 @@ declare namespace chrome {
1961
1960
  VIDEO = "video",
1962
1961
  AUDIO = "audio",
1963
1962
  LAUNCHER = "launcher",
1963
+ /** MV2 only */
1964
1964
  BROWSER_ACTION = "browser_action",
1965
+ /** MV2 only */
1965
1966
  PAGE_ACTION = "page_action",
1967
+ /** Applies to the context menu of the extension's action (its toolbar icon). */
1966
1968
  ACTION = "action",
1967
- /** @since Chrome 150 */
1969
+ /**
1970
+ * Applies to the context menu of a tab in the tab strip.
1971
+ * @since Chrome 150
1972
+ */
1968
1973
  TAB = "tab",
1969
1974
  }
1970
1975
 
@@ -2319,8 +2324,8 @@ declare namespace chrome {
2319
2324
  *
2320
2325
  * Can return its result via Promise in Manifest V3 or later.
2321
2326
  */
2322
- function set(details: SetDetails): Promise<Cookie | null>;
2323
- function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
2327
+ function set(details: SetDetails): Promise<Cookie | undefined>;
2328
+ function set(details: SetDetails, callback: (cookie?: Cookie) => void): void;
2324
2329
 
2325
2330
  /**
2326
2331
  * Deletes a cookie by name.
@@ -2328,15 +2333,15 @@ declare namespace chrome {
2328
2333
  * Can return its result via Promise in Manifest V3 or later.
2329
2334
  */
2330
2335
  function remove(details: CookieDetails): Promise<CookieDetails>;
2331
- function remove(details: CookieDetails, callback?: (details: CookieDetails) => void): void;
2336
+ function remove(details: CookieDetails, callback: (details: CookieDetails) => void): void;
2332
2337
 
2333
2338
  /**
2334
2339
  * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
2335
2340
  *
2336
2341
  * Can return its result via Promise in Manifest V3 or later.
2337
2342
  */
2338
- function get(details: CookieDetails): Promise<Cookie | null>;
2339
- function get(details: CookieDetails, callback: (cookie: Cookie | null) => void): void;
2343
+ function get(details: CookieDetails): Promise<Cookie | null | undefined>;
2344
+ function get(details: CookieDetails, callback: (cookie?: Cookie | null) => void): void;
2340
2345
 
2341
2346
  /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */
2342
2347
  const onChanged: events.Event<(changeInfo: CookieChangeInfo) => void>;
@@ -2443,16 +2448,22 @@ declare namespace chrome {
2443
2448
  *
2444
2449
  * Can return its result via Promise since Chrome 96.
2445
2450
  */
2446
- function sendCommand(
2451
+ function sendCommand<
2452
+ T extends object = { [key: string]: any },
2453
+ U extends object = { [key: string]: unknown },
2454
+ >(
2447
2455
  target: DebuggerSession,
2448
2456
  method: string,
2449
- commandParams?: { [key: string]: unknown },
2450
- ): Promise<object | undefined>;
2451
- function sendCommand(
2457
+ commandParams?: T,
2458
+ ): Promise<U | undefined>;
2459
+ function sendCommand<
2460
+ T extends object = { [key: string]: any },
2461
+ U extends object = { [key: string]: unknown },
2462
+ >(
2452
2463
  target: DebuggerSession,
2453
2464
  method: string,
2454
- commandParams?: { [key: string]: unknown },
2455
- callback?: (result?: object) => void,
2465
+ commandParams: T | undefined,
2466
+ callback: (result?: U) => void,
2456
2467
  ): void;
2457
2468
 
2458
2469
  /**
@@ -2464,9 +2475,11 @@ declare namespace chrome {
2464
2475
  function getTargets(callback: (result: TargetInfo[]) => void): void;
2465
2476
 
2466
2477
  /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */
2467
- const onDetach: chrome.events.Event<(source: Debuggee, reason: `${DetachReason}`) => void>;
2478
+ const onDetach: events.Event<(source: Debuggee, reason: `${DetachReason}`) => void>;
2468
2479
  /** Fired whenever debugging target issues instrumentation event. */
2469
- const onEvent: chrome.events.Event<(source: DebuggerSession, method: string, params?: object) => void>;
2480
+ const onEvent: events.Event<
2481
+ (source: DebuggerSession, method: string, params?: { [key: string]: unknown }) => void
2482
+ >;
2470
2483
  }
2471
2484
 
2472
2485
  export { _debugger as debugger };
@@ -4067,7 +4080,7 @@ declare namespace chrome {
4067
4080
  }
4068
4081
 
4069
4082
  interface GetFileIconOptions {
4070
- /** The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. */
4083
+ /** The size of the returned icon in density-independent pixels (DIPs). Must be either 16 or 32 (defaults to 32). On high-DPI displays, the returned image scales with the device scale factor (e.g., 64x64 px for size 32 on a 2x display). Calls from background service workers default to 1x scale. */
4071
4084
  size?: 16 | 32 | undefined;
4072
4085
  }
4073
4086
 
@@ -4181,7 +4194,7 @@ declare namespace chrome {
4181
4194
  function pause(downloadId: number, callback: () => void): void;
4182
4195
 
4183
4196
  /**
4184
- * Retrieve an icon for the specified download. For new downloads, file icons are available after the {@link onCreated} event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, {@link runtime.lastError} will contain an error message.
4197
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the download's target filename has been determined (for example, when {@link onChanged} fires with a `filename` change). Attempting to retrieve the icon before the filename is determined will result in an error through {@link runtime.lastError}. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, {@link runtime.lastError} will contain an error message.
4185
4198
  * @param downloadId The identifier for the download.
4186
4199
  *
4187
4200
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
@@ -4982,7 +4995,7 @@ declare namespace chrome {
4982
4995
  /** The ID of the tab that raised this event. Tab IDs are unique within a browser session. */
4983
4996
  tab_id?: number;
4984
4997
  /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */
4985
- entries: any[];
4998
+ entries: FileSystemFileEntry[];
4986
4999
  }
4987
5000
 
4988
5001
  /** Fired when file system action is executed from ChromeOS file browser. */
@@ -6025,10 +6038,10 @@ declare namespace chrome {
6025
6038
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6026
6039
  */
6027
6040
  function getDefaultFontSize(details?: { [key: string]: unknown }): Promise<FontSizeResult>;
6028
- function getDefaultFontSize(callback: (options: FontSizeResult) => void): void;
6041
+ function getDefaultFontSize(callback: (details: FontSizeResult) => void): void;
6029
6042
  function getDefaultFontSize(
6030
6043
  details: { [key: string]: unknown } | undefined,
6031
- callback: (options: FontSizeResult) => void,
6044
+ callback: (details: FontSizeResult) => void,
6032
6045
  ): void;
6033
6046
 
6034
6047
  /**
@@ -6038,10 +6051,10 @@ declare namespace chrome {
6038
6051
  * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6039
6052
  */
6040
6053
  function getMinimumFontSize(details?: { [key: string]: unknown }): Promise<FontSizeResult>;
6041
- function getMinimumFontSize(callback: (options: FontSizeResult) => void): void;
6054
+ function getMinimumFontSize(callback: (details: FontSizeResult) => void): void;
6042
6055
  function getMinimumFontSize(
6043
6056
  details: { [key: string]: unknown } | undefined,
6044
- callback: (options: FontSizeResult) => void,
6057
+ callback: (details: FontSizeResult) => void,
6045
6058
  ): void;
6046
6059
 
6047
6060
  /**
@@ -6166,7 +6179,7 @@ declare namespace chrome {
6166
6179
  /** Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The default value of time-to-live is 86,400 seconds (1 day) and the maximum value is 2,419,200 seconds (28 days). */
6167
6180
  timeToLive?: number | undefined;
6168
6181
  /** Message data to send to the server. Case-insensitive `goog.` and `google`, as well as case-sensitive `collapse_key` are disallowed as key prefixes. Sum of all key/value pairs should not exceed {@link gcm.MAX_MESSAGE_SIZE}. */
6169
- data: { [key: string]: unknown };
6182
+ data: { [key: string]: string };
6170
6183
  }
6171
6184
 
6172
6185
  /** The maximum size (in bytes) of all key/value pairs in a message. */
@@ -6204,7 +6217,7 @@ declare namespace chrome {
6204
6217
  /** The collapse key of a message. See the Non-collapsible and collapsible messages for details. */
6205
6218
  collapseKey?: string;
6206
6219
  /** The message data. */
6207
- data: { [key: string]: unknown };
6220
+ data: { [key: string]: string };
6208
6221
  /** The sender who issued the message. */
6209
6222
  from?: string;
6210
6223
  }) => void
@@ -6217,7 +6230,7 @@ declare namespace chrome {
6217
6230
  const onSendError: events.Event<
6218
6231
  (error: {
6219
6232
  /** Additional details related to the error, when available. */
6220
- details: { [key: string]: unknown };
6233
+ details: { [key: string]: string };
6221
6234
  /** The error message describing the problem. */
6222
6235
  errorMessage: string;
6223
6236
  /** The ID of the message with this error, if error is related to a specific message. */
@@ -6591,7 +6604,7 @@ declare namespace chrome {
6591
6604
  */
6592
6605
  function getProfileUserInfo(details?: ProfileDetails): Promise<ProfileUserInfo>;
6593
6606
  function getProfileUserInfo(
6594
- details: ProfileDetails,
6607
+ details: ProfileDetails | undefined,
6595
6608
  callback: (userInfo: ProfileUserInfo) => void,
6596
6609
  ): void;
6597
6610
  function getProfileUserInfo(callback: (userInfo: ProfileUserInfo) => void): void;
@@ -6629,7 +6642,7 @@ declare namespace chrome {
6629
6642
  function getRedirectURL(path?: string): string;
6630
6643
 
6631
6644
  /** Fired when signin state changes for an account on the user's profile. */
6632
- const onSignInChanged: chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void>;
6645
+ const onSignInChanged: events.Event<(account: AccountInfo, signedIn: boolean) => void>;
6633
6646
  }
6634
6647
 
6635
6648
  ////////////////////
@@ -9994,7 +10007,7 @@ declare namespace chrome {
9994
10007
  /** Enables use of particular extension APIs. */
9995
10008
  permissions?: ManifestPermission[] | undefined;
9996
10009
  /** Identifies an HTML file to display in a sidePanel. */
9997
- side_panel?: { default_path: string } | undefined;
10010
+ side_panel?: sidePanel.SidePanel | undefined;
9998
10011
  /** Defines files within the extension that can be accessed by web pages or other extensions. */
9999
10012
  web_accessible_resources?:
10000
10013
  | Array<
@@ -10058,8 +10071,8 @@ declare namespace chrome {
10058
10071
  *
10059
10072
  * Can return its result via Promise in Manifest V3 or later since Chrome 122.
10060
10073
  */
10061
- function getPackageDirectoryEntry(): Promise<DirectoryEntry>;
10062
- function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void;
10074
+ function getPackageDirectoryEntry(): Promise<FileSystemDirectoryEntry>;
10075
+ function getPackageDirectoryEntry(callback: (directoryEntry: FileSystemDirectoryEntry) => void): void;
10063
10076
 
10064
10077
  /**
10065
10078
  * Returns information about the current platform.
@@ -10315,7 +10328,7 @@ declare namespace chrome {
10315
10328
  */
10316
10329
  documentIds?: never | undefined;
10317
10330
  /** The IDs of specific frames to inject into. */
10318
- frameIds: number[] | undefined;
10331
+ frameIds?: number[] | undefined;
10319
10332
  }
10320
10333
  | {
10321
10334
  /** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` or `documentIds` is specified. */
@@ -10401,8 +10414,6 @@ declare namespace chrome {
10401
10414
  })
10402
10415
  );
10403
10416
 
10404
- type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
10405
-
10406
10417
  /** @since Chrome 96 */
10407
10418
  type RegisteredContentScript =
10408
10419
  & {
@@ -10781,7 +10792,7 @@ declare namespace chrome {
10781
10792
  * A set of feature codes indicating some of the processor's capabilities.
10782
10793
  * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx".
10783
10794
  */
10784
- features: string[];
10795
+ features: Array<"mmx" | "sse" | "sse2" | "sse3" | "ssse3" | "sse4_1" | "sse4_2" | "avx">;
10785
10796
  /** Information about each logical processor. */
10786
10797
  processors: ProcessorInfo[];
10787
10798
  /**
@@ -13491,7 +13502,7 @@ declare namespace chrome {
13491
13502
  }
13492
13503
 
13493
13504
  interface WebNavigationEventFilter {
13494
- /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */
13505
+ /** Conditions that the URL being navigated to must satisfy. */
13495
13506
  url: chrome.events.UrlFilter[];
13496
13507
  }
13497
13508
 
@@ -14627,6 +14638,7 @@ declare namespace chrome {
14627
14638
  * List of HTTP request methods which the rule can match. An empty list is not allowed.
14628
14639
  *
14629
14640
  * Note: Specifying a `requestMethods` rule condition will also exclude non-HTTP(s) requests, whereas specifying `excludedRequestMethods` will not.
14641
+ * @since Chrome 91
14630
14642
  */
14631
14643
  requestMethods?: `${RequestMethod}`[] | undefined;
14632
14644
 
@@ -14793,7 +14805,7 @@ declare namespace chrome {
14793
14805
  /** Add, remove or replace query key-value pairs. */
14794
14806
  queryTransform?: QueryTransform | undefined;
14795
14807
  /** The new scheme for the request. Allowed values are "http", "https", "ftp" and "chrome-extension". */
14796
- scheme?: string | undefined;
14808
+ scheme?: "http" | "https" | "ftp" | "chrome-extension" | undefined;
14797
14809
  /** The new username for the request. */
14798
14810
  username?: string | undefined;
14799
14811
  }
@@ -15084,7 +15096,7 @@ declare namespace chrome {
15084
15096
  * @since Chrome 111
15085
15097
  */
15086
15098
  function updateStaticRules(options: UpdateStaticRulesOptions): Promise<void>;
15087
- function updateStaticRules(options: UpdateStaticRulesOptions, callback?: () => void): void;
15099
+ function updateStaticRules(options: UpdateStaticRulesOptions, callback: () => void): void;
15088
15100
 
15089
15101
  /** Fired when a rule is matched with a request. Only available for unpacked extensions with the `declarativeNetRequestFeedback` permission as this is intended to be used for debugging purposes only. */
15090
15102
  const onRuleMatchedDebug: events.Event<(info: MatchedRuleInfoDebug) => void>;
@@ -15347,25 +15359,25 @@ declare namespace chrome {
15347
15359
  }
15348
15360
  & (
15349
15361
  | {
15350
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15362
+ /** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` or `documentIds` is specified. */
15351
15363
  allFrames?: boolean | undefined;
15352
- /** The IDs of specific documentIds to inject into. */
15364
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15353
15365
  documentIds?: never;
15354
15366
  /** The IDs of specific frames to inject into. */
15355
15367
  frameIds?: never;
15356
15368
  }
15357
15369
  | {
15358
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15370
+ /** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` or `documentIds` is specified. */
15359
15371
  allFrames?: false | undefined;
15360
- /** The IDs of specific documentIds to inject into. */
15372
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15361
15373
  documentIds?: never;
15362
15374
  /** The IDs of specific frames to inject into. */
15363
- frameIds: number[] | undefined;
15375
+ frameIds?: number[] | undefined;
15364
15376
  }
15365
15377
  | {
15366
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15378
+ /** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` or `documentIds` is specified. */
15367
15379
  allFrames?: false | undefined;
15368
- /** The IDs of specific documentIds to inject into. */
15380
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15369
15381
  documentIds?: string[] | undefined;
15370
15382
  /** The IDs of specific frames to inject into. */
15371
15383
  frameIds?: never;
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "TypeScript definitions for chrome",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -50,10 +50,9 @@
50
50
  },
51
51
  "scripts": {},
52
52
  "dependencies": {
53
- "@types/filesystem": "*",
54
53
  "@types/har-format": "*"
55
54
  },
56
55
  "peerDependencies": {},
57
- "typesPublisherContentHash": "76fc785c0457b56ff51aaa280f9fb73bfa3ddf45f56ffd68266aabb276cfd9d6",
56
+ "typesPublisherContentHash": "5c46d3916b5b2099f0c716d0e5c18fc8b756c5319798989f5e6469e3e4fcc9b6",
58
57
  "typeScriptVersion": "5.6"
59
58
  }