@types/chrome 0.0.193 → 0.0.196

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 +50 -3
  3. chrome/package.json +3 -3
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, 05 Jul 2022 00:02:16 GMT
11
+ * Last updated: Thu, 01 Sep 2022 12:02: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
@@ -2469,7 +2469,7 @@ declare namespace chrome.devtools.inspectedWindow {
2469
2469
  export var tabId: number;
2470
2470
 
2471
2471
  /** Reloads the inspected page. */
2472
- export function reload(reloadOptions: ReloadOptions): void;
2472
+ export function reload(reloadOptions?: ReloadOptions): void;
2473
2473
  /**
2474
2474
  * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
2475
2475
  * @param expression An expression to evaluate.
@@ -7854,6 +7854,28 @@ declare namespace chrome.storage {
7854
7854
  * Parameter items: Object with items in their key-value mappings.
7855
7855
  */
7856
7856
  get(keys: string | string[] | { [key: string]: any } | null, callback: (items: { [key: string]: any }) => void): void;
7857
+ /**
7858
+ * Sets the desired access level for the storage area. The default will be only trusted contexts.
7859
+ * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
7860
+ * @return A void Promise.
7861
+ * @since Chrome 102
7862
+ */
7863
+ setAccessLevel(accessOptions: { accessLevel: AccessLevel }): Promise<void>;
7864
+ /**
7865
+ * Sets the desired access level for the storage area. The default will be only trusted contexts.
7866
+ * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
7867
+ * @param callback Optional.
7868
+ * @since Chrome 102
7869
+ */
7870
+ setAccessLevel(accessOptions: { accessLevel: AccessLevel }, callback: () => void): void;
7871
+ /**
7872
+ * Fired when one or more items change within this storage area.
7873
+ * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
7874
+ * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.
7875
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
7876
+ * Parameter items: Object with items in their key-value mappings.
7877
+ */
7878
+ onChanged: StorageAreaChangedEvent;
7857
7879
  }
7858
7880
 
7859
7881
  export interface StorageChange {
@@ -7895,10 +7917,21 @@ declare namespace chrome.storage {
7895
7917
  QUOTA_BYTES: number;
7896
7918
  }
7897
7919
 
7920
+ export interface StorageAreaChangedEvent
7921
+ extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void> { }
7922
+
7898
7923
  type AreaName = keyof Pick<typeof chrome.storage, 'sync' | 'local' | 'managed' | 'session'>;
7899
7924
  export interface StorageChangedEvent
7900
7925
  extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void> { }
7901
7926
 
7927
+ type AccessLevel = keyof typeof AccessLevel;
7928
+
7929
+ /** The storage area's access level. */
7930
+ export var AccessLevel: {
7931
+ TRUSTED_AND_UNTRUSTED_CONTEXTS: 'TRUSTED_AND_UNTRUSTED_CONTEXTS',
7932
+ TRUSTED_CONTEXTS: 'TRUSTED_CONTEXTS'
7933
+ };
7934
+
7902
7935
  /** Items in the local storage area are local to each machine. */
7903
7936
  export var local: LocalStorageArea;
7904
7937
  /** Items in the sync storage area are synced using Chrome Sync. */
@@ -9565,7 +9598,7 @@ declare namespace chrome.tabs {
9565
9598
  * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
9566
9599
  * @since Chrome 20.
9567
9600
  */
9568
- export function sendMessage<M = any, R = any>(tabId: number, message: M, responseCallback?: (response: R) => void): void;
9601
+ export function sendMessage<M = any, R = any>(tabId: number, message: M, responseCallback: (response: R) => void): void;
9569
9602
  /**
9570
9603
  * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
9571
9604
  * @since Chrome 41.
@@ -9576,8 +9609,22 @@ declare namespace chrome.tabs {
9576
9609
  tabId: number,
9577
9610
  message: M,
9578
9611
  options: MessageSendOptions,
9579
- responseCallback?: (response: R) => void,
9612
+ responseCallback: (response: R) => void,
9580
9613
  ): void;
9614
+ /**
9615
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
9616
+ * @since Chrome 99
9617
+ */
9618
+ export function sendMessage<M = any, R = any>(tabId: number, message: M): Promise<R>;
9619
+ /**
9620
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
9621
+ * @since Chrome 99
9622
+ */
9623
+ export function sendMessage<M = any, R = any>(
9624
+ tabId: number,
9625
+ message: M,
9626
+ options: MessageSendOptions
9627
+ ): Promise<R>;
9581
9628
  /**
9582
9629
  * Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The extension.onRequest event is fired in each content script running in the specified tab for the current extension.
9583
9630
  * @deprecated since Chrome 33. Please use runtime.sendMessage.
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.193",
3
+ "version": "0.0.196",
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": "5b4b19a45af72fa27d09cf5ab83b562d2063984b64c182f7836f54e52c39561e",
97
- "typeScriptVersion": "4.0"
96
+ "typesPublisherContentHash": "ade96379cfac9d4a5497afcdf7f058b9aedac0f28bc58bf498fed6b81a141c5f",
97
+ "typeScriptVersion": "4.1"
98
98
  }