Skip to content

Add definitions for TypeScript #127

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

Merged
merged 3 commits into from
Nov 4, 2016
Merged

Add definitions for TypeScript #127

merged 3 commits into from
Nov 4, 2016

Conversation

forabi
Copy link
Contributor

@forabi forabi commented Oct 23, 2016

This helps IDEs like VS Code and Atom with TypeScript plugins understand the types of different functions and exports and warn about issues with typos/incompatible types... etc

@omnidan
Copy link
Owner

omnidan commented Nov 4, 2016

Thank you for the PR, @forabi 😁 I am not too familiar with typescript, is it normal to start type names with a lowercase character? I think that's a bit confusing (maybe I'm just used to the naming conventions of types in other languages, like Haskell, though).

@forabi
Copy link
Contributor Author

forabi commented Nov 4, 2016

I'm not too familiar with TS either 😄

Actually this is the first time I use TypeScript in a large project and VS Code kept complaining about the missing definition file. So I had to write it myself and reference it manually.

I thought it might be a good idea to have them in the package itself.

As for the naming of types, I am not sure, I have seen many projects with different naming conventions, some prefix types with a T and interfaces with an I. Some just use a capital letter.

I see your point however, I've updated the PR to keep names consistent.

@omnidan
Copy link
Owner

omnidan commented Nov 4, 2016

@forabi Thanks for the quick response! Looks good to me now 😁

@omnidan omnidan merged commit 41b8a5d into omnidan:master Nov 4, 2016
@jfstephe
Copy link

jfstephe commented Dec 9, 2016

@forabi - quick question.... I tried running 'typings install [email protected]' to get the TS definitions but it failed. Can you tell me how are you getting the types?

Many thanks!

@forabi
Copy link
Contributor Author

forabi commented Dec 9, 2016

@jfstephe You do not need to use typings install, definition files are included in the npm package and they should be automatically picked up by TypeScript language service just by doing npm install redux-undo

@jfstephe
Copy link

jfstephe commented Dec 9, 2016

ah - indeed. I'm using jspm and I think microsoft/TypeScript#6012 is biting me. Thanks for jolting my grey cells :-).

@jessewatson
Copy link

Newbie question (typescript related)... I am not seeing any type definitions after an "npm install redux-undo" - it looks like npm is pulling down [email protected] by default. When I tried "npm install [email protected]", it says "invalid" and appears to be the unbuilt source tree.

Do I need to git clone it and build it myself? Are there docs for this?

@omnidan
Copy link
Owner

omnidan commented Jan 26, 2017

@jessewatson did you try installing via npm install redux-undo@beta (as described in the README)?

@jessewatson
Copy link

@omnidan - Wow - no idea how I missed that. Thanks!

@omnidan
Copy link
Owner

omnidan commented Jan 26, 2017

@jessewatson no worries 😉 glad it works now 😁

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

Successfully merging this pull request may close these issues.

4 participants