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 definition #242

Open
ramarro123 opened this issue Oct 19, 2017 · 4 comments
Open

typescript definition #242

ramarro123 opened this issue Oct 19, 2017 · 4 comments

Comments

@ramarro123
Copy link

Hi, do you know if there is typescript definition for preloadjs 1?

@lannymcnie
Copy link
Member

I don't think there is. We don't currently manage or update the DefinitelyTyped definitions, but plan to take that over as we roll into ES6 for the next version.

In the mean time, the API for 1.0 is very similar to 0.6.2, and should work fine.

@ramarro123
Copy link
Author

tnx :) the d.ts of 0.6.2 it's not very good imho, everything it's object | any[] | string, making using typescript less than optimal (i can pass any params without having any compilation issue)

anyway, it work as expected with 0.6.2 definition, tnx

@ramarro123
Copy link
Author

just to say, loadManifest for instance shouldn't be (obj | any[] | string) but
customtype | LoadItem[] | string | string[]

and customtype = {src, callback}

or i am wrong? just to enforce compilation issue of wrong params (i see in my code that someone use "id" attr as an array (in loaditem), and everything work, but id it's stated to be a string and data should be used to pass custom values)

that's why i love typescript, with strong definition, it will avoid this kind of things

@lannymcnie
Copy link
Member

Agree, they should be better. Looking forward to supporting this officially, as we would definitely want to be as specific as possible!

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

2 participants