@hatiolab/things-scene 3.0.27 → 3.0.29

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.
package/things-scene.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { property } from 'lodash'
2
-
3
1
  declare module '@hatiolab/things-scene' {
4
2
  type Constructor<T = {}> = new (...args: any[]) => T
5
3
  type Class = { new (...args: any[]): any }
@@ -160,7 +158,19 @@ declare module '@hatiolab/things-scene' {
160
158
  class Anchor {
161
159
  constructor({ component, anchor, position }: { component: Component; anchor: string; position: POSITION })
162
160
 
161
+ component?: Component
162
+ name: string
163
163
  position: POSITION
164
+ bounds?: BOUNDS
165
+ type?: 'in' | 'out' | 'inout'
166
+ multiplicity?: boolean
167
+ draw?: (context: CanvasRenderingContext2D, component: Component) => void
168
+ }
169
+
170
+ class LinkEnd {
171
+ component: string /** end component refid */
172
+ anchor: string /** end anchor name of end component */
173
+ position: POSITION /** position of the link end */
164
174
  }
165
175
 
166
176
  class Model {
@@ -208,6 +218,17 @@ declare module '@hatiolab/things-scene' {
208
218
 
209
219
  function MoveHandle<TBase extends Constructor>(Base: TBase): TBase
210
220
 
221
+ function Connectable<TBase extends Constructor>(
222
+ Base: TBase
223
+ ): {
224
+ new (...args: any[]): {
225
+ findOutletLines(anchorName: string): Line[]
226
+ findOutletEnds(anchorName: string): Component[]
227
+ findInletLines(anchorName: string): Line[]
228
+ findInletEnds(anchorName: string): Component[]
229
+ }
230
+ } & TBase
231
+
211
232
  function MixinHTMLElement<TBase extends Constructor>(
212
233
  Base: TBase
213
234
  ): {
@@ -256,7 +277,6 @@ declare module '@hatiolab/things-scene' {
256
277
  model: Model
257
278
  hierarchy: Model
258
279
  path: Array<DIMENSION>
259
- anchors: Array<Anchor>
260
280
  hidden: boolean
261
281
 
262
282
  get nature(): ComponentNature
@@ -275,6 +295,7 @@ declare module '@hatiolab/things-scene' {
275
295
  get center(): POINT
276
296
  set center(point: POINT)
277
297
 
298
+ get anchors(): Array<Anchor>
278
299
  get controls(): Array<Control> | undefined
279
300
  get hasTextProperty(): boolean
280
301
  get textSubstitutor(): () => string
@@ -369,6 +390,13 @@ declare module '@hatiolab/things-scene' {
369
390
  class Shape extends Component {}
370
391
  class Ellipse extends Shape {}
371
392
  class Polygon extends Shape {}
393
+ class Line extends Component {
394
+ get fromAnchor(): Anchor | undefined
395
+ get toAnchor(): Anchor | undefined
396
+ get from(): LinkEnd
397
+ get to(): LinkEnd
398
+ }
399
+ class OrthoLine extends Line {}
372
400
  class Donut extends Ellipse {}
373
401
  class Rect extends RectPath(Shape) {}
374
402
  class HTMLOverlayElement extends MixinHTMLElement(RectPath(Component)) {}
@@ -552,6 +580,8 @@ declare module '@hatiolab/things-scene' {
552
580
 
553
581
  data: object
554
582
 
583
+ anchorStarterTemplate: object
584
+
555
585
  // @deprecated
556
586
  variables: object
557
587