@types/chrome 0.1.14 → 0.1.16

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 +182 -295
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 29 Sep 2025 19:32:00 GMT
11
+ * Last updated: Tue, 30 Sep 2025 21:32:35 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
@@ -6881,54 +6881,42 @@ declare namespace chrome {
6881
6881
  * Permissions: "management"
6882
6882
  */
6883
6883
  export namespace management {
6884
+ /**
6885
+ * A reason the item is disabled.
6886
+ * @since Chrome 44
6887
+ */
6888
+ export enum ExtensionDisabledReason {
6889
+ UNKNOWN = "unknown",
6890
+ PERMISSIONS_INCREASE = "permissions_increase",
6891
+ }
6892
+
6884
6893
  /** Information about an installed extension, app, or theme. */
6885
6894
  export interface ExtensionInfo {
6886
- /**
6887
- * Optional.
6888
- * A reason the item is disabled.
6889
- * @since Chrome 17
6890
- */
6891
- disabledReason?: string | undefined;
6892
- /** Optional. The launch url (only present for apps). */
6893
- appLaunchUrl?: string | undefined;
6894
- /**
6895
- * The description of this extension, app, or theme.
6896
- * @since Chrome 9
6897
- */
6895
+ /** A reason the item is disabled. */
6896
+ disabledReason?: `${ExtensionDisabledReason}`;
6897
+ /** The launch url (only present for apps). */
6898
+ appLaunchUrl?: string;
6899
+ /** The description of this extension, app, or theme. */
6898
6900
  description: string;
6899
- /**
6900
- * Returns a list of API based permissions.
6901
- * @since Chrome 9
6902
- */
6901
+ /** Returns a list of API based permissions. */
6903
6902
  permissions: string[];
6904
- /**
6905
- * Optional.
6906
- * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
6907
- */
6908
- icons?: IconInfo[] | undefined;
6909
- /**
6910
- * Returns a list of host based permissions.
6911
- * @since Chrome 9
6912
- */
6903
+ /** A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. */
6904
+ icons?: IconInfo[];
6905
+ /** Returns a list of host based permissions. */
6913
6906
  hostPermissions: string[];
6914
6907
  /** Whether it is currently enabled or disabled. */
6915
6908
  enabled: boolean;
6916
- /**
6917
- * Optional.
6918
- * The URL of the homepage of this extension, app, or theme.
6919
- * @since Chrome 11
6920
- */
6921
- homepageUrl?: string | undefined;
6922
- /**
6923
- * Whether this extension can be disabled or uninstalled by the user.
6924
- * @since Chrome 12
6925
- */
6909
+ /** The URL of the homepage of this extension, app, or theme. */
6910
+ homepageUrl?: string;
6911
+ /** Whether this extension can be disabled or uninstalled by the user. */
6926
6912
  mayDisable: boolean;
6927
6913
  /**
6928
- * How the extension was installed.
6929
- * @since Chrome 22
6914
+ * Whether this extension can be enabled by the user. This is only returned for extensions which are not enabled.
6915
+ * @since Chrome 62
6930
6916
  */
6931
- installType: string;
6917
+ mayEnable?: boolean;
6918
+ /** How the extension was installed. */
6919
+ installType: `${ExtensionInstallType}`;
6932
6920
  /** The version of this extension, app, or theme. */
6933
6921
  version: string;
6934
6922
  /**
@@ -6938,266 +6926,217 @@ declare namespace chrome {
6938
6926
  versionName?: string;
6939
6927
  /** The extension's unique identifier. */
6940
6928
  id: string;
6941
- /**
6942
- * Whether the extension, app, or theme declares that it supports offline.
6943
- * @since Chrome 15
6944
- */
6929
+ /** Whether the extension, app, or theme declares that it supports offline. */
6945
6930
  offlineEnabled: boolean;
6946
- /**
6947
- * Optional.
6948
- * The update URL of this extension, app, or theme.
6949
- * @since Chrome 16
6950
- */
6951
- updateUrl?: string | undefined;
6952
- /**
6953
- * The type of this extension, app, or theme.
6954
- * @since Chrome 23
6955
- */
6956
- type: string;
6931
+ /** The update URL of this extension, app, or theme. */
6932
+ updateUrl?: string;
6933
+ /** The type of this extension, app, or theme. */
6934
+ type: `${ExtensionType}`;
6957
6935
  /** The url for the item's options page, if it has one. */
6958
6936
  optionsUrl: string;
6959
6937
  /** The name of this extension, app, or theme. */
6960
6938
  name: string;
6961
- /**
6962
- * A short version of the name of this extension, app, or theme.
6963
- * @since Chrome 31
6964
- */
6939
+ /** A short version of the name of this extension, app, or theme. */
6965
6940
  shortName: string;
6966
6941
  /**
6967
6942
  * True if this is an app.
6968
- * @deprecated since Chrome 33. Please use management.ExtensionInfo.type.
6943
+ * @deprecated since Chrome 33. Please use {@link management.ExtensionInfo.type}.
6969
6944
  */
6970
6945
  isApp: boolean;
6971
- /**
6972
- * Optional.
6973
- * The app launch type (only present for apps).
6974
- * @since Chrome 37
6975
- */
6976
- launchType?: string | undefined;
6977
- /**
6978
- * Optional.
6979
- * The currently available launch types (only present for apps).
6980
- * @since Chrome 37
6981
- */
6982
- availableLaunchTypes?: string[] | undefined;
6946
+ /** The app launch type (only present for apps). */
6947
+ launchType?: `${LaunchType}`;
6948
+ /** The currently available launch types (only present for apps). */
6949
+ availableLaunchTypes?: `${LaunchType}`[];
6950
+ }
6951
+
6952
+ /**
6953
+ * How the extension was installed
6954
+ * @since Chrome 44
6955
+ */
6956
+ export enum ExtensionInstallType {
6957
+ /** The extension was installed because of an administrative policy. */
6958
+ ADMIN = "admin",
6959
+ /** The extension was loaded unpacked in developer mode. */
6960
+ DEVELOPMENT = "development",
6961
+ /** The extension was installed normally via a .crx file. */
6962
+ NORMAL = "normal",
6963
+ /** The extension was installed by other software on the machine. */
6964
+ SIDELOAD = "sideload",
6965
+ /** The extension was installed by other means. */
6966
+ OTHER = "other",
6967
+ }
6968
+
6969
+ /**
6970
+ * The type of this extension, app, or theme.
6971
+ * @since Chrome 44
6972
+ */
6973
+ export enum ExtensionType {
6974
+ EXTENSION = "extension",
6975
+ HOSTED_APP = "hosted_app",
6976
+ PACKAGE_APP = "package_app",
6977
+ LEGACY_PACKAGED_APP = "legacy_packaged_app",
6978
+ THEME = "theme",
6979
+ LOGIN_SCREEN_EXTENSION = "login_screen_extension",
6983
6980
  }
6984
6981
 
6985
6982
  /** Information about an icon belonging to an extension, app, or theme. */
6986
6983
  export interface IconInfo {
6987
- /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */
6984
+ /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append `?grayscale=true` to the URL. */
6988
6985
  url: string;
6989
6986
  /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */
6990
6987
  size: number;
6991
6988
  }
6992
6989
 
6990
+ /** These are all possible app launch types. */
6991
+ export enum LaunchType {
6992
+ OPEN_AS_REGULAR_TAB = "OPEN_AS_REGULAR_TAB",
6993
+ OPEN_AS_PINNED_TAB = "OPEN_AS_PINNED_TAB",
6994
+ OPEN_AS_WINDOW = "OPEN_AS_WINDOW",
6995
+ OPEN_FULL_SCREEN = "OPEN_FULL_SCREEN",
6996
+ }
6997
+
6998
+ /**
6999
+ * Options for how to handle the extension's uninstallation.
7000
+ * @since Chrome 88
7001
+ */
6993
7002
  export interface UninstallOptions {
6994
- /**
6995
- * Optional.
6996
- * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown.
6997
- */
7003
+ /** Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. */
6998
7004
  showConfirmDialog?: boolean | undefined;
6999
7005
  }
7000
7006
 
7001
- export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
7002
-
7003
- export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {}
7004
-
7005
- export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
7006
-
7007
- export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
7008
-
7009
7007
  /**
7010
- * Enables or disables an app or extension.
7011
- * @param id This should be the id from an item of management.ExtensionInfo.
7008
+ * Enables or disables an app or extension. In most cases this function must be called in the context of a user gesture (e.g. an onclick handler for a button), and may present the user with a native confirmation UI as a way of preventing abuse.
7009
+ *
7010
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7011
+ * @param id This should be the id from an item of {@link management.ExtensionInfo}.
7012
7012
  * @param enabled Whether this item should be enabled or disabled.
7013
- * @return The `setEnabled` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7014
7013
  */
7015
7014
  export function setEnabled(id: string, enabled: boolean): Promise<void>;
7016
- /**
7017
- * Enables or disables an app or extension.
7018
- * @param id This should be the id from an item of management.ExtensionInfo.
7019
- * @param enabled Whether this item should be enabled or disabled.
7020
- */
7021
7015
  export function setEnabled(id: string, enabled: boolean, callback: () => void): void;
7016
+
7022
7017
  /**
7023
7018
  * Returns a list of permission warnings for the given extension id.
7024
- * @since Chrome 15
7019
+ *
7020
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7025
7021
  * @param id The ID of an already installed extension.
7026
- * @return The `getPermissionWarningsById` method provides its result via callback or returned as a `Promise` (MV3 only).
7027
7022
  */
7028
7023
  export function getPermissionWarningsById(id: string): Promise<string[]>;
7029
- /**
7030
- * Returns a list of permission warnings for the given extension id.
7031
- * @since Chrome 15
7032
- * @param id The ID of an already installed extension.
7033
- */
7034
7024
  export function getPermissionWarningsById(id: string, callback: (permissionWarnings: string[]) => void): void;
7025
+
7035
7026
  /**
7036
7027
  * Returns information about the installed extension, app, or theme that has the given ID.
7037
- * @since Chrome 9
7038
- * @param id The ID from an item of management.ExtensionInfo.
7039
- * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
7028
+ *
7029
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7030
+ * @param id The ID from an item of {@link management.ExtensionInfo}.
7040
7031
  */
7041
7032
  export function get(id: string): Promise<ExtensionInfo>;
7042
- /**
7043
- * Returns information about the installed extension, app, or theme that has the given ID.
7044
- * @since Chrome 9
7045
- * @param id The ID from an item of management.ExtensionInfo.
7046
- */
7047
7033
  export function get(id: string, callback: (result: ExtensionInfo) => void): void;
7034
+
7048
7035
  /**
7049
7036
  * Returns a list of information about installed extensions and apps.
7050
- * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
7037
+ *
7038
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7051
7039
  */
7052
7040
  export function getAll(): Promise<ExtensionInfo[]>;
7053
- /**
7054
- * Returns a list of information about installed extensions and apps.
7055
- */
7056
7041
  export function getAll(callback: (result: ExtensionInfo[]) => void): void;
7042
+
7057
7043
  /**
7058
7044
  * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
7059
- * @since Chrome 15
7060
- * @param manifestStr Extension manifest JSON string.
7061
- * @return The `getPermissionWarningsByManifest` method provides its result via callback or returned as a `Promise` (MV3 only).
7062
- */
7063
- export function getPermissionWarningsByManifest(
7064
- manifestStr: string,
7065
- ): Promise<string[]>;
7066
- /**
7067
- * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
7068
- * @since Chrome 15
7045
+ *
7046
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7069
7047
  * @param manifestStr Extension manifest JSON string.
7070
7048
  */
7049
+ export function getPermissionWarningsByManifest(manifestStr: string): Promise<string[]>;
7071
7050
  export function getPermissionWarningsByManifest(
7072
7051
  manifestStr: string,
7073
- callback: (permissionwarnings: string[]) => void,
7052
+ callback: (permissionWarnings: string[]) => void,
7074
7053
  ): void;
7054
+
7075
7055
  /**
7076
7056
  * Launches an application.
7057
+ *
7058
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7077
7059
  * @param id The extension id of the application.
7078
- * @return The `launchApp` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7079
7060
  */
7080
7061
  export function launchApp(id: string): Promise<void>;
7081
- /**
7082
- * Launches an application.
7083
- * @param id The extension id of the application.
7084
- */
7085
7062
  export function launchApp(id: string, callback: () => void): void;
7063
+
7086
7064
  /**
7087
- * Uninstalls a currently installed app or extension.
7088
- * @since Chrome 21
7089
- * @param id This should be the id from an item of management.ExtensionInfo.
7090
- * @return The `uninstall` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7065
+ * Uninstalls a currently installed app or extension. Note: This function does not work in managed environments when the user is not allowed to uninstall the specified extension/app. If the uninstall fails (e.g. the user cancels the dialog) the promise will be rejected or the callback will be called with {@link runtime.lastError} set.
7066
+ *
7067
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7068
+ * @param id This should be the id from an item of {@link management.ExtensionInfo}.
7091
7069
  */
7092
7070
  export function uninstall(id: string, options?: UninstallOptions): Promise<void>;
7093
- /**
7094
- * Uninstalls a currently installed app or extension.
7095
- * @since Chrome 21
7096
- * @param id This should be the id from an item of management.ExtensionInfo.
7097
- */
7098
- export function uninstall(id: string, callback: () => void): void;
7099
- export function uninstall(id: string, options: UninstallOptions, callback: () => void): void;
7100
- /**
7101
- * Uninstalls a currently installed app or extension.
7102
- * @deprecated since Chrome 21. The options parameter was added to this function.
7103
- * @param id This should be the id from an item of management.ExtensionInfo.
7104
- * @return The `uninstall` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7105
- */
7106
- export function uninstall(id: string): Promise<void>;
7107
- /**
7108
- * Uninstalls a currently installed app or extension.
7109
- * @deprecated since Chrome 21. The options parameter was added to this function.
7110
- * @param id This should be the id from an item of management.ExtensionInfo.
7111
- */
7112
7071
  export function uninstall(id: string, callback: () => void): void;
7072
+ export function uninstall(id: string, options: UninstallOptions | undefined, callback: () => void): void;
7073
+
7113
7074
  /**
7114
7075
  * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
7115
- * @since Chrome 39
7116
- * @return The `getSelf` method provides its result via callback or returned as a `Promise` (MV3 only).
7076
+ *
7077
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7117
7078
  */
7118
7079
  export function getSelf(): Promise<ExtensionInfo>;
7119
- /**
7120
- * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
7121
- * @since Chrome 39
7122
- */
7123
7080
  export function getSelf(callback: (result: ExtensionInfo) => void): void;
7081
+
7124
7082
  /**
7125
- * Uninstalls the calling extension.
7126
- * Note: This function can be used without requesting the 'management' permission in the manifest.
7127
- * @since Chrome 26
7128
- * @return The `uninstallSelf` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7129
- */
7130
- export function uninstallSelf(options?: UninstallOptions): Promise<void>;
7131
- /**
7132
- * Uninstalls the calling extension.
7133
- * Note: This function can be used without requesting the 'management' permission in the manifest.
7134
- * @since Chrome 26
7135
- */
7136
- export function uninstallSelf(callback: () => void): void;
7137
- export function uninstallSelf(options: UninstallOptions, callback: () => void): void;
7138
- /**
7139
- * Uninstalls the calling extension.
7140
- * Note: This function can be used without requesting the 'management' permission in the manifest.
7141
- * @since Chrome 26
7142
- * @return The `uninstallSelf` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7083
+ * Launches the replacement_web_app specified in the manifest. Prompts the user to install if not already installed.
7084
+ *
7085
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7086
+ * @since Chrome 77
7143
7087
  */
7144
- export function uninstallSelf(): Promise<void>;
7088
+ export function installReplacementWebApp(): Promise<void>;
7089
+ export function installReplacementWebApp(callback: () => void): void;
7090
+
7145
7091
  /**
7146
- * Uninstalls the calling extension.
7147
- * Note: This function can be used without requesting the 'management' permission in the manifest.
7148
- * @since Chrome 26
7092
+ * Uninstalls the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest. This function does not work in managed environments when the user is not allowed to uninstall the specified extension/app.
7093
+ *
7094
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7149
7095
  */
7096
+ export function uninstallSelf(options?: UninstallOptions): Promise<void>;
7150
7097
  export function uninstallSelf(callback: () => void): void;
7098
+ export function uninstallSelf(options: UninstallOptions | undefined, callback: () => void): void;
7099
+
7151
7100
  /**
7152
7101
  * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
7153
- * @since Chrome 37
7154
- * @return The `createAppShortcut` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7102
+ *
7103
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7104
+ * @param id This should be the id from an app item of {@link management.ExtensionInfo}.
7155
7105
  */
7156
7106
  export function createAppShortcut(id: string): Promise<void>;
7157
- /**
7158
- * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
7159
- * @since Chrome 37
7160
- */
7161
7107
  export function createAppShortcut(id: string, callback: () => void): void;
7108
+
7162
7109
  /**
7163
7110
  * Set the launch type of an app.
7164
- * @since Chrome 37
7165
- * @param id This should be the id from an app item of management.ExtensionInfo.
7166
- * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
7167
- * @return The `setLaunchType` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
7168
- */
7169
- export function setLaunchType(id: string, launchType: string): Promise<void>;
7170
- /**
7171
- * Set the launch type of an app.
7172
- * @since Chrome 37
7173
- * @param id This should be the id from an app item of management.ExtensionInfo.
7174
- * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
7111
+ *
7112
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7113
+ * @param id This should be the id from an app item of {@link management.ExtensionInfo}.
7114
+ * @param launchType The target launch type. Always check and make sure this launch type is in {@link ExtensionInfo.availableLaunchTypes}, because the available launch types vary on different platforms and configurations.
7175
7115
  */
7176
- export function setLaunchType(id: string, launchType: string, callback: () => void): void;
7116
+ export function setLaunchType(id: string, launchType: `${LaunchType}`): Promise<void>;
7117
+ export function setLaunchType(id: string, launchType: `${LaunchType}`, callback: () => void): void;
7118
+
7177
7119
  /**
7178
7120
  * Generate an app for a URL. Returns the generated bookmark app.
7179
- * @since Chrome 37
7121
+ *
7122
+ * Can return its result via Promise in Manifest V3 or later since Chrome 88.
7180
7123
  * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
7181
7124
  * @param title The title of the generated app.
7182
- * @return The `generateAppForLink` method provides its result via callback or returned as a `Promise` (MV3 only).
7183
7125
  */
7184
7126
  export function generateAppForLink(url: string, title: string): Promise<ExtensionInfo>;
7185
- /**
7186
- * Generate an app for a URL. Returns the generated bookmark app.
7187
- * @since Chrome 37
7188
- * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
7189
- * @param title The title of the generated app.
7190
- */
7191
7127
  export function generateAppForLink(url: string, title: string, callback: (result: ExtensionInfo) => void): void;
7192
7128
 
7193
7129
  /** Fired when an app or extension has been disabled. */
7194
- export var onDisabled: ManagementDisabledEvent;
7130
+ export const onDisabled: events.Event<(info: ExtensionInfo) => void>;
7131
+
7195
7132
  /** Fired when an app or extension has been uninstalled. */
7196
- export var onUninstalled: ManagementUninstalledEvent;
7133
+ export const onUninstalled: events.Event<(id: string) => void>;
7134
+
7197
7135
  /** Fired when an app or extension has been installed. */
7198
- export var onInstalled: ManagementInstalledEvent;
7136
+ export const onInstalled: events.Event<(info: ExtensionInfo) => void>;
7137
+
7199
7138
  /** Fired when an app or extension has been enabled. */
7200
- export var onEnabled: ManagementEnabledEvent;
7139
+ export const onEnabled: events.Event<(info: ExtensionInfo) => void>;
7201
7140
  }
7202
7141
 
7203
7142
  ////////////////////
@@ -7648,15 +7587,11 @@ declare namespace chrome {
7648
7587
 
7649
7588
  /**
7650
7589
  * Saves the content of the tab with given id as MHTML.
7651
- * @param callback Called when the MHTML has been generated.
7652
- * Parameter mhtmlData: The MHTML data as a Blob.
7653
- */
7654
- export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
7655
- /**
7656
- * Saves the content of the tab with given id as MHTML.
7657
- * @since Chrome 116 MV3
7590
+ *
7591
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
7658
7592
  */
7659
7593
  export function saveAsMHTML(details: SaveDetails): Promise<Blob | undefined>;
7594
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
7660
7595
  }
7661
7596
 
7662
7597
  ////////////////////
@@ -8564,57 +8499,48 @@ declare namespace chrome {
8564
8499
 
8565
8500
  /**
8566
8501
  * Adds an entry to the reading list if it does not exist.
8567
- * @since Chrome 120, MV3
8502
+ *
8503
+ * Can return its result via Promise.
8568
8504
  * @param entry The entry to add to the reading list.
8569
- * @param callback
8570
8505
  */
8571
8506
  export function addEntry(entry: AddEntryOptions): Promise<void>;
8572
8507
  export function addEntry(entry: AddEntryOptions, callback: () => void): void;
8573
8508
 
8574
8509
  /**
8575
8510
  * Retrieves all entries that match the `QueryInfo` properties. Properties that are not provided will not be matched.
8576
- * @since Chrome 120, MV3
8511
+ *
8512
+ * Can return its result via Promise.
8577
8513
  * @param info The properties to search for.
8578
- * @param callback
8579
8514
  */
8580
8515
  export function query(info: QueryInfo): Promise<ReadingListEntry[]>;
8581
8516
  export function query(info: QueryInfo, callback: (entries: ReadingListEntry[]) => void): void;
8582
8517
 
8583
8518
  /**
8584
8519
  * Removes an entry from the reading list if it exists.
8585
- * @since Chrome 120, MV3
8520
+ *
8521
+ * Can return its result via Promise.
8586
8522
  * @param info The entry to remove from the reading list.
8587
- * @param callback
8588
8523
  */
8589
8524
  export function removeEntry(info: RemoveOptions): Promise<void>;
8590
8525
  export function removeEntry(info: RemoveOptions, callback: () => void): void;
8591
8526
 
8592
8527
  /**
8593
8528
  * Updates a reading list entry if it exists.
8594
- * @since Chrome 120, MV3
8529
+ *
8530
+ * Can return its result via Promise.
8595
8531
  * @param info The entry to update.
8596
- * @param callback
8597
8532
  */
8598
8533
  export function updateEntry(info: UpdateEntryOptions): Promise<void>;
8599
8534
  export function updateEntry(info: UpdateEntryOptions, callback: () => void): void;
8600
8535
 
8601
- /**
8602
- * Triggered when a ReadingListEntry is added to the reading list.
8603
- * @since Chrome 120, MV3
8604
- */
8605
- export const onEntryAdded: chrome.events.Event<(entry: ReadingListEntry) => void>;
8536
+ /** Triggered when a `ReadingListEntry` is added to the reading list. */
8537
+ export const onEntryAdded: events.Event<(entry: ReadingListEntry) => void>;
8606
8538
 
8607
- /**
8608
- * Triggered when a ReadingListEntry is removed from the reading list.
8609
- * @since Chrome 120, MV3
8610
- */
8611
- export const onEntryRemoved: chrome.events.Event<(entry: ReadingListEntry) => void>;
8539
+ /** Triggered when a `ReadingListEntry` is removed from the reading list. */
8540
+ export const onEntryRemoved: events.Event<(entry: ReadingListEntry) => void>;
8612
8541
 
8613
- /**
8614
- * Triggered when a ReadingListEntry is updated in the reading list.
8615
- * @since Chrome 120, MV3
8616
- */
8617
- export const onEntryUpdated: chrome.events.Event<(entry: ReadingListEntry) => void>;
8542
+ /** Triggered when a `ReadingListEntry` is updated in the reading list. */
8543
+ export const onEntryUpdated: events.Event<(entry: ReadingListEntry) => void>;
8618
8544
  }
8619
8545
 
8620
8546
  ////////////////////
@@ -9799,25 +9725,16 @@ declare namespace chrome {
9799
9725
  */
9800
9726
  export namespace sessions {
9801
9727
  export interface Filter {
9802
- /**
9803
- * Optional.
9804
- * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS).
9805
- */
9728
+ /** The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ({@link sessions.MAX_SESSION_RESULTS}). */
9806
9729
  maxResults?: number | undefined;
9807
9730
  }
9808
9731
 
9809
9732
  export interface Session {
9810
9733
  /** The time when the window or tab was closed or modified, represented in seconds since the epoch. */
9811
9734
  lastModified: number;
9812
- /**
9813
- * Optional.
9814
- * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set.
9815
- */
9735
+ /** The {@link tabs.Tab}, if this entry describes a tab. Either this or {@link sessions.Session.window} will be set. */
9816
9736
  tab?: tabs.Tab | undefined;
9817
- /**
9818
- * Optional.
9819
- * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set.
9820
- */
9737
+ /** The {@link windows.Window}, if this entry describes a window. Either this or {@link sessions.Session.tab} will be set. */
9821
9738
  window?: windows.Window | undefined;
9822
9739
  }
9823
9740
 
@@ -9828,69 +9745,39 @@ declare namespace chrome {
9828
9745
  sessions: Session[];
9829
9746
  }
9830
9747
 
9831
- export interface SessionChangedEvent extends chrome.events.Event<() => void> {}
9832
-
9833
- /** The maximum number of sessions.Session that will be included in a requested list. */
9834
- export var MAX_SESSION_RESULTS: number;
9748
+ /** The maximum number of {@link sessions.Session} that will be included in a requested list. */
9749
+ export const MAX_SESSION_RESULTS: 25;
9835
9750
 
9836
9751
  /**
9837
9752
  * Gets the list of recently closed tabs and/or windows.
9838
- * @return The `getRecentlyClosed` method provides its result via callback or returned as a `Promise` (MV3 only).
9753
+ *
9754
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9839
9755
  */
9840
9756
  export function getRecentlyClosed(filter?: Filter): Promise<Session[]>;
9841
- /**
9842
- * Gets the list of recently closed tabs and/or windows.
9843
- * @param callback
9844
- * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
9845
- */
9846
- export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void;
9847
- /**
9848
- * Gets the list of recently closed tabs and/or windows.
9849
- * @param callback
9850
- * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
9851
- */
9852
9757
  export function getRecentlyClosed(callback: (sessions: Session[]) => void): void;
9758
+ export function getRecentlyClosed(filter: Filter | undefined, callback: (sessions: Session[]) => void): void;
9759
+
9853
9760
  /**
9854
9761
  * Retrieves all devices with synced sessions.
9855
- * @return The `getDevices` method provides its result via callback or returned as a `Promise` (MV3 only).
9762
+ *
9763
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9856
9764
  */
9857
9765
  export function getDevices(filter?: Filter): Promise<Device[]>;
9858
- /**
9859
- * Retrieves all devices with synced sessions.
9860
- * @param callback
9861
- * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
9862
- */
9863
- export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void;
9864
- /**
9865
- * Retrieves all devices with synced sessions.
9866
- * @param callback
9867
- * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
9868
- */
9869
9766
  export function getDevices(callback: (devices: Device[]) => void): void;
9767
+ export function getDevices(filter: Filter | undefined, callback: (devices: Device[]) => void): void;
9768
+
9870
9769
  /**
9871
- * Reopens a windows.Window or tabs.Tab.
9872
- * @param sessionId Optional.
9873
- * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
9874
- * @return The `restore` method provides its result via callback or returned as a `Promise` (MV3 only).
9770
+ * Reopens a {@link windows.Window} or {@link tabs.Tab}, with an optional callback to run when the entry has been restored.
9771
+ *
9772
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9773
+ * @param sessionId The {@link windows.Window.sessionId}, or {@link tabs.Tab.sessionId} to restore. If this parameter is not specified, the most recently closed session is restored.
9875
9774
  */
9876
9775
  export function restore(sessionId?: string): Promise<Session>;
9877
- /**
9878
- * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
9879
- * @param sessionId Optional.
9880
- * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
9881
- * @param callback Optional.
9882
- * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
9883
- */
9884
- export function restore(sessionId: string, callback: (restoredSession: Session) => void): void;
9885
- /**
9886
- * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
9887
- * @param callback Optional.
9888
- * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
9889
- */
9890
9776
  export function restore(callback: (restoredSession: Session) => void): void;
9777
+ export function restore(sessionId: string | undefined, callback: (restoredSession: Session) => void): void;
9891
9778
 
9892
9779
  /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */
9893
- export var onChanged: SessionChangedEvent;
9780
+ export const onChanged: events.Event<() => void>;
9894
9781
  }
9895
9782
 
9896
9783
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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": "2a0e1ced978ad35915b1c262da583e4f3dd9cc4aaa598935e14ee906b8038e3a",
97
+ "typesPublisherContentHash": "3cb748894519c88fdf8bbd53c9b88cde0db71bd0e3a5becf92e9e47bbb21bd6c",
98
98
  "typeScriptVersion": "5.2"
99
99
  }