@types/chrome 0.3.5 → 0.3.7

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 +81 -72
  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: Tue, 27 Oct 2026 21:32:13 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
  /**
@@ -11245,10 +11256,9 @@ declare namespace chrome {
11245
11256
  * Can return its result via Promise in Manifest V3 or later since Chrome 91.
11246
11257
  * @param flags Options affecting how the information is returned.
11247
11258
  */
11259
+ function getInfo(flags?: GetInfoFlags): Promise<DisplayUnitInfo[]>;
11248
11260
  function getInfo(callback: (displayInfo: DisplayUnitInfo[]) => void): void;
11249
- function getInfo(flags: GetInfoFlags, callback: (displayInfo: DisplayUnitInfo[]) => void): void;
11250
- function getInfo(): Promise<DisplayUnitInfo[]>;
11251
- function getInfo(flags: GetInfoFlags): Promise<DisplayUnitInfo[]>;
11261
+ function getInfo(flags: GetInfoFlags | undefined, callback: (displayInfo: DisplayUnitInfo[]) => void): void;
11252
11262
 
11253
11263
  /**
11254
11264
  * Requests the layout info for all displays
@@ -11257,8 +11267,8 @@ declare namespace chrome {
11257
11267
  * @platform ChromeOS only
11258
11268
  * @since Chrome 53
11259
11269
  */
11260
- function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void;
11261
11270
  function getDisplayLayout(): Promise<DisplayLayout[]>;
11271
+ function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void;
11262
11272
 
11263
11273
  /**
11264
11274
  * Updates the properties for the display specified by `id`, according to the information provided in `info`. On failure, {@link runtime.lastError} will be set.
@@ -11268,8 +11278,8 @@ declare namespace chrome {
11268
11278
  * @param info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in `info`.
11269
11279
  * @platform ChromeOS only
11270
11280
  */
11271
- function setDisplayProperties(id: string, info: DisplayProperties, callback: () => void): void;
11272
11281
  function setDisplayProperties(id: string, info: DisplayProperties): Promise<void>;
11282
+ function setDisplayProperties(id: string, info: DisplayProperties, callback: () => void): void;
11273
11283
 
11274
11284
  /**
11275
11285
  * Set the layout for all displays. display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered.
@@ -11279,8 +11289,8 @@ declare namespace chrome {
11279
11289
  * @platform ChromeOS only
11280
11290
  * @since Chrome 53
11281
11291
  */
11282
- function setDisplayLayout(layouts: DisplayLayout[], callback: () => void): void;
11283
11292
  function setDisplayLayout(layouts: DisplayLayout[]): Promise<void>;
11293
+ function setDisplayLayout(layouts: DisplayLayout[], callback: () => void): void;
11284
11294
 
11285
11295
  /**
11286
11296
  * Enables/disables the unified desktop feature. If enabled while mirroring is active, the desktop mode will not change until mirroring is turned off. Otherwise, the desktop mode will switch to unified immediately.
@@ -11331,8 +11341,8 @@ declare namespace chrome {
11331
11341
  * @platform ChromeOS only
11332
11342
  * @since Chrome 57
11333
11343
  */
11334
- function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void;
11335
11344
  function showNativeTouchCalibration(id: string): Promise<boolean>;
11345
+ function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void;
11336
11346
 
11337
11347
  /**
11338
11348
  * Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error.
@@ -11367,11 +11377,11 @@ declare namespace chrome {
11367
11377
  * @platform ChromeOS only
11368
11378
  * @since Chrome 65
11369
11379
  */
11370
- function setMirrorMode(info: MirrorModeInfo, callback: () => void): void;
11371
11380
  function setMirrorMode(info: MirrorModeInfo): Promise<void>;
11381
+ function setMirrorMode(info: MirrorModeInfo, callback: () => void): void;
11372
11382
 
11373
11383
  /** Fired when anything changes to the display configuration. */
11374
- const onDisplayChanged: chrome.events.Event<() => void>;
11384
+ const onDisplayChanged: events.Event<() => void>;
11375
11385
  }
11376
11386
 
11377
11387
  ////////////////////
@@ -11662,7 +11672,7 @@ declare namespace chrome {
11662
11672
  * An ID that represents the absence of a split tab.
11663
11673
  * @since Chrome 140
11664
11674
  */
11665
- const SPLIT_VIEW_ID_NONE: -1;
11675
+ const SPLIT_VIEW_ID_NONE = -1;
11666
11676
 
11667
11677
  /**
11668
11678
  * An ID that represents the absence of a browser tab.
@@ -11754,7 +11764,7 @@ declare namespace chrome {
11754
11764
  * Open a port to a specific document identified by `documentId` instead of all frames in the tab.
11755
11765
  * @since Chrome 106
11756
11766
  */
11757
- documentId?: string;
11767
+ documentId?: string | undefined;
11758
11768
  }
