@metadev/daga 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/Changelog.md +16 -0
  2. package/README.md +2 -2
  3. package/fesm2022/metadev-daga.mjs +810 -58
  4. package/fesm2022/metadev-daga.mjs.map +1 -1
  5. package/lib/collapse-button/collapse-button.component.d.ts +4 -0
  6. package/lib/diagram/diagram.component.d.ts +1 -0
  7. package/lib/diagram-buttons/diagram-buttons.component.d.ts +4 -0
  8. package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +4 -0
  9. package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +4 -0
  10. package/lib/diagram-editor/diagram/converters/daga-model.d.ts +5 -0
  11. package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
  12. package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
  13. package/lib/diagram-editor/diagram/diagram-action.d.ts +67 -1
  14. package/lib/diagram-editor/diagram/diagram-canvas.d.ts +4 -0
  15. package/lib/diagram-editor/diagram/diagram-config.d.ts +21 -3
  16. package/lib/diagram-editor/diagram/diagram-connection.d.ts +75 -0
  17. package/lib/diagram-editor/diagram/diagram-element.d.ts +40 -3
  18. package/lib/diagram-editor/diagram/diagram-field.d.ts +64 -0
  19. package/lib/diagram-editor/diagram/diagram-model.d.ts +75 -2
  20. package/lib/diagram-editor/diagram/diagram-node.d.ts +58 -0
  21. package/lib/diagram-editor/diagram/diagram-port.d.ts +36 -0
  22. package/lib/diagram-editor/diagram/diagram-property.d.ts +23 -2
  23. package/lib/diagram-editor/diagram/diagram-section.d.ts +45 -0
  24. package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +1 -0
  25. package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +1 -0
  26. package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +2 -2
  27. package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +8 -0
  28. package/lib/diagram-editor/diagram/layout/force-layout.d.ts +1 -0
  29. package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +1 -0
  30. package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +1 -0
  31. package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +1 -0
  32. package/lib/diagram-editor/diagram-editor.component.d.ts +4 -0
  33. package/lib/errors/diagram-error.d.ts +19 -0
  34. package/lib/errors/diagram-validator.d.ts +6 -1
  35. package/lib/errors/errors.component.d.ts +5 -0
  36. package/lib/interfaces/canvas.d.ts +48 -4
  37. package/lib/interfaces/diagram-buttons.d.ts +8 -0
  38. package/lib/interfaces/diagram-editor.d.ts +4 -0
  39. package/lib/interfaces/palette.d.ts +2 -0
  40. package/lib/interfaces/property-editor.d.ts +4 -0
  41. package/lib/object-editor/object-editor.component.d.ts +7 -1
  42. package/lib/palette/palette.component.d.ts +6 -0
  43. package/lib/property-editor/property-editor.component.d.ts +5 -0
  44. package/lib/services/canvas-provider.service.d.ts +17 -0
  45. package/lib/services/daga-configuration.service.d.ts +11 -0
  46. package/lib/text-list-editor/text-list-editor.component.d.ts +7 -0
  47. package/lib/text-map-editor/text-map-editor.component.d.ts +7 -0
  48. package/lib/util/canvas-util.d.ts +104 -0
  49. package/lib/util/events.d.ts +8 -4
  50. package/lib/util/grid.d.ts +47 -4
  51. package/lib/util/line.d.ts +44 -0
  52. package/lib/util/list-util.d.ts +14 -0
  53. package/lib/util/shape.d.ts +98 -0
  54. package/lib/util/svg-util.d.ts +77 -5
  55. package/package.json +1 -1
@@ -1,6 +1,10 @@
1
1
  import { ElementRef } from '@angular/core';
2
2
  import { Side } from '../util/svg-util';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Button used to collapse components that implement it.
