@types/chrome 0.0.218 → 0.0.220

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 +21 -32
  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, 28 Feb 2023 02:32:36 GMT
11
+ * Last updated: Mon, 06 Mar 2023 23:32:44 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
@@ -774,12 +774,12 @@ declare namespace chrome.browserAction {
774
774
  /** The string the browser action should display when moused over. */
775
775
  title: string;
776
776
  /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
777
- tabId?: number | undefined;
777
+ tabId?: number | null;
778
778
  }
779
779
 
780
780
  export interface TabDetails {
781
781
  /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */
782
- tabId?: number | undefined;
782
+ tabId?: number | null;
783
783
  }
784
784
 
785
785
  export interface TabIconDetails {
@@ -793,7 +793,7 @@ declare namespace chrome.browserAction {
793
793
 
794
794
  export interface PopupDetails {
795
795
  /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
796
- tabId?: number | undefined;
796
+ tabId?: number | null;
797
797
  /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
798
798
  popup: string;
799
799
  }
@@ -806,15 +806,15 @@ declare namespace chrome.browserAction {
806
806
  * @param tabId The id of the tab for which you want to modify the browser action.
807
807
  * @return The `enable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
808
808
  */
809
- export function enable(tabId?: number): Promise<void>;
809
+ export function enable(tabId?: number | null): Promise<void>;
810
810
  /**
811
811
  * Since Chrome 22.
812
812
  * Enables the browser action for a tab. By default, browser actions are enabled.
813
813
  * @param tabId The id of the tab for which you want to modify the browser action.
814
814
  * @param callback Supported since Chrome 67
815
815
  */
816
- export function enable(callback: () => void): void;
817
- export function enable(tabId: number, callback: () => void): void;
816
+ export function enable(callback?: () => void): void;
817
+ export function enable(tabId: number | null | undefined, callback?: () => void): void;
818
818
  /**
819
819
  * Sets the background color for the badge.
820
820
  * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -824,7 +824,7 @@ declare namespace chrome.browserAction {
824
824
  * Sets the background color for the badge.
825
825
  * @param callback Supported since Chrome 67
826
826
  */
827
- export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback: () => void): void;
827
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
828
828
  /**
829
829
  * Sets the badge text for the browser action. The badge is displayed on top of the icon.
830
830
  * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -866,14 +866,14 @@ declare namespace chrome.browserAction {
866
866
  * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
867
867
  * @param callback Supported since Chrome 67
868
868
  */
869
- export function setPopup(details: PopupDetails, callback: () => void): void;
869
+ export function setPopup(details: PopupDetails, callback?: () => void): void;
870
870
  /**
871
871
  * Since Chrome 22.
872
872
  * Disables the browser action for a tab.
873
873
  * @param tabId The id of the tab for which you want to modify the browser action.
874
874
  * @return The `disable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
875
875
  */
876
- export function disable(tabId?: number): Promise<void>;
876
+ export function disable(tabId?: number | null): Promise<void>;
877
877
  /**
878
878
  * Since Chrome 22.
879
879
  * Disables the browser action for a tab.
@@ -881,7 +881,7 @@ declare namespace chrome.browserAction {
881
881
  * @param callback Supported since Chrome 67
882
882
  */
883
883
  export function disable(callback: () => void): void;
884
- export function disable(tabId: number, callback: () => void): void;
884
+ export function disable(tabId?: number | null, callback?: () => void): void;
885
885
  /**
886
886
  * Since Chrome 19.
887
887
  * Gets the title of the browser action.
@@ -918,7 +918,7 @@ declare namespace chrome.browserAction {
918
918
  /**
919
919
  * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
920
920
  */
921
- export function setIcon(details: TabIconDetails, callback: Function): void;
921
+ export function setIcon(details: TabIconDetails, callback?: Function): void;
922
922
 
923
923
  /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */
924
924
  export var onClicked: BrowserClickedEvent;
@@ -11513,7 +11513,7 @@ declare namespace chrome.declarativeNetRequest {
11513
11513
  type: RuleActionType;
11514
11514
  }
11515
11515
 
11516
- export type RuleCondition = {
11516
+ export interface RuleCondition {
11517
11517
  /**
11518
11518
  * Specifies whether the network request is first-party or third-party to the domain from which it originated.
11519
11519
  * If omitted, all requests are accepted.
@@ -11679,26 +11679,15 @@ declare namespace chrome.declarativeNetRequest {
11679
11679
  * For example, when the request url is http://abc.рф?q=ф, the urlFilter will be matched against the url http://abc.xn--p1ai/?q=%D1%84.
11680
11680
  */
11681
11681
  urlFilter?: string | undefined;
11682
- } & (
11683
- | {
11684
- /**
11685
- * List of resource types which the rule won't match.
11686
- * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
11687
- * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
11688
- * If neither of them is specified, all resource types except "main_frame" are blocked.
11689
- */
11690
- excludedResourceTypes?: ResourceType[] | undefined;
11691
- }
11692
- | {
11693
- /**
11694
- * List of resource types which the rule can match.
11695
- * An empty list is not allowed.
11696
- *
11697
- * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
11698
- */
11699
- resourceTypes?: ResourceType[] | undefined;
11700
- }
11701
- );
11682
+
11683
+ /**
11684
+ * List of resource types which the rule can match.
11685
+ * An empty list is not allowed.
11686
+ *
11687
+ * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
11688
+ */
11689
+ resourceTypes?: ResourceType[] | undefined;
11690
+ }
11702
11691
 
11703
11692
  export interface MatchedRule {
11704
11693
  /** A matching rule's ID. */
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.218",
3
+ "version": "0.0.220",
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",
@@ -93,6 +93,6 @@
93
93
  "@types/filesystem": "*",
94
94
  "@types/har-format": "*"
95
95
  },
96
- "typesPublisherContentHash": "7f719c6796d1282e638038ec4cb6f25e315fa60c5ce8dc0861fc11f38c73ed21",
96
+ "typesPublisherContentHash": "2e46caad2c34ed12445ec7f1aced10dc244b91ed4fe8eefddd26ec31a4d4e87b",
97
97
  "typeScriptVersion": "4.2"
98
98
  }