@joint/core 4.2.0-alpha.1 → 4.2.0-beta.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,4 +1,4 @@
1
- /*! JointJS v4.2.0-alpha.1 (2025-09-25) - JavaScript diagramming library
1
+ /*! JointJS v4.2.0-beta.1 (2025-11-03) - JavaScript diagramming library
2
2
 
3
3
  This Source Code Form is subject to the terms of the Mozilla Public
4
4
  License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -431,6 +431,7 @@ export declare namespace config {
431
431
  var doubleTapInterval: number;
432
432
  var cellMergeStrategy: util.MergeCustomizer | null;
433
433
  var cellDefaultsMergeStrategy: util.MergeCustomizer | null;
434
+ var layerAttribute: string;
434
435
  }
435
436
 
436
437
  export declare namespace connectionPoints {
@@ -761,6 +762,89 @@ export declare namespace dia {
761
762
  util.filter.FilterJSON<'brightness'> |
762
763
  util.filter.FilterJSON<'contrast'>;
763
764
 
765
+ export class CellCollection<C extends Cell = Cell> extends mvc.Collection<C> {
766
+
767
+ cellNamespace: any;
768
+ layer: GraphLayer;
769
+
770
+ minZIndex(): number;
771
+
772
+ maxZIndex(): number;
773
+ }
774
+
775
+ export class GraphLayerCollection<L extends GraphLayer = GraphLayer> extends mvc.Collection<L> {
776
+
777
+ cellNamespace: any;
778
+ layerNamespace: any;
779
+ graph: Graph;
780
+
781
+ insert(layer: Graph.LayerInit, beforeId: GraphLayer.ID | null, opt?: ObjectHash): void;
782
+
783
+ getCell(cellRef: Graph.CellRef): Cell | undefined;
784
+
785
+ getCells(): Cell[];
786
+
787
+ removeCell(cell: Cell, opt?: ObjectHash): void;
788
+
789
+ moveCellBetweenLayers(cell: Cell, targetLayerId: GraphLayer.ID, opt?: ObjectHash): void;
790
+
791
+ addCellToLayer(cell: Cell, layerId: GraphLayer.ID, opt?: ObjectHash): void;
792
+ }
793
+
794
+ export class GraphLayersController extends mvc.Listener<[]> {
795
+
796
+ graph: Graph;
797
+
798
+ layerCollection: GraphLayerCollection;
799
+
800
+ startListening(): void;
801
+
802
+ protected onCellChange(cell: Cell, opt: ObjectHash): void;
803
+
804
+ protected onCellRemove(cell: Cell, opt: ObjectHash): void;
805
+
806
+ protected onLayerCollectionEvent(eventName: string, ...args: any[]): void;
807
+
808
+ protected forwardLayerEvent(...args: any[]): void;
809
+
810
+ protected forwardCellEvent(...args: any[]): void;
811
+
812
+ protected forwardCellCollectionEvent(...args: any[]): void;
813
+
814
+ protected forwardLayerCollectionEvent(...args: any[]): void;
815
+ }
816
+
817
+ export class GraphTopologyIndex extends mvc.Listener<[]> {
818
+
819
+ layerCollection: GraphLayerCollection;
820
+
821
+ startListening(): void;
822
+
823
+ getOutboundEdges(id: Cell.ID): { [edgeId: string]: true };
824
+
825
+ getInboundEdges(id: Cell.ID): { [edgeId: string]: true };
826
+
827
+ getSinkNodes(): string[];
828
+
829
+ getSourceNodes(): string[];
830
+
831
+ isSinkNode(id: Cell.ID): boolean;
832
+
833
+ isSourceNode(id: Cell.ID): boolean;
834
+
835
+ protected initializeIndex(): void;
836
+
837
+ protected _restructureOnReset(): void;
838
+
839
+ protected _restructureOnAdd(cell: Cell): void;
840
+
841
+ protected _restructureOnRemove(cell: Cell): void;
842
+
843
+ protected _restructureOnChangeSource(cell: Cell): void;
844
+
845
+ protected _restructureOnChangeTarget(cell: Cell): void;
846
+ }
847
+
764
848
  export namespace Graph {
765
849
 
766
850
  export interface Options {
@@ -784,35 +868,100 @@ export declare namespace dia {
784
868
  strict?: boolean;
785
869
  }
786
870
 
871
+ export interface SyncCellOptions extends Options {
872
+ remove?: boolean;
873
+ }
874
+
875
+ export interface RemoveCellOptions extends Options {
876
+ disconnectLinks?: boolean;
877
+ replace?: boolean;
878
+ clear?: boolean;
879
+ }
880
+
787
881
  export type SearchByKey = 'bbox' | PositionName;
788
882
 
789
883
  export interface FindUnderElementOptions extends FindInAreaOptions, FindAtPointOptions {
790
884
  searchBy?: SearchByKey;
791
885
  }
792
886
 
793
- export class Cells extends mvc.Collection<Cell> {
794
- graph: Graph;
795
- cellNamespace: any;
796
- }
887
+ export type Cells = CellCollection;
888
+
889
+ export type CellInit = Cell | Cell.JSON;
890
+
891
+ export type CellRef = Cell | Cell.ID;
892
+
893
+ export type LayerInit = GraphLayer | GraphLayer.Attributes;
894
+
895
+ export type LayerRef = GraphLayer | GraphLayer.ID;
797
896
 
798
897
  export interface Attributes {
799
- cells?: Cells;
898
+ /** @deprecated use cellsCollection property **/
899
+ cells?: CellCollection;
800
900
  [key: string]: any;
