@types/chrome 0.0.297 → 0.0.299

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 +259 -53
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 16 Jan 2025 07:02:35 GMT
11
+ * Last updated: Tue, 21 Jan 2025 08:02:38 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
@@ -2192,6 +2192,19 @@ declare namespace chrome {
2192
2192
  cause: string;
2193
2193
  }
2194
2194
 
2195
+ /**
2196
+ * Details to identify the frame.
2197
+ * @since Chrome 132
2198
+ */
2199
+ export interface FrameDetails {
2200
+ /** The unique identifier for the document. If the frameId and/or tabId are provided they will be validated to match the document found by provided document ID. */
2201
+ documentId?: string;
2202
+ /** The unique identifier for the frame within the tab. */
2203
+ frameId?: number;
2204
+ /* The unique identifier for the tab containing the frame. */
2205
+ tabId?: number;
2206
+ }
2207
+
2195
2208
  export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
2196
2209
 
2197
2210
  /**
@@ -2199,52 +2212,72 @@ declare namespace chrome {
2199
2212
  * Parameter cookieStores: All the existing cookie stores.
2200
2213
  */
2201
2214
  export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
2215
+
2202
2216
  /**
2203
2217
  * Lists all existing cookie stores.
2204
2218
  * @return The `getAllCookieStores` method provides its result via callback or returned as a `Promise` (MV3 only).
2205
2219
  */
2206
2220
  export function getAllCookieStores(): Promise<CookieStore[]>;
2221
+
2222
+ /**
2223
+ * The partition key for the frame indicated.
2224
+ * Can return its result via Promise in Manifest V3
2225
+ * @since Chrome 132
2226
+ */
2227
+ export function getPartitionKey(details: FrameDetails): Promise<{ partitionKey: CookiePartitionKey }>;
2228
+ export function getPartitionKey(
2229
+ details: FrameDetails,
2230
+ callback: (details: { partitionKey: CookiePartitionKey }) => void,
2231
+ ): void;
2232
+
2207
2233
  /**
2208
2234
  * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
2209
2235
  * @param details Information to filter the cookies being retrieved.
2210
2236
  * Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
2211
2237
  */
2212
2238
  export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
2239
+
2213
2240
  /**
2214
2241
  * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
2215
2242
  * @param details Information to filter the cookies being retrieved.
2216
2243
  * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
2217
2244
  */
2218
2245
  export function getAll(details: GetAllDetails): Promise<Cookie[]>;
2246
+
2219
2247
  /**
2220
2248
  * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2221
2249
  * @param details Details about the cookie being set.
2222
2250
  * @return The `set` method provides its result via callback or returned as a `Promise` (MV3 only).
2223
2251
  */
2224
2252
  export function set(details: SetDetails): Promise<Cookie | null>;
2253
+
2225
2254
  /**
2226
2255
  * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2227
2256
  * @param details Details about the cookie being set.
2228
2257
  * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set.
2229
2258
  */
2230
2259
  export function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
2260
+
2231
2261
  /**
2232
2262
  * Deletes a cookie by name.
2233
2263
  * @param details Information to identify the cookie to remove.
2234
2264
  * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only).
2235
2265
  */
2236
2266
  export function remove(details: CookieDetails): Promise<CookieDetails>;
2267
+
2237
2268
  /**
2238
2269
  * Deletes a cookie by name.
2239
2270
  * @param details Information to identify the cookie to remove.
2240
2271
  */
2241
2272
  export function remove(details: CookieDetails, callback?: (details: CookieDetails) => void): void;
2273
+
2242
2274
  /**
2243
2275
  * 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.
2244
2276
  * @param details Details to identify the cookie being retrieved.
2245
2277
  * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
2246
2278
  */
2247
2279
  export function get(details: CookieDetails, callback: (cookie: Cookie | null) => void): void;
2280
+
2248
2281
  /**
2249
2282
  * 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.
2250
2283
  * @param details Details to identify the cookie being retrieved.
@@ -10174,18 +10207,12 @@ declare namespace chrome {
10174
10207
  * @since Chrome 18
10175
10208
  */
10176
10209
  openerTabId?: number | undefined;
10177
- /**
10178
- * Optional.
10179
- * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission.
10180
- */
10210
+ /** The title of the tab. This property is only present if the extension has the `tabs` permission or has host permissions for the page. */
10181
10211
  title?: string | undefined;
10182
- /**
10183
- * Optional.
10184
- * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission.
10185
- */
10212
+ /** The last committed URL of the main frame of the tab. This property is only present if the extension has the `tabs` permission or has host permissions for the page. May be an empty string if the tab has not yet committed. See also {@link Tab.pendingUrl}. */
10186
10213
  url?: string | undefined;
