forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dhtmlxgantt.d.ts
1733 lines (1431 loc) · 44.4 KB
/
dhtmlxgantt.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
// Type definitions for dhtmlxGantt 4.0.0
// Project: http://dhtmlx.com/docs/products/dhtmlxGantt
// Definitions by: Maksim Kozhukh <http://github.com/mkozhukh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface GanttCallback { (...args: any[]) : any }
type GanttEventName ='onAfterAutoSchedule'|'onAfterBatchUpdate'|'onAfterLightbox'|'onAfterLinkAdd'|'onAfterLinkDelete'|'onAfterLinkUpdate'|'onAfterRedo'|'onAfterTaskAdd'|'onAfterTaskAutoSchedule'|'onAfterTaskDelete'|'onAfterTaskDrag'|'onAfterTaskMove'|'onAfterTaskUpdate'|'onAfterUndo'|'onAjaxError'|'onBeforeAutoSchedule'|'onBeforeBatchUpdate'|'onBeforeCollapse'|'onBeforeDataRender'|'onBeforeExpand'|'onBeforeGanttReady'|'onBeforeGanttRender'|'onBeforeLightbox'|'onBeforeLinkAdd'|'onBeforeLinkDelete'|'onBeforeLinkDisplay'|'onBeforeLinkUpdate'|'onBeforeParse'|'onBeforeRedo'|'onBeforeRowDragEnd'|'onBeforeTaskAdd'|'onBeforeTaskAutoSchedule'|'onBeforeTaskChanged'|'onBeforeTaskDelete'|'onBeforeTaskDisplay'|'onBeforeTaskDrag'|'onBeforeTaskMove'|'onBeforeTaskSelected'|'onBeforeTaskUpdate'|'onBeforeUndo'|'onCircularLinkError'|'onClear'|'onCollapse'|'onColumnResize'|'onColumnResizeEnd'|'onColumnResizeStart'|'onContextMenu'|'onDataRender'|'onEmptyClick'|'onError'|'onExpand'|'onGanttReady'|'onGanttRender'|'onGanttScroll'|'onGridHeaderClick'|'onGridResize'|'onGridResizeEnd'|'onGridResizeStart'|'onLightbox'|'onLightboxButton'|'onLightboxCancel'|'onLightboxChange'|'onLightboxDelete'|'onLightboxSave'|'onLinkClick'|'onLinkDblClick'|'onLinkIdChange'|'onLinkValidation'|'onLoadEnd'|'onLoadStart'|'onMouseMove'|'onOptionsLoad'|'onParse'|'onRowDragEnd'|'onRowDragStart'|'onScaleAdjusted'|'onScaleClick'|'onTaskClick'|'onTaskClosed'|'onTaskCreated'|'onTaskDblClick'|'onTaskDrag'|'onTaskIdChange'|'onTaskLoading'|'onTaskOpened'|'onTaskRowClick'|'onTaskSelected'|'onTaskUnselected'|'onTemplatesReady';
interface GanttTemplates{
/**
* specifies the format of dates that are set by means of API methods. Used to parse incoming dates
* @param date the date which needs formatting
*/
api_date(date: Date): string;
/**
* specifies the content of start date or end date columns in grid
* @param date the date which needs formatting
* @param task the task object
*/
date_grid(date: Date, task: any): string;
/**
* specifies the date format of the time scale (X-Axis)
* @param date the date which needs formatting
*/
date_scale(date: Date): string;
/**
* specifies the text of tooltips that are displayed when the user creates a new dependency link
* @param from the id of the source task
* @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task
* @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet)
* @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task
*/
drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string;
/**
* specifies the CSS class that will be applied to the link receiver (pop-up circle near the task bar)
* @param from the id of the source task
* @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task
* @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet)
* @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task
*/
drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string;
/**
* specifies the custom content inserted before the labels of child items in the tree column
* @param task the task object
*/
grid_blank(task: any): string;
/**
* specifies the format of dates in the "Start time" column
* @param date the date which needs formatting
*/
grid_date_format(date: Date): string;
/**
* specifies the icon of child items in the tree column
* @param task the task object
*/
grid_file(task: any): string;
/**
* specifies the icon of parent items in the tree column
* @param task the task object
*/
grid_folder(task: any): string;
/**
* specifies the CSS class that will be applied to the headers of the table's columns
* @param columnName the column's name (as specified in the "name" property of the column object)
* @param column column object (as specified in the <i>gantt.config.columns</i> config)
*/
grid_header_class(columnName: string, column: any): string;
/**
* specifies the indent of the child items in a branch (in the tree column)
* @param task the task object
*/
grid_indent(task: any): string;
/**
* specifies the icon of the open/close sign in the tree column
* @param task the task object
*/
grid_open(task: any): string;
/**
* specifies the CSS class that will be applied to a grid row
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
grid_row_class(start: Date, end: Date, task: any): string;
/**
* specifies the CSS class that will be applied to a link
* @param link the link object
*/
link_class(link: any): string;
/**
* specifies the text in the header of the link's "delete" confirm window
* @param link the link object
*/
link_description(link: any): string;
/**
* specifies the text in the completed part of the task bar
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
progress_text(start: Date, end: Date, task: any): string;
/**
* specifies the CSS class that will be applied to the pop-up edit form
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
quick_info_class(start: Date, end: Date, task: any): void;
/**
* specifies the content of the pop-up edit form
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
quick_info_content(start: Date, end: Date, task: any): string;
/**
* specifies the date of the pop-up edit form
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
quick_info_date(start: Date, end: Date, task: any): string;
/**
* specifies the title of the pop-up edit form
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
quick_info_title(start: Date, end: Date, task: any): string;
/**
* specifies the CSS class that will be applied to cells of the time scale of the timeline area
* @param date the date of a cell
*/
scale_cell_class(date: Date): string;
/**
* specifies the CSS class that will be applied to the time scale
* @param scale the scale's configuration object
*/
scale_row_class(scale: any): string;
/**
* specifies the CSS class that will be applied to the cells of the timeline area
* @param item the task object assigned to the row
* @param date the date of a cell
*/
task_cell_class(item: Date, date: Date): string;
/**
* specifies the CSS class that will be applied to task bars
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
task_class(start: Date, end: Date, task: any): string;
/**
* specifies the date format of the label in the 'Time period' section of the lightbox
* @param date the date which needs formatting
*/
task_date(date: Date): string;
/**
* specifies the CSS class that will be applied to the row of the timeline area
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
task_row_class(start: Date, end: Date, task: any): string;
/**
* specifies the text in the task bars and the header of the lightbox
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
task_text(start: Date, end: Date, task: any): string;
/**
* specifies the date period in the header of the lightbox
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
task_time(start: Date, end: Date, task: any): string;
/**
* specifies the dates of unscheduled tasks
* @param task the task object
*/
task_unscheduled_time(task: any): void;
/**
* specifies the format of the drop-down time selector in the lightbox
* @param date the date which needs formatting
*/
time_picker(date: Date): string;
/**
* specifies the format of start and end dates displayed in the tooltip
* @param date the date which needs formatting
*/
tooltip_date_format(date: Date): string;
/**
* specifies the text of tooltips
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
tooltip_text(start: Date, end: Date, task: any): string;
/**
* a string from an XML file is converted into a date object in conformity with this template
* @param date the date which needs formatting
*/
xml_date(date: Date): string;
/**
* a date object is converted into a string in conformity with this template. Used to send data back to the server
* @param date the date which needs formatting
*/
xml_format(date: Date): string;
/**
* specifies the text assigned to tasks bars on the right side
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
rightside_text(start: Date, end: Date, task: any): string;
/**
* specifies the text assigned to tasks bars on the left side
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
* @param task the task object
*/
leftside_text(start: Date, end: Date, task: any): string;
/**
* specifies the lightbox's header
* @param start_date the date when a task is scheduled to begin
* @param end_date the date when a task is scheduled to be completed
* @param task the task's object
*/
lightbox_header(start_date: Date, end_date: Date, task: any): string;
}
interface GanttConfigOptions{
/**
* sets the date format for addTask() method to
*/
api_date: string;
/**
* enables auto scheduling
*/
auto_scheduling: boolean;
/**
* allows or forbids creation of links from parent tasks (projects) to their children
*/
auto_scheduling_descendant_links: boolean;
/**
* defines whether gantt will do autoscheduling on data loading
*/
auto_scheduling_initial: boolean;
/**
* enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date
*/
auto_scheduling_strict: boolean;
/**
* enables automatic adjusting of the grid's columns to the grid's width
*/
autofit: boolean;
/**
* forces the Gantt chart to automatically change its size to show all tasks without scrolling
*/
autosize: boolean|string;
/**
* sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode
*/
autosize_min_width: number;
/**
* enables the dynamic loading in the Gantt chart
*/
branch_loading: boolean;
/**
* stores a collection of buttons resided in the left bottom corner of the lightbox
*/
buttons_left: any[];
/**
* stores a collection of buttons resided in the right bottom corner of the lightbox
*/
buttons_right: any[];
/**
* configures the columns of the table
*/
columns: any[];
/**
* enables adjusting the task's start and end dates to the work time (while dragging)
*/
correct_work_time: boolean;
/**
* sets the format of dates in the "Start time" column of the table
*/
date_grid: string;
/**
* sets the format of the time scale (X-Axis)
*/
date_scale: string;
/**
* 'says' to open the lightbox while creating new events by clicking on the '+' button
*/
details_on_create: boolean;
/**
* 'says' to open the lightbox after double clicking on a task
*/
details_on_dblclick: boolean;
/**
* enables the possibility to drag the lightbox by the header
*/
drag_lightbox: boolean;
/**
* enables creating dependency links by drag-and-drop
*/
drag_links: boolean;
/**
* stores the types of available drag-and-drop modes
*/
drag_mode: any;
/**
* enables the possibility to move tasks by drag-and-drop
*/
drag_move: boolean;
/**
* enables the possibility to change the task progress by dragging the progress knob
*/
drag_progress: boolean;
/**
* enables the possibility to resize tasks by drag-and-drop
*/
drag_resize: boolean;
/**
* sets the number of 'gantt.config.duration_unit' units that will correspond to one unit of the 'duration' data property.
*/
duration_step: number;
/**
* sets the duration unit
*/
duration_unit: string;
/**
* changes the name of a property that affects the editing ability of tasks/links in the read-only Gantt chart
*/
editable_property: string;
/**
* sets the end value of the time scale
*/
end_date: Date;
/**
* 'says' the Gantt chart to re-render the scale each time a task doesn't fit into the existing scale interval
*/
fit_tasks: boolean;
/**
* makes the grid resizable by dragging the right grid's border
*/
grid_resize: boolean;
/**
* sets the name of the attribute of the grid resizer's DOM element
*/
grid_resizer_attribute: string;
/**
* sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index
*/
grid_resizer_column_attribute: string;
/**
* sets the maximum width of the grid
*/
grid_width: number;
/**
* shows the critical path in the chart
*/
highlight_critical_path: boolean;
/**
* specifies whether sub-scales shall use the scale_cell_class template by default
*/
inherit_scale_class: boolean;
/**
* sets whether the timeline area will be initially scrolled to display the earliest task
*/
initial_scroll: boolean;
/**
* 'says' to preserve the initial grid's width during resizing the columns within
*/
keep_grid_width: boolean;
/**
* sets the name of the attribute of the task layer's DOM element
*/
layer_attribute: string;
/**
* specifies the lightbox object
*/
lightbox: any;
/**
* increases the height of the lightbox
*/
lightbox_additional_height: number;
/**
* sets the size of the link arrow
*/
link_arrow_size: number;
/**
* sets the name of the attribute that will specify the id of the link's HTML element
*/
link_attribute: string;
/**
* sets the width of dependency links in the timeline area
*/
link_line_width: number;
/**
* sets the width of the area (over the link) sensitive to clicks
*/
link_wrapper_width: number;
/**
* stores the types of links dependencies
*/
links: any;
/**
* sets the minimum width for a column in the timeline area
*/
min_column_width: number;
/**
* sets the minimum step (in milliseconds) for task's time values
*/
min_duration: number;
/**
* sets the minumum width for the grid (in pixels) while being resized
*/
min_grid_column_width: number;
/**
* enables/disables multi-task selection in the Gantt chart
*/
multiselect: boolean;
/**
* specifies whether multi-task selection will be available within one or any level
*/
multiselect_one_level: boolean;
/**
* openes all branches initially
*/
open_tree_initially: boolean;
/**
* activates the 'branch' mode that allows dragging tasks only within the parent branch
*/
order_branch: boolean;
/**
* activates the 'branch' mode that allows dragging tasks within the whole gantt
*/
order_branch_free: boolean;
/**
* preserves the current position of the vertical and horizontal scrolls while re-drawing the gantt chart
*/
preserve_scroll: boolean;
/**
* specifies whether the gantt container should block the mousewheel event, or should it be propagated up to the window element
*/
prevent_default_scroll: boolean;
/**
* defines whether the task form will appear from the left/right side of the screen or near the selected task
*/
quick_info_detached: boolean;
/**
* stores a collection of buttons resided in the pop-up task's details form
*/
quickinfo_buttons: any[];
/**
* activates the read-only mode for the Gantt chart
*/
readonly: boolean;
/**
* changes the name of a property that affects the read-only behaviour of tasks/links
*/
readonly_property: string;
/**
* enables the Redo functionality for the gantt
*/
redo: boolean;
/**
* sets the id of the virtual root element
*/
root_id: string|number;
/**
* enables rounding the task's start and end dates to the nearest scale marks
*/
round_dnd_dates: boolean;
/**
* sets the default height for rows of the table
*/
row_height: number;
/**
* sets the height of the time scale and the header of the grid
*/
scale_height: number;
/**
* sets the minimal scale unit (in case multiple scales are used) as the interval of leading/closing empty space
*/
scale_offset_minimal: boolean;
/**
* sets the unit of the time scale (X-Axis)
*/
scale_unit: string;
/**
* specifies whether the timeline area shall be scrolled while selecting to display the selected task
*/
scroll_on_click: boolean;
/**
* enables selection of tasks in the Gantt chart
*/
select_task: boolean;
/**
* enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server
*/
server_utc: boolean;
/**
* shows the chart (timeline) area of the Gantt chart
*/
show_chart: boolean;
/**
* enables showing error alerts in case of unexpected behavior
*/
show_errors: boolean;
/**
* shows the grid area of the Gantt chart
*/
show_grid: boolean;
/**
* enables/disables displaying links in the Gantt chart
*/
show_links: boolean;
/**
* shows/hides markers on the page
*/
show_markers: boolean;
/**
* enables displaying of the progress inside the task bars
*/
show_progress: boolean;
/**
* activates/disables the 'quick_info' extension (pop-up task's details form)
*/
show_quick_info: boolean;
/**
* enables/disables displaying column borders in the chart area
*/
show_task_cells: boolean;
/**
* enables showing unscheduled tasks
*/
show_unscheduled: boolean;
/**
* hides non-working time from the time scale
*/
skip_off_time: boolean;
/**
* enables the smart rendering mode for gantt's tasks and links rendering
*/
smart_rendering: boolean;
/**
* enables sorting in the table
*/
sort: boolean;
/**
* sets the start value of the time scale
*/
start_date: Date;
/**
* sets the start day of weeks
*/
start_on_monday: boolean;
/**
* generates a background image for the timeline area instead of rendering actual columns' and rows' lines
*/
static_background: boolean;
/**
* sets the step of the time scale (X-Axis)
*/
step: number;
/**
* specifies the second time scale(s)
*/
subscales: any[];
/**
* sets the name of the attribute that will specify the id of the task's HTML element
*/
task_attribute: string;
/**
* sets the format of the date label in the 'Time period' section of the lightbox
*/
task_date: string;
/**
* sets the height of task bars in the timeline area
*/
task_height: number;
/**
* sets the offset (in pixels) of the nearest task from the left border in the timeline
*/
task_scroll_offset: number;
/**
* sets the format of the time drop-down selector in the lightbox
*/
time_picker: string;
/**
* sets the minimum step (in minutes) for the task's time values
*/
time_step: number;
/**
* sets the length of time, in milliseconds, before the tooltip hides
*/
tooltip_hide_timeout: number;
/**
* sets the the right (if positive) offset of the tooltip's position
*/
tooltip_offset_x: number;
/**
* sets the the top (if positive) offset of the tooltip's position
*/
tooltip_offset_y: number;
/**
* sets the timeout in milliseconds before the tooltip is displayed for a task
*/
tooltip_timeout: number;
/**
* enables/disables the touch support for the Gantt chart
*/
touch: boolean|string;
/**
* defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture
*/
touch_drag: number|boolean;
/**
* enables/disables vibration while moving tasks on touch devices
*/
touch_feedback: boolean;
/**
* redefines functions responsible for displaying different types of tasks
*/
type_renderers: any;
/**
* stores the names of lightbox's structures (used for different types of tasks)
*/
types: any;
/**
* enables the Undo functionality for the gantt
*/
undo: boolean;
/**
* sets the actions that the Undo operation will revert
*/
undo_actions: any;
/**
* sets the number of steps that should be reverted by the undo method
*/
undo_steps: number;
/**
* sets the types of entities for which the Undo operation will be applied
*/
undo_types: any;
/**
* enables calculating the duration of tasks in working time instead of calendar time
*/
work_time: boolean;
/**
* sets the date format that is used to parse data from the data set
*/
xml_date: string;
}
interface GanttDateHelpers{
add(origin: Date, count: number, unit: string): Date;
copy(origin: Date): Date;
date_part(origin: Date): Date;
time_part(origin: Date): Date;
day_start(origin: Date): Date;
month_start(origin: Date): Date;
week_start(origin: Date): Date;
year_start(origin: Date): Date;
getISOWeek(origin: Date): number;
getUTCISOWeek(origin: Date): number;
date_to_str(format: string): any;
str_to_date(format: string): any;
convert_to_utc(origin: Date): Date;
to_fixed(value: number): string;
}
interface GanttHotkeys{
edit_save: number;
edit_cancel: number;
}
//Gantt.locale
interface GanttLocaleDate{
month_full: string[];
month_short: string[];
day_full: string[];
day_short: string[];
}
interface GanttLocaleLabels{
new_task: string;
icon_save: string;
icon_cancel: string;
icon_details: string;
icon_edit: string;
icon_delete: string;
confirm_closing: string;
confirm_deleting: string;
section_description: string;
section_time: string;
confirm_link_deleting: string;
link_from: string;
link_to: string;
link_start: string;
link_end: string;
minutes: string;
hours: string;
days: string;
weeks: string;
months: string;
years: string;
}
interface GanttLocale{
date: GanttLocaleDate;
labels: GanttLocaleLabels;
}
interface GanttEnterprise{
/**
* Creates a new instance of Gantt
*/
getGanttInstance(): GanttStatic;
}
interface GanttStatic{
templates: GanttTemplates;
config: GanttConfigOptions;
date: GanttDateHelpers;
keys: GanttHotkeys;
skin: String;
version: String;
locale: GanttLocale;
$click: any;
/**
* adds a new dependency link
* @param link the link object
*/
addLink(link: any): string|number;
/**
* displayes an additional layer with custom elements for a link in the timeline area
* @param func a render function or a config object
*/
addLinkLayer(func: GanttCallback|any): string;
/**
* adds a marker to the timeline area
* @param marker the marker's configuration object
*/
addMarker(marker: any): string;
/**
* adds a new task
* @param task the task object
* @param parent the parent's id
* @param index optional, the position the task will be added into (0 or greater)
*/
addTask(task: any, parent: string, index?: number): string|number;
/**
* displayes an additional layer with custom elements for a task in the timeline area
* @param func a render function or a config object
*/
addTaskLayer(func: GanttCallback|any): string;
/**
* calls an alert message box
* @param config the alert box's configuration
*/
alert(config: any): void;
/**
* if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen
* @param expression true to assert the expression, false - if assertion fails
* @param errorMessage an error message that will be shown in the red popup
*/
assert(expression: boolean, errorMessage: string): void;
/**
* attaches the handler to an inner event of dhtmlxGantt
* @param name the event's name, case-insensitive
* @param handler the handler function
*/
attachEvent(name: GanttEventName, handler: GanttCallback): string;
/**
* recalculates the schedule of the project
*/
autoSchedule(): void;
/**
* updates multiple tasks/links at once
* @param callback the callback function
*/
batchUpdate(callback: GanttCallback): void;
/**
* creates a new function that, when called, has its <i>this</i> keyword set to the provided value
* @param method the target function
* @param thisArg the value to be passed as the <i>this</i> parameter to the target function when the bound function is called
*/
bind(method: GanttCallback, thisArg: any): GanttCallback;
/**
* calculates the duration of a task
* @param start the date when a task is scheduled to begin
* @param end the date when a task is scheduled to be completed
*/
calculateDuration(start: Date, end: Date): number;
/**
* calculates the end date of a task
* @param start the date when a task is scheduled to begin
* @param duration the duration of a task
* @param unit the time unit of the duration
*/
calculateEndDate(start: Date, duration: number, unit: string): Date;
/**
* calculates the level of a task
* @param task the task's object
*/
calculateTaskLevel(task: any): number;
/**
* calls an inner event
* @param name the event's name, case-insensitive
* @param params an array of the event-related data
*/
callEvent(name: string, params: any[]): boolean;
/**
* changes the name of the lighbox's structure defined for of the task
* @param id the task id
*/
changeLightboxType(id: string|number): void;
/**
* changes the link's id
* @param id the current link's id
* @param new_id the new link's id
*/
changeLinkId(id: string|number, new_id: string|number): void;
/**
* changes the task's id
* @param id the current task's id
* @param new_id the new task's id