@types/chrome 0.0.219 → 0.0.221

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.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +82 -25
  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: Thu, 02 Mar 2023 23:02:41 GMT
11
+ * Last updated: Fri, 10 Mar 2023 11:02:34 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;
@@ -3562,17 +3562,17 @@ declare namespace chrome.fileSystemProvider {
3562
3562
  }
3563
3563
 
3564
3564
  export interface EntryMetadata {
3565
- /** True if it is a directory. */
3566
- isDirectory: boolean;
3567
- /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */
3568
- name: string;
3569
- /** File size in bytes. */
3570
- size: number;
3571
- /** The last modified time of this entry. */
3572
- modificationTime: Date;
3573
- /** Optional. Mime type for the entry. */
3565
+ /** True if it is a directory. Must be provided if requested in `options`. */
3566
+ isDirectory?: boolean;
3567
+ /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. Must be provided if requested in `options`. */
3568
+ name?: string;
3569
+ /** File size in bytes. Must be provided if requested in `options`. */
3570
+ size?: number;
3571
+ /** The last modified time of this entry. Must be provided if requested in `options`. */
3572
+ modificationTime?: Date;
3573
+ /** Optional. Mime type for the entry. Always optional, but should provided if requested in `options`. */
3574
3574
  mimeType?: string | undefined;
3575
- /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */
3575
+ /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */
3576
3576
  thumbnail?: string | undefined;
3577
3577
  }
3578
3578
 
@@ -3612,8 +3612,8 @@ declare namespace chrome.fileSystemProvider {
3612
3612
  fileSystemId: string;
3613
3613
  /** The unique identifier of this request. */
3614
3614
  requestId: number;
3615
- /** The path of the entry to return the list of actions for. */
3616
- entryPath: string;
3615
+ /** List of paths of entries for the list of actions. */
3616
+ entryPaths: string[];
3617
3617
  }
3618
3618
 
3619
3619
  /** @since Since Chrome 45. Warning: this is the current Beta channel. */
@@ -3630,8 +3630,8 @@ declare namespace chrome.fileSystemProvider {
3630
3630
  fileSystemId: string;
3631
3631
  /** The unique identifier of this request. */
3632
3632
  requestId: number;
3633
- /** The path of the entry to be used for the action. */
3634
- entryPath: string;
3633
+ /** The set of paths of the entries to be used for the action. */
3634
+ entryPaths: string[];
3635
3635
  /** The identifier of the action to be executed. */
3636
3636
  actionId: string;
3637
3637
  }
@@ -3699,11 +3699,33 @@ declare namespace chrome.fileSystemProvider {
3699
3699
  export interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions {
3700
3700
  /** Set to true if the thumbnail is requested. */
3701
3701
  thumbnail: boolean;
3702
+ /** Set to true if is_directory value is requested. */
3703
+ isDirectory: boolean;
3704
+ /** Set to true if name value is requested. */
3705
+ name: boolean;
3706
+ /** Set to true if size value is requested. */
3707
+ size: boolean;
3708
+ /** Set to true if modificationTime value is requested. */
3709
+ modificationTime: boolean;
3710
+ /** Set to true if mimeType value is requested. */
3711
+ mimeType: boolean;
3702
3712
  }
3703
3713
 
3704
3714
  export interface DirectoryPathRequestedEventOptions extends RequestedEventOptions {
3705
3715
  /** The path of the directory which is to be operated on. */
3706
3716
  directoryPath: string;
3717
+ /** Set to true if is_directory value is requested. */
3718
+ isDirectory: boolean;
3719
+ /** Set to true if name value is requested. */
3720
+ name: boolean;
3721
+ /** Set to true if size value is requested. */
3722
+ size: boolean;
3723
+ /** Set to true if modificationTime value is requested. */
3724
+ modificationTime: boolean;
3725
+ /** Set to true if mimeType value is requested. */
3726
+ mimeType: boolean;
3727
+ /** Set to true if the thumbnail is requested. */
3728
+ thumbnail: boolean;
3707
3729
  }
3708
3730
 
3709
3731
  export interface FilePathRequestedEventOptions extends RequestedEventOptions {
@@ -3878,6 +3900,24 @@ declare namespace chrome.fileSystemProvider {
3878
3900
  export interface OptionlessRequestedEvent
3879
3901
  extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { }
3880
3902
 
3903
+ export interface GetActionsRequested
3904
+ extends chrome.events.Event<
3905
+ (
3906
+ options: GetActionsRequestedOptions,
3907
+ successCallback: (actions: Action[]) => void,
3908
+ errorCallback: (error: string) => void,
3909
+ ) => void
3910
+ > {}
3911
+
3912
+ export interface ExecuteActionRequested
3913
+ extends chrome.events.Event<
3914
+ (
3915
+ options: ExecuteActionRequestedOptions,
3916
+ successCallback: () => void,
3917
+ errorCallback: (error: string) => void,
3918
+ ) => void
3919
+ > {}
3920
+
3881
3921
  /**
3882
3922
  * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
3883
3923
  * Depending on the type of the file system being mounted, the source option must be set appropriately.
@@ -3961,6 +4001,23 @@ declare namespace chrome.fileSystemProvider {
3961
4001
  * @since Since Chrome 45. Warning: this is the current Beta channel.
3962
4002
  */
3963
4003
  export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent;
4004
+
4005
+ /**
4006
+ * Raised when a list of actions for a set of files or directories at
4007
+ * `entryPaths` is requested. All of the returned actions must
4008
+ * be applicable to each entry. If there are no such actions, an empty array
4009
+ * should be returned. The actions must be returned with the
4010
+ * `successCallback` call. In case of an error,
4011
+ * `errorCallback` must be called.
4012
+ */
4013
+ export var onGetActionsRequested: GetActionsRequested;
4014
+
4015
+ /**
4016
+ * Raised when executing an action for a set of files or directories is
4017
+ * requested. After the action is completed, `successCallback`
4018
+ * must be called. On error, `errorCallback` must be called.
4019
+ */
4020
+ export var onExecuteActionRequested: ExecuteActionRequested;
3964
4021
  }
3965
4022
 
3966
4023
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.219",
3
+ "version": "0.0.221",
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": "a1321da46e66464a3e59cf8b3dcfc46964a2e33742550c2a39eb940757545dd2",
96
+ "typesPublisherContentHash": "aeb2f3acda4d541a79645e8cdf449d06b6bdedd8a5b8c75cf1b56adadb6e64e8",
97
97
  "typeScriptVersion": "4.2"
98
98
  }