Skip to content

Commit da23e62

Browse files
Bashamegasaschanaz
andauthored
Support multiple types & update toJSON (#2304)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 5b0ab48 commit da23e62

File tree

6 files changed

+254
-34
lines changed

6 files changed

+254
-34
lines changed

baselines/dom.generated.d.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ interface AuthenticationExtensionsClientOutputs {
220220
prf?: AuthenticationExtensionsPRFOutputs;
221221
}
222222

223+
interface AuthenticationExtensionsClientOutputsJSON {
224+
appid?: boolean;
225+
credProps?: CredentialPropertiesOutput;
226+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
227+
prf?: AuthenticationExtensionsPRFOutputsJSON;
228+
}
229+
223230
interface AuthenticationExtensionsLargeBlobInputs {
224231
read?: boolean;
225232
support?: string;
@@ -238,6 +245,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
238245
written?: boolean;
239246
}
240247

248+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
249+
blob?: Base64URLString;
250+
supported?: boolean;
251+
written?: boolean;
252+
}
253+
241254
interface AuthenticationExtensionsPRFInputs {
242255
eval?: AuthenticationExtensionsPRFValues;
243256
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -253,6 +266,11 @@ interface AuthenticationExtensionsPRFOutputs {
253266
results?: AuthenticationExtensionsPRFValues;
254267
}
255268

269+
interface AuthenticationExtensionsPRFOutputsJSON {
270+
enabled?: boolean;
271+
results?: AuthenticationExtensionsPRFValuesJSON;
272+
}
273+
256274
interface AuthenticationExtensionsPRFValues {
257275
first: BufferSource;
258276
second?: BufferSource;
@@ -263,6 +281,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
263281
second?: Base64URLString;
264282
}
265283

284+
interface AuthenticationResponseJSON {
285+
authenticatorAttachment?: string;
286+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
287+
id: string;
288+
rawId: Base64URLString;
289+
response: AuthenticatorAssertionResponseJSON;
290+
type: string;
291+
}
292+
293+
interface AuthenticatorAssertionResponseJSON {
294+
authenticatorData: Base64URLString;
295+
clientDataJSON: Base64URLString;
296+
signature: Base64URLString;
297+
userHandle?: Base64URLString;
298+
}
299+
300+
interface AuthenticatorAttestationResponseJSON {
301+
attestationObject: Base64URLString;
302+
authenticatorData: Base64URLString;
303+
clientDataJSON: Base64URLString;
304+
publicKey?: Base64URLString;
305+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
306+
transports: string[];
307+
}
308+
266309
interface AuthenticatorSelectionCriteria {
267310
authenticatorAttachment?: AuthenticatorAttachment;
268311
requireResidentKey?: boolean;
@@ -2107,6 +2150,15 @@ interface RegistrationOptions {
21072150
updateViaCache?: ServiceWorkerUpdateViaCache;
21082151
}
21092152

2153+
interface RegistrationResponseJSON {
2154+
authenticatorAttachment?: string;
2155+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2156+
id: string;
2157+
rawId: Base64URLString;
2158+
response: AuthenticatorAttestationResponseJSON;
2159+
type: string;
2160+
}
2161+
21102162
interface Report {
21112163
body?: ReportBody | null;
21122164
type?: string;
@@ -26974,7 +27026,7 @@ interface PublicKeyCredential extends Credential {
2697427026
*
2697527027
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2697627028
*/
26977-
toJSON(): PublicKeyCredentialJSON;
27029+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2697827030
}
2697927031

2698027032
declare var PublicKeyCredential: {
@@ -42419,7 +42471,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4241942471
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4242042472
type PerformanceEntryList = PerformanceEntry[];
4242142473
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42422-
type PublicKeyCredentialJSON = any;
4242342474
type RTCRtpTransform = RTCRtpScriptTransform;
4242442475
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4242542476
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

baselines/ts5.5/dom.generated.d.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ interface AuthenticationExtensionsClientOutputs {
217217
prf?: AuthenticationExtensionsPRFOutputs;
218218
}
219219

220+
interface AuthenticationExtensionsClientOutputsJSON {
221+
appid?: boolean;
222+
credProps?: CredentialPropertiesOutput;
223+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
224+
prf?: AuthenticationExtensionsPRFOutputsJSON;
225+
}
226+
220227
interface AuthenticationExtensionsLargeBlobInputs {
221228
read?: boolean;
222229
support?: string;
@@ -235,6 +242,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
235242
written?: boolean;
236243
}
237244

245+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
246+
blob?: Base64URLString;
247+
supported?: boolean;
248+
written?: boolean;
249+
}
250+
238251
interface AuthenticationExtensionsPRFInputs {
239252
eval?: AuthenticationExtensionsPRFValues;
240253
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -250,6 +263,11 @@ interface AuthenticationExtensionsPRFOutputs {
250263
results?: AuthenticationExtensionsPRFValues;
251264
}
252265

266+
interface AuthenticationExtensionsPRFOutputsJSON {
267+
enabled?: boolean;
268+
results?: AuthenticationExtensionsPRFValuesJSON;
269+
}
270+
253271
interface AuthenticationExtensionsPRFValues {
254272
first: BufferSource;
255273
second?: BufferSource;
@@ -260,6 +278,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
260278
second?: Base64URLString;
261279
}
262280

281+
interface AuthenticationResponseJSON {
282+
authenticatorAttachment?: string;
283+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
284+
id: string;
285+
rawId: Base64URLString;
286+
response: AuthenticatorAssertionResponseJSON;
287+
type: string;
288+
}
289+
290+
interface AuthenticatorAssertionResponseJSON {
291+
authenticatorData: Base64URLString;
292+
clientDataJSON: Base64URLString;
293+
signature: Base64URLString;
294+
userHandle?: Base64URLString;
295+
}
296+
297+
interface AuthenticatorAttestationResponseJSON {
298+
attestationObject: Base64URLString;
299+
authenticatorData: Base64URLString;
300+
clientDataJSON: Base64URLString;
301+
publicKey?: Base64URLString;
302+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
303+
transports: string[];
304+
}
305+
263306
interface AuthenticatorSelectionCriteria {
264307
authenticatorAttachment?: AuthenticatorAttachment;
265308
requireResidentKey?: boolean;
@@ -2104,6 +2147,15 @@ interface RegistrationOptions {
21042147
updateViaCache?: ServiceWorkerUpdateViaCache;
21052148
}
21062149

2150+
interface RegistrationResponseJSON {
2151+
authenticatorAttachment?: string;
2152+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2153+
id: string;
2154+
rawId: Base64URLString;
2155+
response: AuthenticatorAttestationResponseJSON;
2156+
type: string;
2157+
}
2158+
21072159
interface Report {
21082160
body?: ReportBody | null;
21092161
type?: string;
@@ -26950,7 +27002,7 @@ interface PublicKeyCredential extends Credential {
2695027002
*
2695127003
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2695227004
*/
26953-
toJSON(): PublicKeyCredentialJSON;
27005+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2695427006
}
2695527007

2695627008
declare var PublicKeyCredential: {
@@ -42393,7 +42445,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4239342445
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4239442446
type PerformanceEntryList = PerformanceEntry[];
4239542447
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42396-
type PublicKeyCredentialJSON = any;
4239742448
type RTCRtpTransform = RTCRtpScriptTransform;
4239842449
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4239942450
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

baselines/ts5.6/dom.generated.d.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ interface AuthenticationExtensionsClientOutputs {
217217
prf?: AuthenticationExtensionsPRFOutputs;
218218
}
219219

220+
interface AuthenticationExtensionsClientOutputsJSON {
221+
appid?: boolean;
222+
credProps?: CredentialPropertiesOutput;
223+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
224+
prf?: AuthenticationExtensionsPRFOutputsJSON;
225+
}
226+
220227
interface AuthenticationExtensionsLargeBlobInputs {
221228
read?: boolean;
222229
support?: string;
@@ -235,6 +242,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
235242
written?: boolean;
236243
}
237244

245+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
246+
blob?: Base64URLString;
247+
supported?: boolean;
248+
written?: boolean;
249+
}
250+
238251
interface AuthenticationExtensionsPRFInputs {
239252
eval?: AuthenticationExtensionsPRFValues;
240253
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -250,6 +263,11 @@ interface AuthenticationExtensionsPRFOutputs {
250263
results?: AuthenticationExtensionsPRFValues;
251264
}
252265

266+
interface AuthenticationExtensionsPRFOutputsJSON {
267+
enabled?: boolean;
268+
results?: AuthenticationExtensionsPRFValuesJSON;
269+
}
270+
253271
interface AuthenticationExtensionsPRFValues {
254272
first: BufferSource;
255273
second?: BufferSource;
@@ -260,6 +278,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
260278
second?: Base64URLString;
261279
}
262280

281+
interface AuthenticationResponseJSON {
282+
authenticatorAttachment?: string;
283+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
284+
id: string;
285+
rawId: Base64URLString;
286+
response: AuthenticatorAssertionResponseJSON;
287+
type: string;
288+
}
289+
290+
interface AuthenticatorAssertionResponseJSON {
291+
authenticatorData: Base64URLString;
292+
clientDataJSON: Base64URLString;
293+
signature: Base64URLString;
294+
userHandle?: Base64URLString;
295+
}
296+
297+
interface AuthenticatorAttestationResponseJSON {
298+
attestationObject: Base64URLString;
299+
authenticatorData: Base64URLString;
300+
clientDataJSON: Base64URLString;
301+
publicKey?: Base64URLString;
302+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
303+
transports: string[];
304+
}
305+
263306
interface AuthenticatorSelectionCriteria {
264307
authenticatorAttachment?: AuthenticatorAttachment;
265308
requireResidentKey?: boolean;
@@ -2104,6 +2147,15 @@ interface RegistrationOptions {
21042147
updateViaCache?: ServiceWorkerUpdateViaCache;
21052148
}
21062149

2150+
interface RegistrationResponseJSON {
2151+
authenticatorAttachment?: string;
2152+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2153+
id: string;
2154+
rawId: Base64URLString;
2155+
response: AuthenticatorAttestationResponseJSON;
2156+
type: string;
2157+
}
2158+
21072159
interface Report {
21082160
body?: ReportBody | null;
21092161
type?: string;
@@ -26971,7 +27023,7 @@ interface PublicKeyCredential extends Credential {
2697127023
*
2697227024
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2697327025
*/
26974-
toJSON(): PublicKeyCredentialJSON;
27026+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2697527027
}
2697627028

2697727029
declare var PublicKeyCredential: {
@@ -42416,7 +42468,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4241642468
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4241742469
type PerformanceEntryList = PerformanceEntry[];
4241842470
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42419-
type PublicKeyCredentialJSON = any;
4242042471
type RTCRtpTransform = RTCRtpScriptTransform;
4242142472
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4242242473
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

0 commit comments

Comments
 (0)