@types/chrome 0.0.182 → 0.0.183
Sign up to get free protection for your applications and to get access to all the features.
- chrome/README.md +1 -1
- chrome/index.d.ts +29 -21
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Chrome extension development (http://
|
|
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, 26 Apr 2022
|
11
|
+
* Last updated: Tue, 26 Apr 2022 11:01:42 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
* Global values: `chrome`
|
14
14
|
|
chrome/index.d.ts
CHANGED
@@ -3421,15 +3421,8 @@ declare namespace chrome.events {
|
|
3421
3421
|
originAndPathMatches?: string | undefined;
|
3422
3422
|
}
|
3423
3423
|
|
3424
|
-
|
3425
|
-
|
3426
|
-
/**
|
3427
|
-
* Registers an event listener callback to an event.
|
3428
|
-
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
|
3429
|
-
* The callback parameter should be a function that looks like this:
|
3430
|
-
* function() {...};
|
3431
|
-
*/
|
3432
|
-
addListener(callback: T): void;
|
3424
|
+
export interface BaseEvent<T extends Function> {
|
3425
|
+
addListener(callback: T, filter?: webRequest.RequestFilter): void;
|
3433
3426
|
/**
|
3434
3427
|
* Returns currently registered rules.
|
3435
3428
|
* @param callback Called with registered rules.
|
@@ -3485,6 +3478,20 @@ declare namespace chrome.events {
|
|
3485
3478
|
hasListeners(): boolean;
|
3486
3479
|
}
|
3487
3480
|
|
3481
|
+
/** An object which allows the addition and removal of listeners for a Chrome event. */
|
3482
|
+
interface Event<T extends Function> extends BaseEvent<T> {
|
3483
|
+
/**
|
3484
|
+
* Registers an event listener callback to an event.
|
3485
|
+
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
|
3486
|
+
* The callback parameter should be a function that looks like this:
|
3487
|
+
* function() {...};
|
3488
|
+
*/
|
3489
|
+
addListener(callback: T): void;
|
3490
|
+
}
|
3491
|
+
export interface EventWithRequiredFilterInAddListener<T extends Function> extends BaseEvent<T> {
|
3492
|
+
addListener(callback: T, filter: webRequest.RequestFilter): void;
|
3493
|
+
}
|
3494
|
+
|
3488
3495
|
/** Description of a declarative rule for handling events. */
|
3489
3496
|
export interface Rule {
|
3490
3497
|
/** Optional. Optional priority of this rule. Defaults to 100. */
|
@@ -10831,41 +10838,42 @@ declare namespace chrome.webRequest {
|
|
10831
10838
|
}
|
10832
10839
|
|
10833
10840
|
export interface WebRequestBodyEvent
|
10834
|
-
extends chrome.events.
|
10841
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestBodyDetails) => BlockingResponse | void> {
|
10835
10842
|
addListener(
|
10836
10843
|
callback: (details: WebRequestBodyDetails) => BlockingResponse | void,
|
10837
|
-
filter
|
10844
|
+
filter: RequestFilter,
|
10838
10845
|
opt_extraInfoSpec?: string[],
|
10839
10846
|
): void;
|
10840
10847
|
}
|
10841
10848
|
|
10842
10849
|
export interface WebRequestHeadersSynchronousEvent
|
10843
|
-
extends chrome.events.
|
10850
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestHeadersDetails) => BlockingResponse | void> {
|
10844
10851
|
addListener(
|
10845
10852
|
callback: (details: WebRequestHeadersDetails) => BlockingResponse | void,
|
10846
|
-
filter
|
10853
|
+
filter: RequestFilter,
|
10847
10854
|
opt_extraInfoSpec?: string[],
|
10848
10855
|
): void;
|
10849
10856
|
}
|
10850
10857
|
|
10851
|
-
export interface WebRequestHeadersEvent
|
10858
|
+
export interface WebRequestHeadersEvent
|
10859
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestHeadersDetails) => void> {
|
10852
10860
|
addListener(
|
10853
10861
|
callback: (details: WebRequestHeadersDetails) => void,
|
10854
|
-
filter
|
10862
|
+
filter: RequestFilter,
|
10855
10863
|
opt_extraInfoSpec?: string[],
|
10856
10864
|
): void;
|
10857
10865
|
}
|
10858
10866
|
|
10859
10867
|
export interface _WebResponseHeadersEvent<T extends WebResponseHeadersDetails>
|
10860
|
-
extends chrome.events.
|
10861
|
-
addListener(callback: (details: T) => void, filter
|
10868
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<(details: T) => void> {
|
10869
|
+
addListener(callback: (details: T) => void, filter: RequestFilter, opt_extraInfoSpec?: string[]): void;
|
10862
10870
|
}
|
10863
10871
|
|
10864
10872
|
export interface WebResponseHeadersEvent
|
10865
|
-
extends chrome.events.
|
10873
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebResponseHeadersDetails) => BlockingResponse | void> {
|
10866
10874
|
addListener(
|
10867
10875
|
callback: (details: WebResponseHeadersDetails) => BlockingResponse | void,
|
10868
|
-
filter
|
10876
|
+
filter: RequestFilter,
|
10869
10877
|
opt_extraInfoSpec?: string[],
|
10870
10878
|
): void;
|
10871
10879
|
}
|
@@ -10875,7 +10883,7 @@ declare namespace chrome.webRequest {
|
|
10875
10883
|
export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> { }
|
10876
10884
|
|
10877
10885
|
export interface WebAuthenticationChallengeEvent
|
10878
|
-
extends chrome.events.
|
10886
|
+
extends chrome.events.EventWithRequiredFilterInAddListener<
|
10879
10887
|
(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void
|
10880
10888
|
> {
|
10881
10889
|
addListener(
|
@@ -10883,7 +10891,7 @@ declare namespace chrome.webRequest {
|
|
10883
10891
|
details: WebAuthenticationChallengeDetails,
|
10884
10892
|
callback?: (response: BlockingResponse) => void,
|
10885
10893
|
) => void,
|
10886
|
-
filter
|
10894
|
+
filter: RequestFilter,
|
10887
10895
|
opt_extraInfoSpec?: string[],
|
10888
10896
|
): void;
|
10889
10897
|
}
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.183",
|
4
4
|
"description": "TypeScript definitions for Chrome extension development",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -98,6 +98,6 @@
|
|
98
98
|
"@types/filesystem": "*",
|
99
99
|
"@types/har-format": "*"
|
100
100
|
},
|
101
|
-
"typesPublisherContentHash": "
|
101
|
+
"typesPublisherContentHash": "2f9c6b07ea8c49d6a58620305e16d1ff0ca1fa1490a4af140b3f676e856b8fef",
|
102
102
|
"typeScriptVersion": "3.9"
|
103
103
|
}
|