@mlightcad/cad-simple-viewer 1.0.0 → 1.0.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 (136) hide show
  1. package/README.md +296 -2
  2. package/dist/index.js +1347 -122
  3. package/dist/index.umd.cjs +2 -2
  4. package/lib/app/AcApContext.d.ts +45 -3
  5. package/lib/app/AcApContext.d.ts.map +1 -1
  6. package/lib/app/AcApContext.js +43 -3
  7. package/lib/app/AcApContext.js.map +1 -1
  8. package/lib/app/AcApDocCreator.d.ts +68 -2
  9. package/lib/app/AcApDocCreator.d.ts.map +1 -1
  10. package/lib/app/AcApDocCreator.js +67 -2
  11. package/lib/app/AcApDocCreator.js.map +1 -1
  12. package/lib/app/AcApDocManager.d.ts +227 -12
  13. package/lib/app/AcApDocManager.d.ts.map +1 -1
  14. package/lib/app/AcApDocManager.js +228 -17
  15. package/lib/app/AcApDocManager.js.map +1 -1
  16. package/lib/app/AcApDocument.d.ts +77 -3
  17. package/lib/app/AcApDocument.d.ts.map +1 -1
  18. package/lib/app/AcApDocument.js +75 -3
  19. package/lib/app/AcApDocument.js.map +1 -1
  20. package/lib/app/AcApFontLoader.d.ts +32 -0
  21. package/lib/app/AcApFontLoader.d.ts.map +1 -1
  22. package/lib/app/AcApFontLoader.js +30 -0
  23. package/lib/app/AcApFontLoader.js.map +1 -1
  24. package/lib/app/AcApSettingManager.d.ts +191 -3
  25. package/lib/app/AcApSettingManager.d.ts.map +1 -1
  26. package/lib/app/AcApSettingManager.js +161 -0
  27. package/lib/app/AcApSettingManager.js.map +1 -1
  28. package/lib/command/AcApConvertToSvgCmd.d.ts +26 -0
  29. package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
  30. package/lib/command/AcApConvertToSvgCmd.js +26 -0
  31. package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
  32. package/lib/command/AcApOpenCmd.d.ts +31 -0
  33. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  34. package/lib/command/AcApOpenCmd.js +31 -0
  35. package/lib/command/AcApOpenCmd.js.map +1 -1
  36. package/lib/command/AcApPanCmd.d.ts +25 -0
  37. package/lib/command/AcApPanCmd.d.ts.map +1 -1
  38. package/lib/command/AcApPanCmd.js +25 -0
  39. package/lib/command/AcApPanCmd.js.map +1 -1
  40. package/lib/command/AcApQNewCmd.d.ts +26 -0
  41. package/lib/command/AcApQNewCmd.d.ts.map +1 -1
  42. package/lib/command/AcApQNewCmd.js +26 -0
  43. package/lib/command/AcApQNewCmd.js.map +1 -1
  44. package/lib/command/AcApSelectCmd.d.ts +26 -0
  45. package/lib/command/AcApSelectCmd.d.ts.map +1 -1
  46. package/lib/command/AcApSelectCmd.js +26 -0
  47. package/lib/command/AcApSelectCmd.js.map +1 -1
  48. package/lib/command/AcApSvgConvertor.d.ts +48 -0
  49. package/lib/command/AcApSvgConvertor.d.ts.map +1 -1
  50. package/lib/command/AcApSvgConvertor.js +48 -0
  51. package/lib/command/AcApSvgConvertor.js.map +1 -1
  52. package/lib/command/AcApZoomCmd.d.ts +29 -0
  53. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  54. package/lib/command/AcApZoomCmd.js +29 -0
  55. package/lib/command/AcApZoomCmd.js.map +1 -1
  56. package/lib/command/AcApZoomToBoxCmd.d.ts +57 -0
  57. package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
  58. package/lib/command/AcApZoomToBoxCmd.js +57 -0
  59. package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
  60. package/lib/editor/command/AcEdCommand.d.ts +118 -9
  61. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  62. package/lib/editor/command/AcEdCommand.js +113 -9
  63. package/lib/editor/command/AcEdCommand.js.map +1 -1
  64. package/lib/editor/command/AcEdCommandStack.d.ts +59 -5
  65. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  66. package/lib/editor/command/AcEdCommandStack.js +48 -5
  67. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  68. package/lib/editor/global/eventBus.d.ts +69 -1
  69. package/lib/editor/global/eventBus.d.ts.map +1 -1
  70. package/lib/editor/global/eventBus.js +37 -0
  71. package/lib/editor/global/eventBus.js.map +1 -1
  72. package/lib/editor/input/AcEdBaseInput.d.ts +65 -1
  73. package/lib/editor/input/AcEdBaseInput.d.ts.map +1 -1
  74. package/lib/editor/input/AcEdBaseInput.js +62 -1
  75. package/lib/editor/input/AcEdBaseInput.js.map +1 -1
  76. package/lib/editor/input/AcEdBoxSelector.d.ts +81 -0
  77. package/lib/editor/input/AcEdBoxSelector.d.ts.map +1 -1
  78. package/lib/editor/input/AcEdBoxSelector.js +80 -0
  79. package/lib/editor/input/AcEdBoxSelector.js.map +1 -1
  80. package/lib/editor/input/AcEdCursorManager.d.ts +95 -8
  81. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
  82. package/lib/editor/input/AcEdCursorManager.js +95 -11
  83. package/lib/editor/input/AcEdCursorManager.js.map +1 -1
  84. package/lib/editor/input/AcEdInputPoint.d.ts +38 -1
  85. package/lib/editor/input/AcEdInputPoint.d.ts.map +1 -1
  86. package/lib/editor/input/AcEdInputPoint.js +38 -1
  87. package/lib/editor/input/AcEdInputPoint.js.map +1 -1
  88. package/lib/editor/input/AcEdJig.d.ts +166 -0
  89. package/lib/editor/input/AcEdJig.d.ts.map +1 -1
  90. package/lib/editor/input/AcEdJig.js +164 -0
  91. package/lib/editor/input/AcEdJig.js.map +1 -1
  92. package/lib/editor/input/AcEdJigLoop.d.ts +49 -0
  93. package/lib/editor/input/AcEdJigLoop.d.ts.map +1 -1
  94. package/lib/editor/input/AcEdJigLoop.js +48 -0
  95. package/lib/editor/input/AcEdJigLoop.js.map +1 -1
  96. package/lib/editor/input/AcEdSelectionSet.d.ts +122 -2
  97. package/lib/editor/input/AcEdSelectionSet.d.ts.map +1 -1
  98. package/lib/editor/input/AcEdSelectionSet.js +117 -1
  99. package/lib/editor/input/AcEdSelectionSet.js.map +1 -1
  100. package/lib/editor/input/AcEditor.d.ts +90 -6
  101. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  102. package/lib/editor/input/AcEditor.js +86 -6
  103. package/lib/editor/input/AcEditor.js.map +1 -1
  104. package/lib/editor/view/AcEdBaseView.d.ts +163 -16
  105. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  106. package/lib/editor/view/AcEdBaseView.js +94 -5
  107. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  108. package/lib/util/AcTrGeometryUtil.d.ts +65 -0
  109. package/lib/util/AcTrGeometryUtil.d.ts.map +1 -1
  110. package/lib/util/AcTrGeometryUtil.js +65 -0
  111. package/lib/util/AcTrGeometryUtil.js.map +1 -1
  112. package/lib/view/AcTrLayer.d.ts +40 -5
  113. package/lib/view/AcTrLayer.d.ts.map +1 -1
  114. package/lib/view/AcTrLayer.js +34 -5
  115. package/lib/view/AcTrLayer.js.map +1 -1
  116. package/lib/view/AcTrLayout.d.ts +122 -23
  117. package/lib/view/AcTrLayout.d.ts.map +1 -1
  118. package/lib/view/AcTrLayout.js +103 -23
  119. package/lib/view/AcTrLayout.js.map +1 -1
  120. package/lib/view/AcTrLayoutView.d.ts +74 -16
  121. package/lib/view/AcTrLayoutView.d.ts.map +1 -1
  122. package/lib/view/AcTrLayoutView.js +65 -16
  123. package/lib/view/AcTrLayoutView.js.map +1 -1
  124. package/lib/view/AcTrLayoutViewManager.d.ts +58 -12
  125. package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
  126. package/lib/view/AcTrLayoutViewManager.js +56 -12
  127. package/lib/view/AcTrLayoutViewManager.js.map +1 -1
  128. package/lib/view/AcTrScene.d.ts +48 -4
  129. package/lib/view/AcTrScene.d.ts.map +1 -1
  130. package/lib/view/AcTrScene.js +44 -4
  131. package/lib/view/AcTrScene.js.map +1 -1
  132. package/lib/view/AcTrView2d.d.ts +71 -0
  133. package/lib/view/AcTrView2d.d.ts.map +1 -1
  134. package/lib/view/AcTrView2d.js +65 -0
  135. package/lib/view/AcTrView2d.js.map +1 -1
  136. package/package.json +8 -4
