mobx-keystone
Advanced tools
Comparing version 0.51.1 to 0.52.0
@@ -7,4 +7,19 @@ import { ActionMiddlewareDisposer } from "../action/middleware"; | ||
*/ | ||
export interface UndoEvent { | ||
export declare type UndoEvent = UndoSingleEvent | UndoEventGroup; | ||
/** | ||
* Undo event type. | ||
*/ | ||
export declare enum UndoEventType { | ||
Single = "single", | ||
Group = "group" | ||
} | ||
/** | ||
* An undo/redo single event. | ||
*/ | ||
export interface UndoSingleEvent { | ||
/** | ||
* Expresses this is a single event. | ||
*/ | ||
readonly type: UndoEventType.Single; | ||
/** | ||
* Path to the object that invoked the action from its root. | ||
@@ -28,2 +43,19 @@ */ | ||
} | ||
/** | ||
* An undo/redo event group. | ||
*/ | ||
export interface UndoEventGroup { | ||
/** | ||
* Expresses this is an event group. | ||
*/ | ||
readonly type: UndoEventType.Group; | ||
/** | ||
* Name of the group (if any). | ||
*/ | ||
readonly groupName?: string; | ||
/** | ||
* Events that conform this group (might be single events or other nested groups). | ||
*/ | ||
readonly events: ReadonlyArray<UndoEvent>; | ||
} | ||
declare const UndoStore_base: import("../model/Model")._Model<unknown, { | ||
@@ -60,2 +92,15 @@ undoEvents: import("..").OptionalModelProp<UndoEvent[], UndoEvent[]>; | ||
_addUndo(event: UndoEvent): void; | ||
private _groupStack; | ||
/** | ||
* @ignore | ||
*/ | ||
_addUndoToCurrentGroup(event: UndoEvent): void; | ||
/** | ||
* @ignore | ||
*/ | ||
_startGroup(groupName: string | undefined): void; | ||
/** | ||
* @ignore | ||
*/ | ||
_endGroup(): void; | ||
} | ||
@@ -134,2 +179,19 @@ /** | ||
/** | ||
* Runs a synchronous code block as an undo group. | ||
* Note that nested groups are allowed. | ||
* | ||
* @param groupName Group name. | ||
* @param fn Code block. | ||
* @returns Code block return value. | ||
*/ | ||
withGroup<T>(groupName: string, fn: () => T): T; | ||
/** | ||
* Runs a synchronous code block as an undo group. | ||
* Note that nested groups are allowed. | ||
* | ||
* @param fn Code block. | ||
* @returns Code block return value. | ||
*/ | ||
withGroup<T>(fn: () => T): T; | ||
/** | ||
* Creates an instance of `UndoManager`. | ||
@@ -136,0 +198,0 @@ * Do not use directly, use `undoMiddleware` instead. |
{ | ||
"name": "mobx-keystone", | ||
"version": "0.51.1", | ||
"version": "0.52.0", | ||
"description": "A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4244882
33841