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

Package does not contains typings for Typescript development #9

Closed
TheAifam5 opened this Issue Feb 10, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@TheAifam5
Copy link
Contributor

TheAifam5 commented Feb 10, 2019

Hey!
I see that the project is written using TypeScript. I wonder why there is no typings for that.
You can generate typings by settings declarationDir/declarationMap and adding to package.json that line: "types": "./dist/main.d.ts".

Regards,
TheAifam5

@dance2die

This comment has been minimized.

Copy link
Owner

dance2die commented Feb 10, 2019

Thanks @TheAifam5~ 🙂

As I am still new to TypeScript, I totally forgot about generating the type definitions 😅

I will add the typings.

@dance2die

This comment has been minimized.

Copy link
Owner

dance2die commented Feb 10, 2019

@allcontributors please add @TheAifam5 for ideas

@allcontributors

This comment has been minimized.

Copy link
Contributor

allcontributors bot commented Feb 10, 2019

@dance2die

I've put up a pull request to add @TheAifam5! 🎉

dance2die added a commit that referenced this issue Feb 10, 2019

Add typings as mentioned in #9 (#11)
*  Added TypeScript typings and source map

*  Added TypeScript typings and source map mentioned in #9
@dance2die

This comment has been minimized.

Copy link
Owner

dance2die commented Feb 10, 2019

@TheAifam5 I've added typings & sourcemap in the distribution

https://unpkg.com/react-use-localstorage@2.4.1/dist/

Also learned that not specifying the return type explicitly, TypeScript generated wrong return type of (string | (item: string) => void) instead of [string | (item: string) => void] so fixed it as well in v2.4.1 🙂

@dance2die dance2die closed this Feb 10, 2019

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