@types/chrome 0.0.182 → 0.0.185

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +31 -23
  3. 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 08:01:41 GMT
11
+ * Last updated: Fri, 13 May 2022 15:31:45 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
- /** An object which allows the addition and removal of listeners for a Chrome event. */
3425
- export interface Event<T extends Function> {
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. */
@@ -9923,7 +9930,7 @@ declare namespace chrome.tabs {
9923
9930
  /** An ID that represents the absence of a group. */
9924
9931
  export var TAB_GROUP_ID_NONE: -1;
9925
9932
 
9926
- export type ColorEnum = 'grey' | 'blue' | 'red' | 'yellow' | 'green' | 'pink' | 'purple' | 'cyan';
9933
+ export type ColorEnum = 'grey' | 'blue' | 'red' | 'yellow' | 'green' | 'pink' | 'purple' | 'cyan' | 'orange';
9927
9934
 
9928
9935
  export interface TabGroup {
9929
9936
  /** Whether the group is collapsed. A collapsed group is one whose tabs are hidden. */
@@ -10831,41 +10838,42 @@ declare namespace chrome.webRequest {
10831
10838
  }
10832
10839
 
10833
10840
  export interface WebRequestBodyEvent
10834
- extends chrome.events.Event<(details: WebRequestBodyDetails) => BlockingResponse | void> {
10841
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestBodyDetails) => BlockingResponse | void> {
10835
10842
  addListener(
10836
10843
  callback: (details: WebRequestBodyDetails) => BlockingResponse | void,
10837
- filter?: RequestFilter,
10844
+ filter: RequestFilter,
10838
10845
  opt_extraInfoSpec?: string[],
10839
10846
  ): void;
10840
10847
  }
10841
10848
 
10842
10849
  export interface WebRequestHeadersSynchronousEvent
10843
- extends chrome.events.Event<(details: WebRequestHeadersDetails) => BlockingResponse | void> {
10850
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestHeadersDetails) => BlockingResponse | void> {
10844
10851
  addListener(
10845
10852
  callback: (details: WebRequestHeadersDetails) => BlockingResponse | void,
10846
- filter?: RequestFilter,
10853
+ filter: RequestFilter,
10847
10854
  opt_extraInfoSpec?: string[],
10848
10855
  ): void;
10849
10856
  }
10850
10857
 
10851
- export interface WebRequestHeadersEvent extends chrome.events.Event<(details: WebRequestHeadersDetails) => void> {
10858
+ export interface WebRequestHeadersEvent
10859
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebRequestHeadersDetails) => void> {
10852
10860
  addListener(
10853
10861
  callback: (details: WebRequestHeadersDetails) => void,
10854
- filter?: RequestFilter,
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.Event<(details: T) => void> {
10861
- addListener(callback: (details: T) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
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.Event<(details: WebResponseHeadersDetails) => BlockingResponse | void> {
10873
+ extends chrome.events.EventWithRequiredFilterInAddListener<(details: WebResponseHeadersDetails) => BlockingResponse | void> {
10866
10874
  addListener(
10867
10875
  callback: (details: WebResponseHeadersDetails) => BlockingResponse | void,
10868
- filter?: RequestFilter,
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.Event<
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?: RequestFilter,
10894
+ filter: RequestFilter,
10887
10895
  opt_extraInfoSpec?: string[],
10888
10896
  ): void;
10889
10897
  }
@@ -11506,7 +11514,7 @@ declare namespace chrome.declarativeNetRequest {
11506
11514
  * Defaults to 1.
11507
11515
  * When specified, should be >= 1.
11508
11516
  */
11509
- priority: number;
11517
+ priority?: number | undefined;
11510
11518
  }
11511
11519
 
11512
11520
  export interface RuleAction {
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.182",
3
+ "version": "0.0.185",
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": "df06856df13b1135f49d2b2d539fb6108ab607f3c1da98be705f0fd3f6ac5538",
101
+ "typesPublisherContentHash": "158faaea34da781ab011edd94bbb860ee76dd0d34ee831755d9ade645556457c",
102
102
  "typeScriptVersion": "3.9"
103
103
  }