Add the chrome.loginState API (#42853)

* Add the chrome.loginState API

https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/common/extensions/api/login_state.idl

* Update index.d.ts

* Update index.d.ts
This commit is contained in:
ankhler
2020-03-24 17:44:14 -07:00
committed by GitHub
parent 878f12fc93
commit 461cc6054f
+28
View File
@@ -4153,6 +4153,34 @@ declare namespace chrome.input.ime {
export var onReset: InputResetEvent;
}
////////////////////
// LoginState
////////////////////
/**
* Use the chrome.loginState API to read and monitor the login state.
* Permissions: "loginState"
* @since Chrome 78.
* Important: This API works only on Chrome OS.
*/
declare namespace chrome.loginState {
export interface SessionStateChangedEvent extends chrome.events.Event<(sessionState: SessionState) => void> { }
/** Possible profile types. */
export type ProfileType = 'SIGNIN_PROFILE'|'USER_PROFILE';
/** Possible session states. */
export type SessionState = 'UNKNOWN'|'IN_OOBE_SCREEN'|'IN_LOGIN_SCREEN'|'IN_SESSION'|'IN_LOCK_SCREEN';
/** Gets the type of the profile the extension is in. */
export function getProfileType(callback: (profileType: ProfileType) => void): void;
/** Gets the current session state. */
export function getSessionState(callback: (sessionState: SessionState) => void): void;
/** Dispatched when the session state changes. sessionState is the new session state.*/
export const onSessionStateChanged: SessionStateChangedEvent;
}
////////////////////
// Management
////////////////////