akey-electron-webauthn-types 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +160 -0
  2. package/package.json +17 -0
package/index.d.ts ADDED
@@ -0,0 +1,160 @@
1
+ export type GetCredentialErrorCodes =
2
+ | "TypeError"
3
+ | "AbortError"
4
+ | "NotAllowedError"
5
+ | "SecurityError";
6
+
7
+ export interface GetCredentialSuccessData {
8
+ credentialId: string;
9
+ clientDataJSON: string;
10
+ authenticatorData: string;
11
+ signature: string;
12
+ userHandle: string;
13
+ extensions?: {
14
+ prf?: {
15
+ results?: {
16
+ first: string;
17
+ second?: string;
18
+ };
19
+ };
20
+ largeBlob?: {
21
+ blob?: string;
22
+ written?: boolean;
23
+ };
24
+ };
25
+ }
26
+
27
+ export interface GetCredentialSuccessResult {
28
+ success: true;
29
+ data: GetCredentialSuccessData;
30
+ }
31
+
32
+ export interface GetCredentialErrorResult {
33
+ success: false;
34
+ error: GetCredentialErrorCodes;
35
+ errorObject?: Error;
36
+ }
37
+
38
+ export type GetCredentialResult =
39
+ | GetCredentialSuccessResult
40
+ | GetCredentialErrorResult;
41
+
42
+ export type CreateCredentialErrorCodes =
43
+ | "TypeError"
44
+ | "AbortError"
45
+ | "NotAllowedError"
46
+ | "SecurityError"
47
+ | "InvalidStateError";
48
+
49
+ export interface CreateCredentialSuccessData {
50
+ credentialId: string;
51
+ clientDataJSON: string;
52
+ attestationObject: string;
53
+ authData: string;
54
+ publicKey: string;
55
+ publicKeyAlgorithm: number;
56
+ transports: string[];
57
+ extensions: {
58
+ credProps?: {
59
+ rk: boolean;
60
+ };
61
+ prf?: {
62
+ enabled?: boolean;
63
+ results: {
64
+ first?: string;
65
+ second?: string;
66
+ };
67
+ };
68
+ largeBlob?: {
69
+ supported?: boolean;
70
+ };
71
+ };
72
+ }
73
+
74
+ export interface CreateCredentialSuccessResult {
75
+ success: true;
76
+ data: CreateCredentialSuccessData;
77
+ }
78
+
79
+ export interface CreateCredentialErrorResult {
80
+ success: false;
81
+ error: CreateCredentialErrorCodes;
82
+ errorObject?: Error;
83
+ }
84
+
85
+ export type CreateCredentialResult =
86
+ | CreateCredentialSuccessResult
87
+ | CreateCredentialErrorResult;
88
+
89
+ export interface PasskeyCredential {
90
+ id: string;
91
+ rpId: string;
92
+ userName: string;
93
+ userHandle: string;
94
+ }
95
+
96
+ export type PasskeyAuthorizationStatus =
97
+ | "authorized"
98
+ | "denied"
99
+ | "notDetermined";
100
+
101
+ export interface PasskeyAuthorizationResult {
102
+ success: true;
103
+ status: PasskeyAuthorizationStatus;
104
+ }
105
+
106
+ export interface PasskeyAuthorizationError {
107
+ success: false;
108
+ error: Error;
109
+ }
110
+
111
+ export interface ListPasskeysOptions {
112
+ requestAuthorization?: boolean;
113
+ }
114
+
115
+ export interface ListPasskeysResult {
116
+ success: true;
117
+ credentials: PasskeyCredential[];
118
+ }
119
+
120
+ export interface ListPasskeysError {
121
+ success: false;
122
+ error: Error;
123
+ }
124
+
125
+ export interface WebauthnGetRequestOptions {
126
+ currentOrigin: string;
127
+ topFrameOrigin: string | undefined;
128
+ isPublicSuffix?: (domain: string) => boolean;
129
+ nativeWindowHandle: Buffer;
130
+ allowSecurityKeyRequests?: boolean;
131
+ }
132
+
133
+ export interface WebauthnCreateRequestOptions {
134
+ currentOrigin: string;
135
+ topFrameOrigin: string | undefined;
136
+ isPublicSuffix?: (domain: string) => boolean;
137
+ nativeWindowHandle: Buffer;
138
+ allowSecurityKeyRequests?: boolean;
139
+ }
140
+
141
+ export interface WebauthnModule {
142
+ createCredential(
143
+ publicKeyOptions: PublicKeyCredentialCreationOptions | undefined,
144
+ additionalOptions: WebauthnCreateRequestOptions,
145
+ ): Promise<CreateCredentialResult>;
146
+ getCredential(
147
+ publicKeyOptions: PublicKeyCredentialRequestOptions | undefined,
148
+ additionalOptions: WebauthnGetRequestOptions,
149
+ ): Promise<GetCredentialResult>;
150
+ getListPasskeyAuthorizationStatus(): Promise<
151
+ PasskeyAuthorizationResult | PasskeyAuthorizationError
152
+ >;
153
+ requestListPasskeyAuthorization(): Promise<
154
+ PasskeyAuthorizationResult | PasskeyAuthorizationError
155
+ >;
156
+ listPasskeys(
157
+ relyingPartyId: string,
158
+ options?: ListPasskeysOptions,
159
+ ): Promise<ListPasskeysResult | ListPasskeysError>;
160
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "akey-electron-webauthn-types",
3
+ "version": "1.3.10",
4
+ "description": "Shared public types for electron-webauthn packages.",
5
+ "types": "index.d.ts",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "index.d.ts"
16
+ ]
17
+ }