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

Add definitions for TypeScript #127

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 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 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 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
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@jfstephe
Copy link

@jfstephe jfstephe commented Dec 9, 2016

@forabi - quick question.... I tried running 'typings install redux-undo@1.0.0-beta9-2' 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 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 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

@jessewatson jessewatson commented Jan 25, 2017

Newbie question (typescript related)... I am not seeing any type definitions after an "npm install redux-undo" - it looks like npm is pulling down redux-undo@0.6.1 by default. When I tried "npm install redux-undo@1.0.0-beta9-2", 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 omnidan commented Jan 26, 2017

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

@jessewatson
Copy link

@jessewatson jessewatson commented Jan 26, 2017

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

@omnidan
Copy link
Owner

@omnidan 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants