@types/chrome 0.2.8 → 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 +2 -2
- chrome/index.d.ts +90 -25
- chrome/package.json +2 -42
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: Tue,
|
|
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
|
|
15
|
-
These definitions were written by [
|
|
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
|
@@ -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
|
////////////////////
|
|
@@ -2902,20 +2920,59 @@ declare namespace chrome {
|
|
|
2902
2920
|
injectedScript?: string | undefined;
|
|
2903
2921
|
}
|
|
2904
2922
|
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2923
|
+
type EvaluationExceptionInfo =
|
|
2924
|
+
| {
|
|
2925
|
+
/**
|
|
2926
|
+
* Set if the error occurred on the DevTools side before the expression is evaluated.
|
|
2927
|
+
*
|
|
2928
|
+
* If `isError` is set to true, a DevTools-side error has occurred, and `code` is set to an error code.
|
|
2929
|
+
*
|
|
2930
|
+
* See the docs on `isException` for more details on parsing this object.
|
|
2931
|
+
*/
|
|
2932
|
+
isError: true;
|
|
2933
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated. */
|
|
2934
|
+
code: string;
|
|
2935
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated. */
|
|
2936
|
+
description: string;
|
|
2937
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */
|
|
2938
|
+
details: any[];
|
|
2939
|
+
/**
|
|
2940
|
+
* Set if the evaluated code produces an unhandled exception.
|
|
2941
|
+
*
|
|
2942
|
+
* If `isException` is non-null but not true, and `isError` is true, a DevTools-side error has occurred, and `code` is set to an error code.
|
|
2943
|
+
*
|
|
2944
|
+
* If `isException` is set to true, a JavaScript error has occurred, and `value` is set to the string value of the thrown object.
|
|
2945
|
+
*/
|
|
2946
|
+
isException?: undefined;
|
|
2947
|
+
/** Set if the evaluated code produces an unhandled exception. */
|
|
2948
|
+
value?: undefined;
|
|
2949
|
+
}
|
|
2950
|
+
| {
|
|
2951
|
+
/**
|
|
2952
|
+
* Set if the error occurred on the DevTools side before the expression is evaluated.
|
|
2953
|
+
*
|
|
2954
|
+
* If `isError` is set to true, a DevTools-side error has occurred, and `code` is set to an error code.
|
|
2955
|
+
*
|
|
2956
|
+
* See the docs on `isException` for more details on parsing this object.
|
|
2957
|
+
*/
|
|
2958
|
+
isError?: undefined;
|
|
2959
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated. */
|
|
2960
|
+
code?: undefined;
|
|
2961
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated. */
|
|
2962
|
+
description?: undefined;
|
|
2963
|
+
/** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */
|
|
2964
|
+
details?: undefined;
|
|
2965
|
+
/**
|
|
2966
|
+
* Set if the evaluated code produces an unhandled exception.
|
|
2967
|
+
*
|
|
2968
|
+
* If `isException` is non-null but not true, and `isError` is true, a DevTools-side error has occurred, and `code` is set to an error code.
|
|
2969
|
+
*
|
|
2970
|
+
* If `isException` is set to true, a JavaScript error has occurred, and `value` is set to the string value of the thrown object.
|
|
2971
|
+
*/
|
|
2972
|
+
isException: true;
|
|
2973
|
+
/** Set if the evaluated code produces an unhandled exception. */
|
|
2974
|
+
value: string;
|
|
2975
|
+
};
|
|
2919
2976
|
|
|
2920
2977
|
/** The ID of the tab being inspected. This ID may be used with {@link chrome.tabs} API. */
|
|
2921
2978
|
const tabId: number;
|
|
@@ -2935,15 +2992,23 @@ declare namespace chrome {
|
|
|
2935
2992
|
function eval<T = { [key: string]: unknown }>(
|
|
2936
2993
|
expression: string,
|
|
2937
2994
|
options?: EvalOptions,
|
|
2938
|
-
): Promise<
|
|
2995
|
+
): Promise<T>;
|
|
2939
2996
|
function eval<T = { [key: string]: unknown }>(
|
|
2940
2997
|
expression: string,
|
|
2941
|
-
callback
|
|
2998
|
+
callback: (
|
|
2999
|
+
...args:
|
|
3000
|
+
| [result: T, exceptionInfo: undefined]
|
|
3001
|
+
| [result: undefined, exceptionInfo: EvaluationExceptionInfo]
|
|
3002
|
+
) => void,
|
|
2942
3003
|
): void;
|
|
2943
3004
|
function eval<T = { [key: string]: unknown }>(
|
|
2944
3005
|
expression: string,
|
|
2945
3006
|
options: EvalOptions | undefined,
|
|
2946
|
-
callback
|
|
3007
|
+
callback: (
|
|
3008
|
+
...args:
|
|
3009
|
+
| [result: T, exceptionInfo: undefined]
|
|
3010
|
+
| [result: undefined, exceptionInfo: EvaluationExceptionInfo]
|
|
3011
|
+
) => void,
|
|
2947
3012
|
): void;
|
|
2948
3013
|
|
|
2949
3014
|
/**
|
chrome/package.json
CHANGED
|
@@ -1,50 +1,15 @@
|
|
|
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",
|
|
7
7
|
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Matthew Kimber",
|
|
10
|
-
"githubUsername": "matthewkimber",
|
|
11
|
-
"url": "https://github.com/matthewkimber"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "otiai10",
|
|
15
|
-
"githubUsername": "otiai10",
|
|
16
|
-
"url": "https://github.com/otiai10"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "sreimer15",
|
|
20
|
-
"githubUsername": "sreimer15",
|
|
21
|
-
"url": "https://github.com/sreimer15"
|
|
22
|
-
},
|
|
23
8
|
{
|
|
24
9
|
"name": "MatCarlson",
|
|
25
10
|
"githubUsername": "MatCarlson",
|
|
26
11
|
"url": "https://github.com/MatCarlson"
|
|
27
12
|
},
|
|
28
|
-
{
|
|
29
|
-
"name": "ekinsol",
|
|
30
|
-
"githubUsername": "ekinsol",
|
|
31
|
-
"url": "https://github.com/ekinsol"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "Brian Wilson",
|
|
35
|
-
"githubUsername": "echoabstract",
|
|
36
|
-
"url": "https://github.com/echoabstract"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "Sebastiaan Pasma",
|
|
40
|
-
"githubUsername": "spasma",
|
|
41
|
-
"url": "https://github.com/spasma"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "bdbai",
|
|
45
|
-
"githubUsername": "bdbai",
|
|
46
|
-
"url": "https://github.com/bdbai"
|
|
47
|
-
},
|
|
48
13
|
{
|
|
49
14
|
"name": "Jason Xian",
|
|
50
15
|
"githubUsername": "JasonXian",
|
|
@@ -55,11 +20,6 @@
|
|
|
55
20
|
"githubUsername": "usertim",
|
|
56
21
|
"url": "https://github.com/usertim"
|
|
57
22
|
},
|
|
58
|
-
{
|
|
59
|
-
"name": "Idan Zeierman",
|
|
60
|
-
"githubUsername": "idan315",
|
|
61
|
-
"url": "https://github.com/idan315"
|
|
62
|
-
},
|
|
63
23
|
{
|
|
64
24
|
"name": "Nicolas Rodriguez",
|
|
65
25
|
"githubUsername": "nicolas377",
|
|
@@ -94,6 +54,6 @@
|
|
|
94
54
|
"@types/har-format": "*"
|
|
95
55
|
},
|
|
96
56
|
"peerDependencies": {},
|
|
97
|
-
"typesPublisherContentHash": "
|
|
57
|
+
"typesPublisherContentHash": "9c20c819fceff510723a6c0d98a378ee8e943c0a33951dfcd16ddb2a43167319",
|
|
98
58
|
"typeScriptVersion": "5.6"
|
|
99
59
|
}
|