6
+ * @private
7
+ */
4
8
  export declare class CollapseButtonComponent {
5
9
  collapsableSelector: string | ElementRef | HTMLElement;
6
10
  collapsableAdditionalSelector: string;
@@ -6,6 +6,7 @@ import * as i0 from "@angular/core";
6
6
  /**
7
7
  * The context of a diagram. Every separate diagram must be contained within its own {@link DiagramComponent} and every {@link DiagramComponent} must contain its own {@link DiagramEditorComponent}.
8
8
  * This component defines a {@link DagaConfigurationService} and a {@link CanvasProviderService}, which is shared by all the components within and allows accessing the configuration and the canvas of this component's diagram, respectively.
9
+ * @public
9
10
  */
10
11
  export declare class DiagramComponent implements OnInit {
11
12
  private configurationService;
@@ -3,6 +3,10 @@ import { Canvas } from '../interfaces/canvas';
3
3
  import { DiagramButtons } from '../interfaces/diagram-buttons';
4
4
  import { CanvasProviderService } from '../services/canvas-provider.service';
5
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Buttons used to trigger diagram functionalities by the user.
8
+ * @private
9
+ */
6
10
  export declare class DiagramButtonsComponent implements DiagramButtons {
7
11
  private canvasProvider;
8
12
  get canvas(): Canvas;
@@ -1,6 +1,10 @@
1
1
  import { DiagramModel } from '../diagram-model';
2
2
  import { DagaModel } from './daga-model';
3
3
  import { DiagramModelExporter } from './diagram-model-exporter';
4
+ /**
5
+ * Importer which exports a diagram to its daga model representation.
6
+ * @public
7
+ */
4
8
  export declare class DagaExporter implements DiagramModelExporter<DagaModel> {
5
9
  export(model: DiagramModel): DagaModel;
6
10
  }
@@ -1,6 +1,10 @@
1
1
  import { DiagramModel } from '../diagram-model';
2
2
  import { DagaModel } from './daga-model';
3
3
  import { DiagramModelImporter } from './diagram-model-importer';
4
+ /**
5
+ * Importer which imports a diagram from its daga model representation.
6
+ * @public
7
+ */
4
8
  export declare class DagaImporter implements DiagramModelImporter<DagaModel> {
5
9
  import(model: DiagramModel, data: DagaModel): DiagramModel;
6
10
  }
@@ -1,6 +1,11 @@
1
1
  import { Point } from '../../../util/canvas-util';
2
2
  import { Side } from '../../../util/svg-util';
3
3
  export declare const DAGA_FILE_VERSION = 1;
4
+ /**
5
+ * Representation of a diagram model in a serialized format.
6
+ * @see DiagramModel
7
+ * @public
8
+ */
4
9
  export interface DagaModel {
5
10
  id?: string;
6
11
  /** User version */
@@ -1,7 +1,14 @@
1
1
  import { DiagramModel } from '../diagram-model';
2
+ /**
3
+ * A diagram exporter which given a diagram model returns a representation of the diagram in some other form.
4
+ * @see DiagramModel
5
+ * @see DiagramModelImporter
6
+ * @public
7
+ */
2
8
  export interface DiagramModelExporter<T> {
3
9
  /**
4
10
  * Exports a diagram from the given model.
11
+ * @public
5
12
  */
6
13
  export(model: DiagramModel): T;
7
14
  }
@@ -1,7 +1,14 @@
1
1
  import { DiagramModel } from '../diagram-model';
2
+ /**
3
+ * A diagram importer which given a diagram's representation in some other form imports the diagram into a given diagram model.
4
+ * @see DiagramModel
5
+ * @see DiagramModelExporter
6
+ * @public
7
+ */
2
8
  export interface DiagramModelImporter<T> {
3
9
  /**
4
10
  * Imports a diagram in the given model using the given data.
11
+ * @public
5
12
  */
6
13
  import(model: DiagramModel, data: T): DiagramModel;
7
14
  }
@@ -8,29 +8,56 @@ import { DiagramNode, DiagramNodeType } from './diagram-node';
8
8
  import { DiagramPort } from './diagram-port';
9
9
  import { ValueSet } from './diagram-property';
10
10
  import { DiagramSection } from './diagram-section';
11
+ /**
12
+ * A queue of recent actions taken by the user that can be undone and redone.
13
+ * @private
14
+ */
11
15
  export declare class ActionQueue {
16
+ /**
17
+ * Maximum number of actions that can be recorded simultaneously.
18
+ * When new actions are added past this limit, older actions are removed.
19
+ * @private
20
+ */
12
21
  maximum: number;
22
+ /**
23
+ * List of recorded actions, from oldest to newest.
24
+ * @private
25
+ */
13
26
  history: DiagramAction[];
14
- /** Index of the last action not counting undone actions. One-indexed. Zero if all actions are undone. */
27
+ /**
28
+ * Index of the last action not counting undone actions. One-indexed. Zero if all actions are undone.
29
+ * @private
30
+ */
15
31
  index: number;
16
32
  constructor(maximum: number);
17
33
  /**
18
34
  * Adds an action to the history.
35
+ * @private
19
36
  */
20
37
  add(action: DiagramAction): void;
21
38
  /**
22
39
  * Undoes the last action in the history, not counting undone actions.
40
+ * @private
23
41
  */
24
42
  undo(): void;
25
43
  /**
26
44
  * Redoes the last undone action in the history.
45
+ * @private
27
46
  */
28
47
  redo(): void;
29
48
  }
49
+ /**
50
+ * An action taken by the user that can be undone and redone.
51
+ * @private
52
+ */
30
53
  export interface DiagramAction {
31
54
  undo(): void;
32
55
  redo(): void;
33
56
  }
57
+ /**
58
+ * Enum listing the actions that can be taken by the user.
59
+ * @private
60
+ */
34
61
  export declare enum DiagramActions {
35
62
  AddConnectionAction = "add-connection",
36
63
  AddNodeAction = "add-node",
@@ -41,6 +68,11 @@ export declare enum DiagramActions {
41
68
  StretchSectionAction = "stretch-section",
42
69
  UpdateValuesAction = "update-values"
43
70
  }
71
+ /**
72
+ * Action which consists of adding a node.
73
+ * @see DiagramNode
74
+ * @private
75
+ */
44
76
  export declare class AddNodeAction implements DiagramAction {
45
77
  canvas: Canvas;
46
78
  type: DiagramNodeType;
@@ -62,6 +94,11 @@ export declare class AddNodeAction implements DiagramAction {
62
94
  undo(): void;
63
95
  redo(): void;
64
96
  }
97
+ /**
98
+ * Action which consists of moving a node.
99
+ * @see DiagramNode
100
+ * @private
101
+ */
65
102
  export declare class MoveNodeAction implements DiagramAction {
66
103
  canvas: Canvas;
67
104
  nodeId: string;
@@ -71,6 +108,11 @@ export declare class MoveNodeAction implements DiagramAction {
71
108
  undo(): void;
72
109
  redo(): void;
73
110
  }
111
+ /**
112
+ * Action which consists of changing the dimensions of a node in a given direction.
113
+ * @see DiagramNode
114
+ * @private
115
+ */
74
116
  export declare class StretchNodeAction implements DiagramAction {
75
117
  canvas: Canvas;
76
118
  nodeId: string;
@@ -81,6 +123,11 @@ export declare class StretchNodeAction implements DiagramAction {
81
123
  undo(): void;
82
124
  redo(): void;
83
125
  }
126
+ /**
127
+ * Action which consists of changing the dimensions of a section in a given direction.
128
+ * @see DiagramSection
129
+ * @private
130
+ */
84
131
  export declare class StretchSectionAction implements DiagramAction {
85
132
  canvas: Canvas;
86
133
  sectionId: string;
@@ -91,6 +138,11 @@ export declare class StretchSectionAction implements DiagramAction {
91
138
  undo(): void;
92
139
  redo(): void;
93
140
  }
141
+ /**
142
+ * Action which consists of adding a connection.
143
+ * @see DiagramConnection
144
+ * @private
145
+ */
94
146
  export declare class AddConnectionAction implements DiagramAction {
95
147
  canvas: Canvas;
96
148
  type: DiagramConnectionType;
@@ -101,6 +153,11 @@ export declare class AddConnectionAction implements DiagramAction {
101
153
  undo(): void;
102
154
  redo(): void;
103
155
  }
156
+ /**
157
+ * Action which consists of editing the text of a field.
158
+ * @see DiagramField
159
+ * @private
160
+ */
104
161
  export declare class EditFieldAction implements DiagramAction {
105
162
  canvas: Canvas;
106
163
  fieldId: string;
@@ -110,6 +167,11 @@ export declare class EditFieldAction implements DiagramAction {
110
167
  undo(): void;
111
168
  redo(): void;
112
169
  }
170
+ /**
171
+ * Action which consists of editing the values of a value set.
172
+ * @see ValueSet
173
+ * @private
174
+ */
113
175
  export declare class UpdateValuesAction implements DiagramAction {
114
176
  model: DiagramModel;
115
177
  id: string | undefined;
@@ -128,6 +190,10 @@ export declare class UpdateValuesAction implements DiagramAction {
128
190
  undo(): void;
129
191
  redo(): void;
130
192
  }
193
+ /**
194
+ * Action which consists of removing elements from a diagram.
195
+ * @private
196
+ */
131
197
  export declare class RemoveAction implements DiagramAction {
132
198
  model: DiagramModel;
133
199
  nodes: DiagramNode[];
@@ -13,20 +13,24 @@ import { DiagramPort } from './diagram-port';
13
13
  import { ValueSet } from './diagram-property';
14
14
  /**
15
15
  * Thickness of the invisible path around a connection used to make it easier to click on, in pixels.
16
+ * @private
16
17
  */
17
18
  export declare const CONNECTION_PATH_BOX_THICKNESS = 12;
18
19
  /**
19
20
  * Thickness of the resizer line used to resize nodes and sections on drag, in pixels.
21
+ * @private
20
22
  */
21
23
  export declare const RESIZER_THICKNESS = 6;
22
24
  /**
23
25
  * Text to display as the title of the property editor when editing this diagram's properties.
24
26
  * @see PropertyEditorComponent
27
+ * @private
25
28
  */
26
29
  export declare const DIAGRAM_PROPERTIES_TEXT = "Diagram properties";
27
30
  /**
28
31
  * Maximum number of user actions that can be recorded in the user action queue.
29
32
  * @see ActionQueue
33
+ * @private
30
34
  */
31
35
  export declare const ACTION_QUEUE_SIZE = 25;
32
36
  export declare class DiagramCanvas implements Canvas {
@@ -6,6 +6,7 @@ import { DiagramActions } from './diagram-action';
6
6
  import { Property } from './diagram-property';
7
7
  /**
8
8
  * The configuration for a diagram.
9
+ * @public
9
10
  */
10
11
  export interface DiagramConfig {
11
12
  /**
@@ -63,9 +64,7 @@ export interface DiagramConfig {
63
64
  * Mapping of user actions to a boolean indicating whether the user can perform those actions. Absent values are assumed to be `true`.
64
65
  * @default {}
65
66
  */
66
- userActions?: {
67
- [key in DiagramActions]?: boolean;
68
- };
67
+ userActions?: UserActionConfig;
69
68
  /**
70
69
  * Configuration for the palettes of this diagram. Each configuration provided will configure one palette, which will be displayed as one of the tabs in the palette component.
71
70
  * @see PaletteComponent
@@ -99,9 +98,17 @@ export interface DiagramConfig {
99
98
  */
100
99
  properties?: Property[];
101
100
  }
101
+ /**
102
+ * Configuration for which user actions are allowed in a diagram.
103
+ * @public
104
+ */
105
+ export type UserActionConfig = {
106
+ [key in DiagramActions]?: boolean;
107
+ };
102
108
  /**
103
109
  * Configuration for a palette.
104
110
  * @see PaletteComponent
111
+ * @public
105
112
  */
106
113
  export interface PaletteConfig {
107
114
  /**
@@ -122,6 +129,7 @@ export interface PaletteConfig {
122
129
  /**
123
130
  * Configuration for a template of a node in a palette.
124
131
  * @see PaletteComponent
132
+ * @public
125
133
  */
126
134
  export interface NodeTemplateConfig {
127
135
  /**
@@ -146,6 +154,7 @@ export interface NodeTemplateConfig {
146
154
  /**
147
155
  * Configuration for a template of a connection in a palette.
148
156
  * @see PaletteComponent
157
+ * @public
149
158
  */
150
159
  export interface ConnectionTemplateConfig {
151
160
  /**
@@ -180,6 +189,7 @@ export interface ConnectionTemplateConfig {
180
189
  /**
181
190
  * Configuration for a type of node.
182
191
  * @see DiagramNodeType
192
+ * @public
183
193
  */
184
194
  export interface NodeTypeConfig {
185
195
  /**
@@ -260,6 +270,7 @@ export interface NodeTypeConfig {
260
270
  /**
261
271
  * Configuration for a field that is part of another element.
262
272
  * @see DiagramField
273
+ * @public
263
274
  */
264
275
  export interface FieldConfig {
265
276
  /**
@@ -312,6 +323,7 @@ export interface FieldConfig {
312
323
  /**
313
324
  * Configuration for a port that is part of another element.
314
325
  * @see DiagramPort
326
+ * @public
315
327
  */
316
328
  export interface PortConfig {
317
329
  /**
@@ -331,6 +343,7 @@ export interface PortConfig {
331
343
  /**
332
344
  * Configuration for the sections of a node.
333
345
  * @see DiagramSection
346
+ * @public
334
347
  */
335
348
  export interface SectionConfig {
336
349
  /**
@@ -376,6 +389,7 @@ export interface SectionConfig {
376
389
  }
377
390
  /**
378
391
  * Configuration for the look of a node given by shape and color.
392
+ * @public
379
393
  */
380
394
  export interface NodeShapedLook {
381
395
  /**
@@ -405,6 +419,7 @@ export interface NodeShapedLook {
405
419
  }
406
420
  /**
407
421
  * Configuration for the look of a node given by an image.
422
+ * @public
408
423
  */
409
424
  export interface NodeImageLook {
410
425
  /**
@@ -422,6 +437,7 @@ export interface NodeImageLook {
422
437
  }
423
438
  /**
424
439
  * Configuration for the look of a node given by fixed size images in the corners and stretchable images in the middle.
440
+ * @public
425
441
  */
426
442
  export interface NodeStretchableImageLook {
427
443
  /**
@@ -520,6 +536,7 @@ export interface NodeStretchableImageLook {
520
536
  /**
521
537
  * Configuration for a type of connection.
522
538
  * @see DiagramConnectionType
539
+ * @public
523
540
  */
524
541
  export interface ConnectionTypeConfig {
525
542
  /**
@@ -588,6 +605,7 @@ export interface ConnectionTypeConfig {
588
605
  }
589
606
  /**
590
607
  * Configuration for the look of the markers at the start and end of a connection.
608
+ * @public
591
609
  */
592
610
  export interface ConnectionMarkerLook {
593
611
  /**
@@ -6,6 +6,11 @@ import { DiagramElement, DiagramEntity, DiagramEntitySet } from './diagram-eleme
6
6
  import { DiagramModel } from './diagram-model';
7
7
  import { DiagramPort } from './diagram-port';
8
8
  import { PropertySet, ValueSet } from './diagram-property';
9
+ /**
10
+ * Default values of the parameters of a diagram connection.
11
+ * @see DiagramConnection
12
+ * @private
13
+ */
9
14
  export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
10
15
  name: string;
11
16
  width: number;
@@ -20,6 +25,11 @@ export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
20
25
  selectedColor: string;
21
26
  properties: never[];
22
27
  };
28
+ /**
29
+ * A connection type, which holds properties that connections of this type share in common.
30
+ * @see ConnectionTypeConfig
31
+ * @public
32
+ */
23
33
  export declare class DiagramConnectionType implements DiagramEntity {
24
34
  id: string;
25
35
  name: string;
@@ -38,22 +48,87 @@ export declare class DiagramConnectionType implements DiagramEntity {
38
48
  canStartFromType(type: string): boolean;
39
49
  canFinishOnType(type: string): boolean;
40
50
  }
51
+ /**
52
+ * A connection which goes from one port to another.
53
+ * @see DiagramPort
54
+ * @public
55
+ */
41
56
  export declare class DiagramConnection extends DiagramElement {
42
57
  type: DiagramConnectionType;
58
+ /**
59
+ * Additional properties of this connection.
60
+ * @public
61
+ */
43
62
  valueSet: ValueSet;
63
+ /**
64
+ * Variable used to preserve the original data of a connection when importing from a different format.
65
+ * @public
66
+ */
44
67
  originalData: unknown;
68
+ /**
69
+ * Port that this connection starts from.
70
+ * @public
71
+ */
45
72
  start?: DiagramPort;
73
+ /**
74
+ * Direction that this connection follows at its start.
75
+ * @public
76
+ */
46
77
  startDirection?: Side;
78
+ /**
79
+ * Coordinates of the start point of this connection.
80
+ * @public
81
+ */
47
82
  startCoords: Point;
83
+ /**
84
+ * Look of the marker of this connection at the start, or `null` if the connection has no start marker.
85
+ * @public
86
+ */
48
87
  startMarkerLook: ConnectionMarkerLook | null;
88
+ /**
89
+ * Port that this connection ends at.
90
+ * @public
91
+ */
49
92
  end?: DiagramPort;
93
+ /**
94
+ * Direction that this connection follows at its end.
95
+ * @public
96
+ */
50
97
  endDirection?: Side;
98
+ /**
99
+ * Coordinates of the end point of this connection.
100
+ * @public
101
+ */
51
102
  endCoords: Point;
103
+ /**
104
+ * Look of the marker of this connection at the end, or `null` if the connection has no end marker.
105
+ * @public
106
+ */
52
107
  endMarkerLook: ConnectionMarkerLook | null;
108
+ /**
109
+ * Text at the start of this connection, or `''` if no text.
110
+ * @public
111
+ */
53
112
  startLabel: string;
113
+ /**
114
+ * Text at the middle of this connection, or `''` if no text.
115
+ * @public
116
+ */
54
117
  middleLabel: string;
118
+ /**
119
+ * Text at the end of this connection, or `''` if no text.
120
+ * @public
121
+ */
55
122
  endLabel: string;
123
+ /**
124
+ * Points that this connection passes through.
125
+ * @public
126
+ */
56
127
  points: Point[];
128
+ /**
129
+ * Name of this connection. Alias for this connection's middle label.
130
+ * @public
131
+ */
57
132
  get name(): string;
58
133
  set name(name: string);
59
134
  constructor(model: DiagramModel, type: DiagramConnectionType, start?: DiagramPort, end?: DiagramPort, id?: string);
@@ -2,92 +2,129 @@ import * as d3 from 'd3';
2
2
  import { DiagramModel } from './diagram-model';
3
3
  /**
4
4
  * Represents an object which exists as part of a diagram model.
5
+ * @public
5
6
  * @see DiagramModel
6
7
  */
7
8
  export interface DiagramEntity {
9
+ /**
10
+ * Identifier that uniquely identifies this entity within its diagram model.
11
+ * @public
12
+ */
8
13
  get id(): string;
9
- set id(value: string);
10
14
  }
11
15
  /**
12
16
  * Represents an object which exists as part of a specific diagram model and has a visual representation in a diagram canvas.
17
+ * @public
13
18
  * @see DiagramModel
14
19
  * @see DiagramCanvas
15
20
  */
16
21
  export declare abstract class DiagramElement implements DiagramEntity {
22
+ /**
23
+ * Diagram model this diagram element is part of.
24
+ * @private
25
+ */
17
26
  model: DiagramModel;
18
- _id: string;
27
+ private _id;
19
28
  get id(): string;
20
- set id(value: string);
29
+ /**
30
+ * Whether this diagram element is currently highlighted by the user.
31
+ * @private
32
+ */
21
33
  highlighted: boolean;
34
+ /**
35
+ * Whether this diagram element is currently selected by the user.
36
+ * @private
37
+ */
22
38
  selected: boolean;
23
39
  constructor(model: DiagramModel, id: string);
40
+ /**
41
+ * Update the view of the canvas to show the current state of this element.
42
+ * @public
43
+ */
24
44
  abstract updateInView(): void;
25
45
  /**
26
46
  * Obtain the selection of this element.
47
+ * @private
27
48
  */
28
49
  select(): d3.Selection<SVGGElement, unknown, null, unknown> | undefined;
29
50
  }
30
51
  /**
31
52
  * Represents a collection of diagram entities of a type that exists as part of a diagram model.
53
+ * @public
32
54
  * @see DiagramEntity
33
55
  * @see DiagramModel
34
56
  */
35
57
  export declare class DiagramEntitySet<E extends DiagramEntity> implements Iterable<E> {
36
58
  /**
37
59
  * The list of entities contained in this set.
60
+ * @private
38
61
  */
39
62
  protected entities: E[];
40
63
  /**
41
64
  * A mapping of entity ids to their corresponding entity in this set for quickly fetching entities based on their id.
65
+ * @private
42
66
  */
43
67
  protected entityMap: {
44
68
  [id: string]: E;
45
69
  };
46
70
  /**
47
71
  * The number of entities of this set.
72
+ * @public
48
73
  */
49
74
  get length(): number;
50
75
  /**
51
76
  * Gets all of the entities of this set.
77
+ * @public
52
78
  * @returns An array containing all of the entities of this set.
53
79
  */
54
80
  all(): E[];
55
81
  /**
56
82
  * Adds an entity to this set if there are no entities with the same id. Has no effect if there already exists an entity with the same id as the given entity.
57
83
  * For creating entities with relationships with other entities, the new() method should be used instead. The add() method adds an entity but doesn't take care of setting that entity's relationships with other entities.
84
+ * @private
58
85
  * @param entity An entity to be added to this set.
59
86
  */
60
87
  add(entity: E): void;
61
88
  /**
62
89
  * Removes all the entities in this set.
90
+ * @public
63
91
  */
64
92
  clear(): void;
65
93
  /**
66
94
  * Checks if this set contains an entity with the given id.
95
+ * @public
67
96
  * @param id An id.
68
97
  * @returns `true` if this set contains an entity with the given id, `false` otherwise.
69
98
  */
70
99
  contains(id: string): boolean;
71
100
  /**
72
101
  * Gets all of the entities of this set filtered following given criteria.
102
+ * @public
73
103
  * @returns An array containing the entities of this set that meet the given criteria.
74
104
  */
75
105
  filter(): E[];
76
106
  /**
77
107
  * Gets an entity of this set matching specific criteria.
108
+ * @public
78
109
  * @returns An entity of this set.
79
110
  */
80
111
  find(): E | undefined;
81
112
  /**
82
113
  * Gets an entity from this set.
114
+ * @public
83
115
  * @param id An id.
84
116
  * @returns An entity with the given id, or `undefined` if there are no entities with the given id.
85
117
  */
86
118
  get(id: string): E | undefined;
87
119
  /**
88
120
  * Attempts to find and remove an entity with the given id. Has no effect if there are no entities with the given id.
121
+ * @public
89
122
  * @param id An id.
90
123
  */
91
124
  remove(id: string): void;
125
+ /**
126
+ * Iterator to iterate over the entities of this set.
127
+ * @public
128
+ */
92
129
  [Symbol.iterator](): Iterator<E>;
93
130
  }