10187
10214
  /**
10188
- * The URL the tab is navigating to, before it has committed.
10215
+ * The URL the tab is navigating to, before it has committed. This property is only present if the extension has the `tabs` permission or has host permissions for the page and there is a pending navigation.The URL the tab is navigating to, before it has committed.
10189
10216
  * This property is only present if the extension's manifest includes the "tabs" permission and there is a pending navigation.
10190
10217
  * @since Chrome 79
10191
10218
  */
@@ -10207,11 +10234,13 @@ declare namespace chrome {
10207
10234
  * @since Chrome 16
10208
10235
  */
10209
10236
  active: boolean;
10237
+ /** The URL of the tab's favicon. This property is only present if the extension has the `tabs` permission or has host permissions for the page. It may also be an empty string if the tab is loading. */
10238
+ favIconUrl?: string | undefined;
10210
10239
  /**
10211
- * Optional.
10212
- * The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading.
10240
+ * Whether the tab is frozen. A frozen tab cannot execute tasks, including event handlers or timers. It is visible in the tab strip and its content is loaded in memory. It is unfrozen on activation.
10241
+ * @since Chrome 132
10213
10242
  */
10214
- favIconUrl?: string | undefined;
10243
+ frozen: boolean;
10215
10244
  /**
10216
10245
  * Optional.
10217
10246
  * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows.
@@ -10508,9 +10537,9 @@ declare namespace chrome {
10508
10537
  * @since Chrome 18
10509
10538
  */
10510
10539
  index?: number | undefined;
10511
- /** Optional. Match page titles against a pattern. */
10540
+ /** Match page titles against a pattern. This property is ignored if the extension does not have the `tabs` permission or host permissions for the page. */
10512
10541
  title?: string | undefined;
10513
- /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */
10542
+ /** Match tabs against one or more URL patterns. Fragment identifiers are not matched. This property is ignored if the extension does not have the `tabs` permission or host permissions for the page. */
10514
10543
  url?: string | string[] | undefined;
10515
10544
  /**
10516
10545
  * Optional. Whether the tabs are in the current window.
@@ -10525,6 +10554,11 @@ declare namespace chrome {
10525
10554
  * @since Chrome 54
10526
10555
  */
10527
10556
  discarded?: boolean | undefined;
10557
+ /**
10558
+ * Whether the tabs are frozen. A frozen tab cannot execute tasks, including event handlers or timers. It is visible in the tab strip and its content is loaded in memory. It is unfrozen on activation.
10559
+ * @since Chrome 132
10560
+ */
10561
+ frozen?: boolean;
10528
10562
  /**
10529
10563
  * Optional.
10530
10564
  * Whether the tabs can be discarded automatically by the browser when resources are low.
@@ -10610,6 +10644,11 @@ declare namespace chrome {
10610
10644
  * @since Chrome 27
10611
10645
  */
10612
10646
  favIconUrl?: string | undefined;
10647
+ /**
10648
+ * The tab's new frozen state.
10649
+ * @since Chrome 132
10650
+ */
10651
+ frozen?: boolean;
10613
10652
  /**
10614
10653
  * The tab's new title.
10615
10654
  * @since Chrome 48
@@ -10810,26 +10849,26 @@ declare namespace chrome {
10810
10849
  export function move(tabIds: number[], moveProperties: MoveProperties, callback: (tabs: Tab[]) => void): void;
10811
10850
  /**
10812
10851
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
10813
- * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
10852
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The `url`, `pendingUrl`, `title` and `favIconUrl` properties are only included on the {@link tabs.Tab} object if the extension has the `tabs` permission or has host permissions for the page..
10814
10853
  */
10815
- export function update(updateProperties: UpdateProperties): Promise<Tab>;
10854
+ export function update(updateProperties: UpdateProperties): Promise<Tab | undefined>;
10816
10855
  /**
10817
10856
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
10818
10857
  * @param callback Optional.
10819
- * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
10858
+ * Optional parameter tab: Details about the updated tab. The `url`, `pendingUrl`, `title` and `favIconUrl` properties are only included on the {@link tabs.Tab} object if the extension has the `tabs` permission or has host permissions for the page..
10820
10859
  */
10821
10860
  export function update(updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
10822
10861
  /**
10823
10862
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
10824
10863
  * @param tabId Defaults to the selected tab of the current window.
10825
- * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
10864
+ * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The `url`, `pendingUrl`, `title` and `favIconUrl` properties are only included on the {@link tabs.Tab} object if the extension has the `tabs` permission or has host permissions for the page..
10826
10865
  */
10827
- export function update(tabId: number, updateProperties: UpdateProperties): Promise<Tab>;
10866
+ export function update(tabId: number, updateProperties: UpdateProperties): Promise<Tab | undefined>;
10828
10867
  /**
10829
10868
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
10830
10869
  * @param tabId Defaults to the selected tab of the current window.
10831
10870
  * @param callback Optional.
10832
- * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
10871
+ * Optional parameter tab: Details about the updated tab. The `url`, `pendingUrl`, `title` and `favIconUrl` properties are only included on the {@link tabs.Tab} object if the extension has the `tabs` permission or has host permissions for the page..
10833
10872
  */
10834
10873
  export function update(tabId: number, updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
10835
10874
  /**
@@ -10919,13 +10958,13 @@ declare namespace chrome {
10919
10958
  * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
10920
10959
  * @return The `reload` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
10921
10960
  */
10922
- export function reload(tabId: number, reloadProperties?: ReloadProperties): Promise<void>;
10961
+ export function reload(tabId: number): Promise<void>;
10923
10962
  /**
10924
10963
  * Reload a tab.
10925
10964
  * @since Chrome 16
10926
10965
  * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
10927
10966
  */
10928
- export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void;
10967
+ export function reload(tabId: number, callback?: () => void): void;
10929
10968
  /**
10930
10969
  * Reload the selected tab of the current window.
10931
10970
  * @since Chrome 16
@@ -10937,6 +10976,17 @@ declare namespace chrome {
10937
10976
  * @since Chrome 16
10938
10977
  */
10939
10978
  export function reload(reloadProperties: ReloadProperties, callback: () => void): void;
10979
+ /**
10980
+ * Reload the selected tab of the current window.
10981
+ * @since Chrome 16
10982
+ * @return The `reload` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
10983
+ */
10984
+ export function reload(tabId: number, reloadProperties: ReloadProperties): Promise<void>;
10985
+ /**
10986
+ * Reload the selected tab of the current window.
10987
+ * @since Chrome 16
10988
+ */
10989
+ export function reload(tabId: number, reloadProperties: ReloadProperties, callback: () => void): void;
10940
10990
  /**
10941
10991
  * Reload the selected tab of the current window.
10942
10992
  * @since Chrome 16
@@ -10960,7 +11010,7 @@ declare namespace chrome {
10960
11010
  * @since Chrome 23
10961
11011
  * @param tabId The ID of the tab which is to be duplicated.
10962
11012
  * @param callback Optional.
10963
- * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
11013
+ * Optional parameter tab: Details about the duplicated tab. The `url`, `pendingUrl`, `title` and `favIconUrl` properties are only included on the {@link tabs.Tab} object if the extension has the `tabs` permission or has host permissions for the page.
10964
11014
  */
10965
11015
  export function duplicate(tabId: number, callback: (tab?: Tab) => void): void;
10966
11016
  /**
@@ -11670,47 +11720,173 @@ declare namespace chrome {
11670
11720
  * Permissions: "ttsEngine"
11671
11721
  */
11672
11722
  export namespace ttsEngine {
11723
+ /**
11724
+ * Parameters containing an audio buffer and associated data.
11725
+ * @since Chrome 92
11726
+ */
11727
+ export interface AudioBuffer {
11728
+ /** The audio buffer from the text-to-speech engine. It should have length exactly audioStreamOptions.bufferSize and encoded as mono, at audioStreamOptions.sampleRate, and as linear pcm, 32-bit signed float i.e. the Float32Array type in javascript. */
11729
+ audioBuffer: ArrayBuffer;
11730
+ /** The character index associated with this audio buffer. */
11731
+ charIndex?: number;
11732
+ /** True if this audio buffer is the last for the text being spoken. */
11733
+ isLastBuffer?: boolean;
11734
+ }
11735
+ /**
11736
+ * Contains the audio stream format expected to be produced by an engine.
11737
+ * @since Chrome 92
11738
+ */
11739
+ export interface AudioStreamOptions {
11740
+ /** The number of samples within an audio buffer. */
11741
+ bufferSize: number;
11742
+ /** The sample rate expected in an audio buffer. */
11743
+ sampleRate: number;
11744
+ }
11745
+
11746
+ /**
11747
+ * The install status of a voice.
11748
+ * @since Chrome 132
11749
+ */
11750
+ export enum LanguageInstallStatus {
11751
+ FAILED = "failed",
11752
+ INSTALLED = "installed",
11753
+ INSTALLING = "installing",
11754
+ NOT_INSTALLED = "notInstalled",
11755
+ }
11756
+
11757
+ /**
11758
+ * Install status of a language.
11759
+ * @since Chrome 132
11760
+ */
11761
+ export interface LanguageStatus {
11762
+ /** Detail about installation failures. Optionally populated if the language failed to install. */
11763
+ error?: string;
11764
+ /** Installation status. */
11765
+ installStatus: `${LanguageInstallStatus}`;
11766
+ /** Language string in the form of language code-region code, where the region may be omitted. Examples are en, en-AU, zh-CH. */
11767
+ lang: string;
11768
+ }
11769
+
11770
+ /**
11771
+ * Options for uninstalling a given language.
11772
+ * @since Chrome 132
11773
+ */
11774
+ export interface LanguageUninstallOptions {
11775
+ /** True if the TTS client wants the language to be immediately uninstalled. The engine may choose whether or when to uninstall the language, based on this parameter and the requestor information. If false, it may use other criteria, such as recent usage, to determine when to uninstall. */
11776
+ uninstallImmediately: boolean;
11777
+ }
11778
+
11779
+ /**
11780
+ * Options specified to the tts.speak() method.
11781
+ * @since Chrome 92
11782
+ */
11673
11783
  export interface SpeakOptions {
11674
- /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
11675
- lang?: string | undefined;
11676
- /** Optional. The name of the voice to use for synthesis. */
11677
- voiceName?: string | undefined;
11784
+ /** The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
11785
+ lang?: string;
11786
+ /** The name of the voice to use for synthesis. */
11787
+ voiceName?: string;
11678
11788
  /**
11679
- * Optional. Gender of voice for synthesized speech.
11680
- * One of: "male", or "female"
11789
+ * Gender of voice for synthesized speech.
11790
+ * @deprecated Gender is deprecated since Chrome 92 and will be ignored.
11681
11791
  */
11682
- gender?: string | undefined;
11683
- /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
11684
- volume?: number | undefined;
11685
- /**
11686
- * Optional.
11687
- * 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. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports.
11688
- */
11689
- rate?: number | undefined;
11690
- /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */
11691
- pitch?: number | undefined;
11792
+ gender?: `${VoiceGender}`;
11793
+ /** Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
11794
+ volume?: number;
11795
+ /** 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. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports. */
11796
+ rate?: number;
11797
+ /** Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */
11798
+ pitch?: number;
11692
11799
  }
11693
11800
 
11694
- export interface TtsEngineSpeakEvent extends
11695
- chrome.events.Event<
11696
- (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
11697
- >
11698
- {}
11801
+ /**
11802
+ * Identifier for the client requesting status.
11803
+ * @since Chrome 131
11804
+ */
11805
+ export interface TtsClient {
11806
+ /** Client making a language management request. For an extension, this is the unique extension ID. For Chrome features, this is the human-readable name of the feature. */
11807
+ id: string;
11808
+ /** Type of requestor. */
11809
+ source: `${TtsClientSource}`;
11810
+ }
11811
+
11812
+ /**
11813
+ * Type of requestor.
11814
+ * @since Chrome 131
11815
+ */
11816
+ export enum TtsClientSource {
11817
+ CHROMEFEATURE = "chromefeature",
11818
+ EXTENSION = "extension",
11819
+ }
11820
+
11821
+ /**
11822
+ * @since Chrome 54
11823
+ * @deprecated Gender is deprecated and will be ignored.
11824
+ */
11825
+ export enum VoiceGender {
11826
+ MALE = "male",
11827
+ FEMALE = "female",
11828
+ }
11829
+
11830
+ /**
11831
+ * Called by an engine when a language install is attempted, and when a language is uninstalled. Also called in response to a status request from a client. When a voice is installed or uninstalled, the engine should also call ttsEngine.updateVoices to register the voice.
11832
+ * @since Chrome 132
11833
+ */
11834
+ export function updateLanguage(status: LanguageStatus): void;
11835
+
11836
+ /**
11837
+ * Called by an engine to update its list of voices. This list overrides any voices declared in this extension's manifest.
11838
+ * @since Chrome 66
11839
+ */
11840
+ export function updateVoices(voices: tts.TtsVoice[]): void;
11841
+
11842
+ /**
11843
+ * Fired when a TTS client requests to install a new language. The engine should attempt to download and install the language, and call ttsEngine.updateLanguage with the result. On success, the engine should also call ttsEngine.updateVoices to register the newly available voices.
11844
+ * @since Chrome 131
11845
+ */
11846
+ export const onInstallLanguageRequest: chrome.events.Event<(requestor: TtsClient, lang: string) => void>;
11847
+
11848
+ /**
11849
+ * Fired when a TTS client requests the install status of a language.
11850
+ * @since Chrome 132
11851
+ */
11852
+ export const onLanguageStatusRequest: chrome.events.Event<(requestor: TtsClient, lang: string) => void>;
11853
+
11854
+ /** Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. */
11855
+ export const onPause: chrome.events.Event<() => void>;
11856
+
11857
+ /** Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. */
11858
+ export const onResume: chrome.events.Event<() => void>;
11699
11859
 
11700
11860
  /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
11701
- export var onSpeak: TtsEngineSpeakEvent;
11702
- /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */
11703
- export var onStop: chrome.events.Event<() => void>;
11861
+ export const onSpeak: chrome.events.Event<
11862
+ (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
11863
+ >;
11864
+
11704
11865
  /**
11705
- * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state.
11706
- * @since Chrome 29
11866
+ * Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. Differs from ttsEngine.onSpeak in that Chrome provides audio playback services and handles dispatching tts events.
11867
+ * @since Chrome 92
11707
11868
  */
11708
- export var onPause: chrome.events.Event<() => void>;
11869
+
11870
+ export const onSpeakWithAudioStream: chrome.events.Event<
11871
+ (
11872
+ utterance: string,
11873
+ options: SpeakOptions,
11874
+ audioStreamOptions: AudioStreamOptions,
11875
+ sendTtsAudio: (audioBufferParams: AudioBuffer) => void,
11876
+ sendError: (errorMessage?: string) => void,
11877
+ ) => void
11878
+ >;
11879
+
11880
+ /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */
11881
+ export const onStop: chrome.events.Event<() => void>;
11882
+
11709
11883
  /**
11710
- * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state.
11711
- * @since Chrome 29
11884
+ * Fired when a TTS client indicates a language is no longer needed.
11885
+ * @since Chrome 132
11712
11886
  */
11713
- export var onResume: chrome.events.Event<() => void>;
11887
+ export const onUninstallLanguageRequest: chrome.events.Event<
11888
+ (requestor: TtsClient, lang: string, uninstallOptions: LanguageUninstallOptions) => void
11889
+ >;
11714
11890
  }
11715
11891
 
11716
11892
  ////////////////////
@@ -13329,6 +13505,18 @@ declare namespace chrome {
13329
13505
  * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
13330
13506
  */
13331
13507
  resourceTypes?: ResourceType[] | undefined;
13508
+
13509
+ /**
13510
+ * Rule does not match if the request matches any response header condition in this list (if specified). If both `excludedResponseHeaders` and `responseHeaders` are specified, then the `excludedResponseHeaders` property takes precedence.
13511
+ * @since Chrome 128
13512
+ */
13513
+ excludedResponseHeaders?: HeaderInfo[];
13514
+
13515
+ /**
13516
+ * Rule matches if the request matches any response header condition in this list (if specified).
13517
+ * @since Chrome 128
13518
+ */
13519
+ responseHeaders?: HeaderInfo[];
13332
13520
  }
13333
13521
 
13334
13522
  export interface MatchedRule {
@@ -13363,6 +13551,24 @@ declare namespace chrome {
13363
13551
  tabId?: number | undefined;
13364
13552
  }
13365
13553
 
13554
+ /** @since Chrome 128 */
13555
+ export interface HeaderInfo {
13556
+ /** If specified, this condition is not matched if the header exists but its value contains at least one element in this list. This uses the same match pattern syntax as `values`. */
13557
+ excludedValues?: string[];
13558
+ /** The name of the header. This condition matches on the name only if both `values` and `excludedValues` are not specified. */
13559
+ header: string;
13560
+ /**
13561
+ * If specified, this condition matches if the header's value matches at least one pattern in this list. This supports case-insensitive header value matching plus the following constructs:
13562
+ *
13563
+ * **'\*'** : Matches any number of characters.
13564
+ *
13565
+ * **'?'** : Matches zero or one character(s).
13566
+ *
13567
+ * **'\*'** and **'?'** can be escaped with a backslash, e.g. **'\\\*'** and **'\\?'**
13568
+ */
13569
+ values?: string[];
13570
+ }
13571
+
13366
13572
  export interface ModifyHeaderInfo {
13367
13573
  /** The name of the header to be modified. */
13368
13574
  header: string;
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.297",
3
+ "version": "0.0.299",
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": "65509e0de498161946587a7c67fba0f28940902c3349b325329313d2393e42e0",
97
+ "typesPublisherContentHash": "b2964406ff7217c1b5dbdf83080b618e808d3ade3cab218e9651859955da3747",
98
98
  "typeScriptVersion": "5.0"
99
99
  }