Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[embind] Use type alias for string arguments definitions. #21694

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

brendandahl
Copy link
Collaborator

Makes the TypeScript output easier to read.

Fixes #21642

@brendandahl brendandahl requested a review from sbc100 April 4, 2024 21:58
test/other/embind_tsgen.d.ts Outdated Show resolved Hide resolved
@@ -373,6 +379,9 @@ var LibraryEmbind = {
def.printModuleEntry(this.typeToJsName.bind(this), out);
}
out.push('}');
if (this.usedEmbindString) {
out.push('type EmbindString = ArrayBuffer|Uint8Array|Uint8ClampedArray|Int8Array|string;\n');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we avoid outputting this more than once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will only happen once per TS generation.

@brendandahl brendandahl merged commit cb158e3 into emscripten-core:main Apr 9, 2024
29 checks passed
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Apr 11, 2024
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.

embind d.ts defintion for std::string
2 participants