autodux icon indicating copy to clipboard operation
autodux copied to clipboard

TypeScript support?

Open devlato opened this issue 6 years ago • 9 comments

Hi,

do you plan to export some TypeScript/Flow definitions for the library?

devlato avatar Apr 13 '18 21:04 devlato

I was wondering the same thing.

lydia-schow avatar Apr 16 '18 16:04 lydia-schow

Please PR. Add typings in separate files.

ericelliott avatar Apr 16 '18 17:04 ericelliott

Any news on this one?

zvertovsek avatar May 09 '18 08:05 zvertovsek

Looking for volunteers to lead the charge.

ericelliott avatar May 09 '18 21:05 ericelliott

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
}

andrii-maglovanyi avatar Jun 03 '18 20:06 andrii-maglovanyi

Please feel free to PR. Maybe @warrenv can test & review?

ericelliott avatar Aug 01 '18 02:08 ericelliott

Not looking great, and not quite "typed". But I am not sure TS could properly handle dynamic interface creation.

theKashey avatar Aug 20 '18 00:08 theKashey

Still open to PRs. =)

ericelliott avatar Aug 29 '18 04:08 ericelliott

I came up with this which I think gets close.

rssfrncs avatar Apr 16 '21 10:04 rssfrncs

I'm thinking of doing an update that will have TypeScript definitions in a d.ts file.

ericelliott avatar Feb 28 '23 00:02 ericelliott