801
901
  }
902
+
903
+ export interface JSON {
904
+ cells: Array<Cell.JSON>;
905
+ layers?: Array<GraphLayer.Attributes>;
906
+ defaultLayer?: string;
907
+ [key: string]: any;
908
+ }
909
+
910
+ export interface InsertLayerOptions extends Options {
911
+ before?: GraphLayer.ID | null;
912
+ index?: number;
913
+ }
802
914
  }
803
915
 
804
916
  export class Graph<A extends ObjectHash = Graph.Attributes, S = dia.ModelSetOptions> extends mvc.Model<A, S> {
805
917
 
806
- constructor(attributes?: Graph.Attributes, opt?: { cellNamespace?: any, cellModel?: typeof Cell });
918
+ layerCollection: GraphLayerCollection;
919
+
920
+ defaultLayerId: GraphLayer.ID;
921
+
922
+ layersController: GraphLayersController;
923
+
924
+ topologyIndex: GraphTopologyIndex;
925
+
926
+ constructor(attributes?: Graph.Attributes, opt?: {
927
+ cellNamespace?: any,
928
+ layerNamespace?: any,
929
+ /** @deprecated use cellNamespace instead */
930
+ cellModel?: typeof Cell
931
+ });
932
+
933
+ addCell(cell: Graph.CellInit, opt?: CollectionAddOptions): this;
934
+ addCell(cell: Array<Graph.CellInit>, opt?: CollectionAddOptions): this;
935
+
936
+ addCells(cells: Array<Graph.CellInit>, opt?: CollectionAddOptions): this;
937
+
938
+ removeCell(cell: Graph.CellRef, opt?: Graph.RemoveCellOptions): void;
939
+
940
+ removeCells(cells: Array<Graph.CellRef>, opt?: Graph.RemoveCellOptions): this;
941
+
942
+ resetCells(cells: Array<Graph.CellInit>, opt?: Graph.Options): this;
943
+
944
+ syncCells(cells: Array<Graph.CellInit>, opt?: Graph.SyncCellOptions): void;
945
+
946
+ addLayer(layerInit: Graph.LayerInit, opt?: Graph.InsertLayerOptions): void;
947
+
948
+ moveLayer(layerRef: Graph.LayerRef, opt?: Graph.InsertLayerOptions): void;
949
+
950
+ removeLayer(layerRef: Graph.LayerRef, opt?: Graph.Options): void;
807
951
 
808
- addCell(cell: Cell.JSON | Cell, opt?: CollectionAddOptions): this;
809
- addCell(cell: Array<Cell | Cell.JSON>, opt?: CollectionAddOptions): this;
952
+ getDefaultLayer(): GraphLayer;
810
953
 
811
- addCells(cells: Array<Cell | Cell.JSON>, opt?: CollectionAddOptions): this;
954
+ setDefaultLayer(id: string, opt?: Graph.Options): void;
812
955
 
813
- resetCells(cells: Array<Cell | Cell.JSON>, opt?: Graph.Options): this;
956
+ getLayer(id: string): GraphLayer;
814
957
 
815
- getCell(id: Cell.ID | Cell): Cell;
958
+ hasLayer(id: string): boolean;
959
+
960
+ getLayers(): GraphLayer[];
961
+
962
+ getCellLayerId(cell: Graph.CellRef): GraphLayer.ID;
963
+
964
+ getCell(id: Graph.CellRef): Cell;
816
965
 
817
966
  getElements(): Element[];
818
967
 
@@ -820,15 +969,15 @@ export declare namespace dia {
820
969
 
821
970
  getCells(): Cell[];
822
971
 
823
- getFirstCell(): Cell | undefined;
972
+ getFirstCell(layerId?: string): Cell | undefined;
824
973
 
825
- getLastCell(): Cell | undefined;
974
+ getLastCell(layerId?: string): Cell | undefined;
826
975
 
827
976
  getConnectedLinks(cell: Cell, opt?: Graph.ConnectionOptions): Link[];
828
977
 
829
978
  disconnectLinks(cell: Cell, opt?: S): void;
830
979
 
831
- removeLinks(cell: Cell, opt?: Cell.DisconnectableOptions): void;
980
+ removeLinks(cell: Graph.CellRef, opt?: Graph.RemoveCellOptions): void;
832
981
 
833
982
  translate(tx: number, ty?: number, opt?: Element.TranslateOptions): this;
834
983
 
@@ -900,6 +1049,12 @@ export declare namespace dia {
900
1049
 
901
1050
  protected _filterCellsUnderElement(cells: Cell[], element: Element, opt: Graph.FindUnderElementOptions): Cell[];
902
1051
 
1052
+ protected _syncCell(cellInit: Graph.CellInit, opt?: Graph.Options): void;
1053
+
1054
+ protected _replaceCell(currentCell: Cell, newCellInit: Graph.CellInit, opt?: Graph.Options): void;
1055
+
1056
+ protected _resetLayers(layers: Array<Graph.LayerInit>, defaultLayerId: GraphLayer.ID | null, opt?: Graph.Options): this;
1057
+
903
1058
  /** @deprecated use `findElementsAtPoint` instead */
904
1059
  findModelsFromPoint(p: Point): Element[];
905
1060
 
@@ -915,11 +1070,9 @@ export declare namespace dia {
915
1070
 
916
1071
  hasActiveBatch(name?: string | string[]): boolean;
917
1072
 
918
- maxZIndex(): number;
1073
+ maxZIndex(layerId?: GraphLayer.ID): number;
919
1074
 
920
- minZIndex(): number;
921
-
922
- removeCells(cells: Cell[], opt?: Cell.DisconnectableOptions): this;
1075
+ minZIndex(layerId?: GraphLayer.ID): number;
923
1076
 
924
1077
  transferCellEmbeds(sourceCell: Cell, targetCell: Cell, opt?: S): void;
925
1078
 
@@ -978,9 +1131,7 @@ export declare namespace dia {
978
1131
  deep?: T;
979
1132
  }
980
1133
 
981
- export interface DisconnectableOptions extends Options {
982
- disconnectLinks?: boolean;
983
- }
1134
+ export type DisconnectableOptions = Graph.RemoveCellOptions;
984
1135
 
985
1136
  export interface GetEmbeddedCellsOptions extends EmbeddableOptions {
986
1137
  breadthFirst?: boolean;
@@ -1060,9 +1211,9 @@ export declare namespace dia {
1060
1211
 
1061
1212
  protected generateId(): string | number;
1062
1213
 
1063
- protected stopPendingTransitions(path?: string, delim?: string): void;
1214
+ protected stopPendingTransitions(path?: Path, delim?: string): void;
1064
1215
 
1065
- protected stopScheduledTransitions(path?: string, delim?: string): void;
1216
+ protected stopScheduledTransitions(path?: Path, delim?: string): void;
1066
1217
 
1067
1218
  toJSON(opt?: dia.Cell.ExportOptions): Cell.JSON<any, A>;
1068
1219
 
@@ -1100,11 +1251,11 @@ export declare namespace dia {
1100
1251
 
1101
1252
  removeAttr(path: Path, opt?: Cell.Options): this;
1102
1253
 
1103
- transition(path: string, value?: any, opt?: Cell.TransitionOptions, delim?: string): number;
1254
+ transition(path: Path, value?: any, opt?: Cell.TransitionOptions, delim?: string): number;
1104
1255
 
1105
1256
  getTransitions(): string[];
1106
1257
 
1107
- stopTransitions(path?: string, delim?: string): this;
1258
+ stopTransitions(path?: Path, delim?: string): this;
1108
1259
 
1109
1260
  embed(cell: Cell | Cell[], opt?: Cell.EmbedOptions): this;
1110
1261
 
@@ -1128,6 +1279,9 @@ export declare namespace dia {
1128
1279
 
1129
1280
  z(): number;
1130
1281
 
1282
+ layer(): string | null;
1283
+ layer(id: string | null, opt?: Graph.Options): this;
1284
+
1131
1285
  angle(): number;
1132
1286
 
1133
1287
  getBBox(): g.Rect;
@@ -1258,7 +1412,7 @@ export declare namespace dia {
1258
1412
  }
1259
1413
 
1260
1414
  export interface FitParentOptions extends FitToChildrenOptions {
1261
- terminator?: Cell | Cell.ID;
1415
+ terminator?: Graph.CellRef;
1262
1416
  }
1263
1417
 
1264
1418
  export interface RotateOptions {
@@ -1985,14 +2139,17 @@ export declare namespace dia {
1985
2139
  }
1986
2140
 
1987
2141
  export enum Layers {
1988
- CELLS = 'cells',
1989
2142
  LABELS = 'labels',
1990
2143
  BACK = 'back',
1991
2144
  FRONT = 'front',
2145
+ /** @deprecated */
2146
+ CELLS = 'cells',
1992
2147
  TOOLS = 'tools',
1993
2148
  GRID = 'grid',
1994
2149
  }
1995
2150
 
2151
+ export type LayerRef = Layers | string | dia.LayerView | dia.GraphLayer;
2152
+
1996
2153
  export interface RenderStats {
1997
2154
  priority: number;
1998
2155
  updated: number;
@@ -2135,6 +2292,7 @@ export declare namespace dia {
2135
2292
  validateUnembedding?: (this: Paper, childView: ElementView) => boolean;
2136
2293
  // default views, models & attributes
2137
2294
  cellViewNamespace?: any;
2295
+ layerViewNamespace?: any;
2138
2296
  routerNamespace?: any;
2139
2297
  connectorNamespace?: any;
2140
2298
  highlighterNamespace?: any;
@@ -2308,6 +2466,11 @@ export declare namespace dia {
2308
2466
  view: CellView;
2309
2467
  magnet: SVGElement;
2310
2468
  }
2469
+
2470
+ export interface InsertLayerViewOptions {
2471
+ before?: LayerRef | null;
2472
+ index?: number;
2473
+ }
2311
2474
  }
2312
2475
 
2313
2476
  export class Paper extends mvc.View<Graph> {
@@ -2320,10 +2483,14 @@ export declare namespace dia {
2320
2483
 
2321
2484
  svg: SVGSVGElement;
2322
2485
  defs: SVGDefsElement;
2486
+
2487
+ /** @deprecated use getLayerViewNode()*/
2323
2488
  cells: SVGGElement;
2489
+ /** @deprecated use layers property*/
2490
+ viewport: SVGGElement;
2491
+
2324
2492
  tools: SVGGElement;
2325
2493
  layers: SVGGElement;
2326
- viewport: SVGGElement;
2327
2494
 
2328
2495
  GUARDED_TAG_NAMES: string[];
2329
2496
  FORM_CONTROLS_TAG_NAMES: string[];
@@ -2399,7 +2566,7 @@ export declare namespace dia {
2399
2566
 
2400
2567
  findView<T extends ElementView | LinkView>(element: mvc.$SVGElement): T;
2401
2568
 
2402
- findViewByModel<T extends ElementView | LinkView>(model: Cell | Cell.ID): T;
2569
+ findViewByModel<T extends ElementView | LinkView>(model: Graph.CellRef): T;
2403
2570
 
2404
2571
  /**
2405
2572
  * Finds all the element views at the specified point
@@ -2461,7 +2628,7 @@ export declare namespace dia {
2461
2628
 
2462
2629
  getDefaultLink(cellView: CellView, magnet: SVGElement): Link;
2463
2630
 
2464
- getModelById(id: Cell.ID | Cell): Cell;
2631
+ getModelById(id: Graph.CellRef): Cell;
2465
2632
 
2466
2633
  setDimensions(width: Paper.Dimension, height: Paper.Dimension, data?: any): void;
2467
2634
 
@@ -2497,29 +2664,38 @@ export declare namespace dia {
2497
2664
 
2498
2665
  // layers
2499
2666
 
2500
- getLayerNode(layerName: Paper.Layers | string): SVGGElement;
2667
+ getLayerView(layerRef: Paper.LayerRef): LayerView;
2668
+ getLayerView(layer: GraphLayer): GraphLayerView;
2669
+
2670
+ hasLayerView(layerRef: Paper.LayerRef): boolean;
2671
+
2672
+ getLayerViews(): Array<LayerView>;
2673
+
2674
+ getGraphLayerViews(): Array<GraphLayerView>;
2501
2675
 
2502
- getLayerView(layerName: Paper.Layers | string): PaperLayer;
2676
+ addLayerView(layerView: LayerView, options?: Paper.InsertLayerViewOptions): void;
2503
2677
 
2504
- hasLayerView(layerName: Paper.Layers | string): boolean;
2678
+ moveLayerView(layerRef: Paper.LayerRef, options?: Paper.InsertLayerViewOptions): void;
2505
2679
 
2506
- renderLayers(layers: Array<{ name: string }>): void;
2680
+ removeLayerView(layerRef: Paper.LayerRef): void;
2507
2681
 
2508
- protected removeLayers(): void;
2682
+ protected insertLayerView(layerView: LayerView, before?: Paper.LayerRef): void;
2509
2683
 
2510
- protected resetLayers(): void;
2684
+ protected requestLayerViewRemoval(layerRef: Paper.LayerRef): void;
2511
2685
 
2512
- addLayer(layerName: string, layerView: PaperLayer, options?: { insertBefore?: string }): void;
2686
+ protected createLayerView(options: Omit<LayerView.Options, 'paper'>): LayerView;
2513
2687
 
2514
- removeLayer(layer: string | PaperLayer): void;
2688
+ protected getLayerViewOrder(): string[];
2515
2689
 
2516
- moveLayer(layer: string | PaperLayer, insertBefore: string | PaperLayer | null): void;
2690
+ protected renderLayerViews(): void;
2517
2691
 
2518
- hasLayer(layer: string | PaperLayer): boolean;
2692
+ protected renderImplicitLayerViews(): void;
2519
2693
 
2520
- getLayerNames(): string[];
2694
+ protected renderGraphLayerViews(): void;
2521
2695
 
2522
- getLayers(): Array<PaperLayer>;
2696
+ protected removeLayerViews(): void;
2697
+
2698
+ protected resetLayerViews(): void;
2523
2699
 
2524
2700
  // rendering
2525
2701
 
@@ -2533,7 +2709,9 @@ export declare namespace dia {
2533
2709
 
2534
2710
  requestViewUpdate(view: mvc.View<any, any>, flag: number, priority: number, opt?: { [key: string]: any }): void;
2535
2711
 
2536
- requireView<T extends ElementView | LinkView>(cellOrId: Cell | Cell.ID, opt?: Paper.UpdateViewOptions & Paper.RenderCallbackOptions): T;
2712
+ requestCellViewInsertion(cell: Graph.CellRef, opt?: { [key: string]: any }): void;
2713
+
2714
+ requireView<T extends ElementView | LinkView>(cellOrId: Graph.CellRef, opt?: Paper.UpdateViewOptions & Paper.RenderCallbackOptions): T;
2537
2715
 
2538
2716
  updateViews(opt?: Paper.UpdateViewsOptions): Paper.RenderStats & { batches: number };
2539
2717
 
@@ -2541,10 +2719,10 @@ export declare namespace dia {
2541
2719
 
2542
2720
  disposeHiddenCellViews(): void;
2543
2721
 
2544
- isCellVisible(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2722
+ isCellVisible(cellOrId: Graph.CellRef): boolean;
2545
2723
 
2546
2724
  updateCellVisibility(
2547
- cell: Cell | Cell.ID,
2725
+ cell: Graph.CellRef,
2548
2726
  opt?: Paper.CellVisibilityOptions & Paper.UpdateViewOptions & Paper.RenderCallbackOptions
2549
2727
  ): void;
2550
2728
 
@@ -2596,9 +2774,9 @@ export declare namespace dia {
2596
2774
 
2597
2775
  protected checkUnmountedViews(viewport: Paper.ViewportCallback, opt?: Paper.MountOptions): number;
2598
2776
 
2599
- protected prioritizeCellViewMount(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2777
+ protected prioritizeCellViewMount(cellOrId: Graph.CellRef): boolean;
2600
2778
 
2601
- protected prioritizeCellViewUnmount(cellOrId: dia.Cell | dia.Cell.ID): boolean;
2779
+ protected prioritizeCellViewUnmount(cellOrId: Graph.CellRef): boolean;
2602
2780
 
2603
2781
  protected isViewMounted(viewOrCid: dia.CellView | string): boolean;
2604
2782
 
@@ -2659,6 +2837,14 @@ export declare namespace dia {
2659
2837
  protected onCellChanged(cell: Cell, opt: dia.Cell.Options): void;
2660
2838
  protected onCellChanged(cell: mvc.Collection<Cell>, opt: dia.Graph.Options): void;
2661
2839
 
2840
+ protected onGraphLayerAdd(layer: GraphLayer, collection: mvc.Collection<GraphLayer>, opt: dia.Graph.Options): void;
2841
+
2842
+ protected onGraphLayerRemove(layer: GraphLayer, collection: mvc.Collection<GraphLayer>, opt: dia.Graph.Options): void;
2843
+
2844
+ protected onGraphLayerCollectionReset(layer: mvc.Collection<GraphLayer>, opt: dia.Graph.Options): void;
2845
+
2846
+ protected onGraphLayerCollectionSort(layer: GraphLayer[]): void;
2847
+
2662
2848
  protected onGraphReset(cells: mvc.Collection<Cell>, opt: dia.Graph.Options): void;
2663
2849
 
2664
2850
  protected onGraphSort(): void;
@@ -2689,6 +2875,11 @@ export declare namespace dia {
2689
2875
 
2690
2876
  protected addStylesheet(stylesheet: string): void;
2691
2877
 
2878
+ /**
2879
+ * @deprecated use `getLayerView(id).el` instead
2880
+ * **/
2881
+ getLayerNode(id: Paper.Layers | string): SVGElement;
2882
+
2692
2883
  /**
2693
2884
  * @deprecated use `findElementViewsAtPoint()
2694
2885
  */
@@ -2715,17 +2906,20 @@ export declare namespace dia {
2715
2906
  dumpViews(opt?: Paper.ScheduleCellsVisibilityUpdateOptions & Paper.UpdateViewsOptions): void;
2716
2907
  }
2717
2908
 
2718
- export namespace PaperLayer {
2909
+ export namespace LayerView {
2719
2910
 
2720
- export interface Options extends mvc.ViewOptions<undefined, SVGElement> {
2721
- name: string;
2911
+ export interface Options<T extends mvc.Model | undefined = undefined> extends mvc.ViewOptions<T, SVGElement> {
2912
+ id: string;
2913
+ paper: Paper;
2914
+ type?: string;
2722
2915
  }
2723
2916
  }
2724
- export class PaperLayer extends mvc.View<undefined, SVGElement> {
2725
2917
 
2726
- constructor(opt?: PaperLayer.Options);
2918
+ export class LayerView<T extends mvc.Model | undefined = undefined> extends mvc.View<T, SVGElement> {
2727
2919
 
2728
- options: PaperLayer.Options;
2920
+ constructor(opt?: LayerView.Options);
2921
+
2922
+ options: LayerView.Options;
2729
2923
 
2730
2924
  pivotNodes: { [z: number]: Comment };
2731
2925
 
@@ -2735,7 +2929,78 @@ export declare namespace dia {
2735
2929
 
2736
2930
  insertPivot(z: number): Comment;
2737
2931
 
2738
- removePivots(): void;
2932
+ isEmpty(): boolean;
2933
+
2934
+ reset(): void;
2935
+
2936
+ setPaperReference(paper: Paper): void;
2937
+
2938
+ unsetPaperReference(): void;
2939
+
2940
+ protected removePivots(): void;
2941
+
2942
+ protected afterPaperReferenceSet(paper: Paper): void;
2943
+
2944
+ protected beforePaperReferenceUnset(paper: Paper): void;
2945
+
2946
+ protected assertPaperReferenceSet(): void;
2947
+ }
2948
+
2949
+ export namespace GraphLayer {
2950
+
2951
+ export type ID = string;
2952
+
2953
+ export interface Attributes extends mvc.ObjectHash {
2954
+ id: ID;
2955
+ type?: string;
2956
+ }
2957
+ }
2958
+
2959
+ export class GraphLayer<C extends CellCollection = CellCollection, A extends GraphLayer.Attributes = GraphLayer.Attributes, S extends mvc.ModelSetOptions = dia.ModelSetOptions> extends mvc.Model<A, S> {
2960
+
2961
+ id: string;
2962
+
2963
+ cellCollection: C;
2964
+ graph: Graph | null;
2965
+
2966
+ constructor(attributes?: DeepPartial<A>, options?: mvc.ModelConstructorOptions<GraphLayer>);
2967
+
2968
+ getCells(): Cell[];
2969
+ }
2970
+
2971
+ export class GraphLayerView<T extends GraphLayer = GraphLayer> extends LayerView<T> {
2972
+
2973
+ sort(): void;
2974
+
2975
+ sortExact(): void;
2976
+
2977
+ insertCellView(cellView: CellView): void;
2978
+
2979
+ protected onCellMove(cell: Cell, opt: Graph.Options): void;
2980
+
2981
+ protected onCellChange(cell: Cell, opt: Cell.Options): void;
2982
+
2983
+ protected onCellCollectionSort(collection: CellCollection, opt: Graph.Options): void;
2984
+
2985
+ protected onGraphBatchStop(data: any): void;
2986
+ }
2987
+
2988
+ export namespace GridLayerView {
2989
+
2990
+ export interface Options extends LayerView.Options {
2991
+ patterns?: Record<string, Paper.GridOptions[]>;
2992
+ }
2993
+ }
2994
+
2995
+ export class GridLayerView extends LayerView {
2996
+
2997
+ setGrid(opt?: null | boolean | string | Paper.GridOptions | Paper.GridOptions[]): void;
2998
+
2999
+ renderGrid(): void;
3000
+
3001
+ updateGrid(): void;
3002
+
3003
+ removeGrid(): void;
2739
3004
  }
2740
3005
 
2741
3006
  export namespace ToolsView {
@@ -4529,6 +4794,7 @@ export declare namespace mvc {
4529
4794
 
4530
4795
  export interface ModelConstructorOptions<TModel extends Model = Model> extends ModelSetOptions, Parseable {
4531
4796
  collection?: Collection<TModel> | undefined;
4797
+ eventPrefix?: string | undefined;
4532
4798
  }
4533
4799
 
4534
4800
  export type CombinedModelConstructorOptions<E, M extends Model<any, any, E> = Model> = ModelConstructorOptions<M> & E;