Redux: Redux typings

Created on 15 Feb 2016  路  13Comments  路  Source: reduxjs/redux

Current typings on _DefinitelyTyped_ seem to be outdated and not so strict.
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ffceea9dd124d277c4597c7bd12930666ec074c5/redux/redux.d.ts

// Type definitions for Redux v1.0.0
// Project: https://github.com/rackt/redux

I have prepared up-to-date version with more strict approach to type safety -> see it here.

Please update it or add typings to this repo. Or I can update it myself. I can help updating those typings also on future releases :)

Most helpful comment

Typing from #1431 have been released with Redux 3.4.0. Big thanks to everyone who made this happen!

All 13 comments

Please send a PR to DefinitelyTyped. We don鈥檛 maintain them ourselves but your help is very welcome.

@ulfryk As you could see, it's been a while since https://github.com/DefinitelyTyped/DefinitelyTyped/pull/7908 was submitted, and its predecessor https://github.com/DefinitelyTyped/DefinitelyTyped/pull/6629 was stuck for even longer time without approval.

It seems that DefinitelyTyped model outgrown itself and we should move to Typings.

@aikoven - yes I see - my proposition is also on it's way to stuck ;) ( 8093

Another option would be to maintain them directly in the repo, like what is done for ng-redux, with an index.d.ts at the root.
This seems to be the best solution since TypeScript 1.6, see Typings for npm packages, and doesn't require any action from the user to get the typings working.
Your call @gaearon, I can understand your wish of keeping redux free of specific languages considerations as well.

I鈥檓 happy to keep it in our repo if somebody is willing to maintain them.

:+1:
We have been ~10 recurrent people debating on this issue in the various PR at definitlyTyped, so I think there will be plenty of people willing to help on that, myself included.
Plus, if you make a change to Redux's API, outdated typings will only affect TypeScript user, so it will force the community to act, and have no impact on non-TS users (and typings are really easy to do, so the barrier of entry to make a PR is fairly low).

@aikoven, are you ok to bring back your PR here as something compliant with TS 1.6 definition files for npm modules ?

Does anyone see any problem with this approach that I may have missed?

(Pinging @xogeny @Keats @abarre)

:+1: I can help maintaining TS typings in this repo. That is definitely the most user friendly way :)

@wbuchwalter I'll do it.

I think that the approach of keeping the definition file in this repo is better.
So, +1.

+1

Keeping a typing a here is much better in my opinion. I've had very good luck with npm+TS using latest versions of TS.

Done.

Please help review the new official typings in https://github.com/reactjs/redux/pull/1413.

Typing from #1431 have been released with Redux 3.4.0. Big thanks to everyone who made this happen!

Was this page helpful?
0 / 5 - 0 ratings