@types/chrome 0.2.9 → 0.3.1

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 +78 -15
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sat, 05 Sep 2026 20:03:40 GMT
11
+ * Last updated: Mon, 28 Sep 2026 17:35:53 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
@@ -11,8 +11,20 @@ type SetPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
11
11
  ////////////////////
12
12
  interface Window {
13
13
  chrome: typeof chrome;
14
+
15
+ /**
16
+ * Cross-browser alias of {@link chrome}.
17
+ * @since Chrome 148 (Chrome 152 for extensions declaring a `devtools_page` in manifest)
18
+ */
19
+ browser: typeof chrome;
14
20
  }
15
21
 
22
+ /**
23
+ * Cross-browser alias of {@link chrome}.
24
+ * @since Chrome 148 (Chrome 152 for extensions declaring a `devtools_page` in manifest)
25
+ */
26
+ declare var browser: typeof chrome;
27
+
16
28
  declare namespace chrome {
17
29
  ////////////////////
18
30
  // Accessibility Features
@@ -525,7 +537,7 @@ declare namespace chrome {
525
537
  /** Device name */
526
538
  deviceName: string;
527
539
  /** Type of the device */
528
- deviceType: DeviceType;
540
+ deviceType: `${DeviceType}`;
529
541
  /** The user-friendly name (e.g. "USB Microphone"). */
530
542
  displayName: string;
531
543
  /** The unique identifier of the audio device. */
@@ -537,14 +549,14 @@ declare namespace chrome {
537
549
  /** The stable/persisted device id string when available. */
538
550
  stableDeviceId?: string;
539
551
  /** Stream type associated with this device. */
540
- streamType: StreamType;
552
+ streamType: `${StreamType}`;
541
553
  }
542
554
 
543
555
  interface DeviceFilter {
544
556
  /** If set, only audio devices whose active state matches this value will satisfy the filter. */
545
557
  isActive?: boolean;
546
558
  /** If set, only audio devices whose stream type is included in this list will satisfy the filter. */
547
- streamTypes?: StreamType[];
559
+ streamTypes?: `${StreamType}`[];
548
560
  }
549
561
 
550
562
  interface DeviceIdLists {
@@ -600,7 +612,7 @@ declare namespace chrome {
600
612
  /** Whether or not the stream is now muted. */
601
613
  isMuted: boolean;
602
614
  /** The type of the stream for which the mute value changed. The updated mute value applies to all devices with this stream type. */
603
- streamType: StreamType;
615
+ streamType: `${StreamType}`;
604
616
  }
605
617
 
606
618
  /** Type of stream an audio device provides. */
@@ -611,14 +623,17 @@ declare namespace chrome {
611
623
 
612
624
  /**
613
625
  * Gets a list of audio devices filtered based on filter.
626
+ * @param filter Device properties by which to filter the list of returned audio devices. If the filter is not set or set to `{}`, returned device list will contain all available audio devices.
627
+ *
614
628
  * Can return its result via Promise in Manifest V3 or later since Chrome 116.
615
629
  */
616
630
  function getDevices(filter?: DeviceFilter): Promise<AudioDeviceInfo[]>;
617
- function getDevices(filter: DeviceFilter, callback: (devices: AudioDeviceInfo[]) => void): void;
618
631
  function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void;
632
+ function getDevices(filter: DeviceFilter | undefined, callback: (devices: AudioDeviceInfo[]) => void): void;
619
633
 
620
634
  /**
621
635
  * Gets the system-wide mute state for the specified stream type.
636
+ *
622
637
  * Can return its result via Promise in Manifest V3 or later since Chrome 116.
623
638
  */
624
639
  function getMute(streamType: `${StreamType}`): Promise<boolean>;
@@ -626,6 +641,7 @@ declare namespace chrome {
626
641
 
627
642
  /**
628
643
  * Sets lists of active input and/or output devices.
644
+ *
629
645
  * Can return its result via Promise in Manifest V3 or later since Chrome 116.
630
646
  */
631
647
  function setActiveDevices(ids: DeviceIdLists): Promise<void>;
@@ -633,6 +649,7 @@ declare namespace chrome {
633
649
 
634
650
  /**
635
651
  * Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type.
652
+ *
636
653
  * Can return its result via Promise in Manifest V3 or later since Chrome 116.
637
654
  */
638
655
  function setMute(streamType: `${StreamType}`, isMuted: boolean): Promise<void>;
@@ -640,6 +657,7 @@ declare namespace chrome {
640
657
 
641
658
  /**
642
659
  * Sets the properties for the input or output device.
660
+ *
643
661
  * Can return its result via Promise in Manifest V3 or later since Chrome 116.
644
662
  */
645
663
  function setProperties(id: string, properties: DeviceProperties): Promise<void>;
@@ -648,18 +666,18 @@ declare namespace chrome {
648
666
  /**
649
667
  * Fired when audio devices change, either new devices being added, or existing devices being removed.
650
668
  */
651
- const onDeviceListChanged: chrome.events.Event<(devices: AudioDeviceInfo[]) => void>;
669
+ const onDeviceListChanged: events.Event<(devices: AudioDeviceInfo[]) => void>;
652
670
 
653
671
  /**
654
672
  * Fired when sound level changes for an active audio device.
655
673
  */
656
- const onLevelChanged: chrome.events.Event<(event: LevelChangedEvent) => void>;
674
+ const onLevelChanged: events.Event<(event: LevelChangedEvent) => void>;
657
675
 
658
676
  /**
659
677
  * Fired when the mute state of the audio input or output changes.
660
678
  * Note that mute state is system-wide and the new value applies to every audio device with specified stream type.
661
679
  */
662
- const onMuteChanged: chrome.events.Event<(event: MuteChangedEvent) => void>;
680
+ const onMuteChanged: events.Event<(event: MuteChangedEvent) => void>;
663
681
  }
664
682
 
665
683
  ////////////////////
@@ -8971,6 +8989,43 @@ declare namespace chrome {
8971
8989
  const onProxyError: events.Event<(details: ErrorDetails) => void>;
8972
8990
  }
8973
8991
 
8992
+ ////////////////////
8993
+ // PublicSuffix
8994
+ ////////////////////
8995
+ /**
8996
+ * Use the `chrome.publicSuffix` API to query the browser's Public Suffix List (PSL).
8997
+ *
8998
+ * Permissions: "publicSuffix"
8999
+ * @since Chrome 153
9000
+ */
9001
+ export namespace publicSuffix {
9002
+ /** The encoding to use for returned domains. */
9003
+ enum DomainEncoding {
9004
+ DISPLAY = "display",
9005
+ PUNYCODE = "punycode",
9006
+ }
9007
+
9008
+ interface DomainOptions {
9009
+ /** Whether IP addresses may be returned as domains. Defaults to false. Note: When allowed, IP addresses are returned without being looked up in the Public Suffix List. */
9010
+ allowIPAddress?: boolean | undefined;
9011
+ /** Whether known public suffixes may be returned as domains. Defaults to false. */
9012
+ allowPlainSuffix?: boolean | undefined;
9013
+ /** Whether unknown TLDs should be considered as a public suffix. For example, for non-public hostnames like `printer.internal-network`. Defaults to false. */
9014
+ allowUnknownSuffix?: boolean | undefined;
9015
+ /** The encoding to use for the returned domain. Defaults to "punycode", but pass "display" if displaying the domain to the user. Generally, "display" will use Unicode, except in cases where that would be unsafe due to ["Unicode confusables"](https://www.unicode.org/reports/tr39/#Confusable_Detection). */
9016
+ encoding?: `${DomainEncoding}` | undefined;
9017
+ }
9018
+
9019
+ /** Gets the registrable domain for `hostname`, if any. */
9020
+ function getDomain(hostname: string, options?: DomainOptions): string | null;
9021
+
9022
+ /** Gets the known public suffix for `hostname`, if any. */
9023
+ function getKnownSuffix(hostname: string): string | null;
9024
+
9025
+ /** Determines whether `hostname` is itself a known public suffix. */
9026
+ function isKnownSuffix(hostname: string): boolean;
9027
+ }
9028
+
8974
9029
  ////////////////////
8975
9030
  // ReadingList
8976
9031
  ////////////////////
@@ -10001,7 +10056,7 @@ declare namespace chrome {
10001
10056
  * Send a single message to a native application. This method requires the `"nativeMessaging"` permission
10002
10057
  *
10003
10058
  * Can return its result via Promise in Manifest V3 or later since Chrome 99.
10004
- * @param application The name of the native messaging host.
10059
+ * @param application The name of the native messaging host, or target details.
10005
10060
  * @param message The message that will be passed to the native messaging host.
10006
10061
  */
10007
10062
  function sendNativeMessage(application: string, message: object): Promise<any>;
@@ -10964,7 +11019,7 @@ declare namespace chrome {
10964
11019
  /** The user-friendly name (e.g. 'HP LCD monitor'). */
10965
11020
  name: string;
10966
11021
  /**
10967
- * @platform ChromeOS and Web UI only
11022
+ * @platform ChromeOS only
10968
11023
  * @since Chrome 67
10969
11024
  */
10970
11025
  edid?: Edid;
@@ -11075,7 +11130,7 @@ declare namespace chrome {
11075
11130
  /**
11076
11131
  * Requests the layout info for all displays
11077
11132
  * Can return its result via Promise in Manifest V3 or later since Chrome 91.
11078
- * @platform ChromeOS and Web UI only
11133
+ * @platform ChromeOS only
11079
11134
  * @since Chrome 53
11080
11135
  */
11081
11136
  function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void;
@@ -11087,7 +11142,7 @@ declare namespace chrome {
11087
11142
  * Updates the properties for the display specified by `id`,
11088
11143
  * according to the information provided in `info`.
11089
11144
  * On failure, `runtime.lastError` will be set.
11090
- * @platform ChromeOS and Web UI only
11145
+ * @platform ChromeOS only
11091
11146
  * @param id The display's unique identifier.
11092
11147
  * @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`.
11093
11148
  */
@@ -11100,7 +11155,7 @@ declare namespace chrome {
11100
11155
  * If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout.
11101
11156
  * After layout is resolved, an onDisplayChanged event will be triggered.
11102
11157
  * Can return its result via Promise in Manifest V3 or later since Chrome 91.
11103
- * @platform ChromeOS and Web UI only
11158
+ * @platform ChromeOS only
11104
11159
  * @since Chrome 53
11105
11160
  * @param layouts The layout information, required for all displays except the primary display.
11106
11161
  */
@@ -11111,8 +11166,8 @@ declare namespace chrome {
11111
11166
  * Enables/disables the unified desktop feature.
11112
11167
  * If enabled while mirroring is active, the desktop mode will not change until mirroring is turned off.
11113
11168
  * Otherwise, the desktop mode will switch to unified immediately.
11169
+ * @platform ChromeOS only
11114
11170
  * @since Chrome 46
11115
- * @platform ChromeOS and Web UI only
11116
11171
  * @param enabled True if unified desktop should be enabled.
11117
11172
  */
11118
11173
  function enableUnifiedDesktop(enabled: boolean): void;
@@ -11121,6 +11176,7 @@ declare namespace chrome {
11121
11176
  * Starts overscan calibration for a display.
11122
11177
  * This will show an overlay on the screen indicating the current overscan insets.
11123
11178
  * If overscan calibration for display `id` is in progress this will reset calibration.
11179
+ * @platform ChromeOS only
11124
11180
  * @since Chrome 53
11125
11181
  * @param id The display's unique identifier.
11126
11182
  */
@@ -11131,6 +11187,7 @@ declare namespace chrome {
11131
11187
  * Typically this should either move the display along an axis (e.g. left+right have the same value)
11132
11188
  * or scale it along an axis (e.g. top+bottom have opposite values).
11133
11189
  * Each Adjust call is cumulative with previous calls since Start.
11190
+ * @platform ChromeOS only
11134
11191
  * @since Chrome 53
11135
11192
  * @param id The display's unique identifier.
11136
11193
  * @param delta The amount to change the overscan insets.
@@ -11139,6 +11196,7 @@ declare namespace chrome {
11139
11196
 
11140
11197
  /**
11141
11198
  * Resets the overscan insets for a display to the last saved value (i.e before Start was called).
11199
+ * @platform ChromeOS only
11142
11200
  * @since Chrome 53
11143
11201
  * @param id The display's unique identifier.
11144
11202
  */
@@ -11146,6 +11204,7 @@ declare namespace chrome {
11146
11204
 
11147
11205
  /**
11148
11206
  * Complete overscan adjustments for a display by saving the current values and hiding the overlay.
11207
+ * @platform ChromeOS only
11149
11208
  * @since Chrome 53
11150
11209
  * @param id The display's unique identifier.
11151
11210
  */
@@ -11157,6 +11216,7 @@ declare namespace chrome {
11157
11216
  * The callback will be invoked in case of successful calibration only.
11158
11217
  * If the calibration fails, this will throw an error.
11159
11218
  * Can return its result via Promise in Manifest V3 or later since Chrome 91.
11219
+ * @platform ChromeOS only
11160
11220
  * @since Chrome 57
11161
11221
  * @param id The display's unique identifier.
11162
11222
  */
@@ -11167,6 +11227,7 @@ declare namespace chrome {
11167
11227
  * Starts custom touch calibration for a display.
11168
11228
  * This should be called when using a custom UX for collecting calibration data.
11169
11229
  * If another touch calibration is already in progress this will throw an error.
11230
+ * @platform ChromeOS only
11170
11231
  * @since Chrome 57
11171
11232
  * @param id The display's unique identifier.
11172
11233
  */
@@ -11177,6 +11238,7 @@ declare namespace chrome {
11177
11238
  * These `pairs` would be used to calibrate the touch screen for display with `id` called in startCustomTouchCalibration().
11178
11239
  * Always call `startCustomTouchCalibration` before calling this method.
11179
11240
  * If another touch calibration is already in progress this will throw an error.
11241
+ * @platform ChromeOS only
11180
11242
  * @since Chrome 57
11181
11243
  * @param pairs The pairs of point used to calibrate the display.
11182
11244
  * @param bounds Bounds of the display when the touch calibration was performed. `bounds.left` and `bounds.top` values are ignored.
@@ -11186,6 +11248,7 @@ declare namespace chrome {
11186
11248
 
11187
11249
  /**
11188
11250
  * Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display.
11251
+ * @platform ChromeOS only
11189
11252
  * @since Chrome 57
11190
11253
  * @param id The display's unique identifier.
11191
11254
  */
@@ -11195,7 +11258,7 @@ declare namespace chrome {
11195
11258
  * Sets the display mode to the specified mirror mode.
11196
11259
  * Each call resets the state from previous calls.
11197
11260
  * Calling setDisplayProperties() will fail for the mirroring destination displays.
11198
- * @platform ChromeOS and Web UI only
11261
+ * @platform ChromeOS only
11199
11262
  * @param info The information of the mirror mode that should be applied to the display mode.
11200
11263
  * @since Chrome 65
11201
11264
  */
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "TypeScript definitions for chrome",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -54,6 +54,6 @@
54
54
  "@types/har-format": "*"
55
55
  },
56
56
  "peerDependencies": {},
57
- "typesPublisherContentHash": "f5961bea7501409c00f4d057d324fcadcefdc9adee1b3d33f0dad9cca1597b91",
57
+ "typesPublisherContentHash": "7ea6fa0086ffac2cbb3c773dd4de696ba9b67e5439157b5b025db56df5a9be3c",
58
58
  "typeScriptVersion": "5.6"
59
59
  }