declare type CreateMethods = (state: T) => { [P in keyof M]: (payload?: any) => T; }; declare type WrappedMethods = { [P in keyof M]: (...payload: any) => void; }; declare const useMethods: (createMethods: CreateMethods, initialState: T) => [T, WrappedMethods]; export default useMethods;