You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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. */
0 commit comments