Skip to content

Support multiple types & update toJSON - #2304

Merged
github-actions[bot] merged 9 commits into
microsoft:mainfrom
Bashamega:toJSON
Dec 24, 2025
Merged

github-actions[bot] merged 9 commits into
microsoft:mainfrom
Bashamega:toJSON

Conversation

@Bashamega

Copy link
Copy Markdown
Contributor

fixes #2114

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by Kagami Sascha Rosylight (@saschanaz) - if they write a comment saying "LGTM" then it will be merged.

@Bashamega

Copy link
Copy Markdown
Contributor Author

What do you think Lucas Garron (@lgarron)

Comment thread src/build/patches.ts Outdated
function handleMultipleTypes(
typeNodes: Node[],
returns?: Value,
): DeepPartial<Typed> | DeepPartial<Typed>[] | undefined {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's DeepPartial<Typed> | undefined, no? It never returns an array.

And this function should be called handleTyped and the singular version should be called handleSingleTypeNode or something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/build/patches.ts Outdated
...optionalMember("overrideType", "string", child.properties?.overrideType),
...(typeNode
? handleTyped(typeNode)
? handleSingleTypeNode(typeNode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? properties can have union types too. handleSingleTypeNode should not be called outside handleTyped.

Comment thread src/build/patches.ts Outdated
const subType =
type.children.length > 0 ? handleTyped(type.children[0]) : undefined;
type.children.length > 0
? handleSingleTypeNode(type.children[0])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And subtypes can be union too

@Bashamega

Copy link
Copy Markdown
Contributor Author

Done

Comment thread src/build/patches.ts Outdated

function handleTyped(
typeNodes: Node[],
returns?: Value,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns? you mean property?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot to include it i will fix it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still forgot this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed it

@Bashamega

Copy link
Copy Markdown
Contributor Author

Better?

@Bashamega

Copy link
Copy Markdown
Contributor Author

Is there any thing missing here Kagami Sascha Rosylight (@saschanaz)

Comment thread baselines/dom.generated.d.ts Outdated

interface AuthenticationExtensionsClientOutputsJSON {
appid?: boolean;
appidExclude?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this has no implementation, otherwise seems good

@saschanaz

Copy link
Copy Markdown
Contributor

LGTM, thanks!

@github-actions

Copy link
Copy Markdown
Contributor

Merging because Kagami Sascha Rosylight (@saschanaz) is a code-owner of all the changes - thanks!

@github-actions
github-actions Bot merged commit da23e62 into microsoft:main Dec 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.toJSON() on PublicKeyCredential effectively returns any

2 participants