@types/chrome 0.0.292 → 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 +67 -94
- 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: Thu, 09 Jan 2025
|
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
@@ -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
|
}
|