okwolf/hyperapp-fx

Missing TypeScript declaration file

Frikki opened this issue · 2 comments

The README file indicates that the library is typed. For example:

EffectsConfig = {
  [effectName]: (
    props: object,
    getAction: (name: string) => Action
  ) => undefined
}
withFx = App => App | EffectsConfig => App => App

EffectTuple = [type: string, props: object]
Effect = EffectTuple | EffectTuple[] | Effect[]

action = (name: string, data?: any) => EffectTuple

However, TypeScript alerts:

Could not find a declaration file for module '@hyperapp/fx'

when import { withFx } from '@hyperapp/fx.

hyperapp has type declarations. Is there a particular reason why @hyperapp/fx doesn’t?

You are correct that @hyperapp/fx does not include type definitions. I am not a TypeScript user and any resemblance to TypeScript in the documentation is purely coincidental.

If someone who does know TypeScript wants to submit a PR for typings to improve IntelliSense DX with @hyperapp/fx we would be happy to take a look.

I made a local types declaration file to get the things working in my TS environment. I’d be happy to submit a PR or maybe even share a gist first to discuss.