forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpasskey.ts
More file actions
58 lines (48 loc) · 1.7 KB
/
Copy pathpasskey.ts
File metadata and controls
58 lines (48 loc) · 1.7 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
import type { PasskeyJSONSnapshot } from 'snapshots';
import type { DeletedObjectResource } from './deletedObject';
import type { PasskeyJSON } from './json';
import type { ClerkResource } from './resource';
import type { SnakeToCamel } from './utils';
import type { PasskeyVerificationResource } from './verification';
type UpdatePasskeyJSON = Pick<PasskeyJSON, 'name'>;
export type UpdatePasskeyParams = Partial<SnakeToCamel<UpdatePasskeyJSON>>;
export interface PasskeyResource extends ClerkResource {
id: string;
name: string | null;
verification: PasskeyVerificationResource | null;
lastUsedAt: Date | null;
updatedAt: Date;
createdAt: Date;
update: (params: UpdatePasskeyParams) => Promise<PasskeyResource>;
delete: () => Promise<DeletedObjectResource>;
__internal_toSnapshot: () => PasskeyJSONSnapshot;
}
export type PublicKeyCredentialCreationOptionsWithoutExtensions = Omit<
Required<PublicKeyCredentialCreationOptions>,
'extensions'
>;
export type PublicKeyCredentialRequestOptionsWithoutExtensions = Omit<
Required<PublicKeyCredentialRequestOptions>,
'extensions'
>;
export type PublicKeyCredentialWithAuthenticatorAttestationResponse = Omit<
PublicKeyCredential,
'response' | 'getClientExtensionResults'
> & {
response: Omit<AuthenticatorAttestationResponse, 'getAuthenticatorData' | 'getPublicKey' | 'getPublicKeyAlgorithm'>;
};
export type PublicKeyCredentialWithAuthenticatorAssertionResponse = Omit<
PublicKeyCredential,
'response' | 'getClientExtensionResults'
> & {
response: AuthenticatorAssertionResponse;
};
export type CredentialReturn<T> =
| {
publicKeyCredential: T;
error: null;
}
| {
publicKeyCredential: null;
error: Error;
};