UNPKG

mobx-keystone-mindreframer

Version:

A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more

23 lines (22 loc) 862 B
import type { O } from "ts-toolbelt"; import type { AnyDataModel } from "../dataModel/BaseDataModel"; import type { AnyModel } from "../model/BaseModel"; import { ActionContext, ActionContextActionType } from "./context"; /** * @ignore */ export declare type WrapInActionOverrideContextFn = (ctx: O.Writable<ActionContext>, self: any) => void; /** * @ignore */ export declare function wrapInAction<T extends Function>({ nameOrNameFn, fn, actionType, overrideContext, isFlowFinisher, }: { nameOrNameFn: string | (() => string); fn: T; actionType: ActionContextActionType; overrideContext?: WrapInActionOverrideContextFn; isFlowFinisher?: boolean; }): T; /** * @ignore */ export declare function wrapModelMethodInActionIfNeeded<M extends AnyModel | AnyDataModel>(model: M, propertyKey: keyof M, name: string): void;