@types/chrome 0.0.291 → 0.0.293
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 +89 -116
- 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:
|
11
|
+
* Last updated: Thu, 09 Jan 2025 14:35:38 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
@@ -1980,25 +1980,7 @@ declare namespace chrome {
|
|
1980
1980
|
visible?: boolean | undefined;
|
1981
1981
|
}
|
1982
1982
|
|
1983
|
-
export interface UpdateProperties {
|
1984
|
-
documentUrlPatterns?: string[] | undefined;
|
1985
|
-
checked?: boolean | undefined;
|
1986
|
-
title?: string | undefined;
|
1987
|
-
contexts?: ContextType[] | undefined;
|
1988
|
-
/** Optional. @since Chrome 20 */
|
1989
|
-
enabled?: boolean | undefined;
|
1990
|
-
targetUrlPatterns?: string[] | undefined;
|
1991
|
-
onclick?: Function | undefined;
|
1992
|
-
/** Optional. Note: You cannot change an item to be a child of one of its own descendants. */
|
1993
|
-
parentId?: number | string;
|
1994
|
-
type?: ContextItemType | undefined;
|
1995
|
-
/**
|
1996
|
-
* Optional.
|
1997
|
-
* @since Chrome 62
|
1998
|
-
* Whether the item is visible in the menu.
|
1999
|
-
*/
|
2000
|
-
visible?: boolean | undefined;
|
2001
|
-
}
|
1983
|
+
export interface UpdateProperties extends Omit<CreateProperties, "id"> {}
|
2002
1984
|
|
2003
1985
|
export interface MenuClickedEvent
|
2004
1986
|
extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void>
|
@@ -2010,30 +1992,48 @@ declare namespace chrome {
|
|
2010
1992
|
*/
|
2011
1993
|
export var ACTION_MENU_TOP_LEVEL_LIMIT: number;
|
2012
1994
|
|
1995
|
+
/**
|
1996
|
+
* Removes all context menu items added by this extension.
|
1997
|
+
* @since Chrome 123
|
1998
|
+
*/
|
1999
|
+
export function removeAll(): Promise<void>;
|
2013
2000
|
/**
|
2014
2001
|
* Removes all context menu items added by this extension.
|
2015
2002
|
* @param callback Called when removal is complete.
|
2016
2003
|
*/
|
2017
|
-
export function removeAll(callback
|
2004
|
+
export function removeAll(callback: () => void): void;
|
2018
2005
|
/**
|
2019
2006
|
* Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
|
2020
2007
|
* @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
|
2021
2008
|
* @return The ID of the newly created item.
|
2022
2009
|
*/
|
2023
2010
|
export function create(createProperties: CreateProperties, callback?: () => void): number | string;
|
2011
|
+
/**
|
2012
|
+
* Updates a previously created context menu item.
|
2013
|
+
* @param id The ID of the item to update.
|
2014
|
+
* @param updateProperties The properties to update. Accepts the same values as the create function.
|
2015
|
+
* @since Chrome 123
|
2016
|
+
*/
|
2017
|
+
export function update(id: string | number, updateProperties: UpdateProperties): Promise<void>;
|
2024
2018
|
/**
|
2025
2019
|
* Updates a previously created context menu item.
|
2026
2020
|
* @param id The ID of the item to update.
|
2027
2021
|
* @param updateProperties The properties to update. Accepts the same values as the create function.
|
2028
2022
|
* @param callback Called when the context menu has been updated.
|
2029
2023
|
*/
|
2030
|
-
export function update(id: string | number, updateProperties: UpdateProperties, callback
|
2024
|
+
export function update(id: string | number, updateProperties: UpdateProperties, callback: () => void): void;
|
2025
|
+
/**
|
2026
|
+
* Removes a context menu item.
|
2027
|
+
* @param menuItemId The ID of the context menu item to remove.
|
2028
|
+
* @since Chrome 123
|
2029
|
+
*/
|
2030
|
+
export function remove(menuItemId: string | number): Promise<void>;
|
2031
2031
|
/**
|
2032
2032
|
* Removes a context menu item.
|
2033
2033
|
* @param menuItemId The ID of the context menu item to remove.
|
2034
2034
|
* @param callback Called when the context menu has been removed.
|
2035
2035
|
*/
|
2036
|
-
export function remove(menuItemId: string | number, callback
|
2036
|
+
export function remove(menuItemId: string | number, callback: () => void): void;
|
2037
2037
|
|
2038
2038
|
/**
|
2039
2039
|
* @since Chrome 21
|
@@ -3807,8 +3807,12 @@ declare namespace chrome {
|
|
3807
3807
|
originAndPathMatches?: string | undefined;
|
3808
3808
|
}
|
3809
3809
|
|
3810
|
-
export interface
|
3811
|
-
|
3810
|
+
export interface Event<T extends Function> {
|
3811
|
+
/**
|
3812
|
+
* Registers an event listener callback to an event.
|
3813
|
+
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
|
3814
|
+
*/
|
3815
|
+
addListener(callback: T): void;
|
3812
3816
|
/**
|
3813
3817
|
* Returns currently registered rules.
|
3814
3818
|
* @param callback Called with registered rules.
|
@@ -3866,18 +3870,6 @@ declare namespace chrome {
|
|
3866
3870
|
hasListeners(): boolean;
|
3867
3871
|
}
|
3868
3872
|
|
3869
|
-
/** An object which allows the addition and removal of listeners for a Chrome event. */
|
3870
|
-
interface Event<T extends Function> extends BaseEvent<T> {
|
3871
|
-
/**
|
3872
|
-
* Registers an event listener callback to an event.
|
3873
|
-
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
|
3874
|
-
*/
|
3875
|
-
addListener(callback: T): void;
|
3876
|
-
}
|
3877
|
-
export interface EventWithRequiredFilterInAddListener<T extends Function> extends BaseEvent<T> {
|
3878
|
-
addListener(callback: T, filter: webRequest.RequestFilter): void;
|
3879
|
-
}
|
3880
|
-
|
3881
3873
|
/** Description of a declarative rule for handling events. */
|
3882
3874
|
export interface Rule {
|
3883
3875
|
/** Optional. Optional priority of this rule. Defaults to 100. */
|
@@ -12036,6 +12028,12 @@ declare namespace chrome {
|
|
12036
12028
|
* @since Chrome 17
|
12037
12029
|
*/
|
12038
12030
|
export namespace webRequest {
|
12031
|
+
interface WebRequestEvent<T extends Function, U extends string[]>
|
12032
|
+
extends Omit<chrome.events.Event<T>, "addListener">
|
12033
|
+
{
|
12034
|
+
addListener(callback: T, filter: RequestFilter, extraInfoSpec?: U): void;
|
12035
|
+
}
|
12036
|
+
|
12039
12037
|
/** How the requested resource will be used. */
|
12040
12038
|
export type ResourceType =
|
12041
12039
|
| "main_frame"
|
@@ -12234,82 +12232,45 @@ declare namespace chrome {
|
|
12234
12232
|
error: string;
|
12235
12233
|
}
|
12236
12234
|
|
12237
|
-
export
|
12238
|
-
|
12239
|
-
|
12240
|
-
|
12241
|
-
|
12242
|
-
{
|
12243
|
-
addListener(
|
12244
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12245
|
-
callback: (details: WebRequestBodyDetails) => BlockingResponse | void,
|
12246
|
-
filter: RequestFilter,
|
12247
|
-
opt_extraInfoSpec?: string[],
|
12248
|
-
): void;
|
12249
|
-
}
|
12235
|
+
export type WebRequestBodyEvent = WebRequestEvent<
|
12236
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12237
|
+
(details: WebRequestBodyDetails) => BlockingResponse | void,
|
12238
|
+
string[]
|
12239
|
+
>;
|
12250
12240
|
|
12251
|
-
export
|
12252
|
-
|
12253
|
-
|
12254
|
-
|
12255
|
-
|
12256
|
-
{
|
12257
|
-
addListener(
|
12258
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12259
|
-
callback: (details: WebRequestHeadersDetails) => BlockingResponse | void,
|
12260
|
-
filter: RequestFilter,
|
12261
|
-
opt_extraInfoSpec?: string[],
|
12262
|
-
): void;
|
12263
|
-
}
|
12241
|
+
export type WebRequestHeadersSynchronousEvent = WebRequestEvent<
|
12242
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12243
|
+
(details: WebRequestHeadersDetails) => BlockingResponse | void,
|
12244
|
+
string[]
|
12245
|
+
>;
|
12264
12246
|
|
12265
|
-
export
|
12266
|
-
|
12267
|
-
|
12268
|
-
|
12269
|
-
callback: (details: WebRequestHeadersDetails) => void,
|
12270
|
-
filter: RequestFilter,
|
12271
|
-
opt_extraInfoSpec?: string[],
|
12272
|
-
): void;
|
12273
|
-
}
|
12247
|
+
export type WebRequestHeadersEvent = WebRequestEvent<
|
12248
|
+
(details: WebRequestHeadersDetails) => void,
|
12249
|
+
string[]
|
12250
|
+
>;
|
12274
12251
|
|
12275
|
-
export
|
12276
|
-
|
12277
|
-
|
12278
|
-
|
12279
|
-
}
|
12252
|
+
export type _WebResponseHeadersEvent<T extends WebResponseHeadersDetails> = WebRequestEvent<
|
12253
|
+
(details: T) => void,
|
12254
|
+
string[]
|
12255
|
+
>;
|
12280
12256
|
|
12281
|
-
export
|
12282
|
-
|
12283
|
-
|
12284
|
-
|
12285
|
-
|
12286
|
-
{
|
12287
|
-
addListener(
|
12288
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12289
|
-
callback: (details: WebResponseHeadersDetails) => BlockingResponse | void,
|
12290
|
-
filter: RequestFilter,
|
12291
|
-
opt_extraInfoSpec?: string[],
|
12292
|
-
): void;
|
12293
|
-
}
|
12257
|
+
export type WebResponseHeadersEvent = WebRequestEvent<
|
12258
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
12259
|
+
(details: WebResponseHeadersDetails) => BlockingResponse | void,
|
12260
|
+
string[]
|
12261
|
+
>;
|
12294
12262
|
|
12295
|
-
export
|
12263
|
+
export type WebResponseCacheEvent = _WebResponseHeadersEvent<WebResponseCacheDetails>;
|
12296
12264
|
|
12297
|
-
export
|
12265
|
+
export type WebRedirectionResponseEvent = _WebResponseHeadersEvent<WebRedirectionResponseDetails>;
|
12298
12266
|
|
12299
|
-
export
|
12300
|
-
|
12301
|
-
|
12302
|
-
|
12303
|
-
|
12304
|
-
|
12305
|
-
|
12306
|
-
details: WebAuthenticationChallengeDetails,
|
12307
|
-
callback?: (response: BlockingResponse) => void,
|
12308
|
-
) => void,
|
12309
|
-
filter: RequestFilter,
|
12310
|
-
opt_extraInfoSpec?: string[],
|
12311
|
-
): void;
|
12312
|
-
}
|
12267
|
+
export type WebAuthenticationChallengeEvent = WebRequestEvent<
|
12268
|
+
(
|
12269
|
+
details: WebAuthenticationChallengeDetails,
|
12270
|
+
callback?: (response: BlockingResponse) => void,
|
12271
|
+
) => void,
|
12272
|
+
string[]
|
12273
|
+
>;
|
12313
12274
|
|
12314
12275
|
export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> {}
|
12315
12276
|
|
@@ -12319,17 +12280,25 @@ declare namespace chrome {
|
|
12319
12280
|
*/
|
12320
12281
|
export var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number;
|
12321
12282
|
|
12322
|
-
/**
|
12323
|
-
|
12283
|
+
/**
|
12284
|
+
* Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often.
|
12285
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 116.
|
12286
|
+
*/
|
12287
|
+
export function handlerBehaviorChanged(): Promise<void>;
|
12288
|
+
export function handlerBehaviorChanged(callback: Function): void;
|
12324
12289
|
|
12325
12290
|
/** Fired when a request is about to occur. */
|
12326
|
-
export
|
12291
|
+
export const onBeforeRequest: WebRequestBodyEvent;
|
12292
|
+
|
12327
12293
|
/** Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. */
|
12328
|
-
export
|
12294
|
+
export const onBeforeSendHeaders: WebRequestHeadersSynchronousEvent;
|
12295
|
+
|
12329
12296
|
/** Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired). */
|
12330
|
-
export
|
12297
|
+
export const onSendHeaders: WebRequestHeadersEvent;
|
12298
|
+
|
12331
12299
|
/** Fired when HTTP response headers of a request have been received. */
|
12332
|
-
export
|
12300
|
+
export const onHeadersReceived: WebResponseHeadersEvent;
|
12301
|
+
|
12333
12302
|
/**
|
12334
12303
|
* Fired when an authentication failure is received.
|
12335
12304
|
* The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge.
|
@@ -12338,15 +12307,19 @@ declare namespace chrome {
|
|
12338
12307
|
*
|
12339
12308
|
* Requires the `webRequestAuthProvider` permission.
|
12340
12309
|
*/
|
12341
|
-
export
|
12310
|
+
export const onAuthRequired: WebAuthenticationChallengeEvent;
|
12311
|
+
|
12342
12312
|
/** Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. */
|
12343
|
-
export
|
12313
|
+
export const onResponseStarted: WebResponseCacheEvent;
|
12314
|
+
|
12344
12315
|
/** Fired when a server-initiated redirect is about to occur. */
|
12345
|
-
export
|
12316
|
+
export const onBeforeRedirect: WebRedirectionResponseEvent;
|
12317
|
+
|
12346
12318
|
/** Fired when a request is completed. */
|
12347
|
-
export
|
12319
|
+
export const onCompleted: WebResponseCacheEvent;
|
12320
|
+
|
12348
12321
|
/** Fired when an error occurs. */
|
12349
|
-
export
|
12322
|
+
export const onErrorOccurred: WebResponseErrorEvent;
|
12350
12323
|
}
|
12351
12324
|
|
12352
12325
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.293",
|
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": "3562b0db015921b752bed042f4f84e49c863b177ba1695d426f93a479b4c3f62",
|
98
98
|
"typeScriptVersion": "5.0"
|
99
99
|
}
|