Skip to content

Commit 46a515a

Browse files
committed
Support multiple types & update toJSON
1 parent 636c228 commit 46a515a

File tree

6 files changed

+249
-22
lines changed

6 files changed

+249
-22
lines changed

baselines/dom.generated.d.ts

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ interface AuthenticationExtensionsClientOutputs {
215215
prf?: AuthenticationExtensionsPRFOutputs;
216216
}
217217

218+
interface AuthenticationExtensionsClientOutputsJSON {
219+
appid?: boolean;
220+
appidExclude?: boolean;
221+
credProps?: CredentialPropertiesOutput;
222+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
223+
prf?: AuthenticationExtensionsPRFOutputsJSON;
224+
}
225+
218226
interface AuthenticationExtensionsLargeBlobInputs {
219227
read?: boolean;
220228
support?: string;
@@ -233,6 +241,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
233241
written?: boolean;
234242
}
235243

244+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
245+
blob?: Base64URLString;
246+
supported?: boolean;
247+
written?: boolean;
248+
}
249+
236250
interface AuthenticationExtensionsPRFInputs {
237251
eval?: AuthenticationExtensionsPRFValues;
238252
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -248,6 +262,11 @@ interface AuthenticationExtensionsPRFOutputs {
248262
results?: AuthenticationExtensionsPRFValues;
249263
}
250264

265+
interface AuthenticationExtensionsPRFOutputsJSON {
266+
enabled?: boolean;
267+
results?: AuthenticationExtensionsPRFValuesJSON;
268+
}
269+
251270
interface AuthenticationExtensionsPRFValues {
252271
first: BufferSource;
253272
second?: BufferSource;
@@ -258,6 +277,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
258277
second?: Base64URLString;
259278
}
260279

280+
interface AuthenticationResponseJSON {
281+
authenticatorAttachment?: string;
282+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
283+
id: string;
284+
rawId: Base64URLString;
285+
response: AuthenticatorAssertionResponseJSON;
286+
type: string;
287+
}
288+
289+
interface AuthenticatorAssertionResponseJSON {
290+
authenticatorData: Base64URLString;
291+
clientDataJSON: Base64URLString;
292+
signature: Base64URLString;
293+
userHandle?: Base64URLString;
294+
}
295+
296+
interface AuthenticatorAttestationResponseJSON {
297+
attestationObject: Base64URLString;
298+
authenticatorData: Base64URLString;
299+
clientDataJSON: Base64URLString;
300+
publicKey?: Base64URLString;
301+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
302+
transports: string[];
303+
}
304+
261305
interface AuthenticatorSelectionCriteria {
262306
authenticatorAttachment?: AuthenticatorAttachment;
263307
requireResidentKey?: boolean;
@@ -2098,6 +2142,15 @@ interface RegistrationOptions {
20982142
updateViaCache?: ServiceWorkerUpdateViaCache;
20992143
}
21002144

2145+
interface RegistrationResponseJSON {
2146+
authenticatorAttachment?: string;
2147+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2148+
id: string;
2149+
rawId: Base64URLString;
2150+
response: AuthenticatorAttestationResponseJSON;
2151+
type: string;
2152+
}
2153+
21012154
interface Report {
21022155
body?: ReportBody | null;
21032156
type?: string;
@@ -26953,7 +27006,7 @@ interface PublicKeyCredential extends Credential {
2695327006
*
2695427007
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2695527008
*/
26956-
toJSON(): PublicKeyCredentialJSON;
27009+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2695727010
}
2695827011

2695927012
declare var PublicKeyCredential: {
@@ -42398,7 +42451,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4239842451
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4239942452
type PerformanceEntryList = PerformanceEntry[];
4240042453
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42401-
type PublicKeyCredentialJSON = any;
4240242454
type RTCRtpTransform = RTCRtpScriptTransform;
4240342455
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4240442456
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

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

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ interface AuthenticationExtensionsClientOutputs {
212212
prf?: AuthenticationExtensionsPRFOutputs;
213213
}
214214

215+
interface AuthenticationExtensionsClientOutputsJSON {
216+
appid?: boolean;
217+
appidExclude?: boolean;
218+
credProps?: CredentialPropertiesOutput;
219+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
220+
prf?: AuthenticationExtensionsPRFOutputsJSON;
221+
}
222+
215223
interface AuthenticationExtensionsLargeBlobInputs {
216224
read?: boolean;
217225
support?: string;
@@ -230,6 +238,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
230238
written?: boolean;
231239
}
232240

241+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
242+
blob?: Base64URLString;
243+
supported?: boolean;
244+
written?: boolean;
245+
}
246+
233247
interface AuthenticationExtensionsPRFInputs {
234248
eval?: AuthenticationExtensionsPRFValues;
235249
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -245,6 +259,11 @@ interface AuthenticationExtensionsPRFOutputs {
245259
results?: AuthenticationExtensionsPRFValues;
246260
}
247261

262+
interface AuthenticationExtensionsPRFOutputsJSON {
263+
enabled?: boolean;
264+
results?: AuthenticationExtensionsPRFValuesJSON;
265+
}
266+
248267
interface AuthenticationExtensionsPRFValues {
249268
first: BufferSource;
250269
second?: BufferSource;
@@ -255,6 +274,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
255274
second?: Base64URLString;
256275
}
257276

277+
interface AuthenticationResponseJSON {
278+
authenticatorAttachment?: string;
279+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
280+
id: string;
281+
rawId: Base64URLString;
282+
response: AuthenticatorAssertionResponseJSON;
283+
type: string;
284+
}
285+
286+
interface AuthenticatorAssertionResponseJSON {
287+
authenticatorData: Base64URLString;
288+
clientDataJSON: Base64URLString;
289+
signature: Base64URLString;
290+
userHandle?: Base64URLString;
291+
}
292+
293+
interface AuthenticatorAttestationResponseJSON {
294+
attestationObject: Base64URLString;
295+
authenticatorData: Base64URLString;
296+
clientDataJSON: Base64URLString;
297+
publicKey?: Base64URLString;
298+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
299+
transports: string[];
300+
}
301+
258302
interface AuthenticatorSelectionCriteria {
259303
authenticatorAttachment?: AuthenticatorAttachment;
260304
requireResidentKey?: boolean;
@@ -2095,6 +2139,15 @@ interface RegistrationOptions {
20952139
updateViaCache?: ServiceWorkerUpdateViaCache;
20962140
}
20972141

2142+
interface RegistrationResponseJSON {
2143+
authenticatorAttachment?: string;
2144+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2145+
id: string;
2146+
rawId: Base64URLString;
2147+
response: AuthenticatorAttestationResponseJSON;
2148+
type: string;
2149+
}
2150+
20982151
interface Report {
20992152
body?: ReportBody | null;
21002153
type?: string;
@@ -26929,7 +26982,7 @@ interface PublicKeyCredential extends Credential {
2692926982
*
2693026983
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2693126984
*/
26932-
toJSON(): PublicKeyCredentialJSON;
26985+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2693326986
}
2693426987

2693526988
declare var PublicKeyCredential: {
@@ -42372,7 +42425,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4237242425
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4237342426
type PerformanceEntryList = PerformanceEntry[];
4237442427
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42375-
type PublicKeyCredentialJSON = any;
4237642428
type RTCRtpTransform = RTCRtpScriptTransform;
4237742429
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4237842430
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

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

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ interface AuthenticationExtensionsClientOutputs {
212212
prf?: AuthenticationExtensionsPRFOutputs;
213213
}
214214

215+
interface AuthenticationExtensionsClientOutputsJSON {
216+
appid?: boolean;
217+
appidExclude?: boolean;
218+
credProps?: CredentialPropertiesOutput;
219+
largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON;
220+
prf?: AuthenticationExtensionsPRFOutputsJSON;
221+
}
222+
215223
interface AuthenticationExtensionsLargeBlobInputs {
216224
read?: boolean;
217225
support?: string;
@@ -230,6 +238,12 @@ interface AuthenticationExtensionsLargeBlobOutputs {
230238
written?: boolean;
231239
}
232240

241+
interface AuthenticationExtensionsLargeBlobOutputsJSON {
242+
blob?: Base64URLString;
243+
supported?: boolean;
244+
written?: boolean;
245+
}
246+
233247
interface AuthenticationExtensionsPRFInputs {
234248
eval?: AuthenticationExtensionsPRFValues;
235249
evalByCredential?: Record<string, AuthenticationExtensionsPRFValues>;
@@ -245,6 +259,11 @@ interface AuthenticationExtensionsPRFOutputs {
245259
results?: AuthenticationExtensionsPRFValues;
246260
}
247261

262+
interface AuthenticationExtensionsPRFOutputsJSON {
263+
enabled?: boolean;
264+
results?: AuthenticationExtensionsPRFValuesJSON;
265+
}
266+
248267
interface AuthenticationExtensionsPRFValues {
249268
first: BufferSource;
250269
second?: BufferSource;
@@ -255,6 +274,31 @@ interface AuthenticationExtensionsPRFValuesJSON {
255274
second?: Base64URLString;
256275
}
257276

277+
interface AuthenticationResponseJSON {
278+
authenticatorAttachment?: string;
279+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
280+
id: string;
281+
rawId: Base64URLString;
282+
response: AuthenticatorAssertionResponseJSON;
283+
type: string;
284+
}
285+
286+
interface AuthenticatorAssertionResponseJSON {
287+
authenticatorData: Base64URLString;
288+
clientDataJSON: Base64URLString;
289+
signature: Base64URLString;
290+
userHandle?: Base64URLString;
291+
}
292+
293+
interface AuthenticatorAttestationResponseJSON {
294+
attestationObject: Base64URLString;
295+
authenticatorData: Base64URLString;
296+
clientDataJSON: Base64URLString;
297+
publicKey?: Base64URLString;
298+
publicKeyAlgorithm: COSEAlgorithmIdentifier;
299+
transports: string[];
300+
}
301+
258302
interface AuthenticatorSelectionCriteria {
259303
authenticatorAttachment?: AuthenticatorAttachment;
260304
requireResidentKey?: boolean;
@@ -2095,6 +2139,15 @@ interface RegistrationOptions {
20952139
updateViaCache?: ServiceWorkerUpdateViaCache;
20962140
}
20972141

2142+
interface RegistrationResponseJSON {
2143+
authenticatorAttachment?: string;
2144+
clientExtensionResults: AuthenticationExtensionsClientOutputsJSON;
2145+
id: string;
2146+
rawId: Base64URLString;
2147+
response: AuthenticatorAttestationResponseJSON;
2148+
type: string;
2149+
}
2150+
20982151
interface Report {
20992152
body?: ReportBody | null;
21002153
type?: string;
@@ -26950,7 +27003,7 @@ interface PublicKeyCredential extends Credential {
2695027003
*
2695127004
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON)
2695227005
*/
26953-
toJSON(): PublicKeyCredentialJSON;
27006+
toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON;
2695427007
}
2695527008

2695627009
declare var PublicKeyCredential: {
@@ -42395,7 +42448,6 @@ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
4239542448
type OptionalPrefixToken<T extends string> = `${T} ` | "";
4239642449
type PerformanceEntryList = PerformanceEntry[];
4239742450
type PublicKeyCredentialClientCapabilities = Record<string, boolean>;
42398-
type PublicKeyCredentialJSON = any;
4239942451
type RTCRtpTransform = RTCRtpScriptTransform;
4240042452
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
4240142453
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;

0 commit comments

Comments
 (0)