@types/chrome 0.0.287 → 0.0.288

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 +113 -96
  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: Tue, 26 Nov 2024 07:33:59 GMT
11
+ * Last updated: Thu, 02 Jan 2025 18:37:07 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
@@ -21,53 +21,53 @@ declare namespace chrome {
21
21
  */
22
22
  export namespace accessibilityFeatures {
23
23
  /** **ChromeOS only.** Spoken feedback (text-to-speech). */
24
- export var spokenFeedback: chrome.types.ChromeSetting;
24
+ export var spokenFeedback: chrome.types.ChromeSetting<boolean>;
25
25
  /** **ChromeOS only.** Enlarged cursor. */
26
- export var largeCursor: chrome.types.ChromeSetting;
26
+ export var largeCursor: chrome.types.ChromeSetting<boolean>;
27
27
  /** **ChromeOS only.** Sticky modifier keys (like shift or alt). */
28
- export var stickyKeys: chrome.types.ChromeSetting;
28
+ export var stickyKeys: chrome.types.ChromeSetting<boolean>;
29
29
  /** **ChromeOS only.** High contrast rendering mode. */
30
- export var highContrast: chrome.types.ChromeSetting;
30
+ export var highContrast: chrome.types.ChromeSetting<boolean>;
31
31
  /** **ChromeOS only.** Full screen magnification. */
32
- export var screenMagnifier: chrome.types.ChromeSetting;
32
+ export var screenMagnifier: chrome.types.ChromeSetting<boolean>;
33
33
  /** **ChromeOS only.** Auto mouse click after mouse stops moving. */
34
- export var autoclick: chrome.types.ChromeSetting;
34
+ export var autoclick: chrome.types.ChromeSetting<boolean>;
35
35
  /** **ChromeOS only.** Virtual on-screen keyboard. */
36
- export var virtualKeyboard: chrome.types.ChromeSetting;
36
+ export var virtualKeyboard: chrome.types.ChromeSetting<boolean>;
37
37
  /**
38
38
  * **ChromeOS only.**
39
39
  * Caret highlighting.
40
40
  * @since Chrome 51
41
41
  */
42
- export var caretHighlight: chrome.types.ChromeSetting;
42
+ export var caretHighlight: chrome.types.ChromeSetting<boolean>;
43
43
  /**
44
44
  * **ChromeOS only.**
45
45
  * Cursor highlighting.
46
46
  * @since Chrome 51
47
47
  */
48
- export var cursorHighlight: chrome.types.ChromeSetting;
48
+ export var cursorHighlight: chrome.types.ChromeSetting<boolean>;
49
49
  /**
50
50
  * **ChromeOS only.**
51
51
  * Focus highlighting.
52
52
  * @since Chrome 51
53
53
  */
54
- export var focusHighlight: chrome.types.ChromeSetting;
54
+ export var focusHighlight: chrome.types.ChromeSetting<boolean>;
55
55
  /**
56
56
  * **ChromeOS only.**
57
57
  * Select-to-speak.
58
58
  * @since Chrome 51
59
59
  */
60
- export var selectToSpeak: chrome.types.ChromeSetting;
60
+ export var selectToSpeak: chrome.types.ChromeSetting<boolean>;
61
61
  /**
62
62
  * **ChromeOS only.**
63
63
  * Switch Access.
64
64
  * @since Chrome 51
65
65
  */
66
- export var switchAccess: chrome.types.ChromeSetting;
66
+ export var switchAccess: chrome.types.ChromeSetting<boolean>;
67
67
  /**
68
68
  * @since Chrome 42
69
69
  */
70
- export var animationPolicy: chrome.types.ChromeSetting;
70
+ export var animationPolicy: chrome.types.ChromeSetting<"allowed" | "once" | "none">;
71
71
  }
72
72
 
73
73
  ////////////////////
@@ -7237,46 +7237,49 @@ declare namespace chrome {
7237
7237
  * @since Chrome 18
7238
7238
  */
7239
7239
  export namespace privacy {
7240
+ /**
7241
+ * The IP handling policy of WebRTC.
7242
+ * @since Chrome 48
7243
+ */
7244
+ export type IPHandlingPolicy =
7245
+ | "default"
7246
+ | "default_public_and_private_interfaces"
7247
+ | "default_public_interface_only"
7248
+ | "disable_non_proxied_udp";
7249
+
7240
7250
  export interface Services {
7241
7251
  /** @since Chrome 20 */
7242
- spellingServiceEnabled: chrome.types.ChromeSetting;
7243
- searchSuggestEnabled: chrome.types.ChromeSetting;
7244
- instantEnabled: chrome.types.ChromeSetting;
7245
- alternateErrorPagesEnabled: chrome.types.ChromeSetting;
7246
- safeBrowsingEnabled: chrome.types.ChromeSetting;
7252
+ spellingServiceEnabled: chrome.types.ChromeSetting<boolean>;
7253
+ searchSuggestEnabled: chrome.types.ChromeSetting<boolean>;
7254
+ alternateErrorPagesEnabled: chrome.types.ChromeSetting<boolean>;
7255
+ safeBrowsingEnabled: chrome.types.ChromeSetting<boolean>;
7247
7256
  /** @deprecated since Chrome 70. Please use privacy.services.autofillAddressEnabled and privacy.services.autofillCreditCardEnabled. */
7248
- autofillEnabled: chrome.types.ChromeSetting;
7249
- translationServiceEnabled: chrome.types.ChromeSetting;
7257
+ autofillEnabled: chrome.types.ChromeSetting<boolean>;
7258
+ translationServiceEnabled: chrome.types.ChromeSetting<boolean>;
7250
7259
  /** @since Chrome 38 */
7251
- passwordSavingEnabled: chrome.types.ChromeSetting;
7260
+ passwordSavingEnabled: chrome.types.ChromeSetting<boolean>;
7252
7261
  /** @since Chrome 42 */
7253
- hotwordSearchEnabled: chrome.types.ChromeSetting;
7254
- /** @since Chrome 42 */
7255
- safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting;
7262
+ safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting<boolean>;
7256
7263
  /** @since Chrome 70 */
7257
- autofillAddressEnabled: chrome.types.ChromeSetting;
7264
+ autofillAddressEnabled: chrome.types.ChromeSetting<boolean>;
7258
7265
  /** @since Chrome 70 */
7259
- autofillCreditCardEnabled: chrome.types.ChromeSetting;
7266
+ autofillCreditCardEnabled: chrome.types.ChromeSetting<boolean>;
7260
7267
  }
7261
7268
 
7262
7269
  export interface Network {
7263
- networkPredictionEnabled: chrome.types.ChromeSetting;
7264
- /** @deprecated since Chrome 48. Please use privacy.network.webRTCIPHandlingPolicy. */
7265
- webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting;
7266
- /** @deprecated since Chrome 48. Please use privacy.network.webRTCIPHandlingPolicy. */
7267
- webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting;
7270
+ networkPredictionEnabled: chrome.types.ChromeSetting<boolean>;
7268
7271
  /** @since Chrome 48 */
7269
- webRTCIPHandlingPolicy: chrome.types.ChromeSetting;
7272
+ webRTCIPHandlingPolicy: chrome.types.ChromeSetting<IPHandlingPolicy>;
7270
7273
  }
7271
7274
 
7272
7275
  export interface Websites {
7273
- thirdPartyCookiesAllowed: chrome.types.ChromeSetting;
7274
- referrersEnabled: chrome.types.ChromeSetting;
7275
- hyperlinkAuditingEnabled: chrome.types.ChromeSetting;
7276
+ thirdPartyCookiesAllowed: chrome.types.ChromeSetting<boolean>;
7277
+ referrersEnabled: chrome.types.ChromeSetting<boolean>;
7278
+ hyperlinkAuditingEnabled: chrome.types.ChromeSetting<boolean>;
7276
7279
  /** @since Chrome 21. Available on Windows and ChromeOS only. */
7277
- protectedContentEnabled: chrome.types.ChromeSetting;
7280
+ protectedContentEnabled: chrome.types.ChromeSetting<boolean>;
7278
7281
  /** @since Chrome 65 */
7279
- doNotTrackEnabled: chrome.types.ChromeSetting;
7282
+ doNotTrackEnabled: chrome.types.ChromeSetting<boolean>;
7280
7283
  }
7281
7284
 
7282
7285
  /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */
@@ -7359,7 +7362,7 @@ declare namespace chrome {
7359
7362
 
7360
7363
  export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
7361
7364
 
7362
- export var settings: chrome.types.ChromeSetting;
7365
+ export var settings: chrome.types.ChromeSetting<ProxyConfig>;
7363
7366
  /** Notifies about proxy errors. */
7364
7367
  export var onProxyError: ProxyErrorEvent;
7365
7368
  }
@@ -11526,93 +11529,107 @@ declare namespace chrome {
11526
11529
  * @since Chrome 13
11527
11530
  */
11528
11531
  export namespace types {
11529
- type settingsScope = "regular" | "regular_only" | "incognito_persistent" | "incognito_session_only" | undefined;
11532
+ /**
11533
+ * The scope of the ChromeSetting. One of
11534
+ * * `regular`: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
11535
+ * * `regular_only`: setting for the regular profile only (not inherited by the incognito profile),
11536
+ * * `incognito_persistent`: setting for the incognito profile that survives browser restarts (overrides regular preferences)
11537
+ * * `incognito_session_only`: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
11538
+ * @since Chrome 44
11539
+ */
11540
+ export type ChromeSettingScope = "regular" | "regular_only" | "incognito_persistent" | "incognito_session_only";
11530
11541
 
11531
- export interface ChromeSettingClearDetails {
11532
- /**
11533
- * Optional.
11534
- * The scope of the ChromeSetting. One of
11535
- * regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
11536
- * regular_only: setting for the regular profile only (not inherited by the incognito profile),
11537
- * incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
11538
- * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
11539
- */
11540
- scope?: settingsScope;
11541
- }
11542
+ /**
11543
+ * One of
11544
+ * * `not_controllable`: cannot be controlled by any extension
11545
+ * * `controlled_by_other_extensions`: controlled by extensions with higher precedence
11546
+ * * `controllable_by_this_extension`: can be controlled by this extension
11547
+ * * `controlled_by_this_extension`: controlled by this extension
11548
+ * @since Chrome 44
11549
+ */
11550
+ export type LevelOfControl =
11551
+ | "not_controllable"
11552
+ | "controlled_by_other_extensions"
11553
+ | "controllable_by_this_extension"
11554
+ | "controlled_by_this_extension";
11542
11555
 
11543
- export interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
11556
+ /** Which setting to change. */
11557
+ export interface ChromeSettingSetDetails<T> {
11544
11558
  /**
11545
11559
  * The value of the setting.
11546
11560
  * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.
11547
11561
  */
11548
- value: any;
11549
- /**
11550
- * Optional.
11551
- * The scope of the ChromeSetting. One of
11552
- * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
11553
- * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
11554
- * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
11555
- * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
11556
- */
11557
- scope?: settingsScope;
11562
+ value: T;
11563
+ /** Where to set the setting (default: regular). */
11564
+ scope?: ChromeSettingScope;
11558
11565
  }
11559
11566
 
11567
+ /** Which setting to consider. */
11560
11568
  export interface ChromeSettingGetDetails {
11561
- /** Optional. Whether to return the value that applies to the incognito session (default false). */
11562
- incognito?: boolean | undefined;
11569
+ /** Whether to return the value that applies to the incognito session (default false). */
11570
+ incognito?: boolean;
11563
11571
  }
11564
11572
 
11565
- /**
11566
- * @param details Details of the currently effective value.
11567
- */
11568
- export type DetailsCallback = (details: ChromeSettingGetResultDetails) => void;
11569
-
11570
- export interface ChromeSettingGetResultDetails {
11571
- /**
11572
- * One of
11573
- * • not_controllable: cannot be controlled by any extension
11574
- * • controlled_by_other_extensions: controlled by extensions with higher precedence
11575
- * • controllable_by_this_extension: can be controlled by this extension
11576
- * • controlled_by_this_extension: controlled by this extension
11577
- */
11578
- levelOfControl:
11579
- | "not_controllable"
11580
- | "controlled_by_other_extensions"
11581
- | "controllable_by_this_extension"
11582
- | "controlled_by_this_extension";
11573
+ /** Details of the currently effective value */
11574
+ export interface ChromeSettingGetResult<T> {
11575
+ /** The level of control of the setting. */
11576
+ levelOfControl: LevelOfControl;
11583
11577
  /** The value of the setting. */
11584
- value: any;
11578
+ value: T;
11585
11579
  /**
11586
- * Optional.
11587
11580
  * Whether the effective value is specific to the incognito session.
11588
11581
  * This property will only be present if the incognito property in the details parameter of get() was true.
11589
11582
  */
11590
- incognitoSpecific?: boolean | undefined;
11583
+ incognitoSpecific?: boolean;
11584
+ }
11585
+
11586
+ /** Which setting to clear. */
11587
+ export interface ChromeSettingClearDetails {
11588
+ /** Where to clear the setting (default: regular). */
11589
+ scope?: ChromeSettingScope;
11591
11590
  }
11592
11591
 
11593
- export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> {}
11592
+ /** Details of the currently effective value. */
11593
+ export interface ChromeSettingOnChangeDetails<T> {
11594
+ /**
11595
+ * Whether the effective value is specific to the incognito session. T
11596
+ * his property will only be present if the incognito property in the details parameter of get() was true.
11597
+ */
11598
+ incognitoSpecific?: boolean;
11599
+ /** The value of the setting. */
11600
+ value: T;
11601
+ /** The level of control of the setting. */
11602
+ levelOfControl: LevelOfControl;
11603
+ }
11594
11604
 
11595
- /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */
11596
- export interface ChromeSetting {
11605
+ /**
11606
+ * An interface that allows access to a Chrome browser setting.
11607
+ * See {@link chrome.accessibilityFeatures} for an example.
11608
+ */
11609
+ export interface ChromeSetting<T> {
11597
11610
  /**
11598
11611
  * Sets the value of a setting.
11599
- * @param details Which setting to change.
11600
- * @param callback Optional. Called at the completion of the set operation.
11612
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
11601
11613
  */
11602
- set(details: ChromeSettingSetDetails, callback?: Function): void;
11614
+ set(details: ChromeSettingSetDetails<T>, callback: () => void): void;
11615
+ set(details: ChromeSettingSetDetails<T>): Promise<void>;
11616
+
11603
11617
  /**
11604
11618
  * Gets the value of a setting.
11605
- * @param details Which setting to consider.
11619
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
11606
11620
  */
11607
- get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
11621
+ get(details: ChromeSettingGetDetails, callback: (details: ChromeSettingGetResult<T>) => void): void;
11622
+ get(details: ChromeSettingGetDetails): Promise<ChromeSettingGetResult<T>>;
11623
+
11608
11624
  /**
11609
11625
  * Clears the setting, restoring any default value.
11610
- * @param details Which setting to clear.
11611
- * @param callback Optional. Called at the completion of the clear operation.
11626
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
11612
11627
  */
11613
- clear(details: ChromeSettingClearDetails, callback?: Function): void;
11628
+ clear(details: ChromeSettingClearDetails, callback: () => void): void;
11629
+ clear(details: ChromeSettingClearDetails): Promise<void>;
11630
+
11614
11631
  /** Fired after the setting changes. */
11615
- onChange: ChromeSettingChangedEvent;
11632
+ onChange: chrome.events.Event<(details: ChromeSettingOnChangeDetails<T>) => void>;
11616
11633
  }
11617
11634
  }
11618
11635
 
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.287",
3
+ "version": "0.0.288",
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": "93718a3e0ce89514577fd2476b8b954fad422c79dda8f5cab5509b57e4a7da16",
97
+ "typesPublisherContentHash": "115546e2b199f5d8b21729e4d49bada5c8b5d60ee6eb0fdb5688219cb24d1fe2",
98
98
  "typeScriptVersion": "5.0"
99
99
  }