@types/chrome 0.2.9 → 0.3.0
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.
- chrome/README.md +1 -1
- chrome/index.d.ts +26 -8
- 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:
|
|
11
|
+
* Last updated: Tue, 15 Sep 2026 20:33:28 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:
|
|
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:
|
|
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:
|
|
680
|
+
const onMuteChanged: events.Event<(event: MuteChangedEvent) => void>;
|
|
663
681
|
}
|
|
664
682
|
|
|
665
683
|
////////////////////
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": "
|
|
57
|
+
"typesPublisherContentHash": "9c20c819fceff510723a6c0d98a378ee8e943c0a33951dfcd16ddb2a43167319",
|
|
58
58
|
"typeScriptVersion": "5.6"
|
|
59
59
|
}
|