aboutsummaryrefslogtreecommitdiff
path: root/third_party/closure_compiler/externs/quick_unlock_private.js
blob: 4229b89ef724c928ab2b3a9d6038f17d87ec3abd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file was generated by:
//   tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
//   'chrome.quickUnlockPrivate.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md

/** @fileoverview Externs generated from namespace: quickUnlockPrivate */

/**
 * @const
 */
chrome.quickUnlockPrivate = {};

/**
 * @typedef {{
 *   token: string,
 *   lifetimeSeconds: number
 * }}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#type-TokenInfo
 */
chrome.quickUnlockPrivate.TokenInfo;

/**
 * @enum {string}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#type-QuickUnlockMode
 */
chrome.quickUnlockPrivate.QuickUnlockMode = {
  PIN: 'PIN',
};

/**
 * @enum {string}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#type-CredentialProblem
 */
chrome.quickUnlockPrivate.CredentialProblem = {
  TOO_SHORT: 'TOO_SHORT',
  TOO_LONG: 'TOO_LONG',
  TOO_WEAK: 'TOO_WEAK',
  CONTAINS_NONDIGIT: 'CONTAINS_NONDIGIT',
};

/**
 * @typedef {{
 *   errors: !Array<!chrome.quickUnlockPrivate.CredentialProblem>,
 *   warnings: !Array<!chrome.quickUnlockPrivate.CredentialProblem>
 * }}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#type-CredentialCheck
 */
chrome.quickUnlockPrivate.CredentialCheck;

/**
 * @typedef {{
 *   minLength: number,
 *   maxLength: number
 * }}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#type-CredentialRequirements
 */
chrome.quickUnlockPrivate.CredentialRequirements;

/**
 * Returns a token that can be used for future operations and the number of
 * seconds until the token expires.
 * @param {string} accountPassword The account password for the logged in user.
 * @param {function(!chrome.quickUnlockPrivate.TokenInfo):void} onComplete
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-getAuthToken
 */
chrome.quickUnlockPrivate.getAuthToken = function(accountPassword, onComplete) {};

/**
 * Sets the lock screen enabled state. NOTE: The lock enabled state is reflected
 * in the settings.enable_screen_lock pref, which can be read but not written
 * using the settings_private API (which also provides policy information). This
 * API must be used to change the pref.
 * @param {string} token The token returned by $(ref:getAuthToken).
 * @param {boolean} enabled
 * @param {function():void=} onComplete
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-setLockScreenEnabled
 */
chrome.quickUnlockPrivate.setLockScreenEnabled = function(token, enabled, onComplete) {};

/**
 * Returns the set of quick unlock modes that are available for the user to use.
 * Some quick unlock modes may be disabled by policy.
 * @param {function(!Array<!chrome.quickUnlockPrivate.QuickUnlockMode>):void}
 *     onComplete
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-getAvailableModes
 */
chrome.quickUnlockPrivate.getAvailableModes = function(onComplete) {};

/**
 * Returns the quick unlock modes that are currently enabled and usable on the
 * lock screen.
 * @param {function(!Array<!chrome.quickUnlockPrivate.QuickUnlockMode>):void}
 *     onComplete
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-getActiveModes
 */
chrome.quickUnlockPrivate.getActiveModes = function(onComplete) {};

/**
 * Checks if the given credential can be used for the given unlock mode.
 * Enterprise policy can change credential requirements.
 * @param {!chrome.quickUnlockPrivate.QuickUnlockMode} mode The quick unlock
 *     mode that is used.
 * @param {string} credential The given credential.
 * @param {function(!chrome.quickUnlockPrivate.CredentialCheck):void} onComplete
 *     Called with a list of warnings and errors the given     |credential| has
 *     (or an empty list if there are none).
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-checkCredential
 */
chrome.quickUnlockPrivate.checkCredential = function(mode, credential, onComplete) {};

/**
 * Gets the credential requirements for the given unlock mode.
 * @param {!chrome.quickUnlockPrivate.QuickUnlockMode} mode The quick unlock
 *     mode that is used.
 * @param {function(!chrome.quickUnlockPrivate.CredentialRequirements):void}
 *     onComplete Called with the credential requirements of the given
 *     |mode|.
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-getCredentialRequirements
 */
chrome.quickUnlockPrivate.getCredentialRequirements = function(mode, onComplete) {};

/**
 * Update the set of quick unlock modes that are currently active/enabled.
 * @param {string} token The token returned by $(ref:getAuthToken).
 * @param {!Array<!chrome.quickUnlockPrivate.QuickUnlockMode>} modes The quick
 *     unlock modes that should be active.
 * @param {!Array<string>} credentials The associated credential for each mode.
 *     To keep the     credential the same for the associated mode, pass an
 *     empty string.
 * @param {function():void} onComplete Called with true if the quick unlock
 *     state was updated,     false otherwise. The update is treated as a single
 *     atomic operation.
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#method-setModes
 */
chrome.quickUnlockPrivate.setModes = function(token, modes, credentials, onComplete) {};

/**
 * Called after the active set of quick unlock modes has changed.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/quickUnlockPrivate#event-onActiveModesChanged
 */
chrome.quickUnlockPrivate.onActiveModesChanged;