type RemoveFirstParameter = T extends (first: any, ...rest: infer P) => infer R ? (...args: P) => R : never; type Mutation = (arg: { state: S; mutations: MutationTree; }, value: any) => any; type Action = (arg: { state: S; mutations: { [K in keyof M]: RemoveFirstParameter; }; actions: ActionTree; }, value: any) => any; interface MutationTree { [key: string]: Mutation; } interface ActionTree { [key: string]: Action; } export default function regie, A>({ initialState, actions, mutations, }?: { initialState?: S; actions?: A & ActionTree; mutations?: M; }): { state: S; observe: (mapper: any, handler: (value: any, change: any) => void) => () => void; actions: { [key in keyof A]: RemoveFirstParameter; }; mutations: { [key in keyof M]: RemoveFirstParameter; }; $$register: any; }; export {};