UNPKG

proxy-state-tree

Version:

An implementation of the Mobx/Vue state tracking approach, for library authors

28 lines (27 loc) 978 B
import { IMutation, IMutationCallback, IMutationTree, IProxifier, IProxyStateTree } from './types'; export declare class MutationTree<T extends object> implements IMutationTree<T> { private mutationCallbacks; root: IProxyStateTree<T>; state: T; proxifier: IProxifier<T>; mutations: IMutation[]; objectChanges: Set<string>; isTracking: boolean; isBlocking: boolean; trackPathListeners: Array<(path: string) => void>; constructor(root: IProxyStateTree<T>, proxifier?: IProxifier<T>); trackPaths(): () => Set<string>; getMutations(): IMutation[]; getObjectChanges(): Set<string>; addMutation(mutation: IMutation, objectChangePath?: string): void; flush(isAsync?: boolean): { mutations: IMutation[]; flushId: number; }; onMutation(callback: IMutationCallback): void; canMutate(): boolean; canTrack(): boolean; blockMutations(): void; enableMutations(): void; dispose(): this; }