Skip to content

Commit db6155f

Browse files
authored
added history file
1 parent 57b7071 commit db6155f

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
import { SelectorModel } from '../objects/node-model';
2+
import { ConnectorModel } from '../objects/connector-model';
3+
import { NodeModel, PhaseModel } from '../objects/node-model';
4+
import { DiagramModel } from '../diagram-model';
5+
import { ShapeAnnotation, PathAnnotation } from '../objects/annotation';
6+
import { PointPortModel } from '../objects/port-model';
7+
import { EntryType, EntryChangeType, EntryCategory, DiagramHistoryAction, HistoryEntryType } from '../enum/enum';
8+
import { DiagramElement } from '../core/elements/diagram-element';
9+
/**
10+
* Interface for a class HistoryEntry
11+
*/
12+
export interface HistoryEntry {
13+
14+
/**
15+
* Sets the type of the entry to be stored
16+
*/
17+
type?: EntryType;
18+
/**
19+
* Sets the changed values to be stored
20+
*/
21+
redoObject?: NodeModel | ConnectorModel | SelectorModel | DiagramModel;
22+
/**
23+
* Sets the changed values to be stored
24+
*/
25+
undoObject?: NodeModel | ConnectorModel | SelectorModel | DiagramModel | ShapeAnnotation | PathAnnotation | PointPortModel;
26+
/**
27+
* Sets the changed values to be stored in table
28+
*/
29+
childTable?: {};
30+
/**
31+
* Sets the category for the entry
32+
*/
33+
category?: EntryCategory;
34+
/**
35+
* Sets the next the current object
36+
*/
37+
next?: HistoryEntry;
38+
/**
39+
* Sets the previous of the current object
40+
*/
41+
previous?: HistoryEntry;
42+
43+
/**
44+
* Sets the type of the object is added or remove
45+
*/
46+
changeType?: EntryChangeType;
47+
/**
48+
* Set the value for undo action is activated
49+
*/
50+
isUndo?: boolean;
51+
/**
52+
* Used to stored the entry or not
53+
*/
54+
cancel?: boolean;
55+
/**
56+
* Used to stored the which annotation or port to be changed
57+
*/
58+
objectId?: string;
59+
/**
60+
* Used to indicate last phase to be changed.
61+
*/
62+
isLastPhase?: boolean;
63+
/**
64+
* Used to stored the previous phase.
65+
*/
66+
previousPhase?: PhaseModel;
67+
/**
68+
* Used to stored the added node cause.
69+
* @blazorType object
70+
*/
71+
historyAction?: DiagramHistoryAction;
72+
73+
/**
74+
* Used to define the object type that is to be added into the entry.
75+
*/
76+
blazorHistoryEntryType?: HistoryEntryType
77+
78+
}
79+
80+
export interface History {
81+
/**
82+
* set the history entry can be undo
83+
*/
84+
canUndo?: boolean;
85+
/**
86+
* Set the history entry can be redo
87+
*/
88+
canRedo?: boolean;
89+
/**
90+
* Set the current entry object
91+
*/
92+
currentEntry?: HistoryEntry;
93+
/**
94+
* Stores a history entry to history list
95+
*/
96+
push?: Function;
97+
/**
98+
* Used for custom undo option
99+
*/
100+
undo?: Function;
101+
/**
102+
* Used for custom redo option
103+
*/
104+
redo?: Function;
105+
/**
106+
* Used to intimate the group action is start
107+
*/
108+
startGroupAction?: Function;
109+
/**
110+
* Used to intimate the group action is end
111+
*/
112+
endGroupAction?: Function;
113+
/**
114+
* Used to decide to stored the changes to history
115+
*/
116+
canLog?: Function;
117+
/**
118+
* Used to store the undoStack
119+
*/
120+
undoStack?: HistoryEntry[];
121+
/**
122+
* Used to store the redostack
123+
*/
124+
redoStack?: HistoryEntry[];
125+
/**
126+
* Used to restrict or limits the number of history entry will be stored on the history list
127+
*
128+
* @deprecated
129+
*/
130+
stackLimit?: number;
131+
}

0 commit comments

Comments
 (0)