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

How to generate typescript typings from WebIDL #9674

Closed
giniedp opened this issue Oct 19, 2019 · 5 comments
Closed

How to generate typescript typings from WebIDL #9674

giniedp opened this issue Oct 19, 2019 · 5 comments
Labels

Comments

@giniedp
Copy link

giniedp commented Oct 19, 2019

I am new to emscripten and curious about how people generate d.ts files for 3rd party C++ libraries where nbind or mbind is not an option.

A couple of weeks ago i have written an WebIDL -> d.ts converter specifically for ammo.js

Before doing that i was looking for an existing WebIDL -> d.ts conversion tool but could not find any complete solution. The closest i could find was

so i am left with these questions

  1. is there a WebIDL -> d.ts converter outside of emscripten that i have overseen?
  2. is such tool desired for emscripten (or maybe already exists)?
  3. should such a tool be part of emscripten or should it be a standalone project
@kripken
Copy link
Member

kripken commented Oct 21, 2019

I don't think there is one. I think it could be useful! And yes, would be good to have it in emscripten itself.

@stale
Copy link

stale bot commented Oct 21, 2020

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Oct 21, 2020
@stale stale bot closed this as completed Nov 21, 2020
@tchakabam
Copy link

@giniedp I have understood you built it yourself? :) https://github.com/giniedp/webidl2ts

@giniedp
Copy link
Author

giniedp commented Dec 19, 2022

@giniedp I have understood you built it yourself? :) https://github.com/giniedp/webidl2ts

yes, i did. But haven't worked on that topic for a while now.

@isaac-mason
Copy link

isaac-mason commented Apr 6, 2024

JoltPhysics.js and recast-navigation-js are using a fork of @giniedp's webidl2ts to generate typescript types from the emscripten webidl: https://github.com/pmndrs/webidl-dts-gen

We've stumbled through adding fixes aligning generated types with the output of the webidl binder. @giniedp if you're still working on webidl2ts I'm keen to upstream the improvements.

Like webidl2ts, webidl-dts-gen still has an emscripten and non-emscripten mode, but I'm really only supporting it for usage with emscripten.

I'm also keen to help improve the typescript story for the webidl binder itself, but I'm lacking in direction 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants