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

TypeScript type definitions not available #135

Open
fcrick opened this issue Sep 14, 2018 · 2 comments
Open

TypeScript type definitions not available #135

fcrick opened this issue Sep 14, 2018 · 2 comments

Comments

@fcrick
Copy link

fcrick commented Sep 14, 2018

Not really your problem, per say, but if libraries maintain their own type definitions they tend to stay in sync better than ones provided separately. This would be a big help for fengari, specifically, as the API is quite large, and already has great documentation, so getting all that info to show up in tooling and be type checked would mean a big gain for not much work.

Usually the process is something like:

  1. Add something like "types": "types/index.d.ts", to package.json and make sure it's included in the published package.
  2. Add types/index.d.ts with all the types.

Alternatively, the types can be published separately as the package @types/fengari. I'm not exactly sure what the process around that is but it looks like these are added via pull requests to https://github.com/DefinitelyTyped/DefinitelyTyped

I might try to get this started at some point if time permits.

Thanks for making fengari! I think I'll find it incredibly useful.

@daurnimator
Copy link
Member

I don't think any of us are Typescript users, so we don't have the expertise to create such type definition files.
That said, if you were to send a PR with 80% of the API covered, I'd be happy to merge+maintain it.

@roddypratt
Copy link

I'm actually working on this now, I have most of the API functions defined, and a typescript version of lapi.test.js which compiles and runs cleanly.

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

No branches or pull requests

3 participants