-
Notifications
You must be signed in to change notification settings - Fork 16
/
familytree.d.ts
2626 lines (2490 loc) · 90 KB
/
familytree.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare class FamilyTree extends FamilyTreeBase {
nodes: { [key in any]: FamilyTree.node };
isVisible: boolean;
visibleNodeIds: Array<number | string>;
/**
* @param element HTML element or string selector for example '#tree'
* @param options configuration options
*/
constructor(element: HTMLElement | string, options?: FamilyTree.options);
/**
* Updates the node data
* @param newData node data
*/
update(newData: object): FamilyTree;
/**
* Removes specified node from nodes collection
* @param id identification number of the node
*/
remove(id: string | number): FamilyTree;
/**
* Adds new node to the nodes collection
* @param data node data
*/
add(data: object): FamilyTree;
/**
* Gets node data.
* @param id identification number of the node
*/
get(id: string | number): FamilyTree.node;
/**
* If specified node has assistant/s or partner/s as children will return false.
* @param id identification number of the node
*/
canRemove(id: string | number): boolean;
/**
* Expands specified nodes.
* @param id the id of the node that will not move during the animation
* @param ids node ids that will be expanded
* @param callback called after the animation completes
*/
expand(id: string | number, ids: Array<string | number>, callback?: () => void): void;
/**
* Collapses specified nodes.
* @param id the id of the node that will not move
* @param ids node ids that will be collapsed
* @param callback called after the animation completes
*/
collapse(id: string | number, ids: Array<string | number>, callback?: () => void): void;
/**
* Expand/Collapse lists of nodes.
* @param id the id of the node that will not move
* @param expandIds expand all nodes with ids
* @param collapseIds collpase all nodes with ids
* @param callback called after the animation completes
*/
expandCollapse(id: string | number, expandIds: Array<string | number>, collapseIds: Array<string | number>, callback?: () => void): void;
/**
* Changes roots order.
* @param id id of a node that will not change is position, can be null
* @param roots roots id array in the required order
* @param callback called after the roots are changed and animation completes
*/
changeRoots(id: string | number, roots: Array<string | number>, callback?: () => void): void;
/**
* Maximize the node. Without parameters maximize all nodes.
* @param id the id of the node, if id is null, undefined ot empty string will maximize all nodes
* @param horizontalCenter center horizontally
* @param verticalCenter center vertically
* @param callback called when the animation completes
*/
maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: () => void): void;
/**
* Minimize the node. Without parameters minimize all nodes.
* @param id the id of the node, if id is null, undefined ot empty string will minimize all nodes
* @param callback called when the animation completes
*/
minimize(id?: string | number, callback?: () => void): void;
/**
* Load nodes data.
* @param data node data array
* @param callback function called after the load
*/
load(data: Array<object>, callback?: () => void): FamilyTree;
/**
* Updates the node data, redraws the family and fires update event.
* @param data node data
* @param callback function called when the animation completes
* @param fireEvent if it set to true the update event is called
*/
updateNode(data: object, callback?: () => void, fireEvent?: boolean): void;
/**
* Loads nodes from xml.
* @param xml Xml with node structure
* @param callback function called after the load
*/
loadXML(xml: string, callback?: () => void): FamilyTree;
/**
* Gets nodes as xml.
*/
getXML(): string;
/**
* Draws the family.
* @param action Action for example FamilyTree.action.centerNode, default is FamilyTree.action.update
* @param actionParams parameters for the action
* @param callback called when the animation completes
*/
draw(action?: FamilyTree.action, actionParams?: any, callback?: () => void): void;
/**
* Gets the width of the container.
*/
width(): number;
/**
* Gets the height of the container.
*/
height(): number;
/**
* Gets the view box attribute of the svg html element.
*/
getViewBox(): Array<number>;
/**
* Sets the view box attribute of the svg html element.
* @param viewBox
*/
setViewBox(viewBox: Array<number>): void;
/**
* Gets the current scale of the family.
* @param viewBox
*/
getScale(viewBox?: Array<number>): number;
/**
* Sets the current scale of the family.
* Returns the actual scale limited by scaleMax and scaleMin
* @param newScale new scale value
*/
setScale(newScale: number): number;
/**
* Animates specified node with ripple animation - highlight the node.
* @param id the id of the node
* @param clientX x value of the ripple center in the node
* @param clientY y value of the ripple center in the node
*/
ripple(id: string | number, clientX?: number, clientY?: number): void;
/**
* Centers specified node on the screen.
* @param nodeId the id of the node
* @param options parentState: FamilyTree.COLLAPSE_PARENT_NEIGHBORS, childrenState: FamilyTree.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false
* @param callback called when the animation completes
*/
center(nodeId: string | number, options?: {
parentState: any,
childrenState: any,
rippleId: string | number,
vertical: boolean,
horizontal: boolean
} | null, callback?: () => void): void;
/**
* Fits the content to the visible area.
* @param callback called when the animation completes
*/
fit(callback?: () => void): void;
/**
* Toggles full screen mode.
*/
toggleFullScreen(): void;
/**
* Gets the node as {@link FamilyTree.node} object.
* @param nodeId
*/
getNode(nodeId: string | number): FamilyTree.node;
/**
* Sets layout.
* @param layout layout type
* @param lcn lyout config name for the specified sub tree
*/
/**
* Adds new node to the nodes collection, redraws the family and fires remove event
* @param data node data
* @param callback called at the end of animation
* @param fireEvent indicates if the add event will be called or not
*/
addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
setLayout(layout: FamilyTree.layout | number, lcn?: string): void;
/**
* Sets orientation.
* @param orientation orientation type
* @param lcn lyout config name for the specified sub tree
* @param callback called at the end of animation
*/
setOrientation(orientation: FamilyTree.orientation, lcn?: string, callback?: () => void): void;
/**
* Moves specified nodes to the visible area.
* @param ids Array of node ids
* @param callback called at the end of animation
*/
moveNodesToVisibleArea(ids: Array<number | string>, callback?: () => void): void;
/**
* Search in the family.
* @param value search for value
* @param searchInFields search in field names
* @param retrieveFields retrive data for fields
* {@link https://balkan.app/FamilyTreeJS/Docs/Search | See doc...}
*/
search(value: string, searchInFields?: Array<string>, retrieveFields?: Array<string>): Array<{
id: number | string,
name: string,
__score: number,
__searchField: string,
__searchMarks: string
}>;
/**
* Gets collpased node ids of the specifeid node
* @param node
*/
getCollapsedIds(node: FamilyTree.node): Array<string | number>;
/**
* State to url.
* {@link https://balkan.app/FamilyTreeJS/Docs/State | See doc...}
*/
stateToUrl(): string;
/**
* Genereates unique identification number that can be used for new nodes
*/
generateId(): string;
/**
* Destroys the object.
*/
destroy(): void;
/**
* Replaces the id, pid, stpid, ppid and the ids in clinks, slinks, dottedLines, groupDottedLines.
* After the replacment updates the UI
* @param old_new_ids dictionary containing old and new ids
* @param callback called when the replacment completes
*/
replaceIds(old_new_ids: {
[key: string]: string | number
}, callback?: () => void): void;
/**
* Adds curved link.
* @param from from node with id
* @param to to node with id
* @param label link label
* @param template link template, for example 'orange'
*/
addClink(from: string | number, to: string | number, label?: string, template?: string): FamilyTree;
/**
* Removes curved link.
* @param from from node with id
* @param to to node with id
*/
removeClink(from: string | number, to: string | number): FamilyTree;
/**
* Adds second link.
* @param from from node with id
* @param to to node with id
* @param label link label
* @param template link template, for example 'orange'
*/
addSlink(from: string | number, to: string | number, label?: string, template?: string): FamilyTree;
/**
* Removes second link.
* @param from from node with id
* @param to to node with id
*/
removeSlink(from: string | number, to: string | number): FamilyTree;
/**
* Gets svg html element
*/
getSvg(): SVGAElement;
/**
* Gets node html element
* @param id node id
*/
getNodeElement(id: string | number): HTMLElement;
/**
* Gets menu button html element
*/
getMenuButton(): HTMLElement;
/**
* Exports the details form to PDF.
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportPDFProfile(options: FamilyTree.exportOptions, callback?: () => void): void;
exportPDFPreview(options: FamilyTree.exportOptions): void;
/**
* Exports the details form to PDF.
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportPNGProfile(options: FamilyTree.exportOptions, callback?: () => void): void;
/**
* Exports to CSV
* @param filename The name of the exported file
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportCSV(filename: string | FamilyTree.exportCSVXMLJSONOptions): void;
/**
* Exports to XML
* @param filename The name of the exported file
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportXML(filename: string | FamilyTree.exportCSVXMLJSONOptions): void;
/**
* Exports to JSON
* @param filename The name of the exported file
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportJSON(filename: string | FamilyTree.exportCSVXMLJSONOptions ): void;
/**
* Shares node data, uses build-in device sharing functionallity.
* @param id node id
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
shareProfile(id: string | number): void;
/**
* Exports to PDF document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportPDF(options?: FamilyTree.exportOptions, callback?: () => void): void;
/**
* Exports to PNG document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportPNG(options?: FamilyTree.exportOptions, callback?: () => void): void;
/**
* Exports to SVG document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/FamilyTreeJS/Docs/Exporting | See doc...}
*/
exportSVG(options?: FamilyTree.exportOptions, callback?: () => void): void;
/**
* Imports CSV file.
* {@link https://balkan.app/FamilyTreeJS/Docs/Importing | See doc...}
*/
importCSV(): void;
/**
* Imports XML file.
* {@link https://balkan.app/FamilyTreeJS/Docs/Importing | See doc...}
*/
importXML(): void;
/**
* Imports JSON file.
* {@link https://balkan.app/FamilyTreeJS/Docs/Importing | See doc...}
*/
importJSON(): void;
/**
* Zoom out or zoom in the family.
* @param delta true for zoom in, false for zoom out or scale number, if scale is > 1 it will zoom in and scale < 1 zoom out.
* @param center array [x, y], where x is x percantege from the width and y is y percentage from the height.
* @param shouldAnimate should animate
* @param callback called when the animation completes
*/
zoom(delta: boolean | number, center?: Array<number>, shouldAnimate?: boolean, callback?: () => void): void;
/**
* Magnify(Zoom in) specific node in the family.
* @param id id of the node
* @param scale scale to magnify
* @param front show on front or back
* @param anim animation type
*/
magnify(id: string | number, scale: number, front?: boolean, anim?: FamilyTree.anim | null, callback?: () => void): void;
/**
* Starts the move
* @param movePosition move position
* @param tick callback function in each step
* @param func the name of the animation function, for example FamilyTree.anim.inSin
* @param duration duration before going to 100 percent speed
*/
moveStart(movePosition: FamilyTree.move, tick?: () => void, func?: FamilyTree.anim, duration?: number): void;
/**
* Undo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method.
* @param callback called when the animation completes
*/
undo(callback?: () => void): void;
/**
* Redo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method.
* @param callback called when the animation completes
*/
redo(callback?: () => void): void;
/**
* Clears all Redo stack steps.
*/
clearRedo(): void;
/**
* Clears all Undo stack steps.
*/
clearUndo(): void;
/**
* Returns the number of Undo stack steps
*/
undoStepsCount(): number;
/**
* Returns the number of Redo stack steps
*/
redoStepsCount(): number;
/**
* Ends the move
*/
moveEnd(): void;
/**
* The onField() method of the FamilyTree class sets up a function that will be called whenever the specified event is delivered to the target.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onField((args) => {
* //return false; to cancel
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onField(listener: (this: FamilyTree, args: {
/**
* the node
*/
node: FamilyTree.node,
/**
* node data json object
*/
data: object,
/**
* value of the filed, can be changed in the event
*/
value: any,
/**
* svg or html element of the filed, can be changed in the event
*/
element: string,
/**
* name of the field
*/
name: string
/**
* field template name
*/
field: string
}) => void | boolean): FamilyTree;
/**
* Occurs when the nodes in FamilyTree has been created and loaded to the DOM.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onInit(() => {
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onInit(listener: (this: FamilyTree) => void): FamilyTree;
/**
* The onRedraw event occurs when the family is redrawed.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onRedraw(() => {
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onRedraw(listener: (this: FamilyTree) => void): FamilyTree;
/**
* The onExpandCollpaseButtonClick event occurs when the family is redrawed.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onExpandCollpaseButtonClick(() => {
* //return false; to cancel the operation
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExpandCollpaseButtonClick(listener: (this: FamilyTree, args: {
/**
* Indicates id the operation is collaps or expand
*/
collapsing: boolean,
/**
* the id of the clicked node
*/
id: number | string,
/**
* node ids that will be expanded or collapsed
*/
ids: Array<number | string>
}) => void): FamilyTree;
/**
* Occurs in the beginning of the export. Extra css styles can be added to the exported document using this event listener or show loading image.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onExportStart(() => {
* args.styles += '<link href="https://fonts.googleapis.com/css?family=Gochi+Hand" rel="stylesheet">';
* //return false; to cancel the operation
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExportStart(listener: (this: FamilyTree, args:
{
/**
* the content to be exported
*
* this property is initialized only for PDF/PNG/SVG exports
*/
content: string,
/**
* export options
*
* this property is initialized only for PDF/PNG/SVG exports
*/
options: FamilyTree.exportOptions,
/**
* add extra styles
*
* this property is initialized only for PDF/PNG/SVG exports
*/
styles: string,
/**
* an object that discribes pages to be exported
*
* this property is initialized only for PDF/PNG exports
*/
pages: any,
/**
* extension
*
* this property is initialized only for CSV/XML
*/
ext: string,
/**
* filename, you can change the filename here
*
* this property is initialized only for CSV/XML exports
*/
filename: string,
/**
* array of node objects
*
* this property is initialized only for CSV/XML exports
*/
nodes: Array<object>
}) => void): FamilyTree;
/**
* Occurs in the beginning of the export. Use this event listener to hide loading image or upload exported document to your server using ArrayBuffer argument.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onExportEnd(() => {
* //return false; to cancel the operation for example id you prefer the exported document to not download
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExportEnd(listener: (this: FamilyTree, args:
/**
* for PDF/PNG
*/
{
/**
* the array buffer is the exported document, you can save it on a server or send it via email
*
* this property is initialized only for PDF/PNG exports
*/
ArrayBuffer: ArrayBuffer
/**
* extension
*
* this property is initialized only for CSV/XML exports
*/
ext: string,
/**
* filename, you can change the filename here
*
* this property is initialized only for CSV/XML exports
*/
filename: string,
/**
* an array of node objects
*
* this property is initialized only for CSV/XML exports
*/
nodes: Array<object>,
/**
* csv ot xml string
*
* this property is initialized only for CSV/XML/SVG exports
*/
content: string
/**
* export options
*
* this property is initialized only for SVG exports
*/
options: FamilyTree.exportOptions,
/**
* add extra styles
*
* this property is initialized only for SVG exports
*/
styles: string,
}) => void): FamilyTree;
/**
* On node click event listener.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onNodeClick(() => {
* //return false; to cancel the operation
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onNodeClick(listener: (this: FamilyTree, args: {
/**
* node JSON object
*/
node: FamilyTree.node,
/**
* the browser event
*/
event: any
}) => void): FamilyTree;
/**
* On node double click event listener.
* ```typescript
* var family = new FamilyTree('#tree', {});
* family.onNodeDoubleClick(() => {
* //return false; to cancel the operation
* });
* family.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onNodeDoubleClick(listener: (this: FamilyTree, args: {
/**
* clicked node data
*/
data: object
}) => void): FamilyTree;
element: HTMLElement;
editUI: FamilyTree.editUI;
searchUI: FamilyTree.searchUI;
nodeMenuUI: FamilyTree.menuUI;
filterUI: FamilyTree.filterUI;
xScrollUI: FamilyTree.xScrollUI;
yScrollUI: FamilyTree.yScrollUI;
undoRedoUI: FamilyTree.undoRedoUI;
nodeCircleMenuUI: FamilyTree.circleMenuUI;
nodeContextMenuUI: FamilyTree.menuUI;
menuUI: FamilyTree.menuUI;
toolbarUI: FamilyTree.toolbarUI;
config: FamilyTree.options;
roots: Array<FamilyTree.node>;
static fileUploadDialog(scallback: (file: any) => void): void;
static isMobile(): boolean;
/**
* Checks if the used libraris is licnsed or not
*/
static isTrial(): boolean;
/**
* Count all children nodes of the specified id.
* @param family FamilyTree instance
* @param node
* @param count
*/
static childrenCount(family: FamilyTree, node: FamilyTree.node): number;
static childrenTotalCount(family: FamilyTree, node: FamilyTree.node): number;
static collapsedChildrenCount(family: FamilyTree, node: FamilyTree.node): number;
static collapsedChildrenTotalCount(family: FamilyTree, node: FamilyTree.node): number;
static getRootOf(node: FamilyTree.node): FamilyTree.node;
/**
* is null, empty or undefined
* @param val
*/
static isNEU(val: any): boolean;
static gradientCircleForDefs(id: string | number, colors: Array<string> | string, r: number, strokeWidth: number): string;
static convertCsvToNodes(text: string) : Array<Object>;
/**
* SVG Path rounding function. Takes an input path string or commands and outputs a path
* string where all line-line corners have been rounded.
* @param commands The SVG input path or commands array
* @param radius
* @param useFractionalRadius The amount to round the corners, either a value in the SVG coordinate space, or, if useFractionalRadius is true, a value from 0 to 1.
* @returns A new SVG path string with the rounding
*/
static roundPathCorners(commands: string | Array<Array<any>>, radius: number, useFractionalRadius: boolean) : string;
static convertNodesToCsv(nodes: Array<Object>) : string;
static wrapText(text: string, field: Object): string;
static filterUI: {
textFilterBy: string
};
/**
* Shows/hides lloading image. Usefull when export large data to pdf. You can override and show your own loading image.
*/
static loading: {
show: (family: FamilyTree) => void,
hide: (family: FamilyTree) => void
}
static clinkTemplates: {
[key: string]: FamilyTree.linkTemplate
}
static slinkTemplates: {
[key: string]: FamilyTree.linkTemplate
}
static templates :{ [key: string]: FamilyTree.template} ;
static scroll: {
visible?: boolean,
smooth?: number,
speed?: number,
safari?: { smooth?: number; speed?: number; },
edge?: { smooth?: number; speed?: number; },
chrome?: { smooth?: number; speed?: number; },
firefox?: { smooth?: number; speed?: number; },
opera?: { smooth?: number; speed?: number; }
};
static events: {
/**
* node-created and layout event listeners are obsolete use node-initialized or node-layout instead
* @param type
* @param listener
*/
on(type: "node-created" | "layout", listener: (args: any, args1: any, args2: any) => void): void
};
static state: { clear(stateName: string): void };
static animate(element: Object, attrStart?: Object, attrEnd?: Object, duration?: number, func?: FamilyTree.anim, callback?: Function, tick?: boolean): void;
static VERSION: string;
/**
* @ignore
*/
static TEXT_THRESHOLD: number;
/**
* @ignore
*/
static IMAGES_THRESHOLD: number;
/**
* @ignore
*/
static LINKS_THRESHOLD: number;
/**
* @ignore
*/
static BUTTONS_THRESHOLD: number;
/**
* @ignore
*/
static ANIM_THRESHOLD: number;
/**
* @ignore
*/
static IT_IS_LONELY_HERE: string;
/**
* @ignore
*/
static RES: {
/**
* @ignore
*/
IT_IS_LONELY_HERE_LINK: string
};
/**
* @ignore
*/
static FIRE_DRAG_NOT_CLICK_IF_MOVE: number;
/**
* @ignore
*/
static STRING_TAGS: boolean;
/**
* Search placeholder
*/
static SEARCH_PLACEHOLDER: string;
/**
* Search help symbol.
*/
static SEARCH_HELP_SYMBOL: string;
/**
* Close search result list by click outside list and clean search input
*/
static SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE: boolean;
/**
* @ignore
*/
static IMPORT_MESSAGE: string;
/**
* @ignore
*/
static FIXED_POSITION_ON_CLICK: boolean;
/**
* Render links before nodes, default is false
*/
static RENDER_LINKS_BEFORE_NODES: boolean;
/**
* Render clinks before nodes, default is false
*/
static RENDER_CLINKS_BEFORE_NODES: boolean;
/**
* @ignore
*/
static MIXED_LAYOUT_ALL_NODES: boolean;
/**
* @ignore
*/
static MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN: boolean;
/**
* Use mixed layout for example tree or treeLeftOffset if number of children is more then specified value
*/
static MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN: boolean;
/**
* @ignore
*/
static LINK_ROUNDED_CORNERS: number;
/**
* @ignore
*/
static MOVE_STEP: number;
/**
* @ignore
*/
static CLINK_CURVE: number;
/**
* @ignore
*/
static SEARCH_RESULT_LIMIT: number;
/**
* @ignore
*/
static MAX_DEPTH: number;
/**
* @ignore
*/
static SCALE_FACTOR: number;
/**
* @ignore
*/
static LAZY_LOADING_FACTOR: number;
/**
* Can be used to instruct the browser to defer loading of FamilyTree that are off-screen until the user scrolls near them.
* The init event listener will be called as soon as the FamilyTree become visible.
*/
static LAZY_LOADING: boolean;
/**
* Hides the Edit Form when the family is moved with pan
*/
static HIDE_EDIT_FORM_ON_PAN: boolean;
static ARRAY_FIELDS: Array<string>;
/**
* Csv import and export delimiter/separator
*/
static CSV_DELIMITER: string;
/**
*
*/
static EDITFORM_CLOSE_BTN: string;
/**
* Escape HTML to prevent Cross-site scripting (also known as XSS) attacks
*/
static ESCAPE_HTML: boolean;
/**
* Align children of assistant vertically
*/
static VERTICAL_CHILDREN_ASSISTANT: boolean;
/**
* Cut nodes when export with pages, dafault is false
*/
static EXPORT_PAGES_CUT_NODES: boolean;
/**
* Reset movable nodes to its original position when expand or collapse
*/
static RESET_MOVABLE_ONEXPANDCOLLAPSE: boolean;
/**
* @ignore
*/
static randomId(): any;
static searchUI: any;
static editUI: any;
static pdfPrevUI: FamilyTree.pdfPrevUI;
// static menuUI: any;
static attr: any;
static toolbarUI: any;
static elements: any;
static expcollOpenTag: any;
static upOpenTag: any;
static grCloseTag: any;
}
declare namespace FamilyTree {
/**
* deprecated
* @ignore
*/
const none: number;
/**
* @ignore
*/
const COLLAPSE_PARENT_NEIGHBORS: number;
/**
* @ignore
*/
const COLLAPSE_SUB_CHILDRENS: number;
var template: object;
interface node {
/**
* the same id you provided in the source node
*/
id?: string | number,
/**
* partner parent id, it is the partner parent node id of the partner node, it is the same ppid you provided in the source node, the default value is undefined.
*/
ppid?: string | number,
/**
* a reference to the parent node, default value is null, if the nodes is collapse this proprty is not initalized and can be null even if pid is not null
*/
parent?: node,
/**
* ub tree parent id, it is the parent node id of the root node of the sub tree, it is the same stpid you provided in the source node, the default value is null if not provided or if node with the same id does not exist.
*/
stpid?: string | number,
/**
* - a reference to the parent node of a sub tree, default value is null, if the parent node is minimized this proprty is not initalized and can be null even if we have stpid
*/
stParent?: node,
isPartner?: boolean,
partnerSeparation?: number,
/**
* array of ids, always initialized
*/
childrenIds?: Array<string | number>,
/**