@types/chrome 0.0.288 → 0.0.289

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 +22 -45
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
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 Jan 2025 18:37:07 GMT
11
+ * Last updated: Thu, 02 Jan 2025 21:02:18 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
@@ -6678,72 +6678,49 @@ declare namespace chrome {
6678
6678
  */
6679
6679
  export namespace permissions {
6680
6680
  export interface Permissions {
6681
- /**
6682
- * Optional.
6683
- * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest.
6684
- */
6685
- permissions?: string[] | undefined;
6686
- /**
6687
- * Optional.
6688
- * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional host permission list in the manifest (optional_permissions in MV2, optional_host_permissions in MV3). For example, if http://*.example.com/ or http://* appears in the optional permissions, you can request an origin of http://help.example.com/. Any path is ignored.
6689
- */
6690
- origins?: string[] | undefined;
6691
- }
6692
-
6693
- export interface PermissionsRemovedEvent {
6694
- addListener(
6695
- callback: (/** The permissions that have been removed*/ permissions: Permissions) => void,
6696
- ): void;
6697
- }
6698
-
6699
- export interface PermissionsAddedEvent {
6700
- addListener(callback: (/** The newly-acquired permissions*/ permissions: Permissions) => void): void;
6681
+ /** The list of host permissions, including those specified in the `optional_permissions` or `permissions` keys in the manifest, and those associated with [Content Scripts](https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts). */
6682
+ origins?: string[];
6683
+ /** List of named permissions (does not include hosts or origins). */
6684
+ permissions?: chrome.runtime.ManifestPermissions[];
6701
6685
  }
6702
6686
 
6703
6687
  /**
6704
6688
  * Checks if the extension has the specified permissions.
6705
- * @return A Promise that resolves with boolean: True if the extension has the specified permissions.
6689
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6706
6690
  */
6707
6691
  export function contains(permissions: Permissions): Promise<boolean>;
6708
- /**
6709
- * Checks if the extension has the specified permissions.
6710
- * Parameter result: True if the extension has the specified permissions.
6711
- */
6712
6692
  export function contains(permissions: Permissions, callback: (result: boolean) => void): void;
6693
+
6713
6694
  /**
6714
6695
  * Gets the extension's current set of permissions.
6715
- * @return A Promise that resolves with Permissions object describing the extension's active permissions.
6696
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6716
6697
  */
6717
6698
  export function getAll(): Promise<Permissions>;
6718
- /**
6719
- * Gets the extension's current set of permissions.
6720
- */
6721
6699
  export function getAll(callback: (permissions: Permissions) => void): void;
6700
+
6722
6701
  /**
6723
- * Requests access to the specified permissions. These permissions must be defined in the optional_permissions or optional_host_permissions (MV3 only) fields of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
6724
- * @return A Promise that resolves with boolean: True if the user granted the specified permissions.
6702
+ * Requests access to the specified permissions, displaying a prompt to the user if necessary.
6703
+ * These permissions must either be defined in the optional_permissions field of the manifest or be required permissions that were withheld by the user.
6704
+ * Paths on origin patterns will be ignored.
6705
+ * You can request subsets of optional origin permissions; for example, if you specify `*://*\/*` in the `optional_permissions` section of the manifest, you can request `http://example.com/`.
6706
+ * If there are any problems requesting the permissions, {@link runtime.lastError} will be set.
6707
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6725
6708
  */
6726
6709
  export function request(permissions: Permissions): Promise<boolean>;
6710
+ export function request(permissions: Permissions, callback: (granted: boolean) => void): void;
6711
+
6727
6712
  /**
6728
- * Requests access to the specified permissions. These permissions must be defined in the optional_permissions or optional_host_permissions (MV3 only) fields of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
6729
- * Parameter granted: True if the user granted the specified permissions.
6730
- */
6731
- export function request(permissions: Permissions, callback?: (granted: boolean) => void): void;
6732
- /**
6733
- * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
6734
- * @return A Promise that resolves with boolean: True if the permissions were removed.
6713
+ * Removes access to the specified permissions. If there are any problems removing the permissions, {@link runtime.lastError} will be set.
6714
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6735
6715
  */
6736
6716
  export function remove(permissions: Permissions): Promise<boolean>;
6737
- /**
6738
- * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
6739
- * Parameter removed: True if the permissions were removed.
6740
- */
6741
- export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void;
6717
+ export function remove(permissions: Permissions, callback: (removed: boolean) => void): void;
6742
6718
 
6743
6719
  /** Fired when access to permissions has been removed from the extension. */
6744
- export var onRemoved: PermissionsRemovedEvent;
6720
+ export const onRemoved: chrome.events.Event<(permissions: Permissions) => void>;
6721
+
6745
6722
  /** Fired when the extension acquires new permissions. */
6746
- export var onAdded: PermissionsAddedEvent;
6723
+ export const onAdded: chrome.events.Event<(permissions: Permissions) => void>;
6747
6724
  }
6748
6725
 
6749
6726
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.288",
3
+ "version": "0.0.289",
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": "115546e2b199f5d8b21729e4d49bada5c8b5d60ee6eb0fdb5688219cb24d1fe2",
97
+ "typesPublisherContentHash": "56c695cd33a0165d7b0484e89eba4947466c5b5bdc9baa278b1a67707371ab20",
98
98
  "typeScriptVersion": "5.0"
99
99
  }