@joint/core 4.2.0-alpha.0 → 4.2.0-alpha.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.
package/dist/joint.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- /*! JointJS v4.2.0-alpha.0 (2025-06-16) - JavaScript diagramming library
2
-
1
+ /*! JointJS v4.2.0-alpha.1 (2025-09-25) - JavaScript diagramming library
3
2
 
4
3
  This Source Code Form is subject to the terms of the Mozilla Public
5
4
  License, v. 2.0. If a copy of the MPL was not distributed with this
6
5
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
6
  */
7
+
8
8
  // Definitions by:
9
9
  // Aidan Reel <http://github.com/areel>,
10
10
  // David Durman <http://github.com/DavidDurman>,
@@ -38,7 +38,8 @@ export declare namespace anchors {
38
38
  }
39
39
 
40
40
  export interface MidSideAnchorArguments extends RotateAnchorArguments, PaddingAnchorArguments {
41
-
41
+ mode?: 'prefer-horizontal' | 'prefer-vertical' | 'horizontal' | 'vertical' | 'auto';
42
+ preferenceThreshold?: dia.Sides;
42
43
  }
43
44
 
44
45
  export interface ModelCenterAnchorArguments {
@@ -428,6 +429,8 @@ export declare namespace config {
428
429
  var classNamePrefix: string;
429
430
  var defaultTheme: string;
430
431
  var doubleTapInterval: number;
432
+ var cellMergeStrategy: util.MergeCustomizer | null;
433
+ var cellDefaultsMergeStrategy: util.MergeCustomizer | null;
431
434
  }
432
435
 
433
436
  export declare namespace connectionPoints {
@@ -1146,6 +1149,8 @@ export declare namespace dia {
1146
1149
 
1147
1150
  static define(type: string, defaults?: any, protoProps?: any, staticProps?: any): Cell.Constructor<Cell>;
1148
1151
 
1152
+ static getAttributeDefinition(attrName: string): Cell.PresentationAttributeDefinition<CellView> | null;
1153
+
1149
1154
  /**
1150
1155
  * @deprecated
1151
1156
  */
@@ -1170,24 +1175,40 @@ export declare namespace dia {
1170
1175
  export interface Attributes extends GenericAttributes<Cell.Selectors> {
1171
1176
  }
1172
1177
 
1173
- export type PortPositionCallback = (ports: Port[], bbox: g.Rect) => dia.Point[];
1178
+ export interface ConstructorOptions extends Cell.ConstructorOptions {
1179
+ portLayoutNamespace?: { [key: string]: layout.Port.LayoutFunction };
1180
+ portLabelLayoutNamespace?: { [key: string]: layout.PortLabel.LayoutFunction };
1181
+ }
1182
+
1183
+ export type PortPositionCallback = layout.Port.LayoutFunction;
1184
+
1185
+ export type PortLabelPositionCallback = layout.PortLabel.LayoutFunction;
1174
1186
 
1175
1187
  export interface PortPositionJSON {
1176
1188
  name?: string;
1177
- args?: { [key: string]: any };
1189
+ args?: layout.Port.Options;
1190
+ }
1191
+
1192
+ export interface PortLabelPositionJSON {
1193
+ name?: string;
1194
+ args?: layout.PortLabel.Options;
1178
1195
  }
1179
1196
 
1180
1197
  export type PositionType = string | PortPositionCallback | PortPositionJSON;
1181
1198
 
1199
+ export type PortLabelPositionType = PortLabelPositionCallback | PortPositionJSON;
1200
+
1182
1201
  export interface PortGroup {
1183
1202
  position?: PositionType;
1184
1203
  markup?: string | MarkupJSON;
1185
1204
  attrs?: Cell.Selectors;
1186
1205
  size?: Size;
1187
- label?: {
1188
- markup?: string | MarkupJSON;
1189
- position?: PositionType;
1190
- };
1206
+ label?: PortLabel;
1207
+ }
1208
+
1209
+ export interface PortLabel {
1210
+ markup?: string | MarkupJSON;
1211
+ position?: PortLabelPositionType;
1191
1212
  }
1192
1213
 
1193
1214
  export interface Port {
@@ -1196,14 +1217,12 @@ export declare namespace dia {
1196
1217
  group?: string;
1197
1218
  attrs?: Cell.Selectors;
1198
1219
  position?: {
1199
- args?: { [key: string]: any };
1220
+ args?: layout.Port.Options;
1200
1221
  };
1201
- args?: { [key: string]: any };
1222
+ /** @deprecated use `position.args` instead */
1223
+ args?: layout.Port.Options;
1202
1224
  size?: Size;
1203
- label?: {
1204
- markup?: string | MarkupJSON;
1205
- position?: PositionType;
1206
- };
1225
+ label?: PortLabel;
1207
1226
  z?: number | 'auto';
1208
1227
  }
1209
1228
 
@@ -1233,7 +1252,7 @@ export declare namespace dia {
1233
1252
  filter?: (cell: Cell) => boolean;
1234
1253
  deep?: boolean;
1235
1254
  padding?: Padding;
1236
- minRect?: g.Rect;
1255
+ minRect?: Partial<BBox>;
1237
1256
  expandOnly?: boolean;
1238
1257
  shrinkOnly?: boolean;
1239
1258
  }
@@ -1253,6 +1272,8 @@ export declare namespace dia {
1253
1272
 
1254
1273
  export class Element<A extends ObjectHash = Element.Attributes, S extends mvc.ModelSetOptions = dia.ModelSetOptions> extends Cell<A, S> {
1255
1274
 
1275
+ constructor(attributes?: DeepPartial<A>, opt?: Element.ConstructorOptions);
1276
+
1256
1277
  translate(tx: number, ty?: number, opt?: Element.TranslateOptions): this;
1257
1278
 
1258
1279
  position(opt?: Element.PositionOptions): g.Point;
@@ -1972,36 +1993,94 @@ export declare namespace dia {
1972
1993
  GRID = 'grid',
1973
1994
  }
1974
1995
 
1975
- export type UpdateStats = {
1996
+ export interface RenderStats {
1976
1997
  priority: number;
1977
1998
  updated: number;
1978
- empty?: boolean;
1979
- postponed?: number;
1980
- unmounted?: number;
1981
- mounted?: number;
1999
+ }
2000
+
2001
+ export interface UpdateVisibilityStats {
2002
+ mounted: number;
2003
+ unmounted: number;
2004
+ }
2005
+
2006
+ export interface RenderBatchStats extends RenderStats, UpdateVisibilityStats {
2007
+ postponed: number;
2008
+ empty: boolean;
2009
+ }
2010
+
2011
+ export type UpdateStats = RenderStats & Partial<RenderBatchStats> & {
1982
2012
  batches?: number;
1983
2013
  };
1984
2014
 
1985
2015
  export type ViewportCallback = (view: mvc.View<any, any>, isMounted: boolean, paper: Paper) => boolean;
2016
+ export type CellVisibilityCallback = (cell: Cell, isMounted: boolean, paper: Paper) => boolean;
1986
2017
  export type ProgressCallback = (done: boolean, processed: number, total: number, stats: UpdateStats, paper: Paper) => void;
1987
2018
  export type BeforeRenderCallback = (opt: { [key: string]: any }, paper: Paper) => void;
1988
2019
  export type AfterRenderCallback = (stats: UpdateStats, opt: { [key: string]: any }, paper: Paper) => void;
1989
2020
 
1990
- export interface FreezeOptions {
1991
- key?: string;
2021
+ export interface CellVisibilityOptions {
2022
+ cellVisibility?: CellVisibilityCallback | null;
2023
+
2024
+ /** @deprecated disable `legacyMode` and use `cellVisibility` instead */
2025
+ viewport?: ViewportCallback | null;
1992
2026
  }
1993
2027
 
1994
- export interface UnfreezeOptions {
1995
- key?: string;
2028
+ export interface MountOptions {
1996
2029
  mountBatchSize?: number;
2030
+ }
2031
+
2032
+ export interface UnmountOptions {
1997
2033
  unmountBatchSize?: number;
2034
+ }
2035
+
2036
+ export interface BatchSizeOptions {
1998
2037
  batchSize?: number;
1999
- viewport?: ViewportCallback;
2000
- progress?: ProgressCallback;
2038
+ }
2039
+
2040
+ export interface BeforeRenderOptions {
2001
2041
  beforeRender?: BeforeRenderCallback;
2042
+ }
2043
+
2044
+ export interface AfterRenderOptions {
2002
2045
  afterRender?: AfterRenderCallback;
2003
2046
  }
2004
2047
 
2048
+ export interface RenderCallbackOptions extends BeforeRenderOptions, AfterRenderOptions, mvc.Silenceable {
2049
+
2050
+ }
2051
+
2052
+ export interface KeyOptions {
2053
+ key?: string;
2054
+ }
2055
+
2056
+ export interface UpdateViewOptions {
2057
+ [key: string]: any;
2058
+ }
2059
+
2060
+ export interface UpdateViewsBatchOptions extends UpdateViewOptions, BatchSizeOptions, CellVisibilityOptions {
2061
+
2062
+ }
2063
+
2064
+ export interface UpdateViewsOptions extends UpdateViewsBatchOptions, RenderCallbackOptions {
2065
+
2066
+ }
2067
+
2068
+ export interface UpdateViewsAsyncOptions extends UpdateViewsBatchOptions, ScheduleCellsVisibilityUpdateOptions, RenderCallbackOptions {
2069
+ progress?: ProgressCallback;
2070
+ }
2071
+
2072
+ export interface ScheduleCellsVisibilityUpdateOptions extends CellVisibilityOptions, MountOptions, UnmountOptions {
2073
+
2074
+ }
2075
+
2076
+ export interface FreezeOptions extends KeyOptions {
2077
+
2078
+ }
2079
+
2080
+ export interface UnfreezeOptions extends KeyOptions, UpdateViewsAsyncOptions, UpdateViewsOptions {
2081
+
2082
+ }
2083
+
2005
2084
  export interface SnapLinksOptions {
2006
2085
  radius?: number;
2007
2086
  findInAreaOptions?: FindInAreaOptions;
@@ -2013,7 +2092,7 @@ export declare namespace dia {
2013
2092
  export type FindParentByCallback = ((this: dia.Graph, elementView: ElementView, evt: dia.Event, x: number, y: number) => Cell[]);
2014
2093
  export type MeasureNodeCallback = (node: SVGGraphicsElement, cellView: dia.CellView) => g.Rect;
2015
2094
 
2016
- export interface Options extends mvc.ViewOptions<Graph> {
2095
+ export interface Options extends mvc.ViewOptions<Graph>, CellVisibilityOptions, BeforeRenderOptions, AfterRenderOptions {
2017
2096
  // appearance
2018
2097
  width?: Dimension;
2019
2098
  height?: Dimension;
@@ -2075,14 +2154,17 @@ export declare namespace dia {
2075
2154
  sorting?: sorting;
2076
2155
  frozen?: boolean;
2077
2156
  autoFreeze?: boolean;
2078
- viewport?: ViewportCallback | null;
2157
+ viewManagement?: ViewManagementOptions | boolean;
2079
2158
  onViewUpdate?: (view: mvc.View<any, any>, flag: number, priority: number, opt: { [key: string]: any }, paper: Paper) => void;
2080
2159
  onViewPostponed?: (view: mvc.View<any, any>, flag: number, paper: Paper) => boolean;
2081
- beforeRender?: Paper.BeforeRenderCallback;
2082
- afterRender?: Paper.AfterRenderCallback;
2083
2160
  overflow?: boolean;
2084
2161
  }
2085
2162
 
2163
+ export interface ViewManagementOptions {
2164
+ lazyInitialize?: boolean;
2165
+ disposeHidden?: boolean;
2166
+ }
2167
+
2086
2168
  export interface TransformToFitContentOptions {
2087
2169
  padding?: Padding;
2088
2170
  preserveAspectRatio?: boolean;
@@ -2215,6 +2297,17 @@ export declare namespace dia {
2215
2297
 
2216
2298
  export interface FindInAreaOptions extends Graph.FindInAreaOptions, BufferOptions {
2217
2299
  }
2300
+
2301
+ export interface FindClosestMagnetToPointOptions {
2302
+ radius?: number;
2303
+ findInAreaOptions?: FindInAreaOptions;
2304
+ filter?: (view: CellView, magnet: SVGElement) => boolean;
2305
+ }
2306
+
2307
+ export interface ClosestMagnet {
2308
+ view: CellView;
2309
+ magnet: SVGElement;
2310
+ }
2218
2311
  }
2219
2312
 
2220
2313
  export class Paper extends mvc.View<Graph> {
@@ -2350,6 +2443,13 @@ export declare namespace dia {
2350
2443
  */
2351
2444
  findCellViewsInArea(area: BBox, opt?: Paper.FindInAreaOptions): CellView[];
2352
2445
 
2446
+ /**
2447
+ * Finds the closest magnet to the specified point
2448
+ * @param point a point in local paper coordinates
2449
+ * @param opt options for the search
2450
+ */
2451
+ findClosestMagnetToPoint(point: Point, opt?: Paper.FindClosestMagnetToPointOptions): Paper.ClosestMagnet | null;
2452
+
2353
2453
  fitToContent(opt?: Paper.FitToContentOptions): g.Rect;
2354
2454
  fitToContent(gridWidth?: number, gridHeight?: number, padding?: number, opt?: any): g.Rect;
2355
2455
 
@@ -2427,38 +2527,30 @@ export declare namespace dia {
2427
2527
 
2428
2528
  unfreeze(opt?: Paper.UnfreezeOptions): void;
2429
2529
 
2530
+ wakeUp(): void;
2531
+
2430
2532
  isFrozen(): boolean;
2431
2533
 
2432
2534
  requestViewUpdate(view: mvc.View<any, any>, flag: number, priority: number, opt?: { [key: string]: any }): void;
2433
2535
 
2434
- requireView<T extends ElementView | LinkView>(model: Cell | Cell.ID, opt?: dia.Cell.Options): T;
2536
+ requireView<T extends ElementView | LinkView>(cellOrId: Cell | Cell.ID, opt?: Paper.UpdateViewOptions & Paper.RenderCallbackOptions): T;
2435
2537
 
2436
- dumpViews(opt?: {
2437
- batchSize?: number;
2438
- mountBatchSize?: number;
2439
- unmountBatchSize?: number;
2440
- viewport?: Paper.ViewportCallback;
2441
- }): void;
2538
+ updateViews(opt?: Paper.UpdateViewsOptions): Paper.RenderStats & { batches: number };
2442
2539
 
2443
- checkViewport(opt?: {
2444
- mountBatchSize?: number;
2445
- unmountBatchSize?: number;
2446
- viewport?: Paper.ViewportCallback;
2447
- }): {
2448
- mounted: number;
2449
- unmounted: number;
2450
- };
2540
+ hasScheduledUpdates(): boolean;
2451
2541
 
2452
- updateViews(opt?: {
2453
- batchSize?: number;
2454
- viewport?: Paper.ViewportCallback;
2455
- }): {
2456
- updated: number;
2457
- batches: number;
2458
- priority: number;
2459
- };
2542
+ disposeHiddenCellViews(): void;
2460
2543
 
2461
- hasScheduledUpdates(): boolean;
2544
+ isCellVisible(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2545
+
2546
+ updateCellVisibility(
2547
+ cell: Cell | Cell.ID,
2548
+ opt?: Paper.CellVisibilityOptions & Paper.UpdateViewOptions & Paper.RenderCallbackOptions
2549
+ ): void;
2550
+
2551
+ updateCellsVisibility(
2552
+ opt?: Paper.ScheduleCellsVisibilityUpdateOptions & Paper.UpdateViewsOptions
2553
+ ): void;
2462
2554
 
2463
2555
  // events
2464
2556
 
@@ -2469,52 +2561,51 @@ export declare namespace dia {
2469
2561
  // protected
2470
2562
 
2471
2563
  /**
2472
- * For the specified view, calls the visibility viewport function specified by the paper.options.viewport function.
2564
+ * For the specified view, calls the cell visibility function specified by the `paper.options.cellVisibility` function.
2473
2565
  * If the function returns true, the view is attached to the DOM; in other case it is detached.
2474
- * While async papers do this automatically, synchronous papers require an explicit call to this method for this functionality to be applied. To show the view again, use paper.requestView().
2475
- * If you are using autoFreeze option you should call this function if you are calling paper.requestView() if you want paper.options.viewport function to be applied.
2566
+ * While async papers do this automatically, synchronous papers require an explicit call to this method for this functionality to be applied. To show the view again, use `paper.requestView()`.
2567
+ * If you are using `autoFreeze` option you should call this function if you are calling `paper.requestView()` if you want `paper.options.cellVisibility` function to be applied.
2476
2568
  * @param cellView cellView for which the visibility check is performed
2477
- * @param opt if opt.viewport is provided, it is used as the callback function instead of paper.options.viewport.
2569
+ * @param opt if opt.cellVisibility is provided, it is used as the callback function instead of paper.options.cellVisibility.
2478
2570
  */
2479
- protected checkViewVisibility(cellView: dia.CellView, opt?: {
2480
- viewport?: Paper.ViewportCallback;
2481
- }): {
2482
- mounted: number;
2483
- unmounted: number;
2484
- };
2571
+ protected checkViewVisibility(
2572
+ cellView: dia.CellView,
2573
+ opt?: Paper.CellVisibilityOptions
2574
+ ): Paper.UpdateVisibilityStats;
2575
+
2576
+
2577
+ protected scheduleCellsVisibilityUpdate(opt?: Paper.ScheduleCellsVisibilityUpdateOptions): Paper.UpdateVisibilityStats;
2485
2578
 
2486
2579
  protected scheduleViewUpdate(view: mvc.View<any, any>, flag: number, priority: number, opt?: { [key: string]: any }): void;
2487
2580
 
2488
2581
  protected dumpViewUpdate(view: mvc.View<any, any>): number;
2489
2582
 
2490
- protected dumpView(view: mvc.View<any, any>, opt?: { [key: string]: any }): number;
2583
+ protected dumpView(view: mvc.View<any, any>, opt?: Paper.UpdateViewOptions & Paper.RenderCallbackOptions): number;
2491
2584
 
2492
- protected updateView(view: mvc.View<any, any>, flag: number, opt?: { [key: string]: any }): number;
2585
+ protected updateView(view: mvc.View<any, any>, flag: number, opt?: Paper.UpdateViewOptions): number;
2493
2586
 
2494
2587
  protected registerUnmountedView(view: mvc.View<any, any>): number;
2495
2588
 
2496
2589
  protected registerMountedView(view: mvc.View<any, any>): number;
2497
2590
 
2498
- protected updateViewsAsync(opt?: {
2499
- batchSize?: number;
2500
- mountBatchSize?: number;
2501
- unmountBatchSize?: number;
2502
- viewport?: Paper.ViewportCallback;
2503
- progress?: Paper.ProgressCallback;
2504
- before?: Paper.BeforeRenderCallback;
2505
- }): void;
2591
+ protected updateViewsAsync(opt?: Paper.UpdateViewsAsyncOptions): void;
2506
2592
 
2507
- protected updateViewsBatch(opt?: {
2508
- batchSize?: number;
2509
- viewport?: Paper.ViewportCallback;
2510
- }): Paper.UpdateStats;
2593
+ protected updateViewsBatch(opt?: Paper.UpdateViewsBatchOptions): Paper.RenderBatchStats;
2511
2594
 
2512
- protected checkMountedViews(viewport: Paper.ViewportCallback, opt?: { unmountBatchSize?: number }): number;
2595
+ protected checkMountedViews(viewport: Paper.ViewportCallback, opt?: Paper.UnmountOptions): number;
2513
2596
 
2514
- protected checkUnmountedViews(viewport: Paper.ViewportCallback, opt?: { mountBatchSize?: number }): number;
2597
+ protected checkUnmountedViews(viewport: Paper.ViewportCallback, opt?: Paper.MountOptions): number;
2598
+
2599
+ protected prioritizeCellViewMount(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2600
+
2601
+ protected prioritizeCellViewUnmount(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2602
+
2603
+ protected isViewMounted(viewOrCid: dia.CellView | string): boolean;
2515
2604
 
2516
2605
  protected isAsync(): boolean;
2517
2606
 
2607
+ protected isIdle(): boolean;
2608
+
2518
2609
  protected isExactSorting(): boolean;
2519
2610
 
2520
2611
  protected sortViews(): void;
@@ -2590,7 +2681,9 @@ export declare namespace dia {
2590
2681
 
2591
2682
  protected insertView(cellView: CellView, isInitialInsert: boolean): void;
2592
2683
 
2593
- protected detachView(cellView: CellView): void;
2684
+ protected _hideCellView(cellView: CellView): void;
2685
+
2686
+ protected _detachCellView(cellView: CellView): void;
2594
2687
 
2595
2688
  protected customEventTrigger(event: dia.Event, view: CellView, rootNode?: SVGElement): dia.Event | null;
2596
2689
 
@@ -2610,6 +2703,16 @@ export declare namespace dia {
2610
2703
  * @deprecated use transformToFitContent
2611
2704
  */
2612
2705
  scaleContentToFit(opt?: Paper.ScaleContentOptions): void;
2706
+
2707
+ /**
2708
+ * @deprecated Use `updateCellsVisibility()`
2709
+ */
2710
+ checkViewport(opt?: Paper.ScheduleCellsVisibilityUpdateOptions): Paper.UpdateVisibilityStats;
2711
+
2712
+ /**
2713
+ * @deprecated Use `updateCellsVisibility()`
2714
+ */
2715
+ dumpViews(opt?: Paper.ScheduleCellsVisibilityUpdateOptions & Paper.UpdateViewsOptions): void;
2613
2716
  }
2614
2717
 
2615
2718
  export namespace PaperLayer {
@@ -2668,6 +2771,10 @@ export declare namespace dia {
2668
2771
  hide(): this;
2669
2772
 
2670
2773
  mount(): this;
2774
+
2775
+ getLayer(): string | null;
2776
+
2777
+ hasLayer(): boolean;
2671
2778
  }
2672
2779
 
2673
2780
  export namespace ToolView {
@@ -2711,6 +2818,8 @@ export declare namespace dia {
2711
2818
 
2712
2819
  update(): void;
2713
2820
 
2821
+ isOverlay(): boolean;
2822
+
2714
2823
  protected guard(evt: dia.Event): boolean;
2715
2824
  }
2716
2825
 
@@ -2802,6 +2911,8 @@ export declare namespace dia {
2802
2911
  id?: string
2803
2912
  ): T[];
2804
2913
 
2914
+ static has(cellView: dia.CellView, id?: string): boolean;
2915
+
2805
2916
  static update(cellView: dia.CellView, id?: string): void;
2806
2917
 
2807
2918
  static transform(cellView: dia.CellView, id?: string): void;
@@ -2879,7 +2990,7 @@ export declare namespace elementTools {
2879
2990
 
2880
2991
  export namespace Boundary {
2881
2992
  export interface Options extends dia.ToolView.Options<dia.ElementView> {
2882
- padding?: number | dia.Sides;
2993
+ padding?: dia.Sides;
2883
2994
  useModelGeometry?: boolean;
2884
2995
  rotate?: boolean;
2885
2996
  }
@@ -2957,12 +3068,16 @@ export declare namespace g {
2957
3068
  }
2958
3069
 
2959
3070
  export type Shape = Path | Point | Line | Polyline | Polygon | Rect | Ellipse;
3071
+
2960
3072
  export interface PlainPoint {
2961
3073
 
2962
3074
  x: number;
2963
3075
  y: number;
2964
3076
  }
2965
3077
 
3078
+ /** Can be understood by `g.Point` constructor */
3079
+ export type PointInit = Partial<PlainPoint> | string;
3080
+
2966
3081
  export interface PlainRect {
2967
3082
 
2968
3083
  x: number;
@@ -3022,15 +3137,15 @@ export declare namespace g {
3022
3137
 
3023
3138
  clone(): Segment;
3024
3139
 
3025
- closestPoint(p: Point, opt?: SubdivisionsOpt): Point;
3140
+ closestPoint(p: PlainPoint, opt?: SubdivisionsOpt): Point;
3026
3141
 
3027
- closestPointLength(p: Point, opt?: SubdivisionsOpt): number;
3142
+ closestPointLength(p: PlainPoint, opt?: SubdivisionsOpt): number;
3028
3143
 
3029
- closestPointNormalizedLength(p: Point, opt?: SubdivisionsOpt): number;
3144
+ closestPointNormalizedLength(p: PlainPoint, opt?: SubdivisionsOpt): number;
3030
3145
 
3031
- closestPointT(p: Point): number;
3146
+ closestPointT(p: PlainPoint): number;
3032
3147
 
3033
- closestPointTangent(p: Point): Line | null;
3148
+ closestPointTangent(p: PlainPoint): Line | null;
3034
3149
 
3035
3150
  divideAt(ratio: number, opt?: SubdivisionsOpt): [Segment, Segment];
3036
3151
 
@@ -3056,7 +3171,7 @@ export declare namespace g {
3056
3171
 
3057
3172
  round(precision?: number): this;
3058
3173
 
3059
- scale(sx: number, sy: number, origin?: PlainPoint): this;
3174
+ scale(sx: number, sy: number, origin?: PointInit): this;
3060
3175
 
3061
3176
  tangentAt(ratio: number): Line | null;
3062
3177
 
@@ -3113,7 +3228,7 @@ export declare namespace g {
3113
3228
  end: Point;
3114
3229
  type: types.Curve;
3115
3230
 
3116
- constructor(p1: PlainPoint | string, p2: PlainPoint | string, p3: PlainPoint | string, p4: PlainPoint | string);
3231
+ constructor(p1: PointInit, p2: PointInit, p3: PointInit, p4: PointInit);
3117
3232
  constructor(curve: Curve);
3118
3233
 
3119
3234
  bbox(): Rect;
@@ -3161,7 +3276,7 @@ export declare namespace g {
3161
3276
 
3162
3277
  round(precision?: number): this;
3163
3278
 
3164
- scale(sx: number, sy: number, origin?: PlainPoint | string): this;
3279
+ scale(sx: number, sy: number, origin?: PointInit): this;
3165
3280
 
3166
3281
  tangentAt(ratio: number, opt?: SubdivisionsOpt): Line | null;
3167
3282
 
@@ -3193,7 +3308,7 @@ export declare namespace g {
3193
3308
  b: number;
3194
3309
  type: types.Ellipse;
3195
3310
 
3196
- constructor(center: PlainPoint | string, a: number, b: number);
3311
+ constructor(center: PointInit, a: number, b: number);
3197
3312
  constructor(ellipse: Ellipse);
3198
3313
 
3199
3314
  bbox(): Rect;
@@ -3210,7 +3325,7 @@ export declare namespace g {
3210
3325
 
3211
3326
  intersectionWithLine(l: Line): Point[] | null;
3212
3327
 
3213
- intersectionWithLineFromCenterToPoint(p: PlainPoint, angle?: number): Point;
3328
+ intersectionWithLineFromCenterToPoint(p: PointInit, angle?: number): Point;
3214
3329
 
3215
3330
  normalizedDistance(point: PlainPoint): number;
3216
3331
 
@@ -3229,7 +3344,7 @@ export declare namespace g {
3229
3344
  end: Point;
3230
3345
  type: types.Line;
3231
3346
 
3232
- constructor(p1: PlainPoint | string, p2: PlainPoint | string);
3347
+ constructor(p1: PointInit, p2: PointInit);
3233
3348
  constructor(line: Line);
3234
3349
  constructor();
3235
3350
 
@@ -3243,13 +3358,13 @@ export declare namespace g {
3243
3358
 
3244
3359
  parallel(distance: number): Line;
3245
3360
 
3246
- closestPoint(p: PlainPoint | string): Point;
3361
+ closestPoint(p: PointInit): Point;
3247
3362
 
3248
- closestPointLength(p: PlainPoint | string): number;
3363
+ closestPointLength(p: PointInit): number;
3249
3364
 
3250
- closestPointNormalizedLength(p: PlainPoint | string): number;
3365
+ closestPointNormalizedLength(p: PointInit): number;
3251
3366
 
3252
- closestPointTangent(p: PlainPoint | string): Line | null;
3367
+ closestPointTangent(p: PointInit): Line | null;
3253
3368
 
3254
3369
  containsPoint(p: PlainPoint): boolean;
3255
3370
 
@@ -3277,13 +3392,13 @@ export declare namespace g {
3277
3392
 
3278
3393
  pointAtLength(length: number): Point;
3279
3394
 
3280
- pointOffset(p: PlainPoint | string): number;
3395
+ pointOffset(p: PointInit): number;
3281
3396
 
3282
3397
  rotate(origin: PlainPoint, angle: number): this;
3283
3398
 
3284
3399
  round(precision?: number): this;
3285
3400
 
3286
- scale(sx: number, sy: number, origin?: PlainPoint): this;
3401
+ scale(sx: number, sy: number, origin?: PointInit): this;
3287
3402
 
3288
3403
  setLength(length: number): this;
3289
3404
 
@@ -3322,13 +3437,13 @@ export declare namespace g {
3322
3437
 
3323
3438
  clone(): Path;
3324
3439
 
3325
- closestPoint(p: Point, opt?: SegmentSubdivisionsOpt): Point | null;
3440
+ closestPoint(p: PlainPoint, opt?: SegmentSubdivisionsOpt): Point | null;
3326
3441
 
3327
- closestPointLength(p: Point, opt?: SegmentSubdivisionsOpt): number;
3442
+ closestPointLength(p: PlainPoint, opt?: SegmentSubdivisionsOpt): number;
3328
3443
 
3329
- closestPointNormalizedLength(p: Point, opt?: SegmentSubdivisionsOpt): number;
3444
+ closestPointNormalizedLength(p: PlainPoint, opt?: SegmentSubdivisionsOpt): number;
3330
3445
 
3331
- closestPointTangent(p: Point, opt?: SegmentSubdivisionsOpt): Line | null;
3446
+ closestPointTangent(p: PlainPoint, opt?: SegmentSubdivisionsOpt): Line | null;
3332
3447
 
3333
3448
  containsPoint(p: PlainPoint, opt?: SegmentSubdivisionsOpt): boolean;
3334
3449
 
@@ -3364,7 +3479,7 @@ export declare namespace g {
3364
3479
 
3365
3480
  round(precision?: number): this;
3366
3481
 
3367
- scale(sx: number, sy: number, origin?: PlainPoint | string): this;
3482
+ scale(sx: number, sy: number, origin?: PointInit): this;
3368
3483
 
3369
3484
  segmentAt(ratio: number, opt?: SegmentSubdivisionsOpt): Segment | null;
3370
3485
 
@@ -3391,7 +3506,7 @@ export declare namespace g {
3391
3506
 
3392
3507
  validate(): this;
3393
3508
 
3394
- private closestPointT(p: Point, opt?: SegmentSubdivisionsOpt): PathT | null;
3509
+ private closestPointT(p: PlainPoint, opt?: SegmentSubdivisionsOpt): PathT | null;
3395
3510
 
3396
3511
  private lengthAtT(t: PathT, opt?: SegmentSubdivisionsOpt): number;
3397
3512
 
@@ -3419,17 +3534,17 @@ export declare namespace g {
3419
3534
  type: types.Point;
3420
3535
 
3421
3536
  constructor(x?: number, y?: number);
3422
- constructor(p: PlainPoint | string);
3537
+ constructor(p: PointInit);
3423
3538
 
3424
- chooseClosest(points: PlainPoint[]): Point | null;
3539
+ chooseClosest(points: PointInit[]): Point | null;
3425
3540
 
3426
3541
  adhereToRect(r: Rect): this;
3427
3542
 
3428
3543
  angleBetween(p1: PlainPoint, p2: PlainPoint): number;
3429
3544
 
3430
- bearing(p: Point): CardinalDirection;
3545
+ bearing(p: PlainPoint): CardinalDirection;
3431
3546
 
3432
- changeInAngle(dx: number, dy: number, ref: PlainPoint | string): number;
3547
+ changeInAngle(dx: number, dy: number, ref: PointInit): number;
3433
3548
 
3434
3549
  clone(): Point;
3435
3550
 
@@ -3438,42 +3553,42 @@ export declare namespace g {
3438
3553
  difference(dx?: number, dy?: number): Point;
3439
3554
  difference(p: PlainPoint): Point;
3440
3555
 
3441
- distance(p: PlainPoint | string): number;
3556
+ distance(p: PlainPoint): number;
3442
3557
 
3443
3558
  dot(p: PlainPoint): number;
3444
3559
 
3445
- equals(p: Point): boolean;
3560
+ equals(p: PlainPoint): boolean;
3446
3561
 
3447
- lerp(p: Point, t: number): Point;
3562
+ lerp(p: PlainPoint, t: number): Point;
3448
3563
 
3449
3564
  magnitude(): number;
3450
3565
 
3451
3566
  manhattanDistance(p: PlainPoint): number;
3452
3567
 
3453
- move(ref: PlainPoint | string, distance: number): this;
3568
+ move(ref: PointInit, distance: number): this;
3454
3569
 
3455
3570
  normalize(length: number): this;
3456
3571
 
3457
3572
  offset(dx?: number, dy?: number): this;
3458
3573
  offset(p: PlainPoint): this;
3459
3574
 
3460
- reflection(ref: PlainPoint | string): Point;
3575
+ reflection(ref: PointInit): Point;
3461
3576
 
3462
- rotate(origin: PlainPoint | string, angle: number): this;
3577
+ rotate(origin: PlainPoint, angle: number): this;
3463
3578
 
3464
3579
  round(precision?: number): this;
3465
3580
 
3466
- scale(sx: number, sy: number, origin?: PlainPoint | string): this;
3581
+ scale(sx: number, sy: number, origin?: PointInit): this;
3467
3582
 
3468
3583
  snapToGrid(gx: number, gy?: number): this;
3469
3584
 
3470
- squaredDistance(p: PlainPoint | string): number;
3585
+ squaredDistance(p: PlainPoint): number;
3471
3586
 
3472
- theta(p: PlainPoint | string): number;
3587
+ theta(p: PointInit): number;
3473
3588
 
3474
3589
  toJSON(): PlainPoint;
3475
3590
 
3476
- toPolar(origin?: PlainPoint | string): this;
3591
+ toPolar(origin?: PointInit): this;
3477
3592
 
3478
3593
  toString(): string;
3479
3594
 
@@ -3487,7 +3602,7 @@ export declare namespace g {
3487
3602
 
3488
3603
  vectorAngle(p: PlainPoint): number;
3489
3604
 
3490
- static fromPolar(distance: number, angle: number, origin?: PlainPoint | string): Point;
3605
+ static fromPolar(distance: number, angle: number, origin?: PointInit): Point;
3491
3606
 
3492
3607
  static random(x1: number, x2: number, y1: number, y2: number): Point;
3493
3608
  }
@@ -3499,17 +3614,17 @@ export declare namespace g {
3499
3614
 
3500
3615
  constructor();
3501
3616
  constructor(svgString: string);
3502
- constructor(points: PlainPoint[]);
3617
+ constructor(points: PointInit[]);
3503
3618
 
3504
3619
  bbox(): Rect | null;
3505
3620
 
3506
- closestPoint(p: PlainPoint | string): Point | null;
3621
+ closestPoint(p: PlainPoint): Point | null;
3507
3622
 
3508
- closestPointLength(p: PlainPoint | string): number;
3623
+ closestPointLength(p: PlainPoint): number;
3509
3624
 
3510
- closestPointNormalizedLength(p: PlainPoint | string): number;
3625
+ closestPointNormalizedLength(p: PlainPoint): number;
3511
3626
 
3512
- closestPointTangent(p: PlainPoint | string): Line | null;
3627
+ closestPointTangent(p: PlainPoint): Line | null;
3513
3628
 
3514
3629
  containsPoint(p: PlainPoint): boolean;
3515
3630
 
@@ -3529,7 +3644,7 @@ export declare namespace g {
3529
3644
 
3530
3645
  round(precision?: number): this;
3531
3646
 
3532
- scale(sx: number, sy: number, origin?: PlainPoint | string): this;
3647
+ scale(sx: number, sy: number, origin?: PointInit): this;
3533
3648
 
3534
3649
  simplify(opt?: { threshold?: number }): this;
3535
3650
 
@@ -3594,7 +3709,7 @@ export declare namespace g {
3594
3709
 
3595
3710
  clone(): Rect;
3596
3711
 
3597
- containsPoint(p: PlainPoint | string, opt?: StrictOpt): boolean;
3712
+ containsPoint(p: PointInit, opt?: StrictOpt): boolean;
3598
3713
 
3599
3714
  containsRect(r: PlainRect): boolean;
3600
3715
 
@@ -3608,7 +3723,7 @@ export declare namespace g {
3608
3723
 
3609
3724
  intersectionWithLine(l: Line): Point[] | null;
3610
3725
 
3611
- intersectionWithLineFromCenterToPoint(p: PlainPoint | string, angle?: number): Point;
3726
+ intersectionWithLineFromCenterToPoint(p: PointInit, angle?: number): Point;
3612
3727
 
3613
3728
  leftLine(): Line;
3614
3729
 
@@ -3620,7 +3735,7 @@ export declare namespace g {
3620
3735
 
3621
3736
  moveAndExpand(r: PlainRect): this;
3622
3737
 
3623
- moveAroundPoint(origin: PlainPoint | string, angle: number): this;
3738
+ moveAroundPoint(origin: PlainPoint, angle: number): this;
3624
3739
 
3625
3740
  normalize(): this;
3626
3741
 
@@ -3629,7 +3744,7 @@ export declare namespace g {
3629
3744
 
3630
3745
  origin(): Point;
3631
3746
 
3632
- pointNearestToPoint(point: PlainPoint | string): Point;
3747
+ pointNearestToPoint(point: PointInit): Point;
3633
3748
 
3634
3749
  rightLine(): Line;
3635
3750
 
@@ -3637,9 +3752,9 @@ export declare namespace g {
3637
3752
 
3638
3753
  round(precision?: number): this;
3639
3754
 
3640
- scale(sx: number, sy: number, origin?: PlainPoint | string): this;
3755
+ scale(sx: number, sy: number, origin?: PointInit): this;
3641
3756
 
3642
- sideNearestToPoint(point: PlainPoint | string): RectangleSide;
3757
+ sideNearestToPoint(point: PointInit): RectangleSide;
3643
3758
 
3644
3759
  snapToGrid(gx: number, gy?: number): this;
3645
3760
 
@@ -3679,24 +3794,24 @@ export declare namespace g {
3679
3794
  p3: Point;
3680
3795
  }
3681
3796
 
3682
- export function curveThroughPoints(points: PlainPoint[] | Point[]): string[];
3797
+ export function curveThroughPoints(points: PlainPoint[]): string[];
3683
3798
 
3684
- export function getCurveControlPoints(points: PlainPoint[] | Point[]): [Point[], Point[]];
3799
+ export function getCurveControlPoints(points: PlainPoint[]): [Point[], Point[]];
3685
3800
 
3686
3801
  export function getCurveDivider(
3687
- p0: string | PlainPoint,
3688
- p1: string | PlainPoint,
3689
- p2: string | PlainPoint,
3690
- p3: string | PlainPoint
3802
+ p0: PointInit,
3803
+ p1: PointInit,
3804
+ p2: PointInit,
3805
+ p3: PointInit
3691
3806
  ): (t: number) => [IBezierCurve, IBezierCurve];
3692
3807
 
3693
3808
  export function getFirstControlPoints(rhs: number[]): number[];
3694
3809
 
3695
3810
  export function getInversionSolver(
3696
- p0: PlainPoint,
3697
- p1: PlainPoint,
3698
- p2: PlainPoint,
3699
- p3: PlainPoint
3811
+ p0: PointInit,
3812
+ p1: PointInit,
3813
+ p2: PointInit,
3814
+ p3: PointInit
3700
3815
  ): (p: PlainPoint) => number;
3701
3816
  }
3702
3817
 
@@ -3882,7 +3997,7 @@ export declare namespace highlighters {
3882
3997
  position?: Positions | dia.PositionName;
3883
3998
  size?: number | dia.Size;
3884
3999
  gap?: number;
3885
- margin?: number | dia.Sides;
4000
+ margin?: dia.Sides;
3886
4001
  }
3887
4002
  }
3888
4003
 
@@ -3931,7 +4046,7 @@ export declare namespace layout {
3931
4046
  angle: number;
3932
4047
  };
3933
4048
 
3934
- export type LayoutFunction = (ports: Array<Object>, elBBox: g.Rect, opt: Options) => Array<Transformation>;
4049
+ export type LayoutFunction = (ports: Array<dia.Element.Port>, elBBox: g.Rect, opt: Options) => Array<Transformation>;
3935
4050
 
3936
4051
  export interface Options {
3937
4052
  x?: number | string;
@@ -3944,9 +4059,11 @@ export declare namespace layout {
3944
4059
  startAngle?: number;
3945
4060
  step?: number;
3946
4061
  compensateRotation?: boolean;
4062
+ [key: string]: any;
3947
4063
  }
3948
4064
 
3949
4065
  var absolute: LayoutFunction;
4066
+ /** @deprecated */
3950
4067
  var fn: LayoutFunction;
3951
4068
  var line: LayoutFunction;
3952
4069
  var left: LayoutFunction;
@@ -3965,6 +4082,7 @@ export declare namespace layout {
3965
4082
  angle?: number;
3966
4083
  offset?: number;
3967
4084
  attrs?: dia.Cell.Selectors;
4085
+ [key: string]: any;
3968
4086
  }
3969
4087
 
3970
4088
  export interface LabelAttributes {
@@ -4201,7 +4319,7 @@ export declare namespace linkTools {
4201
4319
 
4202
4320
  export namespace Boundary {
4203
4321
  export interface Options extends dia.ToolView.Options<dia.LinkView> {
4204
- padding?: number | dia.Sides;
4322
+ padding?: dia.Sides;
4205
4323
  useModelGeometry?: boolean;
4206
4324
  }
4207
4325
  }
@@ -4699,6 +4817,7 @@ export declare namespace mvc {
4699
4817
  collection?: Collection<any> | undefined; // was: Collection<TModel>;
4700
4818
  el?: $Element<TElement> | string | undefined;
4701
4819
  id?: string | undefined;
4820
+ cid?: string | undefined;
4702
4821
  attributes?: Record<string, any> | undefined;
4703
4822
  className?: string | undefined;
4704
4823
  tagName?: string | undefined;
@@ -4741,9 +4860,9 @@ export declare namespace mvc {
4741
4860
 
4742
4861
  el: TElement;
4743
4862
  attributes: Record<string, any>;
4744
- /* @deprecated use `el` instead */
4863
+ /** @deprecated use `el` instead */
4745
4864
  $el: Dom;
4746
- /* @deprecated use `el.querySelector()` instead */
4865
+ /** @deprecated use `el.querySelector()` instead */
4747
4866
  $(selector: string): Dom;
4748
4867
  render(): this;
4749
4868
  remove(): this;
@@ -5555,6 +5674,8 @@ export declare namespace util {
5555
5674
 
5556
5675
  export function merge(destinationObject: object, ...args: any[]): object;
5557
5676
 
5677
+ export type MergeCustomizer = (value: any, srcValue: any, key: string, object: any, source: any, stack: any) => any;
5678
+
5558
5679
  // ADDITIONAL SIMPLE UTIL FUNCTIONS:
5559
5680
 
5560
5681
  export function isBoolean(value: any): boolean;
@@ -5606,6 +5727,7 @@ export declare namespace Vectorizer {
5606
5727
  annotations?: TextAnnotation[];
5607
5728
  includeAnnotationIndices?: boolean;
5608
5729
  displayEmpty?: boolean;
5730
+ useNoBreakSpace?: boolean;
5609
5731
  }
5610
5732
 
5611
5733
  export interface GetBBoxOptions {
@@ -5627,6 +5749,10 @@ export declare namespace Vectorizer {
5627
5749
  attrs: { [key: string]: any };
5628
5750
  }
5629
5751
 
5752
+ export interface TransformToElementOptions {
5753
+ safe?: boolean;
5754
+ }
5755
+
5630
5756
  // modifiable Matrix. SVGMatrix doesn't allow set on properties or a constructor.
5631
5757
  export interface Matrix {
5632
5758
  a: number;
@@ -5696,7 +5822,7 @@ export declare class VElement {
5696
5822
  id: string;
5697
5823
  node: SVGElement;
5698
5824
 
5699
- getTransformToElement(toElem: SVGGElement | VElement): SVGMatrix;
5825
+ getTransformToElement(target: SVGElement | VElement, opt?: Vectorizer.TransformToElementOptions): SVGMatrix;
5700
5826
 
5701
5827
  transform(): SVGMatrix;
5702
5828
  transform(matrix: SVGMatrix | Vectorizer.Matrix, opt?: Vectorizer.TransformOptions): this;
@@ -5805,6 +5931,9 @@ declare interface VStatic {
5805
5931
 
5806
5932
  ensureId(node: SVGElement | VElement): string;
5807
5933
 
5934
+ /**
5935
+ * @deprecated Use regular spaces and rely on xml:space="preserve" instead.
5936
+ */
5808
5937
  sanitizeText(text: string): string;
5809
5938
 
5810
5939
  isUndefined(value: any): boolean;
@@ -5819,6 +5948,8 @@ declare interface VStatic {
5819
5948
 
5820
5949
  qualifyAttr(name: string): Vectorizer.QualifiedAttribute;
5821
5950
 
5951
+ getCommonAncestor(node1: SVGElement | VElement, node2: SVGElement | VElement): SVGElement | null;
5952
+
5822
5953
  transformStringToMatrix(transform: string): SVGMatrix;
5823
5954
 
5824
5955
  matrixToTransformString(matrix: SVGMatrix | Vectorizer.Matrix): string;