Skip to content

Instantly share code, notes, and snippets.

@ktsn
Created January 23, 2017 16:06
Show Gist options
  • Save ktsn/bb0b2a127020c6240729d7f711c6b3cb to your computer and use it in GitHub Desktop.
Save ktsn/bb0b2a127020c6240729d7f711c6b3cb to your computer and use it in GitHub Desktop.
type FnMapperR<T> = {
[K in keyof T]: (...args: any[]) => T[K]
}
type FnMapper2<T, U, R> = {
[K in keyof U]: (t: T, u: U[K]) => R
}
declare function module <S, G, A, M> (module: {
namespaced?: boolean,
state?: Class<S>,
getters?: FnMapperR<G>,
actions?: FnMapper2<ActionContext<S, G>, A, Promise<any> | void>,
mutations?: FnMapper2<S, M, void>
}): Module<S, G, A, M>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment