@types/chrome 0.2.6 → 0.2.8
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 +81 -12
- 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, 01 Sep 2026 19:04:12 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
|
@@ -394,6 +394,11 @@ declare namespace chrome {
|
|
|
394
394
|
export namespace alarms {
|
|
395
395
|
type AlarmCreateInfo =
|
|
396
396
|
& {
|
|
397
|
+
/**
|
|
398
|
+
* Name of this alarm.
|
|
399
|
+
* @since Chrome 152
|
|
400
|
+
*/
|
|
401
|
+
name?: string | undefined;
|
|
397
402
|
/**
|
|
398
403
|
* Whether the alarm should persist across sessions (browser restarts). In Chrome, this defaults to true to match historical behavior, but you should set this explicitly to maximize compatibility across browsers.
|
|
399
404
|
* @since Chrome 150
|
|
@@ -453,9 +458,18 @@ declare namespace chrome {
|
|
|
453
458
|
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
|
454
459
|
*/
|
|
455
460
|
function create(alarmInfo: AlarmCreateInfo): Promise<void>;
|
|
456
|
-
function create(name:
|
|
461
|
+
function create(name: undefined, alarmInfo: AlarmCreateInfo): Promise<void>;
|
|
462
|
+
function create<T extends AlarmCreateInfo>(
|
|
463
|
+
name: string,
|
|
464
|
+
alarmInfo: T & (T extends { name: string } ? never : unknown),
|
|
465
|
+
): Promise<void>;
|
|
457
466
|
function create(alarmInfo: AlarmCreateInfo, callback: () => void): void;
|
|
458
|
-
function create(name:
|
|
467
|
+
function create(name: undefined, alarmInfo: AlarmCreateInfo, callback: () => void): void;
|
|
468
|
+
function create<T extends AlarmCreateInfo>(
|
|
469
|
+
name: string,
|
|
470
|
+
alarmInfo: T & (T extends { name: string } ? never : unknown),
|
|
471
|
+
callback: () => void,
|
|
472
|
+
): void;
|
|
459
473
|
|
|
460
474
|
/**
|
|
461
475
|
* Gets an array of all the alarms.
|
|
@@ -3074,10 +3088,13 @@ declare namespace chrome {
|
|
|
3074
3088
|
/**
|
|
3075
3089
|
* Creates a pane within panel's sidebar.
|
|
3076
3090
|
* @param title Text that is displayed in sidebar caption.
|
|
3091
|
+
*
|
|
3092
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3077
3093
|
*/
|
|
3094
|
+
createSidebarPane(title: string): Promise<ExtensionSidebarPane>;
|
|
3078
3095
|
createSidebarPane(
|
|
3079
3096
|
title: string,
|
|
3080
|
-
callback
|
|
3097
|
+
callback: (
|
|
3081
3098
|
/** An ExtensionSidebarPane object for created sidebar pane. */
|
|
3082
3099
|
result: ExtensionSidebarPane,
|
|
3083
3100
|
) => void,
|
|
@@ -3091,10 +3108,13 @@ declare namespace chrome {
|
|
|
3091
3108
|
/**
|
|
3092
3109
|
* Creates a pane within panel's sidebar.
|
|
3093
3110
|
* @param title Text that is displayed in sidebar caption.
|
|
3111
|
+
*
|
|
3112
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3094
3113
|
*/
|
|
3114
|
+
createSidebarPane(title: string): Promise<ExtensionSidebarPane>;
|
|
3095
3115
|
createSidebarPane(
|
|
3096
3116
|
title: string,
|
|
3097
|
-
callback
|
|
3117
|
+
callback: (
|
|
3098
3118
|
/** An ExtensionSidebarPane object for created sidebar pane. */
|
|
3099
3119
|
result: ExtensionSidebarPane,
|
|
3100
3120
|
) => void,
|
|
@@ -3114,19 +3134,23 @@ declare namespace chrome {
|
|
|
3114
3134
|
* Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
|
|
3115
3135
|
* @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
|
|
3116
3136
|
* @param rootTitle An optional title for the root of the expression tree.
|
|
3137
|
+
*
|
|
3138
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3117
3139
|
*/
|
|
3118
|
-
setExpression(expression: string,
|
|
3119
|
-
setExpression(expression: string, rootTitle: string | undefined, callback
|
|
3140
|
+
setExpression(expression: string, rootTitle?: string): Promise<void>;
|
|
3141
|
+
setExpression(expression: string, rootTitle: string | undefined, callback: () => void): void;
|
|
3120
3142
|
/**
|
|
3121
3143
|
* Sets a JSON-compliant object to be displayed in the sidebar pane.
|
|
3122
3144
|
* @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
|
|
3123
3145
|
* @param rootTitle An optional title for the root of the expression tree.
|
|
3146
|
+
*
|
|
3147
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3124
3148
|
*/
|
|
3125
|
-
setObject(jsonObject: { [key: string]: unknown },
|
|
3149
|
+
setObject(jsonObject: { [key: string]: unknown }, rootTitle?: string): Promise<void>;
|
|
3126
3150
|
setObject(
|
|
3127
3151
|
jsonObject: { [key: string]: unknown },
|
|
3128
3152
|
rootTitle: string | undefined,
|
|
3129
|
-
callback
|
|
3153
|
+
callback: () => void,
|
|
3130
3154
|
): void;
|
|
3131
3155
|
/**
|
|
3132
3156
|
* Sets an HTML page to be displayed in the sidebar pane.
|
|
@@ -3156,12 +3180,15 @@ declare namespace chrome {
|
|
|
3156
3180
|
* @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
|
|
3157
3181
|
* @param iconPath Path of the panel's icon relative to the extension directory.
|
|
3158
3182
|
* @param pagePath Path of the panel's HTML page relative to the extension directory.
|
|
3183
|
+
*
|
|
3184
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3159
3185
|
*/
|
|
3186
|
+
function create(title: string, iconPath: string, pagePath: string): Promise<ExtensionPanel>;
|
|
3160
3187
|
function create(
|
|
3161
3188
|
title: string,
|
|
3162
3189
|
iconPath: string,
|
|
3163
3190
|
pagePath: string,
|
|
3164
|
-
callback
|
|
3191
|
+
callback: (
|
|
3165
3192
|
/** An ExtensionPanel object representing the created panel. */
|
|
3166
3193
|
panel: ExtensionPanel,
|
|
3167
3194
|
) => void,
|
|
@@ -3188,13 +3215,16 @@ declare namespace chrome {
|
|
|
3188
3215
|
* @param url The URL of the resource to open.
|
|
3189
3216
|
* @param lineNumber Specifies the line number to scroll to when the resource is loaded.
|
|
3190
3217
|
* @param columnNumber Specifies the column number to scroll to when the resource is loaded.
|
|
3218
|
+
*
|
|
3219
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 152.
|
|
3191
3220
|
*/
|
|
3192
|
-
function openResource(url: string, lineNumber: number,
|
|
3221
|
+
function openResource(url: string, lineNumber: number, columnNumber?: number): Promise<void>;
|
|
3222
|
+
function openResource(url: string, lineNumber: number, callback: () => void): void;
|
|
3193
3223
|
function openResource(
|
|
3194
3224
|
url: string,
|
|
3195
3225
|
lineNumber: number,
|
|
3196
3226
|
columnNumber: number | undefined,
|
|
3197
|
-
callback
|
|
3227
|
+
callback: () => void,
|
|
3198
3228
|
): void;
|
|
3199
3229
|
|
|
3200
3230
|
/**
|
|
@@ -4742,6 +4772,25 @@ declare namespace chrome {
|
|
|
4742
4772
|
*/
|
|
4743
4773
|
type CSSOrigin = "author" | "user";
|
|
4744
4774
|
|
|
4775
|
+
/**
|
|
4776
|
+
* Details of the CSS to remove. Either the code or the file property must be set, but both may not be set at the same time.
|
|
4777
|
+
* @since Chrome 87
|
|
4778
|
+
*/
|
|
4779
|
+
interface DeleteInjectionDetails {
|
|
4780
|
+
/** If allFrames is `true`, implies that the CSS should be removed from all frames of current page. By default, it's `false` and is only removed from the top frame. If `true` and `frameId` is set, then the code is removed from the selected frame and all of its child frames. */
|
|
4781
|
+
allFrames?: boolean;
|
|
4782
|
+
/** CSS code to remove. */
|
|
4783
|
+
code?: string;
|
|
4784
|
+
/** The origin of the CSS to remove. Defaults to `"author"`. */
|
|
4785
|
+
cssOrigin?: CSSOrigin;
|
|
4786
|
+
/** CSS file to remove. */
|
|
4787
|
+
file?: string;
|
|
4788
|
+
/** The frame from where the CSS should be removed. Defaults to 0 (the top-level frame). */
|
|
4789
|
+
frameId?: number;
|
|
4790
|
+
/** If matchAboutBlank is true, then the code is also removed from about:blank and about:srcdoc frames if your extension has access to its parent document. By default it is `false`. */
|
|
4791
|
+
matchAboutBlank?: boolean;
|
|
4792
|
+
}
|
|
4793
|
+
|
|
4745
4794
|
/**
|
|
4746
4795
|
* The document lifecycle of the frame.
|
|
4747
4796
|
* @since Chrome 106
|
|
@@ -11890,7 +11939,7 @@ declare namespace chrome {
|
|
|
11890
11939
|
* MV2 only
|
|
11891
11940
|
* @param tabId The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
|
|
11892
11941
|
* @param details Details of the CSS text to insert. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11893
|
-
* @deprecated since Chrome
|
|
11942
|
+
* @deprecated since Chrome 91. Replaced by {@link scripting.insertCSS} in Manifest V3.
|
|
11894
11943
|
*/
|
|
11895
11944
|
function insertCSS(details: extensionTypes.InjectDetails): Promise<void>;
|
|
11896
11945
|
function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise<void>;
|
|
@@ -11901,6 +11950,26 @@ declare namespace chrome {
|
|
|
11901
11950
|
callback: () => void,
|
|
11902
11951
|
): void;
|
|
11903
11952
|
|
|
11953
|
+
/**
|
|
11954
|
+
* Removes from a page CSS that was previously injected by a call to {@link tabs.insertCSS}.
|
|
11955
|
+
*
|
|
11956
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 88.
|
|
11957
|
+
*
|
|
11958
|
+
* MV2 only
|
|
11959
|
+
* @param tabId The ID of the tab from which to remove the CSS; defaults to the active tab of the current window.
|
|
11960
|
+
* @param details Details of the CSS text to remove. Either the code or the file property must be set, but both may not be set at the same time.
|
|
11961
|
+
* @since Chrome 87
|
|
11962
|
+
* @deprecated since Chrome 91. Replaced by {@link scripting.removeCSS} in Manifest V3.
|
|
11963
|
+
*/
|
|
11964
|
+
function removeCSS(details: extensionTypes.DeleteInjectionDetails): Promise<void>;
|
|
11965
|
+
function removeCSS(tabId: number | undefined, details: extensionTypes.DeleteInjectionDetails): Promise<void>;
|
|
11966
|
+
function removeCSS(details: extensionTypes.DeleteInjectionDetails, callback: () => void): void;
|
|
11967
|
+
function removeCSS(
|
|
11968
|
+
tabId: number | undefined,
|
|
11969
|
+
details: extensionTypes.DeleteInjectionDetails,
|
|
11970
|
+
callback: () => void,
|
|
11971
|
+
): void;
|
|
11972
|
+
|
|
11904
11973
|
/**
|
|
11905
11974
|
* Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active.
|
|
11906
11975
|
*
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
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": "
|
|
97
|
+
"typesPublisherContentHash": "891ebb387f87251a1f86664c9f38c41e7192a05982653bdce7fad1dd10cc84b6",
|
|
98
98
|
"typeScriptVersion": "5.6"
|
|
99
99
|
}
|