-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
281 lines (228 loc) · 7.15 KB
/
Copy pathindex.d.ts
File metadata and controls
281 lines (228 loc) · 7.15 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
/* auto-generated by NAPI-RS */
/* eslint-disable */
export type Base64UrlString = string
export type UserVerificationPolicy = 'required' | 'preferred' | 'discouraged'
export type ResidentKeyRequirement = 'discouraged' | 'preferred' | 'required'
export type AuthenticatorAttachment = 'platform' | 'cross-platform'
export type AuthenticatorTransport =
| 'usb'
| 'nfc'
| 'ble'
| 'internal'
| 'hybrid'
| 'test'
| 'unknown'
export type PublicKeyCredentialHint = 'security-key' | 'client-device' | 'hybrid'
export type AttestationConveyancePreference = 'none' | 'indirect' | 'direct'
export type AttestationFormat =
| 'packed'
| 'tpm'
| 'android-key'
| 'android-safetynet'
| 'fido-u2f'
| 'apple'
| 'none'
export type CredentialProtectionPolicy =
| 'userVerificationOptional'
| 'userVerificationOptionalWithCredentialIDList'
| 'userVerificationRequired'
export interface CreationChallengeResponse {
publicKey: PublicKeyCredentialCreationOptions
}
export interface PublicKeyCredentialCreationOptions {
rp: RelyingParty
user: User
challenge: Base64UrlString
pubKeyCredParams: PubKeyCredParams[]
timeout?: number | null
excludeCredentials?: PublicKeyCredentialDescriptor[] | null
authenticatorSelection?: AuthenticatorSelectionCriteria | null
hints?: PublicKeyCredentialHint[] | null
attestation?: AttestationConveyancePreference | null
attestationFormats?: AttestationFormat[] | null
extensions?: RequestRegistrationExtensions | null
}
export interface RelyingParty {
name: string
id: string
}
export interface User {
id: Base64UrlString
name: string
displayName: string
}
export interface PubKeyCredParams {
type: string
alg: number
}
export interface PublicKeyCredentialDescriptor {
type: string
id: Base64UrlString
transports?: AuthenticatorTransport[] | null
}
export interface AuthenticatorSelectionCriteria {
authenticatorAttachment?: AuthenticatorAttachment | null
residentKey?: ResidentKeyRequirement | null
requireResidentKey: boolean
userVerification: UserVerificationPolicy
}
export interface RequestRegistrationExtensions {
credentialProtectionPolicy?: CredentialProtectionPolicy | null
enforceCredentialProtectionPolicy?: boolean | null
uvm?: boolean | null
credProps?: boolean | null
minPinLength?: boolean | null
hmacCreateSecret?: boolean | null
}
export interface RequestChallengeResponse {
publicKey: PublicKeyCredentialRequestOptionsJSON
mediation?: 'conditional' | null
}
export interface PublicKeyCredentialRequestOptionsJSON {
allowCredentials?: PublicKeyCredentialDescriptorJSON[]
challenge: Base64UrlString
extensions?: AuthenticationExtensionsClientInputsJSON
hints?: string[]
rpId?: string
timeout?: number
userVerification?: string
}
export interface PublicKeyCredentialDescriptorJSON {
type: string
id: Base64UrlString
transports?: string[]
}
export interface AuthenticationExtensionsClientInputsJSON {
appid?: string
credProps?: boolean
largeBlob?: AuthenticationExtensionsLargeBlobInputsJSON
prf?: AuthenticationExtensionsPRFInputsJSON
}
export interface AuthenticationExtensionsLargeBlobInputsJSON {
read?: boolean
support?: string
write?: Base64UrlString
}
export interface AuthenticationExtensionsPRFInputsJSON {
eval?: AuthenticationExtensionsPRFValuesJSON
evalByCredential?: Record<string, AuthenticationExtensionsPRFValuesJSON>
}
export interface AuthenticationExtensionsPRFValuesJSON {
first: Base64UrlString
second?: Base64UrlString
}
export type PublicKeyCredentialRequestOptions = PublicKeyCredentialRequestOptionsJSON
export type AllowCredentials = PublicKeyCredentialDescriptorJSON
export type RequestAuthenticationExtensions = AuthenticationExtensionsClientInputsJSON
export interface RegisterPublicKeyCredential {
id: string
rawId: Base64UrlString
response: AuthenticatorAttestationResponseRaw
type: string
extensions: RegistrationExtensionsClientOutputs
}
export interface AuthenticatorAttestationResponseRaw {
attestationObject: Base64UrlString
clientDataJSON: Base64UrlString
transports: AuthenticatorTransport[] | null
}
export interface RegistrationExtensionsClientOutputs {
appid?: boolean
credProps?: CredProps
hmacSecret?: boolean
credProtect?: CredentialProtectionPolicy
minPinLength?: number
}
export interface CredProps {
rk?: boolean | null
}
export interface PublicKeyCredential {
id: string
rawId: Base64UrlString
response: AuthenticatorAssertionResponseRaw
extensions: AuthenticationExtensionsClientOutputs
type: string
}
export interface AuthenticatorAssertionResponseRaw {
authenticatorData: Base64UrlString
clientDataJSON: Base64UrlString
signature: Base64UrlString
userHandle: Base64UrlString | null
}
export interface AuthenticationExtensionsClientOutputs {
appid: boolean | null
hmac_get_secret: HmacGetSecretOutput | null
}
export interface HmacGetSecretOutput {
output1: Base64UrlString
output2: Base64UrlString | null
}
export type CableRequestType =
| 'getAssertion'
| 'makeCredential'
| 'discoverableMakeCredential'
export type CableState =
| 'connectingToTunnelServer'
| 'waitingForInitiatorConnection'
| 'handshaking'
| 'waitingForInitiatorResponse'
| 'waitingForInitiatorCommand'
| 'processing'
| 'waitingForAuthenticatorResponse'
export type CableFingerprintFeedback =
| 'good'
| 'tooHigh'
| 'tooLow'
| 'tooLeft'
| 'tooRight'
| 'tooFast'
| 'tooSlow'
| 'poorQuality'
| 'tooSkewed'
| 'tooShort'
| 'mergeFailure'
| 'alreadyExists'
| 'noUserActivity'
| 'noUserPresenceTransition'
export type CableRequestPinEvent = {
event: 'requestPin'
}
export type CableRequestTouchEvent = {
event: 'requestTouch'
}
export type CableProcessingEvent = {
event: 'processing'
}
export type CableFingerprintEnrollmentFeedbackEvent = {
event: 'fingerprintEnrollmentFeedback'
remainingSamples: number
fingerprintFeedback?: CableFingerprintFeedback
}
export type CableQrCodeEvent = {
event: 'cableQrCode'
requestType: CableRequestType
url: string
}
export type CableDismissQrCodeEvent = {
event: 'dismissQrCode'
}
export type CableStatusUpdateEvent = {
event: 'cableStatusUpdate'
state: CableState
}
export type CableUiEvent =
| CableRequestPinEvent
| CableRequestTouchEvent
| CableProcessingEvent
| CableFingerprintEnrollmentFeedbackEvent
| CableQrCodeEvent
| CableDismissQrCodeEvent
| CableStatusUpdateEvent;
export declare function cableAuthenticate(origin: string, options: RequestChallengeResponse, onEvent: (event: CableUiEvent) => void): Promise<PublicKeyCredential>
export declare function cableGetTunnelDomain(domainId: number): string | null
export declare function cableRegister(origin: string, options: CreationChallengeResponse, onEvent: (event: CableUiEvent) => void): Promise<RegisterPublicKeyCredential>
export declare function supportedBackends(): Array<string>
export declare function win10ApiVersion(): number | null
export declare function win10Authenticate(origin: string, options: RequestChallengeResponse): Promise<PublicKeyCredential>
export declare function win10Register(origin: string, options: CreationChallengeResponse): Promise<RegisterPublicKeyCredential>
export declare function win10SupportsCable(): boolean