autodux
autodux copied to clipboard
TypeScript support?
Hi,
do you plan to export some TypeScript/Flow definitions for the library?
I was wondering the same thing.
Please PR. Add typings in separate files.
Any news on this one?
Looking for volunteers to lead the charge.
Please take a look at this definitions draft:
declare module 'autodux' {
interface LooseObject {
[prop: string]: any,
selectTime: any
}
interface ReducerSlice {
initial: any,
actions?: LooseObject,
selectors?: {},
slice: string
}
interface AutoReducerSlice {
initial: any,
reducer: {},
slice: string,
actions: LooseObject,
selectors: LooseObject
}
const autodux: (arguments: ReducerSlice) => AutoReducerSlice;
export default autodux
}
Please feel free to PR. Maybe @warrenv can test & review?
Not looking great, and not quite "typed". But I am not sure TS could properly handle dynamic interface creation.
Still open to PRs. =)
I came up with this which I think gets close.
I'm thinking of doing an update that will have TypeScript definitions in a d.ts
file.