11759
11769
 
11760
11770
  interface MessageSendOptions {
@@ -11764,7 +11774,7 @@ declare namespace chrome {
11764
11774
  * Send a message to a specific document identified by `documentId` instead of all frames in the tab.
11765
11775
  * @since Chrome 106
11766
11776
  */
11767
- documentId?: string;
11777
+ documentId?: string | undefined;
11768
11778
  }
11769
11779
 
11770
11780
  interface GroupOptions {
@@ -11776,7 +11786,7 @@ declare namespace chrome {
11776
11786
  /** The ID of the group to add the tabs to. If not specified, a new group will be created. */
11777
11787
  groupId?: number | undefined;
11778
11788
  /** The tab ID or list of tab IDs to add to the specified group. */
11779
- tabIds?: number | [number, ...number[]] | undefined;
11789
+ tabIds: number | [number, ...number[]];
11780
11790
  }
11781
11791
 
11782
11792
  interface HighlightInfo {
@@ -12090,18 +12100,17 @@ declare namespace chrome {
12090
12100
  * Can return its result via Promise in Manifest V3 or later since Chrome 88.
12091
12101
  * @param windowId The target window. Defaults to the current window.
12092
12102
  */
12093
- function captureVisibleTab(): Promise<string>;
12094
- function captureVisibleTab(windowId: number): Promise<string>;
12103
+ function captureVisibleTab(windowId?: number): Promise<string>;
12095
12104
  function captureVisibleTab(options: extensionTypes.ImageDetails): Promise<string>;
12096
- function captureVisibleTab(windowId: number, options: extensionTypes.ImageDetails): Promise<string>;
12105
+ function captureVisibleTab(windowId: number | undefined, options: extensionTypes.ImageDetails): Promise<string>;
12097
12106
  function captureVisibleTab(callback: (dataUrl: string) => void): void;
12098
- function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void;
12107
+ function captureVisibleTab(windowId: number | undefined, callback: (dataUrl: string) => void): void;
12099
12108
  function captureVisibleTab(
12100
12109
  options: extensionTypes.ImageDetails,
12101
12110
  callback: (dataUrl: string) => void,
12102
12111
  ): void;
12103
12112
  function captureVisibleTab(
12104
- windowId: number,
12113
+ windowId: number | undefined,
12105
12114
  options: extensionTypes.ImageDetails,
12106
12115
  callback: (dataUrl: string) => void,
12107
12116
  ): void;
@@ -12112,10 +12121,9 @@ declare namespace chrome {
12112
12121
  * Can return its result via Promise in Manifest V3 or later since Chrome 88.
12113
12122
  * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
12114
12123
  */
12115
- function reload(): Promise<void>;
12116
- function reload(tabId: number): Promise<void>;
12124
+ function reload(tabId?: number): Promise<void>;
12117
12125
  function reload(reloadProperties: ReloadProperties): Promise<void>;
12118
- function reload(tabId: number, reloadProperties: ReloadProperties): Promise<void>;
12126
+ function reload(tabId: number | undefined, reloadProperties: ReloadProperties): Promise<void>;
12119
12127
  function reload(callback: () => void): void;
12120
12128
  function reload(tabId: number | undefined, callback: () => void): void;
12121
12129
  function reload(reloadProperties: ReloadProperties | undefined, callback: () => void): void;
@@ -12622,7 +12630,7 @@ declare namespace chrome {
12622
12630
  */
12623
12631
  interface TtsOptions {
12624
12632
  /** The TTS event types that you are interested in listening to. If missing, all event types may be sent. */
12625
- desiredEventTypes?: string[];
12633
+ desiredEventTypes?: `${EventType}`[];
12626
12634
  /** If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. */
12627
12635
  enqueue?: boolean;
12628
12636
  /** The extension ID of the speech engine to use, if known. */
@@ -12639,7 +12647,7 @@ declare namespace chrome {
12639
12647
  /** Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. */
12640
12648
  rate?: number;
12641
12649
  /** The TTS event types the voice must support. */
12642
- requiredEventTypes?: string[];
12650
+ requiredEventTypes?: `${EventType}`[];
12643
12651
  /** The name of the voice to use for synthesis. If empty, uses any available voice. */
12644
12652
  voiceName?: string;
12645
12653
  /** Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
@@ -12712,7 +12720,7 @@ declare namespace chrome {
12712
12720
  */
12713
12721
  function speak(utterance: string, options?: TtsOptions): Promise<void>;
12714
12722
  function speak(utterance: string, callback: () => void): void;
12715
- function speak(utterance: string, options: TtsOptions, callback: () => void): void;
12723
+ function speak(utterance: string, options: TtsOptions | undefined, callback: () => void): void;
12716
12724
 
12717
12725
  /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */
12718
12726
  function stop(): void;
@@ -12721,7 +12729,7 @@ declare namespace chrome {
12721
12729
  * Called when the list of {@link TtsVoice} that would be returned by getVoices has changed.
12722
12730
  * @since Chrome 124
12723
12731
  */
12724
- const onVoicesChanged: chrome.events.Event<() => void>;
12732
+ const onVoicesChanged: events.Event<() => void>;
12725
12733
  }
12726
12734
 
12727
12735
  ////////////////////
@@ -13491,7 +13499,7 @@ declare namespace chrome {
13491
13499
  }
13492
13500
 
13493
13501
  interface WebNavigationEventFilter {
13494
- /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */
13502
+ /** Conditions that the URL being navigated to must satisfy. */
13495
13503
  url: chrome.events.UrlFilter[];
13496
13504
  }
13497
13505
 
@@ -13592,7 +13600,7 @@ declare namespace chrome {
13592
13600
  /** Value of the HTTP header if it can be represented by UTF-8. */
13593
13601
  value?: string | undefined;
13594
13602
  /** Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255). */
13595
- binaryValue?: ArrayBuffer | undefined;
13603
+ binaryValue?: number[] | undefined;
13596
13604
  }
13597
13605
 
13598
13606
  /** Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. */
@@ -14627,6 +14635,7 @@ declare namespace chrome {
14627
14635
  * List of HTTP request methods which the rule can match. An empty list is not allowed.
14628
14636
  *
14629
14637
  * Note: Specifying a `requestMethods` rule condition will also exclude non-HTTP(s) requests, whereas specifying `excludedRequestMethods` will not.
14638
+ * @since Chrome 91
14630
14639
  */
14631
14640
  requestMethods?: `${RequestMethod}`[] | undefined;
14632
14641
 
@@ -14793,7 +14802,7 @@ declare namespace chrome {
14793
14802
  /** Add, remove or replace query key-value pairs. */
14794
14803
  queryTransform?: QueryTransform | undefined;
14795
14804
  /** The new scheme for the request. Allowed values are "http", "https", "ftp" and "chrome-extension". */
14796
- scheme?: string | undefined;
14805
+ scheme?: "http" | "https" | "ftp" | "chrome-extension" | undefined;
14797
14806
  /** The new username for the request. */
14798
14807
  username?: string | undefined;
14799
14808
  }
@@ -15084,7 +15093,7 @@ declare namespace chrome {
15084
15093
  * @since Chrome 111
15085
15094
  */
15086
15095
  function updateStaticRules(options: UpdateStaticRulesOptions): Promise<void>;
15087
- function updateStaticRules(options: UpdateStaticRulesOptions, callback?: () => void): void;
15096
+ function updateStaticRules(options: UpdateStaticRulesOptions, callback: () => void): void;
15088
15097
 
15089
15098
  /** 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
15099
  const onRuleMatchedDebug: events.Event<(info: MatchedRuleInfoDebug) => void>;
@@ -15347,25 +15356,25 @@ declare namespace chrome {
15347
15356
  }
15348
15357
  & (
15349
15358
  | {
15350
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15359
+ /** 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
15360
  allFrames?: boolean | undefined;
15352
- /** The IDs of specific documentIds to inject into. */
15361
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15353
15362
  documentIds?: never;
15354
15363
  /** The IDs of specific frames to inject into. */
15355
15364
  frameIds?: never;
15356
15365
  }
15357
15366
  | {
15358
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15367
+ /** 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
15368
  allFrames?: false | undefined;
15360
- /** The IDs of specific documentIds to inject into. */
15369
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15361
15370
  documentIds?: never;
15362
15371
  /** The IDs of specific frames to inject into. */
15363
- frameIds: number[] | undefined;
15372
+ frameIds?: number[] | undefined;
15364
15373
  }
15365
15374
  | {
15366
- /** Whether the script should inject into all frames within the tab. Defaults to false. */
15375
+ /** 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
15376
  allFrames?: false | undefined;
15368
- /** The IDs of specific documentIds to inject into. */
15377
+ /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
15369
15378
  documentIds?: string[] | undefined;
15370
15379
  /** The IDs of specific frames to inject into. */
15371
15380
  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.7",
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": "04be780c18c40fd1e1d83c370748e7715dfb9c993e5a0df0ba3bac21fde676ca",
58
57
  "typeScriptVersion": "5.6"
59
58
  }