@types/chrome 0.0.270 → 0.0.272

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 +49 -14
  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: Mon, 12 Aug 2024 15:08:19 GMT
11
+ * Last updated: Wed, 25 Sep 2024 00:29:50 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
@@ -8357,6 +8357,11 @@ declare namespace chrome.sessions {
8357
8357
  * @since Chrome 20
8358
8358
  */
8359
8359
  declare namespace chrome.storage {
8360
+ /** NoInfer for old TypeScript versions */
8361
+ type NoInferX<T> = T[][T extends any ? 0 : never];
8362
+ // The next line prevents things without the export keyword from being automatically exported (like NoInferX)
8363
+ export {};
8364
+
8360
8365
  export interface StorageArea {
8361
8366
  /**
8362
8367
  * Gets the amount of space (in bytes) being used by one or more items.
@@ -8370,14 +8375,17 @@ declare namespace chrome.storage {
8370
8375
  * @return A Promise that resolves with a number
8371
8376
  * @since MV3
8372
8377
  */
8373
- getBytesInUse(keys?: string | string[] | null): Promise<number>;
8378
+ getBytesInUse<T = { [key: string]: any }>(keys?: keyof T | Array<keyof T> | null): Promise<number>;
8374
8379
  /**
8375
8380
  * Gets the amount of space (in bytes) being used by one or more items.
8376
8381
  * @param keys Optional. A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage.
8377
8382
  * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
8378
8383
  * Parameter bytesInUse: Amount of space being used in storage, in bytes.
8379
8384
  */
8380
- getBytesInUse(keys: string | string[] | null, callback: (bytesInUse: number) => void): void;
8385
+ getBytesInUse<T = { [key: string]: any }>(
8386
+ keys: keyof T | Array<keyof T> | null,
8387
+ callback: (bytesInUse: number) => void,
8388
+ ): void;
8381
8389
  /**
8382
8390
  * Removes all items from storage.
8383
8391
  * @return A void Promise
@@ -8397,7 +8405,7 @@ declare namespace chrome.storage {
8397
8405
  * @return A void Promise
8398
8406
  * @since MV3
8399
8407
  */
8400
- set(items: { [key: string]: any }): Promise<void>;
8408
+ set<T = { [key: string]: any }>(items: Partial<T>): Promise<void>;
8401
8409
  /**
8402
8410
  * Sets multiple items.
8403
8411
  * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
@@ -8405,7 +8413,7 @@ declare namespace chrome.storage {
8405
8413
  * @param callback Optional.
8406
8414
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8407
8415
  */
8408
- set(items: { [key: string]: any }, callback: () => void): void;
8416
+ set<T = { [key: string]: any }>(items: Partial<T>, callback: () => void): void;
8409
8417
  /**
8410
8418
  * Removes one or more items from storage.
8411
8419
  * @param keys A single key or a list of keys for items to remove.
@@ -8413,20 +8421,20 @@ declare namespace chrome.storage {
8413
8421
  * @return A void Promise
8414
8422
  * @since MV3
8415
8423
  */
8416
- remove(keys: string | string[]): Promise<void>;
8424
+ remove<T = { [key: string]: any }>(keys: keyof T | Array<keyof T>): Promise<void>;
8417
8425
  /**
8418
8426
  * Removes one or more items from storage.
8419
8427
  * @param keys A single key or a list of keys for items to remove.
8420
8428
  * @param callback Optional.
8421
8429
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8422
8430
  */
8423
- remove(keys: string | string[], callback: () => void): void;
8431
+ remove<T = { [key: string]: any }>(keys: keyof T | Array<keyof T>, callback: () => void): void;
8424
8432
  /**
8425
8433
  * Gets the entire contents of storage.
8426
8434
  * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
8427
8435
  * Parameter items: Object with items in their key-value mappings.
8428
8436
  */
8429
- get(callback: (items: { [key: string]: any }) => void): void;
8437
+ get<T = { [key: string]: any }>(callback: (items: T) => void): void;
8430
8438
  /**
8431
8439
  * Gets one or more items from storage.
8432
8440
  * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
@@ -8434,7 +8442,9 @@ declare namespace chrome.storage {
8434
8442
  * @return A Promise that resolves with an object containing items
8435
8443
  * @since MV3
8436
8444
  */
8437
- get(keys?: string | string[] | { [key: string]: any } | null): Promise<{ [key: string]: any }>;
8445
+ get<T = { [key: string]: any }>(
8446
+ keys?: NoInferX<keyof T> | Array<NoInferX<keyof T>> | Partial<NoInferX<T>> | null,
8447
+ ): Promise<T>;
8438
8448
  /**
8439
8449
  * Gets one or more items from storage.
8440
8450
  * @param keys A single key to get, list of keys to get, or a dictionary specifying default values.
@@ -8442,9 +8452,9 @@ declare namespace chrome.storage {
8442
8452
  * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
8443
8453
  * Parameter items: Object with items in their key-value mappings.
8444
8454
  */
8445
- get(
8446
- keys: string | string[] | { [key: string]: any } | null,
8447
- callback: (items: { [key: string]: any }) => void,
8455
+ get<T = { [key: string]: any }>(
8456
+ keys: NoInferX<keyof T> | Array<NoInferX<keyof T>> | Partial<NoInferX<T>> | null,
8457
+ callback: (items: T) => void,
8448
8458
  ): void;
8449
8459
  /**
8450
8460
  * Sets the desired access level for the storage area. The default will be only trusted contexts.
@@ -8513,12 +8523,12 @@ declare namespace chrome.storage {
8513
8523
  extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void>
8514
8524
  {}
8515
8525
 
8516
- type AreaName = keyof Pick<typeof chrome.storage, "sync" | "local" | "managed" | "session">;
8526
+ export type AreaName = keyof Pick<typeof chrome.storage, "sync" | "local" | "managed" | "session">;
8517
8527
  export interface StorageChangedEvent
8518
8528
  extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>
8519
8529
  {}
8520
8530
 
8521
- type AccessLevel = keyof typeof AccessLevel;
8531
+ export type AccessLevel = keyof typeof AccessLevel;
8522
8532
 
8523
8533
  /** The storage area's access level. */
8524
8534
  export var AccessLevel: {
@@ -9013,14 +9023,28 @@ declare namespace chrome.system.display {
9013
9023
  singleUnified?: boolean | undefined;
9014
9024
  }
9015
9025
 
9026
+ /**
9027
+ * An enum to tell if the display is detected and used by the system.
9028
+ * The display is considered 'inactive', if it is not detected by the system (maybe disconnected, or considered disconnected due to sleep mode, etc).
9029
+ * This state is used to keep existing display when the all displays are disconnected, for example.
9030
+ * @since Chrome 117
9031
+ */
9032
+ export type ActiveStateEnum = "active" | "inactive";
9033
+
9016
9034
  /** Information about display properties. */
9017
9035
  export interface DisplayInfo {
9036
+ /**
9037
+ * Active if the display is detected and used by the system.
9038
+ * @since Chrome 117
9039
+ */
9040
+ activeState: ActiveStateEnum;
9018
9041
  /** The unique identifier of the display. */
9019
9042
  id: string;
9020
9043
  /** The user-friendly name (e.g. 'HP LCD monitor'). */
9021
9044
  name: string;
9022
9045
  /**
9023
9046
  * requires(CrOS Kiosk app) Only available in Chrome OS Kiosk apps
9047
+ * @since Chrome 67
9024
9048
  */
9025
9049
  edid?: {
9026
9050
  /**
@@ -9050,6 +9074,7 @@ declare namespace chrome.system.display {
9050
9074
  * Empty if no displays are being mirrored. This will be set to the same value
9051
9075
  * for all displays.
9052
9076
  * ❗ This must not include *mirroringSourceId*. ❗
9077
+ * @since Chrome 64
9053
9078
  */
9054
9079
  mirroringDestinationIds: string[];
9055
9080
  /** True if this is the primary display. */
@@ -9058,6 +9083,11 @@ declare namespace chrome.system.display {
9058
9083
  isInternal: boolean;
9059
9084
  /** True if this display is enabled. */
9060
9085
  isEnabled: boolean;
9086
+ /**
9087
+ * True for all displays when in unified desktop mode
9088
+ * @since Chrome 59
9089
+ */
9090
+ isUnified: boolean;
9061
9091
  /** The number of pixels per inch along the x-axis. */
9062
9092
  dpiX: number;
9063
9093
  /** The number of pixels per inch along the y-axis. */
@@ -9076,15 +9106,20 @@ declare namespace chrome.system.display {
9076
9106
  * The current mode will have isSelected=true.
9077
9107
  * Only available on Chrome OS.
9078
9108
  * Will be set to an empty array on other platforms.
9109
+ * @since Chrome 52
9079
9110
  */
9080
9111
  modes: DisplayMode[];
9081
9112
  /** True if this display has a touch input device associated with it. */
9082
9113
  hasTouchSupport: boolean;
9083
- /** A list of zoom factor values that can be set for the display. */
9114
+ /**
9115
+ * A list of zoom factor values that can be set for the display.
9116
+ * @since Chrome 67
9117
+ */
9084
9118
  availableDisplayZoomFactors: number[];
9085
9119
  /**
9086
9120
  * The ratio between the display's current and default zoom.
9087
9121
  * For example, value 1 is equivalent to 100% zoom, and value 1.5 is equivalent to 150% zoom.
9122
+ * @since Chrome 65
9088
9123
  */
9089
9124
  displayZoomFactor: number;
9090
9125
  }
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.270",
3
+ "version": "0.0.272",
4
4
  "description": "TypeScript definitions for chrome",
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": "0a10bc27fd8dcfa2ea26af51429949ae41b21b649a0c02421d94c5d53d255110",
96
+ "typesPublisherContentHash": "5b474140053b4529fdd4825afb57909288b0afe2b042653e768ea7056c68df63",
97
97
  "typeScriptVersion": "4.8"
98
98
  }