mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
9 lines (8 loc) • 402 B
TypeScript
import { AnyFunction } from '../utils/AnyFunction';
/**
* Calls an object method wrapped in an action.
*
* @param node Target object.
* @param methodName Method name.
*/
export declare function applyMethodCall<O extends object, K extends keyof O, FN extends O[K]>(node: O, methodName: K, ...args: FN extends AnyFunction ? Parameters<FN> : never): FN extends AnyFunction ? ReturnType<FN> : never;