@@ -35,9 +35,66 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { AcEdJigLoop } from './AcEdJigLoop';
38
+ /**
39
+ * Base class for interactive drawing operations (jigs) in the CAD editor.
40
+ *
41
+ * A jig is an interactive operation that allows users to dynamically preview
42
+ * and modify geometric elements during creation. Common examples include:
43
+ * - Drawing lines with real-time preview as the mouse moves
44
+ * - Selecting rectangular areas with visual feedback
45
+ * - Dynamic entity placement with instant visual updates
46
+ *
47
+ * The jig system provides:
48
+ * - Real-time visual feedback during user interaction
49
+ * - Event-driven updates based on mouse movement
50
+ * - Asynchronous completion handling
51
+ * - Cancellation and error handling
52
+ *
53
+ * @template TResult - The type of result returned when the jig completes
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * class RectangleSelectionJig extends AcEdJig<Rectangle> {
58
+ * private startPoint?: Point;
59
+ * private currentPoint?: Point;
60
+ *
61
+ * async sampler() {
62
+ * // Get start point
63
+ * this.startPoint = await this.view.editor.getPoint();
64
+ *
65
+ * // Continue updating until complete
66
+ * this.view.events.mouseMove.addEventListener(this.onMouseMove);
67
+ * }
68
+ *
69
+ * update() {
70
+ * if (this.startPoint && this.currentPoint) {
71
+ * // Update preview rectangle
72
+ * this.drawPreviewRectangle(this.startPoint, this.currentPoint);
73
+ * }
74
+ * }
75
+ *
76
+ * private onMouseMove = (args) => {
77
+ * this.currentPoint = args;
78
+ * // Jig loop will call update() automatically
79
+ * }
80
+ * }
81
+ *
82
+ * // Usage
83
+ * const jig = new RectangleSelectionJig(view);
84
+ * const rectangle = await jig.drag();
85
+ * ```
86
+ */
38
87
  var AcEdJig = /** @class */ (function () {
88
+ /**
89
+ * Creates a new jig instance for the specified view.
90
+ *
91
+ * Sets up the jig loop and connects update event handling.
92
+ *
93
+ * @param view - The view this jig will operate in
94
+ */
39
95
  function AcEdJig(view) {
40
96
  var _this = this;
97
+ /** Internal event handler for jig loop updates */
41
98
  this.onUpdate = function () {
42
99
  _this.update();
43
100
  };
@@ -46,20 +103,78 @@ var AcEdJig = /** @class */ (function () {
46
103
  this._jigLoop.events.update.addEventListener(this.onUpdate);
47
104
  }
48
105
  Object.defineProperty(AcEdJig.prototype, "view", {
106
+ /**
107
+ * Gets the view associated with this jig.
108
+ *
109
+ * @returns The view instance
110
+ */
49
111
  get: function () {
50
112
  return this._view;
51
113
  },
52
114
  enumerable: false,
53
115
  configurable: true
54
116
  });
117
+ /**
118
+ * Resolves the jig operation with the specified result.
119
+ *
120
+ * This method should be called when the jig operation completes successfully.
121
+ * It cleans up event listeners and resolves the underlying promise.
122
+ *
123
+ * @param result - The result to return from the jig operation
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * // In a line drawing jig, when user completes the line
128
+ * if (this.hasValidEndPoint()) {
129
+ * const line = new Line(this.startPoint, this.endPoint);
130
+ * this.resolve(line);
131
+ * }
132
+ * ```
133
+ */
55
134
  AcEdJig.prototype.resolve = function (result) {
56
135
  this._jigLoop.events.update.removeEventListener(this.onUpdate);
57
136
  this._jigLoop.resolve(result);
58
137
  };
138
+ /**
139
+ * Rejects the jig operation with an error.
140
+ *
141
+ * This method should be called when the jig operation fails or is cancelled.
142
+ * It cleans up event listeners and rejects the underlying promise.
143
+ *
144
+ * @param reason - The reason for the rejection
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * // If user cancels or invalid input is detected
149
+ * if (userPressedEscape) {
150
+ * this.reject('Operation cancelled by user');
151
+ * }
152
+ * ```
153
+ */
59
154
  AcEdJig.prototype.reject = function (reason) {
60
155
  this._jigLoop.events.update.removeEventListener(this.onUpdate);
61
156
  this._jigLoop.reject(reason);
62
157
  };
158
+ /**
159
+ * Starts the interactive jig operation.
160
+ *
161
+ * This method initiates both the jig loop and the sampling process.
162
+ * It returns a promise that resolves when the jig operation completes
163
+ * or rejects if an error occurs.
164
+ *
165
+ * @returns Promise that resolves when the jig operation completes
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * const jig = new MyCustomJig(view);
170
+ * try {
171
+ * const result = await jig.drag();
172
+ * console.log('Jig completed with result:', result);
173
+ * } catch (error) {
174
+ * console.log('Jig was cancelled or failed:', error);
175
+ * }
176
+ * ```
177
+ */
63
178
  AcEdJig.prototype.drag = function () {
64
179
  return __awaiter(this, void 0, void 0, function () {
65
180
  var promise1, promise2;
@@ -76,6 +191,30 @@ var AcEdJig = /** @class */ (function () {
76
191
  });
77
192
  });
78
193
  };
194
+ /**
195
+ * Abstract method for handling jig input sampling.
196
+ *
197
+ * This method should be overridden by subclasses to implement
198
+ * the specific input handling logic for the jig. It typically:
199
+ * - Gets initial user input (like a start point)
200
+ * - Sets up event listeners for dynamic updates
201
+ * - Handles user interaction until completion
202
+ *
203
+ * The sampler runs concurrently with the jig loop and should
204
+ * call `resolve()` or `reject()` when the operation completes.
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * async sampler() {
209
+ * // Get initial point
210
+ * const startPoint = await this.view.editor.getPoint();
211
+ *
212
+ * // Set up mouse tracking for dynamic preview
213
+ * this.view.events.mouseMove.addEventListener(this.onMouseMove);
214
+ * this.view.events.mouseClick.addEventListener(this.onMouseClick);
215
+ * }
216
+ * ```
217
+ */
79
218
  AcEdJig.prototype.sampler = function () {
80
219
  return __awaiter(this, void 0, void 0, function () {
81
220
  return __generator(this, function (_a) {
@@ -83,6 +222,31 @@ var AcEdJig = /** @class */ (function () {
83
222
  });
84
223
  });
85
224
  };
225
+ /**
226
+ * Called during each update cycle to refresh the jig display.
227
+ *
228
+ * This method should be overridden by subclasses to implement
229
+ * the visual update logic. It's called automatically by the jig loop
230
+ * whenever the display needs to be refreshed (typically on mouse movement).
231
+ *
232
+ * Common update operations include:
233
+ * - Redrawing preview geometry
234
+ * - Updating dimension displays
235
+ * - Refreshing visual feedback elements
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * update() {
240
+ * if (this.startPoint && this.currentMousePoint) {
241
+ * // Clear previous preview
242
+ * this.clearPreview();
243
+ *
244
+ * // Draw new preview line
245
+ * this.drawPreviewLine(this.startPoint, this.currentMousePoint);
246
+ * }
247
+ * }
248
+ * ```
249
+ */
86
250
  AcEdJig.prototype.update = function () {
87
251
  // Do nothing for now
88
252
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdJig.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;IAIE,iBAAY,IAAkB;QAA9B,iBAIC;QA8BO,aAAQ,GAAG;YACjB,KAAI,CAAC,MAAM,EAAE,CAAA;QACf,CAAC,CAAA;QAnCC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC7D,CAAC;IAED,sBAAI,yBAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;;;OAAA;IAED,yBAAO,GAAP,UAAQ,MAAe;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAED,wBAAM,GAAN,UAAO,MAAc;QACnB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9B,CAAC;IAEK,sBAAI,GAAV;;;;;;wBACQ,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;wBAChC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;wBAC/B,qBAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAA;;wBAA9C,SAA8C,CAAA;;;;;KAC/C;IAEK,yBAAO,GAAb;;;;;;KAEC;IAED,wBAAM,GAAN;QACE,qBAAqB;IACvB,CAAC;IAKH,cAAC;AAAD,CAAC,AAzCD,IAyCC"}
1
+ {"version":3,"file":"AcEdJig.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;IAME;;;;;;OAMG;IACH,iBAAY,IAAkB;QAA9B,iBAIC;QAyID,kDAAkD;QAC1C,aAAQ,GAAG;YACjB,KAAI,CAAC,MAAM,EAAE,CAAA;QACf,CAAC,CAAA;QA/IC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC7D,CAAC;IAOD,sBAAI,yBAAI;QALR;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;;;OAAA;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,yBAAO,GAAP,UAAQ,MAAe;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,wBAAM,GAAN,UAAO,MAAc;QACnB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACG,sBAAI,GAAV;;;;;;wBACQ,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;wBAChC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;wBAC/B,qBAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAA;;wBAA9C,SAA8C,CAAA;;;;;KAC/C;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,yBAAO,GAAb;;;;;;KAEC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAAM,GAAN;QACE,qBAAqB;IACvB,CAAC;IAMH,cAAC;AAAD,CAAC,AA9JD,IA8JC"}
@@ -1,14 +1,63 @@
1
1
  import { AcCmEventManager, AcGePoint2d } from '@mlightcad/data-model';
2
2
  import { AcEdBaseView } from '../view/AcEdBaseView';
3
3
  import { AcEdBaseInput } from './AcEdBaseInput';
4
+ /**
5
+ * A specialized input class for jig operations that provides continuous mouse tracking.
6
+ *
7
+ * This class extends the base input functionality to provide real-time mouse position
8
+ * tracking for interactive operations like drawing previews or dynamic objects that
9
+ * follow the mouse cursor. It fires update events whenever the mouse moves, allowing
10
+ * subscribers to respond to cursor movement.
11
+ *
12
+ * Jig loops are commonly used in CAD applications for operations like:
13
+ * - Drawing preview lines that stretch from a fixed point to the cursor
14
+ * - Moving objects dynamically with the mouse
15
+ * - Providing visual feedback during interactive operations
16
+ *
17
+ * @template TResult - The type of result that this jig operation will return
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const jigLoop = new AcEdJigLoop<string>(view);
22
+ * jigLoop.events.update.subscribe(() => {
23
+ * // Update preview based on jigLoop.curPos
24
+ * console.log(`Mouse at: ${jigLoop.curPos.x}, ${jigLoop.curPos.y}`);
25
+ * });
26
+ * const result = await jigLoop.start();
27
+ * ```
28
+ */
4
29
  export declare class AcEdJigLoop<TResult> extends AcEdBaseInput<TResult> {
30
+ /** Event manager for handling mouse movement updates */
5
31
  readonly events: {
32
+ /** Event fired when the mouse position updates */
6
33
  update: AcCmEventManager<void>;
7
34
  };
35
+ /** Current mouse position in screen coordinates */
8
36
  curPos: AcGePoint2d;
37
+ /**
38
+ * Creates a new jig loop instance.
39
+ *
40
+ * @param view - The view that will handle this jig operation
41
+ */
9
42
  constructor(view: AcEdBaseView);
43
+ /**
44
+ * Activates the jig loop operation.
45
+ * Sets up the mouse move event listener to track cursor position.
46
+ * Overrides the base class to add mouse move event handling.
47
+ */
10
48
  activate(): void;
49
+ /**
50
+ * Deactivates the jig loop operation.
51
+ * Removes the mouse move event listener.
52
+ * Overrides the base class to clean up mouse move event handling.
53
+ */
11
54
  deactivate(): void;
55
+ /**
56
+ * Handles mouse move events to update the current cursor position.
57
+ * Updates the current position and fires the update event to notify subscribers.
58
+ *
59
+ * @param event - The mouse move event containing the new cursor position
60
+ */
12
61
  private onMouseMove;
13
62
  }
14
63
  //# sourceMappingURL=AcEdJigLoop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdJigLoop.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,qBAAa,WAAW,CAAC,OAAO,CAAE,SAAQ,aAAa,CAAC,OAAO,CAAC;IAC9D,SAAgB,MAAM;;MAErB;IACM,MAAM,EAAE,WAAW,CAAA;gBAEd,IAAI,EAAE,YAAY;IAK9B,QAAQ;IAKR,UAAU;IAKV,OAAO,CAAC,WAAW,CAGlB;CACF"}
1
+ {"version":3,"file":"AcEdJigLoop.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,WAAW,CAAC,OAAO,CAAE,SAAQ,aAAa,CAAC,OAAO,CAAC;IAC9D,wDAAwD;IACxD,SAAgB,MAAM;QACpB,kDAAkD;;MAEnD;IACD,mDAAmD;IAC5C,MAAM,EAAE,WAAW,CAAA;IAE1B;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAK9B;;;;OAIG;IACH,QAAQ;IAKR;;;;OAIG;IACH,UAAU;IAKV;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAGlB;CACF"}
@@ -15,13 +15,51 @@ var __extends = (this && this.__extends) || (function () {
15
15
  })();
16
16
  import { AcCmEventManager, AcGePoint2d } from '@mlightcad/data-model';
17
17
  import { AcEdBaseInput } from './AcEdBaseInput';
18
+ /**
19
+ * A specialized input class for jig operations that provides continuous mouse tracking.
20
+ *
21
+ * This class extends the base input functionality to provide real-time mouse position
22
+ * tracking for interactive operations like drawing previews or dynamic objects that
23
+ * follow the mouse cursor. It fires update events whenever the mouse moves, allowing
24
+ * subscribers to respond to cursor movement.
25
+ *
26
+ * Jig loops are commonly used in CAD applications for operations like:
27
+ * - Drawing preview lines that stretch from a fixed point to the cursor
28
+ * - Moving objects dynamically with the mouse
29
+ * - Providing visual feedback during interactive operations
30
+ *
31
+ * @template TResult - The type of result that this jig operation will return
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const jigLoop = new AcEdJigLoop<string>(view);
36
+ * jigLoop.events.update.subscribe(() => {
37
+ * // Update preview based on jigLoop.curPos
38
+ * console.log(`Mouse at: ${jigLoop.curPos.x}, ${jigLoop.curPos.y}`);
39
+ * });
40
+ * const result = await jigLoop.start();
41
+ * ```
42
+ */
18
43
  var AcEdJigLoop = /** @class */ (function (_super) {
19
44
  __extends(AcEdJigLoop, _super);
45
+ /**
46
+ * Creates a new jig loop instance.
47
+ *
48
+ * @param view - The view that will handle this jig operation
49
+ */
20
50
  function AcEdJigLoop(view) {
21
51
  var _this = _super.call(this, view) || this;
52
+ /** Event manager for handling mouse movement updates */
22
53
  _this.events = {
54
+ /** Event fired when the mouse position updates */
23
55
  update: new AcCmEventManager()
24
56
  };
57
+ /**
58
+ * Handles mouse move events to update the current cursor position.
59
+ * Updates the current position and fires the update event to notify subscribers.
60
+ *
61
+ * @param event - The mouse move event containing the new cursor position
62
+ */
25
63
  _this.onMouseMove = function (event) {
26
64
  _this.curPos.set(event.clientX, event.clientY);
27
65
  _this.events.update.dispatch();
@@ -29,10 +67,20 @@ var AcEdJigLoop = /** @class */ (function (_super) {
29
67
  _this.curPos = new AcGePoint2d();
30
68
  return _this;
31
69
  }
70
+ /**
71
+ * Activates the jig loop operation.
72
+ * Sets up the mouse move event listener to track cursor position.
73
+ * Overrides the base class to add mouse move event handling.
74
+ */
32
75
  AcEdJigLoop.prototype.activate = function () {
33
76
  _super.prototype.activate.call(this);
34
77
  this.view.canvas.addEventListener('mousemove', this.onMouseMove);
35
78
  };
79
+ /**
80
+ * Deactivates the jig loop operation.
81
+ * Removes the mouse move event listener.
82
+ * Overrides the base class to clean up mouse move event handling.
83
+ */
36
84
  AcEdJigLoop.prototype.deactivate = function () {
37
85
  _super.prototype.deactivate.call(this);
38
86
  this.view.canvas.removeEventListener('mousemove', this.onMouseMove);
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdJigLoop.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;IAA0C,+BAAsB;IAM9D,qBAAY,IAAkB;QAC5B,YAAA,MAAK,YAAC,IAAI,CAAC,SAAA;QANG,YAAM,GAAG;YACvB,MAAM,EAAE,IAAI,gBAAgB,EAAQ;SACrC,CAAA;QAkBO,iBAAW,GAAG,UAAC,KAAiB;YACtC,KAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC7C,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAA;QAC/B,CAAC,CAAA;QAhBC,KAAI,CAAC,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;;IACjC,CAAC;IAED,8BAAQ,GAAR;QACE,gBAAK,CAAC,QAAQ,WAAE,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IAClE,CAAC;IAED,gCAAU,GAAV;QACE,gBAAK,CAAC,UAAU,WAAE,CAAA;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACrE,CAAC;IAMH,kBAAC;AAAD,CAAC,AAzBD,CAA0C,aAAa,GAyBtD"}
1
+ {"version":3,"file":"AcEdJigLoop.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAA0C,+BAAsB;IAS9D;;;;OAIG;IACH,qBAAY,IAAkB;QAC5B,YAAA,MAAK,YAAC,IAAI,CAAC,SAAA;QAdb,wDAAwD;QACxC,YAAM,GAAG;YACvB,kDAAkD;YAClD,MAAM,EAAE,IAAI,gBAAgB,EAAQ;SACrC,CAAA;QAkCD;;;;;WAKG;QACK,iBAAW,GAAG,UAAC,KAAiB;YACtC,KAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC7C,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAA;QAC/B,CAAC,CAAA;QAhCC,KAAI,CAAC,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;;IACjC,CAAC;IAED;;;;OAIG;IACH,8BAAQ,GAAR;QACE,gBAAK,CAAC,QAAQ,WAAE,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IAClE,CAAC;IAED;;;;OAIG;IACH,gCAAU,GAAV;QACE,gBAAK,CAAC,UAAU,WAAE,CAAA;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACrE,CAAC;IAYH,kBAAC;AAAD,CAAC,AAjDD,CAA0C,aAAa,GAiDtD"}
@@ -1,26 +1,146 @@
1
1
  import { AcCmEventManager } from '@mlightcad/data-model';
2
2
  import { AcDbObjectId } from '@mlightcad/data-model';
3
3
  /**
4
- * Interface to define arguments of selection events.
4
+ * Event arguments for selection-related events.
5
+ *
6
+ * Contains the entity IDs that were involved in the selection change.
5
7
  */
6
8
  export interface AcEdSelectionEventArgs {
9
+ /** Array of entity IDs that were added or removed from selection */
7
10
  ids: AcDbObjectId[];
8
11
  }
9
12
  /**
10
- * The class represents the selection set in current view.
13
+ * Manages a collection of selected CAD entities in the current view.
14
+ *
15
+ * This class maintains a set of selected entity IDs and provides methods to:
16
+ * - Add entities to the selection
17
+ * - Remove entities from the selection
18
+ * - Clear all selections
19
+ * - Query selection state and count
20
+ * - Listen for selection change events
21
+ *
22
+ * The selection set fires events when entities are added or removed, allowing
23
+ * other components (like the view) to respond to selection changes by showing
24
+ * grip points, updating UI, etc.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const selectionSet = new AcEdSelectionSet();
29
+ *
30
+ * // Listen for selection changes
31
+ * selectionSet.events.selectionAdded.addEventListener(args => {
32
+ * console.log('Added entities:', args.ids);
33
+ * });
34
+ *
35
+ * // Add entities to selection
36
+ * selectionSet.add(['entity1', 'entity2']);
37
+ *
38
+ * // Check selection
39
+ * if (selectionSet.count > 0) {
40
+ * console.log(`${selectionSet.count} entities selected`);
41
+ * }
42
+ *
43
+ * // Clear selection
44
+ * selectionSet.clear();
45
+ * ```
11
46
  */
12
47
  export declare class AcEdSelectionSet {
48
+ /** Internal set storing the selected entity IDs */
13
49
  private _ids;
50
+ /** Events fired when selection changes */
14
51
  readonly events: {
52
+ /** Fired when entities are added to the selection */
15
53
  selectionAdded: AcCmEventManager<AcEdSelectionEventArgs>;
54
+ /** Fired when entities are removed from the selection */
16
55
  selectionRemoved: AcCmEventManager<AcEdSelectionEventArgs>;
17
56
  };
57
+ /**
58
+ * Creates a new selection set.
59
+ *
60
+ * @param ids - Optional initial array of entity IDs to include in the selection
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * // Create empty selection set
65
+ * const selectionSet = new AcEdSelectionSet();
66
+ *
67
+ * // Create selection set with initial entities
68
+ * const selectionSet = new AcEdSelectionSet(['entity1', 'entity2']);
69
+ * ```
70
+ */
18
71
  constructor(ids?: AcDbObjectId[]);
72
+ /**
73
+ * Gets an array of all selected entity IDs.
74
+ *
75
+ * @returns Array containing all selected entity IDs
76
+ */
19
77
  get ids(): string[];
78
+ /**
79
+ * Gets the number of selected entities.
80
+ *
81
+ * @returns The count of selected entities
82
+ */
20
83
  get count(): number;
84
+ /**
85
+ * Adds one or more entities to the selection.
86
+ *
87
+ * Fires a `selectionAdded` event with the added entity IDs.
88
+ * Duplicate IDs are automatically handled by the internal Set.
89
+ *
90
+ * @param value - Single entity ID or array of entity IDs to add
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * // Add single entity
95
+ * selectionSet.add('entity1');
96
+ *
97
+ * // Add multiple entities
98
+ * selectionSet.add(['entity2', 'entity3', 'entity4']);
99
+ * ```
100
+ */
21
101
  add(value: AcDbObjectId | AcDbObjectId[]): void;
102
+ /**
103
+ * Removes one or more entities from the selection.
104
+ *
105
+ * Fires a `selectionRemoved` event with the removed entity IDs.
106
+ * Non-existent IDs are silently ignored.
107
+ *
108
+ * @param value - Single entity ID or array of entity IDs to remove
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * // Remove single entity
113
+ * selectionSet.delete('entity1');
114
+ *
115
+ * // Remove multiple entities
116
+ * selectionSet.delete(['entity2', 'entity3']);
117
+ * ```
118
+ */
22
119
  delete(value: AcDbObjectId | AcDbObjectId[]): void;
120
+ /**
121
+ * Checks if an entity is currently selected.
122
+ *
123
+ * @param id - The entity ID to check
124
+ * @returns True if the entity is selected, false otherwise
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * if (selectionSet.has('entity1')) {
129
+ * console.log('Entity1 is selected');
130
+ * }
131
+ * ```
132
+ */
23
133
  has(id: AcDbObjectId): boolean;
134
+ /**
135
+ * Removes all entities from the selection.
136
+ *
137
+ * Fires a `selectionRemoved` event with all previously selected entity IDs.
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * selectionSet.clear(); // Deselect everything
142
+ * ```
143
+ */
24
144
  clear(): void;
25
145
  }
26
146
  //# sourceMappingURL=AcEdSelectionSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdSelectionSet.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdSelectionSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,YAAY,EAAE,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAmB;IAE/B,SAAgB,MAAM;;;MAGrB;gBAEW,GAAG,GAAE,YAAY,EAAO;IAIpC,IAAI,GAAG,aAEN;IAED,IAAI,KAAK,WAER;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAUxC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAU3C,GAAG,CAAC,EAAE,EAAE,YAAY;IAIpB,KAAK;CAON"}
1
+ {"version":3,"file":"AcEdSelectionSet.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdSelectionSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,GAAG,EAAE,YAAY,EAAE,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,gBAAgB;IAC3B,mDAAmD;IACnD,OAAO,CAAC,IAAI,CAAmB;IAE/B,0CAA0C;IAC1C,SAAgB,MAAM;QACpB,qDAAqD;;QAErD,yDAAyD;;MAE1D;IAED;;;;;;;;;;;;;OAaG;gBACS,GAAG,GAAE,YAAY,EAAO;IAIpC;;;;OAIG;IACH,IAAI,GAAG,aAEN;IAED;;;;OAIG;IACH,IAAI,KAAK,WAER;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAUxC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAU3C;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,EAAE,EAAE,YAAY;IAIpB;;;;;;;;;OASG;IACH,KAAK;CAON"}
@@ -1,17 +1,71 @@
1
1
  import { AcCmEventManager } from '@mlightcad/data-model';
2
2
  /**
3
- * The class represents the selection set in current view.
3
+ * Manages a collection of selected CAD entities in the current view.
4
+ *
5
+ * This class maintains a set of selected entity IDs and provides methods to:
6
+ * - Add entities to the selection
7
+ * - Remove entities from the selection
8
+ * - Clear all selections
9
+ * - Query selection state and count
10
+ * - Listen for selection change events
11
+ *
12
+ * The selection set fires events when entities are added or removed, allowing
13
+ * other components (like the view) to respond to selection changes by showing
14
+ * grip points, updating UI, etc.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const selectionSet = new AcEdSelectionSet();
19
+ *
20
+ * // Listen for selection changes
21
+ * selectionSet.events.selectionAdded.addEventListener(args => {
22
+ * console.log('Added entities:', args.ids);
23
+ * });
24
+ *
25
+ * // Add entities to selection
26
+ * selectionSet.add(['entity1', 'entity2']);
27
+ *
28
+ * // Check selection
29
+ * if (selectionSet.count > 0) {
30
+ * console.log(`${selectionSet.count} entities selected`);
31
+ * }
32
+ *
33
+ * // Clear selection
34
+ * selectionSet.clear();
35
+ * ```
4
36
  */
5
37
  var AcEdSelectionSet = /** @class */ (function () {
38
+ /**
39
+ * Creates a new selection set.
40
+ *
41
+ * @param ids - Optional initial array of entity IDs to include in the selection
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * // Create empty selection set
46
+ * const selectionSet = new AcEdSelectionSet();
47
+ *
48
+ * // Create selection set with initial entities
49
+ * const selectionSet = new AcEdSelectionSet(['entity1', 'entity2']);
50
+ * ```
51
+ */
6
52
  function AcEdSelectionSet(ids) {
7
53
  if (ids === void 0) { ids = []; }
54
+ /** Events fired when selection changes */
8
55
  this.events = {
56
+ /** Fired when entities are added to the selection */
9
57
  selectionAdded: new AcCmEventManager(),
58
+ /** Fired when entities are removed from the selection */
10
59
  selectionRemoved: new AcCmEventManager()
11
60
  };
12
61
  this._ids = new Set(ids);
13
62
  }
14
63
  Object.defineProperty(AcEdSelectionSet.prototype, "ids", {
64
+ /**
65
+ * Gets an array of all selected entity IDs.
66
+ *
67
+ * @returns Array containing all selected entity IDs
68
+ */
15
69
  get: function () {
16
70
  return Array.from(this._ids);
17
71
  },
@@ -19,12 +73,34 @@ var AcEdSelectionSet = /** @class */ (function () {
19
73
  configurable: true
20
74
  });
21
75
  Object.defineProperty(AcEdSelectionSet.prototype, "count", {
76
+ /**
77
+ * Gets the number of selected entities.
78
+ *
79
+ * @returns The count of selected entities
80
+ */
22
81
  get: function () {
23
82
  return this._ids.size;
24
83
  },
25
84
  enumerable: false,
26
85
  configurable: true
27
86
  });
87
+ /**
88
+ * Adds one or more entities to the selection.
89
+ *
90
+ * Fires a `selectionAdded` event with the added entity IDs.
91
+ * Duplicate IDs are automatically handled by the internal Set.
92
+ *
93
+ * @param value - Single entity ID or array of entity IDs to add
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * // Add single entity
98
+ * selectionSet.add('entity1');
99
+ *
100
+ * // Add multiple entities
101
+ * selectionSet.add(['entity2', 'entity3', 'entity4']);
102
+ * ```
103
+ */
28
104
  AcEdSelectionSet.prototype.add = function (value) {
29
105
  var _this = this;
30
106
  if (Array.isArray(value)) {
@@ -36,6 +112,23 @@ var AcEdSelectionSet = /** @class */ (function () {
36
112
  this.events.selectionAdded.dispatch({ ids: [value] });
37
113
  }
38
114
  };
115
+ /**
116
+ * Removes one or more entities from the selection.
117
+ *
118
+ * Fires a `selectionRemoved` event with the removed entity IDs.
119
+ * Non-existent IDs are silently ignored.
120
+ *
121
+ * @param value - Single entity ID or array of entity IDs to remove
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * // Remove single entity
126
+ * selectionSet.delete('entity1');
127
+ *
128
+ * // Remove multiple entities
129
+ * selectionSet.delete(['entity2', 'entity3']);
130
+ * ```
131
+ */
39
132
  AcEdSelectionSet.prototype.delete = function (value) {
40
133
  var _this = this;
41
134
  if (Array.isArray(value)) {
@@ -47,9 +140,32 @@ var AcEdSelectionSet = /** @class */ (function () {
47
140
  this.events.selectionRemoved.dispatch({ ids: [value] });
48
141
  }
49
142
  };
143
+ /**
144
+ * Checks if an entity is currently selected.
145
+ *
146
+ * @param id - The entity ID to check
147
+ * @returns True if the entity is selected, false otherwise
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * if (selectionSet.has('entity1')) {
152
+ * console.log('Entity1 is selected');
153
+ * }
154
+ * ```
155
+ */
50
156
  AcEdSelectionSet.prototype.has = function (id) {
51
157
  return this._ids.has(id);
52
158
  };
159
+ /**
160
+ * Removes all entities from the selection.
161
+ *
162
+ * Fires a `selectionRemoved` event with all previously selected entity IDs.
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * selectionSet.clear(); // Deselect everything
167
+ * ```
168
+ */
53
169
  AcEdSelectionSet.prototype.clear = function () {
54
170
  if (this._ids.size > 0) {
55
171
  var ids = Array.from(this._ids);