@owlsdepartment/vuex-typed
Version:
Package for writing typed Vuex store with component helpers
10 lines (9 loc) • 474 B
TypeScript
import { MethodWithoutFirstParam, ObjectWithMethods, WrapInPromise } from "../typings/types";
import { WithHelpers } from "./addHelpers";
export declare type MappedActions<A extends ObjectWithMethods> = {
[K in keyof A]: MethodWithoutFirstParam<A[K], WrapInPromise<ReturnType<A[K]>>>;
};
/**
* Get Vuex actions object, mapped for export
*/
export declare function getActions<A extends ObjectWithMethods>(actions: A, namespace?: string): WithHelpers<MappedActions<A>>;