-
Notifications
You must be signed in to change notification settings - Fork 114
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
Make it TypeScript compatible #19
Comments
Yes, I would like to convert the source code to TypeScript. This requires some fiddling with the build setup to get this all working though. Help would be welcome. |
So - now that v6 is released and in lieu of source being in TypeScript - will there be .d.ts file provided? DefinitelyTyped is missing this project |
Yes the plan is to make this a TypeScript project. The Svelte setup is TypeScript-ready but there where some issues getting the mocha tests working with TypeScript files. Help would be welcome. |
I've fixed the setup so it all works with TypeScript. I've converted a couple of files already, though most files still have to be converted. We'll get there 😄 |
Thanks for the update, but ideally the Doing
Still results in And once that's created, a module or interface will be needed for the whole library too, e.g.
Cheers 👍 |
Also - The
|
Yes indeed, there is work to be done. A couple of things:
|
Things should be improved a lot in Can you give it a try @cloakedninjas? |
I see when using the bundle, the type definitions can be found, but in a typical setup you get a lot of warnings about missing source maps (pointing to TypeScript source files that are not part of the npm package). Looking into it. |
Just installed
Which relies on
in But we don't use Svelte in our project |
Thanks for trying it out. That is a good point. Those interfaces are indeed defined in the Svelte package. So either you will have to import Help would be welcome. |
If auto-generating these definitions is proving tricky, then I would suggest crafting a manual Since I don't image Svelte should be a required dependency for users of the ES bundle |
Yes indeed, the library should not require installing Manually crafting the definitions could be an option indeed, though auto generating them has my preference as a maintainer of the library 😁 . The definitions are part of the library itself and I think we should not move them to a separate |
To solve the missing TypeScript definitions of svelte, I've made Also, I managed to fix the sourcemap, so that is included again in Can you guys give it a try? |
I've just published
The I'm closing this issue now. If there are still TS related issues please reopen a new issue. |
Pardon for posting after closed, but are there typings for the |
@CarterFendley yes there are typings for I did a little test in a new react typescript app to see if I get types, that works as far as I can see: |
I am using typescript in my project and e.g. when I use "createAjvValidator" and pass it a schema, TypeScript complains because due to the comment in the code it thinks there is some JSON type and my data is not of that type.
It would be great if the exposed functions would be made properly TypeScript compatible, or at least fixed in a way that TypeScript is not confused and treats everything as
any
instead of non-existing types.The text was updated successfully, but these errors were encountered: