From 46a515ad8eac7036645ba2303c46b08900999270 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sun, 21 Dec 2025 06:46:17 +0200 Subject: [PATCH 1/6] Support multiple types & update toJSON --- baselines/dom.generated.d.ts | 56 ++++++++++++++++++++++++++++-- baselines/ts5.5/dom.generated.d.ts | 56 ++++++++++++++++++++++++++++-- baselines/ts5.6/dom.generated.d.ts | 56 ++++++++++++++++++++++++++++-- baselines/ts5.9/dom.generated.d.ts | 56 ++++++++++++++++++++++++++++-- inputfiles/patches/webauthn.kdl | 7 ++++ src/build/patches.ts | 40 +++++++++++++-------- 6 files changed, 249 insertions(+), 22 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 70e23ef78..d7c6b6e0e 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -215,6 +215,14 @@ interface AuthenticationExtensionsClientOutputs { prf?: AuthenticationExtensionsPRFOutputs; } +interface AuthenticationExtensionsClientOutputsJSON { + appid?: boolean; + appidExclude?: boolean; + credProps?: CredentialPropertiesOutput; + largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON; + prf?: AuthenticationExtensionsPRFOutputsJSON; +} + interface AuthenticationExtensionsLargeBlobInputs { read?: boolean; support?: string; @@ -233,6 +241,12 @@ interface AuthenticationExtensionsLargeBlobOutputs { written?: boolean; } +interface AuthenticationExtensionsLargeBlobOutputsJSON { + blob?: Base64URLString; + supported?: boolean; + written?: boolean; +} + interface AuthenticationExtensionsPRFInputs { eval?: AuthenticationExtensionsPRFValues; evalByCredential?: Record; @@ -248,6 +262,11 @@ interface AuthenticationExtensionsPRFOutputs { results?: AuthenticationExtensionsPRFValues; } +interface AuthenticationExtensionsPRFOutputsJSON { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValuesJSON; +} + interface AuthenticationExtensionsPRFValues { first: BufferSource; second?: BufferSource; @@ -258,6 +277,31 @@ interface AuthenticationExtensionsPRFValuesJSON { second?: Base64URLString; } +interface AuthenticationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAssertionResponseJSON; + type: string; +} + +interface AuthenticatorAssertionResponseJSON { + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + signature: Base64URLString; + userHandle?: Base64URLString; +} + +interface AuthenticatorAttestationResponseJSON { + attestationObject: Base64URLString; + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + publicKey?: Base64URLString; + publicKeyAlgorithm: COSEAlgorithmIdentifier; + transports: string[]; +} + interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; @@ -2098,6 +2142,15 @@ interface RegistrationOptions { updateViaCache?: ServiceWorkerUpdateViaCache; } +interface RegistrationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAttestationResponseJSON; + type: string; +} + interface Report { body?: ReportBody | null; type?: string; @@ -26953,7 +27006,7 @@ interface PublicKeyCredential extends Credential { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON) */ - toJSON(): PublicKeyCredentialJSON; + toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON; } declare var PublicKeyCredential: { @@ -42398,7 +42451,6 @@ type OptionalPostfixToken = ` ${T}` | ""; type OptionalPrefixToken = `${T} ` | ""; type PerformanceEntryList = PerformanceEntry[]; type PublicKeyCredentialClientCapabilities = Record; -type PublicKeyCredentialJSON = any; type RTCRtpTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index 308ad8250..ee561fd85 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -212,6 +212,14 @@ interface AuthenticationExtensionsClientOutputs { prf?: AuthenticationExtensionsPRFOutputs; } +interface AuthenticationExtensionsClientOutputsJSON { + appid?: boolean; + appidExclude?: boolean; + credProps?: CredentialPropertiesOutput; + largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON; + prf?: AuthenticationExtensionsPRFOutputsJSON; +} + interface AuthenticationExtensionsLargeBlobInputs { read?: boolean; support?: string; @@ -230,6 +238,12 @@ interface AuthenticationExtensionsLargeBlobOutputs { written?: boolean; } +interface AuthenticationExtensionsLargeBlobOutputsJSON { + blob?: Base64URLString; + supported?: boolean; + written?: boolean; +} + interface AuthenticationExtensionsPRFInputs { eval?: AuthenticationExtensionsPRFValues; evalByCredential?: Record; @@ -245,6 +259,11 @@ interface AuthenticationExtensionsPRFOutputs { results?: AuthenticationExtensionsPRFValues; } +interface AuthenticationExtensionsPRFOutputsJSON { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValuesJSON; +} + interface AuthenticationExtensionsPRFValues { first: BufferSource; second?: BufferSource; @@ -255,6 +274,31 @@ interface AuthenticationExtensionsPRFValuesJSON { second?: Base64URLString; } +interface AuthenticationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAssertionResponseJSON; + type: string; +} + +interface AuthenticatorAssertionResponseJSON { + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + signature: Base64URLString; + userHandle?: Base64URLString; +} + +interface AuthenticatorAttestationResponseJSON { + attestationObject: Base64URLString; + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + publicKey?: Base64URLString; + publicKeyAlgorithm: COSEAlgorithmIdentifier; + transports: string[]; +} + interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; @@ -2095,6 +2139,15 @@ interface RegistrationOptions { updateViaCache?: ServiceWorkerUpdateViaCache; } +interface RegistrationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAttestationResponseJSON; + type: string; +} + interface Report { body?: ReportBody | null; type?: string; @@ -26929,7 +26982,7 @@ interface PublicKeyCredential extends Credential { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON) */ - toJSON(): PublicKeyCredentialJSON; + toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON; } declare var PublicKeyCredential: { @@ -42372,7 +42425,6 @@ type OptionalPostfixToken = ` ${T}` | ""; type OptionalPrefixToken = `${T} ` | ""; type PerformanceEntryList = PerformanceEntry[]; type PublicKeyCredentialClientCapabilities = Record; -type PublicKeyCredentialJSON = any; type RTCRtpTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index 3d8546117..08c30221b 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -212,6 +212,14 @@ interface AuthenticationExtensionsClientOutputs { prf?: AuthenticationExtensionsPRFOutputs; } +interface AuthenticationExtensionsClientOutputsJSON { + appid?: boolean; + appidExclude?: boolean; + credProps?: CredentialPropertiesOutput; + largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON; + prf?: AuthenticationExtensionsPRFOutputsJSON; +} + interface AuthenticationExtensionsLargeBlobInputs { read?: boolean; support?: string; @@ -230,6 +238,12 @@ interface AuthenticationExtensionsLargeBlobOutputs { written?: boolean; } +interface AuthenticationExtensionsLargeBlobOutputsJSON { + blob?: Base64URLString; + supported?: boolean; + written?: boolean; +} + interface AuthenticationExtensionsPRFInputs { eval?: AuthenticationExtensionsPRFValues; evalByCredential?: Record; @@ -245,6 +259,11 @@ interface AuthenticationExtensionsPRFOutputs { results?: AuthenticationExtensionsPRFValues; } +interface AuthenticationExtensionsPRFOutputsJSON { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValuesJSON; +} + interface AuthenticationExtensionsPRFValues { first: BufferSource; second?: BufferSource; @@ -255,6 +274,31 @@ interface AuthenticationExtensionsPRFValuesJSON { second?: Base64URLString; } +interface AuthenticationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAssertionResponseJSON; + type: string; +} + +interface AuthenticatorAssertionResponseJSON { + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + signature: Base64URLString; + userHandle?: Base64URLString; +} + +interface AuthenticatorAttestationResponseJSON { + attestationObject: Base64URLString; + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + publicKey?: Base64URLString; + publicKeyAlgorithm: COSEAlgorithmIdentifier; + transports: string[]; +} + interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; @@ -2095,6 +2139,15 @@ interface RegistrationOptions { updateViaCache?: ServiceWorkerUpdateViaCache; } +interface RegistrationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAttestationResponseJSON; + type: string; +} + interface Report { body?: ReportBody | null; type?: string; @@ -26950,7 +27003,7 @@ interface PublicKeyCredential extends Credential { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON) */ - toJSON(): PublicKeyCredentialJSON; + toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON; } declare var PublicKeyCredential: { @@ -42395,7 +42448,6 @@ type OptionalPostfixToken = ` ${T}` | ""; type OptionalPrefixToken = `${T} ` | ""; type PerformanceEntryList = PerformanceEntry[]; type PublicKeyCredentialClientCapabilities = Record; -type PublicKeyCredentialJSON = any; type RTCRtpTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; diff --git a/baselines/ts5.9/dom.generated.d.ts b/baselines/ts5.9/dom.generated.d.ts index 01b293947..d4a02a001 100644 --- a/baselines/ts5.9/dom.generated.d.ts +++ b/baselines/ts5.9/dom.generated.d.ts @@ -212,6 +212,14 @@ interface AuthenticationExtensionsClientOutputs { prf?: AuthenticationExtensionsPRFOutputs; } +interface AuthenticationExtensionsClientOutputsJSON { + appid?: boolean; + appidExclude?: boolean; + credProps?: CredentialPropertiesOutput; + largeBlob?: AuthenticationExtensionsLargeBlobOutputsJSON; + prf?: AuthenticationExtensionsPRFOutputsJSON; +} + interface AuthenticationExtensionsLargeBlobInputs { read?: boolean; support?: string; @@ -230,6 +238,12 @@ interface AuthenticationExtensionsLargeBlobOutputs { written?: boolean; } +interface AuthenticationExtensionsLargeBlobOutputsJSON { + blob?: Base64URLString; + supported?: boolean; + written?: boolean; +} + interface AuthenticationExtensionsPRFInputs { eval?: AuthenticationExtensionsPRFValues; evalByCredential?: Record; @@ -245,6 +259,11 @@ interface AuthenticationExtensionsPRFOutputs { results?: AuthenticationExtensionsPRFValues; } +interface AuthenticationExtensionsPRFOutputsJSON { + enabled?: boolean; + results?: AuthenticationExtensionsPRFValuesJSON; +} + interface AuthenticationExtensionsPRFValues { first: BufferSource; second?: BufferSource; @@ -255,6 +274,31 @@ interface AuthenticationExtensionsPRFValuesJSON { second?: Base64URLString; } +interface AuthenticationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAssertionResponseJSON; + type: string; +} + +interface AuthenticatorAssertionResponseJSON { + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + signature: Base64URLString; + userHandle?: Base64URLString; +} + +interface AuthenticatorAttestationResponseJSON { + attestationObject: Base64URLString; + authenticatorData: Base64URLString; + clientDataJSON: Base64URLString; + publicKey?: Base64URLString; + publicKeyAlgorithm: COSEAlgorithmIdentifier; + transports: string[]; +} + interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; @@ -2095,6 +2139,15 @@ interface RegistrationOptions { updateViaCache?: ServiceWorkerUpdateViaCache; } +interface RegistrationResponseJSON { + authenticatorAttachment?: string; + clientExtensionResults: AuthenticationExtensionsClientOutputsJSON; + id: string; + rawId: Base64URLString; + response: AuthenticatorAttestationResponseJSON; + type: string; +} + interface Report { body?: ReportBody | null; type?: string; @@ -26950,7 +27003,7 @@ interface PublicKeyCredential extends Credential { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON) */ - toJSON(): PublicKeyCredentialJSON; + toJSON(): RegistrationResponseJSON | AuthenticationResponseJSON; } declare var PublicKeyCredential: { @@ -42395,7 +42448,6 @@ type OptionalPostfixToken = ` ${T}` | ""; type OptionalPrefixToken = `${T} ` | ""; type PerformanceEntryList = PerformanceEntry[]; type PublicKeyCredentialClientCapabilities = Record; -type PublicKeyCredentialJSON = any; type RTCRtpTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; diff --git a/inputfiles/patches/webauthn.kdl b/inputfiles/patches/webauthn.kdl index f2f166e3d..14e8374e7 100644 --- a/inputfiles/patches/webauthn.kdl +++ b/inputfiles/patches/webauthn.kdl @@ -1,3 +1,10 @@ +interface PublicKeyCredential { + method toJSON signatureIndex=0 { + type RegistrationResponseJSON + type AuthenticationResponseJSON + } +} + removals { enum AuthenticatorTransport { smart-card // WebKit only as of 2023-05 diff --git a/src/build/patches.ts b/src/build/patches.ts index 26368e585..6e044ef0f 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -62,6 +62,28 @@ function handleTyped(type: Node): DeepPartial { }; } +function handleMultipleTypes( + typeNodes: Node[], + returns?: Value, +): DeepPartial | DeepPartial[] | undefined { + // Support multiple types, merged into array. If only one, keep as object. + let type: DeepPartial | DeepPartial[] | undefined; + if (typeNodes.length === 1) { + type = handleTyped(typeNodes[0]); + } else if (typeNodes.length > 1) { + const types = typeNodes.map(handleTyped); + type = { type: types }; + } else if (returns) { + type = { + type: string(returns), + subtype: undefined, + }; + } else { + type = undefined; + } + return type; +} + function handleTypeParameters(value: Value | Node) { if (!value) { return {}; @@ -300,16 +322,14 @@ function handleParam(node: Node) { function handleMethod(child: Node): DeepPartial { const name = string(child.values[0]); - let typeNode: Node | undefined; + // Collect all type nodes into an array + const typeNodes: Node[] = []; const params: Partial[] = []; for (const c of child.children) { switch (c.name) { case "type": - if (typeNode) { - throw new Error(`Method "${name}" has multiple type nodes (invalid)`); - } - typeNode = c; + typeNodes.push(c); break; case "param": @@ -321,16 +341,8 @@ function handleMethod(child: Node): DeepPartial { } } - const type = typeNode - ? handleTyped(typeNode) - : child.properties?.returns - ? { - type: string(child.properties?.returns), - subtype: undefined, - } - : null; - const signatureIndex = child.properties?.signatureIndex; + const type = handleMultipleTypes(typeNodes, child.properties?.returns); let signature: OverridableMethod["signature"] = []; if (type || params.length > 0) { From c59870a50ffeb2aa0005df085773f0f729ed33e2 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sun, 21 Dec 2025 12:37:30 +0200 Subject: [PATCH 2/6] Rename function --- src/build/patches.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/build/patches.ts b/src/build/patches.ts index 6e044ef0f..eb979f97b 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -48,13 +48,13 @@ function string(arg: unknown): string { return arg; } -function handleTyped(type: Node): DeepPartial { +function handleSingleTypeNode(type: Node): DeepPartial { const isTyped = type.name == "type"; if (!isTyped) { throw new Error("Expected a type node"); } const subType = - type.children.length > 0 ? handleTyped(type.children[0]) : undefined; + type.children.length > 0 ? handleSingleTypeNode(type.children[0]) : undefined; return { ...optionalMember("type", "string", type.values[0]), subtype: subType, @@ -62,16 +62,16 @@ function handleTyped(type: Node): DeepPartial { }; } -function handleMultipleTypes( +function handleTyped( typeNodes: Node[], returns?: Value, -): DeepPartial | DeepPartial[] | undefined { +): DeepPartial | undefined { // Support multiple types, merged into array. If only one, keep as object. - let type: DeepPartial | DeepPartial[] | undefined; + let type: DeepPartial | undefined; if (typeNodes.length === 1) { - type = handleTyped(typeNodes[0]); + type = handleSingleTypeNode(typeNodes[0]); } else if (typeNodes.length > 1) { - const types = typeNodes.map(handleTyped); + const types = typeNodes.map(handleSingleTypeNode); type = { type: types }; } else if (returns) { type = { @@ -282,7 +282,7 @@ function handleProperty(child: Node): DeepPartial { ...optionalMember("optional", "boolean", child.properties?.optional), ...optionalMember("overrideType", "string", child.properties?.overrideType), ...(typeNode - ? handleTyped(typeNode) + ? handleSingleTypeNode(typeNode) : optionalMember("type", "string", child.properties?.type)), ...optionalMember("readonly", "boolean", child.properties?.readonly), ...optionalMember("deprecated", "string", child.properties?.deprecated), @@ -342,7 +342,7 @@ function handleMethod(child: Node): DeepPartial { } const signatureIndex = child.properties?.signatureIndex; - const type = handleMultipleTypes(typeNodes, child.properties?.returns); + const type = handleTyped(typeNodes, child.properties?.returns); let signature: OverridableMethod["signature"] = []; if (type || params.length > 0) { From 0b388054f27f94ee0d8dc7b2ef8b5d09649677e2 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sun, 21 Dec 2025 12:39:05 +0200 Subject: [PATCH 3/6] - --- src/build/patches.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build/patches.ts b/src/build/patches.ts index eb979f97b..5f9a06296 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -54,7 +54,9 @@ function handleSingleTypeNode(type: Node): DeepPartial { throw new Error("Expected a type node"); } const subType = - type.children.length > 0 ? handleSingleTypeNode(type.children[0]) : undefined; + type.children.length > 0 + ? handleSingleTypeNode(type.children[0]) + : undefined; return { ...optionalMember("type", "string", type.values[0]), subtype: subType, From 1779cd335dd339de418e058e40eb891a3110f5f6 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sun, 21 Dec 2025 15:08:28 +0200 Subject: [PATCH 4/6] - --- src/build/patches.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/build/patches.ts b/src/build/patches.ts index 5f9a06296..2aa088453 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -54,9 +54,7 @@ function handleSingleTypeNode(type: Node): DeepPartial { throw new Error("Expected a type node"); } const subType = - type.children.length > 0 - ? handleSingleTypeNode(type.children[0]) - : undefined; + type.children.length > 0 ? handleTyped(type.children) : undefined; return { ...optionalMember("type", "string", type.values[0]), subtype: subType, @@ -270,21 +268,15 @@ function handleEvent(child: Node): Event { * @param child The child node to handle. */ function handleProperty(child: Node): DeepPartial { - let typeNode: Node | undefined; - for (const c of child.children) { - if (c.name === "type") { - typeNode = c; - break; - } - } + const typeNodes = child.children.filter((c) => c.name === "type"); return { name: string(child.values[0]), ...optionalMember("exposed", "string", child.properties?.exposed), ...optionalMember("optional", "boolean", child.properties?.optional), ...optionalMember("overrideType", "string", child.properties?.overrideType), - ...(typeNode - ? handleSingleTypeNode(typeNode) + ...(typeNodes.length > 0 + ? handleTyped(typeNodes, child.properties?.type) : optionalMember("type", "string", child.properties?.type)), ...optionalMember("readonly", "boolean", child.properties?.readonly), ...optionalMember("deprecated", "string", child.properties?.deprecated), From 87954ce4796dacbc431f1eeb3d2079de28a50a6f Mon Sep 17 00:00:00 2001 From: Bashamega Date: Sun, 21 Dec 2025 15:39:24 +0200 Subject: [PATCH 5/6] - --- src/build/patches.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/build/patches.ts b/src/build/patches.ts index 2aa088453..b560b5174 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -275,9 +275,7 @@ function handleProperty(child: Node): DeepPartial { ...optionalMember("exposed", "string", child.properties?.exposed), ...optionalMember("optional", "boolean", child.properties?.optional), ...optionalMember("overrideType", "string", child.properties?.overrideType), - ...(typeNodes.length > 0 - ? handleTyped(typeNodes, child.properties?.type) - : optionalMember("type", "string", child.properties?.type)), + ...handleTyped(typeNodes, child.properties?.type), ...optionalMember("readonly", "boolean", child.properties?.readonly), ...optionalMember("deprecated", "string", child.properties?.deprecated), }; From 6eb4e776b6aa61fcaa0241cae9636cf6df1e2ec4 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Mon, 22 Dec 2025 11:53:33 +0200 Subject: [PATCH 6/6] - --- src/build/patches.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/build/patches.ts b/src/build/patches.ts index b560b5174..57134f10f 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -64,7 +64,7 @@ function handleSingleTypeNode(type: Node): DeepPartial { function handleTyped( typeNodes: Node[], - returns?: Value, + property?: Value, ): DeepPartial | undefined { // Support multiple types, merged into array. If only one, keep as object. let type: DeepPartial | undefined; @@ -73,9 +73,9 @@ function handleTyped( } else if (typeNodes.length > 1) { const types = typeNodes.map(handleSingleTypeNode); type = { type: types }; - } else if (returns) { + } else if (property) { type = { - type: string(returns), + type: string(property), subtype: undefined, }; } else {