@types/chrome 0.1.5 → 0.1.6

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 +19 -14
  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: Wed, 03 Sep 2025 07:03:15 GMT
11
+ * Last updated: Wed, 03 Sep 2025 19:02:45 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
@@ -6121,38 +6121,43 @@ declare namespace chrome {
6121
6121
  * Permissions: "idle"
6122
6122
  */
6123
6123
  export namespace idle {
6124
- export type IdleState = "active" | "idle" | "locked";
6125
- export interface IdleStateChangedEvent extends chrome.events.Event<(newState: IdleState) => void> {}
6124
+ /** @since Chrome 44 */
6125
+ export enum IdleState {
6126
+ ACTIVE = "active",
6127
+ IDLE = "idle",
6128
+ LOCKED = "locked",
6129
+ }
6126
6130
 
6127
6131
  /**
6128
6132
  * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
6129
6133
  * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
6130
- * @since Chrome 116
6131
- */
6132
- export function queryState(detectionIntervalInSeconds: number): Promise<IdleState>;
6133
- /**
6134
- * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
6135
- * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
6136
- * @since Chrome 25
6134
+ *
6135
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
6137
6136
  */
6138
- export function queryState(detectionIntervalInSeconds: number, callback: (newState: IdleState) => void): void;
6137
+ export function queryState(detectionIntervalInSeconds: number): Promise<`${IdleState}`>;
6138
+ export function queryState(
6139
+ detectionIntervalInSeconds: number,
6140
+ callback: (newState: `${IdleState}`) => void,
6141
+ ): void;
6139
6142
 
6140
6143
  /**
6141
6144
  * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.
6142
- * @since Chrome 25
6143
6145
  * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state.
6144
6146
  */
6145
6147
  export function setDetectionInterval(intervalInSeconds: number): void;
6146
6148
 
6147
6149
  /**
6148
- * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only.
6149
- * Parameter delay: Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically.
6150
+ * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically.
6151
+ *
6152
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
6153
+ * @since Chrome 73
6154
+ * @platform ChromeOS only
6150
6155
  */
6151
6156
  export function getAutoLockDelay(): Promise<number>;
6152
6157
  export function getAutoLockDelay(callback: (delay: number) => void): void;
6153
6158
 
6154
6159
  /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */
6155
- export var onStateChanged: IdleStateChangedEvent;
6160
+ export const onStateChanged: events.Event<(newState: `${IdleState}`) => void>;
6156
6161
  }
6157
6162
 
6158
6163
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
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": "e1fac3378e3f586d03c2f3829b254da0467a69917acf1c6921ddc3c4a76a1ebc",
97
+ "typesPublisherContentHash": "395db76dae29e94b5ce4ec6731931627466b88608036f9cee4f5f025e45fd6e8",
98
98
  "typeScriptVersion": "5.2"
99
99
  }