1// Type definitions for dhtmlxGantt 6.3.0 2// Project: https://dhtmlx.com/docs/products/dhtmlxGantt 3 4type GanttCallback = (...args: any[]) => any; 5 6 7type GanttEventName = "onAfterAutoSchedule"|"onAfterBatchUpdate"|"onAfterLightbox"|"onAfterLinkAdd"|"onAfterLinkDelete"|"onAfterLinkUpdate"|"onAfterQuickInfo"|"onAfterRedo"|"onAfterSort"|"onAfterTaskAdd"|"onAfterTaskAutoSchedule"|"onAfterTaskDelete"|"onAfterTaskDrag"|"onAfterTaskMove"|"onAfterTaskUpdate"|"onAfterUndo"|"onAjaxError"|"onAutoScheduleCircularLink"|"onBeforeAutoSchedule"|"onBeforeBatchUpdate"|"onBeforeCollapse"|"onBeforeDataRender"|"onBeforeExpand"|"onBeforeGanttReady"|"onBeforeGanttRender"|"onBeforeLightbox"|"onBeforeLinkAdd"|"onBeforeLinkDelete"|"onBeforeLinkDisplay"|"onBeforeLinkUpdate"|"onBeforeMultiSelect"|"onBeforeParse"|"onBeforeRedo"|"onBeforeRedoStack"|"onBeforeRowDragEnd"|"onBeforeRowDragMove"|"onBeforeTaskAdd"|"onBeforeTaskAutoSchedule"|"onBeforeTaskChanged"|"onBeforeTaskDelete"|"onBeforeTaskDisplay"|"onBeforeTaskDrag"|"onBeforeTaskMove"|"onBeforeTaskMultiSelect"|"onBeforeTaskSelected"|"onBeforeTaskUpdate"|"onBeforeUndo"|"onBeforeUndoStack"|"onCircularLinkError"|"onClear"|"onCollapse"|"onColumnResize"|"onColumnResizeEnd"|"onColumnResizeStart"|"onContextMenu"|"onDataProcessorReady"|"onDataRender"|"onDestroy"|"onEmptyClick"|"onError"|"onExpand"|"onGanttLayoutReady"|"onGanttReady"|"onGanttRender"|"onGanttScroll"|"onGridHeaderClick"|"onGridResize"|"onGridResizeEnd"|"onGridResizeStart"|"onLightbox"|"onLightboxButton"|"onLightboxCancel"|"onLightboxChange"|"onLightboxDelete"|"onLightboxSave"|"onLinkClick"|"onLinkCreated"|"onLinkDblClick"|"onLinkIdChange"|"onLinkValidation"|"onLoadEnd"|"onLoadStart"|"onMouseMove"|"onMultiSelect"|"onOptionsLoad"|"onParse"|"onQuickInfo"|"onRowDragEnd"|"onRowDragStart"|"onScaleAdjusted"|"onScaleClick"|"onTaskClick"|"onTaskClosed"|"onTaskCreated"|"onTaskDblClick"|"onTaskDrag"|"onTaskIdChange"|"onTaskLoading"|"onTaskMultiSelect"|"onTaskOpened"|"onTaskRowClick"|"onTaskSelected"|"onTaskUnselected"|"onTemplatesReady"; 8 9 10interface GanttTemplates { 11 12 /** 13 * specifies the content of start date or end date columns in grid 14 * @param date the date which needs formatting 15 * @param task the task object 16 * @param column the name of the column that called the template 17 */ 18 date_grid(date: Date, task: any, column: string): string; 19 20 /** 21 * specifies the text of tooltips that are displayed when the user creates a new dependency link 22 * @param from the id of the source task 23 * @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 24 * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) 25 * @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 26 */ 27 drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; 28 29 /** 30 * specifies the CSS class that will be applied to the pop-up that appears when a user drags a link 31 * @param from the id of the source task 32 * @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 33 * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) 34 * @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 35 */ 36 drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; 37 38 /** 39 * сonverts a date object to a date string. Used to send data back to the server 40 * @param date the date which needs formatting 41 */ 42 format_date(date: Date): string; 43 44 /** 45 * specifies the custom content inserted before the labels of child items in the tree column 46 * @param task the task object 47 */ 48 grid_blank(task: any): string; 49 50 /** 51 * specifies the format of dates in the "Start time" column 52 * @param date the date which needs formatting 53 * @param column the name of the column that called the template 54 */ 55 grid_date_format(date: Date, column: string): string; 56 57 /** 58 * specifies the icon of child items in the tree column 59 * @param task the task object 60 */ 61 grid_file(task: any): string; 62 63 /** 64 * specifies the icon of parent items in the tree column 65 * @param task the task object 66 */ 67 grid_folder(task: any): string; 68 69 /** 70 * specifies the CSS class that will be applied to the headers of the table's columns 71 * @param columnName the column's name (as specified in the "name" property of the column object) 72 * @param column column object (as specified in the <i>gantt.config.columns</i> config) 73 */ 74 grid_header_class(columnName: string, column: any): string; 75 76 /** 77 * specifies the indent of the child items in a branch (in the tree column) 78 * @param task the task object 79 */ 80 grid_indent(task: any): string; 81 82 /** 83 * specifies the icon of the open/close sign in the tree column 84 * @param task the task object 85 */ 86 grid_open(task: any): string; 87 88 /** 89 * specifies the CSS class that will be applied to a grid row 90 * @param start the date when a task is scheduled to begin 91 * @param end the date when a task is scheduled to be completed 92 * @param task the task object 93 */ 94 grid_row_class(start: Date, end: Date, task: any): string; 95 96 /** 97 * defines the height of the filled area in the resourceHistogram 98 * @param start_date start date of the scale cell 99 * @param end_date end date of the scale cell 100 * @param resource the resource object 101 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell 102 */ 103 histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: any[]): void; 104 105 /** 106 * specifies the height of the line that defines the available capacity of the resource 107 * @param start_date start date of the scale cell 108 * @param end_date end date of the scale cell 109 * @param resource the resource object 110 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell 111 */ 112 histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: any[]): void; 113 114 /** 115 * defines the CSS class which is applied to a cell of the resource panel 116 * @param start_date start date of the scale cell 117 * @param end_date end date of the scale cell 118 * @param resource the resource object 119 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell 120 */ 121 histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: any[]): void; 122 123 /** 124 * defines the label inside a cell 125 * @param start_date start date of the scale cell 126 * @param end_date end date of the scale cell 127 * @param resource the resource object 128 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell 129 */ 130 histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: any[]): void; 131 132 /** 133 * specifies the CSS class that will be applied to a link 134 * @param link the link object 135 */ 136 link_class(link: any): string; 137 138 /** 139 * specifies the text in the header of the link's "delete" confirm window 140 * @param link the link object 141 */ 142 link_description(link: any): string; 143 144 /** 145 * converts date string into a Date object 146 * @param date the string which need to be parsed 147 */ 148 parse_date(date: string): Date; 149 150 /** 151 * specifies the text in the completed part of the task bar 152 * @param start the date when a task is scheduled to begin 153 * @param end the date when a task is scheduled to be completed 154 * @param task the task object 155 */ 156 progress_text(start: Date, end: Date, task: any): string; 157 158 /** 159 * specifies the CSS class that will be applied to the pop-up edit form 160 * @param start the date when a task is scheduled to begin 161 * @param end the date when a task is scheduled to be completed 162 * @param task the task object 163 */ 164 quick_info_class(start: Date, end: Date, task: any): void; 165 166 /** 167 * specifies the content of the pop-up edit form 168 * @param start the date when a task is scheduled to begin 169 * @param end the date when a task is scheduled to be completed 170 * @param task the task object 171 */ 172 quick_info_content(start: Date, end: Date, task: any): string; 173 174 /** 175 * specifies the date of the pop-up edit form 176 * @param start the date when a task is scheduled to begin 177 * @param end the date when a task is scheduled to be completed 178 * @param task the task object 179 */ 180 quick_info_date(start: Date, end: Date, task: any): string; 181 182 /** 183 * specifies the title of the pop-up edit form 184 * @param start the date when a task is scheduled to begin 185 * @param end the date when a task is scheduled to be completed 186 * @param task the task object 187 */ 188 quick_info_title(start: Date, end: Date, task: any): string; 189 190 /** 191 * defines the CSS class names of cells in the resource timeline cells 192 * @param start_date start date of the scale cell 193 * @param end_date end date of the scale cell 194 * @param resource the resource object 195 * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell 196 */ 197 resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: any[]): string; 198 199 /** 200 * defines the HTML content of resource timeline cells 201 * @param start_date start date of the scale cell 202 * @param end_date end date of the scale cell 203 * @param resource the resource object 204 * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell 205 */ 206 resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: any[]): string; 207 208 /** 209 * specifies the CSS class that will be applied to cells of the time scale of the timeline area 210 * @param date the date of a cell 211 */ 212 scale_cell_class(date: Date): string; 213 214 /** 215 * specifies the CSS class that will be applied to the time scale 216 * @param scale the scale's configuration object 217 */ 218 scale_row_class(scale: any): string; 219 220 /** 221 * specifies the CSS class that will be applied to task bars 222 * @param start the date when a task is scheduled to begin 223 * @param end the date when a task is scheduled to be completed 224 * @param task the task object 225 */ 226 task_class(start: Date, end: Date, task: any): string; 227 228 /** 229 * specifies the date format of the label in the 'Time period' section of the lightbox 230 * @param date the date which needs formatting 231 */ 232 task_date(date: Date): string; 233 234 /** 235 * specifies the format for the end dates of tasks in the lightbox 236 * @param date the date which needs formatting 237 */ 238 task_end_date(date: Date): string; 239 240 /** 241 * specifies the CSS class that will be applied to the row of the timeline area 242 * @param start the date when a task is scheduled to begin 243 * @param end the date when a task is scheduled to be completed 244 * @param task the task object 245 */ 246 task_row_class(start: Date, end: Date, task: any): string; 247 248 /** 249 * specifies the text in the task bars and the header of the lightbox 250 * @param start the date when a task is scheduled to begin 251 * @param end the date when a task is scheduled to be completed 252 * @param task the task object 253 */ 254 task_text(start: Date, end: Date, task: any): string; 255 256 /** 257 * specifies the date period in the header of the lightbox 258 * @param start the date when a task is scheduled to begin 259 * @param end the date when a task is scheduled to be completed 260 * @param task the task object 261 */ 262 task_time(start: Date, end: Date, task: any): string; 263 264 /** 265 * specifies the dates of unscheduled tasks 266 * @param task the task object 267 */ 268 task_unscheduled_time(task: any): void; 269 270 /** 271 * specifies the format of the drop-down time selector in the lightbox 272 * @param date the date which needs formatting 273 */ 274 time_picker(date: Date): string; 275 276 /** 277 * specifies the CSS class that will be applied to the cells of the timeline area 278 * @param item the task object assigned to the row 279 * @param date the date of a cell 280 */ 281 timeline_cell_class(item: any, date: Date): string; 282 283 /** 284 * specifies the format of start and end dates displayed in the tooltip 285 * @param date the date which needs formatting 286 */ 287 tooltip_date_format(date: Date): string; 288 289 /** 290 * specifies the text of tooltips 291 * @param start the date when a task is scheduled to begin 292 * @param end the date when a task is scheduled to be completed 293 * @param task the task object 294 */ 295 tooltip_text(start: Date, end: Date, task: any): string; 296 297 /** 298 * a string from an XML file is converted into a date object in conformity with this template 299 * @param date the date which needs formatting 300 */ 301 xml_date(date: Date): string; 302 303 /** 304 * a date object is converted into a string in conformity with this template. Used to send data back to the server 305 * @param date the date which needs formatting 306 */ 307 xml_format(date: Date): string; 308 309 /** 310 * specifies the text assigned to tasks bars on the right side 311 * @param start the date when a task is scheduled to begin 312 * @param end the date when a task is scheduled to be completed 313 * @param task the task object 314 */ 315 rightside_text(start: Date, end: Date, task: any): string; 316 317 /** 318 * specifies the text assigned to tasks bars on the left side 319 * @param start the date when a task is scheduled to begin 320 * @param end the date when a task is scheduled to be completed 321 * @param task the task object 322 */ 323 leftside_text(start: Date, end: Date, task: any): string; 324 325 /** 326 * specifies the lightbox's header 327 * @param start_date the date when a task is scheduled to begin 328 * @param end_date the date when a task is scheduled to be completed 329 * @param task the task's object 330 */ 331 lightbox_header(start_date: Date, end_date: Date, task: any): string; 332} 333 334interface GanttConfigOptions { 335 336 /** 337 * enables auto scheduling 338 */ 339 auto_scheduling: boolean; 340 341 /** 342 * disables usage of time contraints for tasks 343 */ 344 auto_scheduling_compatibility: boolean; 345 346 /** 347 * allows or forbids creating links from parent tasks (projects) to their children 348 */ 349 auto_scheduling_descendant_links: boolean; 350 351 /** 352 * defines whether gantt will do autoscheduling on data loading/parsing 353 */ 354 auto_scheduling_initial: boolean; 355 356 /** 357 * defines whether the whole project will be moved (see the details below) 358 */ 359 auto_scheduling_move_projects: boolean; 360 361 /** 362 * enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date 363 */ 364 auto_scheduling_strict: boolean; 365 366 /** 367 * automatically converts tasks with subtasks to projects and projects without subtasks back to tasks 368 */ 369 auto_types: boolean; 370 371 /** 372 * enables automatic adjusting of the grid's columns to the grid's width 373 */ 374 autofit: boolean; 375 376 /** 377 * enables autoscrolling while dragging a task or link out of the current browser screen 378 */ 379 autoscroll: boolean; 380 381 /** 382 * defines the speed of autoscrolling (in ms) while dragging a task or link out of the current browser screen 383 */ 384 autoscroll_speed: number; 385 386 /** 387 * forces the Gantt chart to automatically change its size to show all tasks without scrolling 388 */ 389 autosize: boolean|string; 390 391 /** 392 * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode 393 */ 394 autosize_min_width: number; 395 396 /** 397 * enables dynamic loading in the Gantt chart 398 */ 399 branch_loading: boolean; 400 401 /** 402 * specifies that the task has children that are not yet loaded from the backend 403 */ 404 branch_loading_property: string; 405 406 /** 407 * stores a collection of buttons resided in the left bottom corner of the lightbox 408 */ 409 buttons_left: any[]; 410 411 /** 412 * stores a collection of buttons resided in the right bottom corner of the lightbox 413 */ 414 buttons_right: any[]; 415 416 /** 417 * changes the name of the property that affects binding of a calendar to a task/group of tasks 418 */ 419 calendar_property: string; 420 421 /** 422 * enables cascade deleting of nested tasks and links 423 */ 424 cascade_delete: boolean; 425 426 /** 427 * enables advanced drag-n-drop 428 */ 429 click_drag: any; 430 431 /** 432 * configures the columns of the table 433 */ 434 columns: any[]; 435 436 /** 437 * contains all available constraint types 438 */ 439 constraint_types: any; 440 441 /** 442 * enables adjusting the task's start and end dates to the work time (while dragging) 443 */ 444 correct_work_time: boolean; 445 446 /** 447 * sets the date format that is used to parse data from a data set and to send dates back to the server 448 */ 449 date_format: string; 450 451 /** 452 * sets the format of dates in the "Start time" column of the table 453 */ 454 date_grid: string; 455 456 /** 457 * sets the format of the time scale (X-Axis) 458 */ 459 date_scale: string; 460 461 /** 462 * 'says' to open the lightbox while creating new events by clicking the '+' button 463 */ 464 details_on_create: boolean; 465 466 /** 467 * 'says' to open the lightbox after double clicking on a task 468 */ 469 details_on_dblclick: boolean; 470 471 /** 472 * enables the possibility to drag the lightbox by the header 473 */ 474 drag_lightbox: boolean; 475 476 /** 477 * enables creating dependency links by drag-and-drop 478 */ 479 drag_links: boolean; 480 481 /** 482 * stores the types of available drag-and-drop modes 483 */ 484 drag_mode: any; 485 486 /** 487 * enables the possibility to move tasks by drag-and-drop 488 */ 489 drag_move: boolean; 490 491 /** 492 * enables the possibility to drag several selected tasks at once 493 */ 494 drag_multiple: boolean; 495 496 /** 497 * enables the possibility to change the task progress by dragging the progress knob 498 */ 499 drag_progress: boolean; 500 501 /** 502 * enables drag and drop of items of the project type 503 */ 504 drag_project: boolean; 505 506 /** 507 * enables the possibility to resize tasks by drag-and-drop 508 */ 509 drag_resize: boolean; 510 511 /** 512 * configures the behavior of the dhtmlxgantt_drag_timeline extension 513 */ 514 drag_timeline: any; 515 516 /** 517 * sets the number of 'gantt.config.duration_unit' units that will correspond to one unit of the 'duration' data property. 518 */ 519 duration_step: number; 520 521 /** 522 * sets the duration unit 523 */ 524 duration_unit: string; 525 526 /** 527 * changes the name of a property that affects the editing ability of tasks/links in the read-only Gantt chart 528 */ 529 editable_property: string; 530 531 /** 532 * an object that contains definitions of inline editors 533 */ 534 editor_types: any; 535 536 /** 537 * sets the end value of the time scale 538 */ 539 end_date: Date; 540 541 /** 542 * 'says' the Gantt chart to automatically extend the time scale in order to fit all displayed tasks 543 */ 544 fit_tasks: boolean; 545 546 /** 547 * makes the grid resizable by dragging the right grid's border 548 */ 549 grid_resize: boolean; 550 551 /** 552 * sets the name of the attribute of the grid resizer's DOM element 553 */ 554 grid_resizer_attribute: string; 555 556 /** 557 * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index 558 */ 559 grid_resizer_column_attribute: string; 560 561 /** 562 * sets the width of the grid 563 */ 564 grid_width: number; 565 566 /** 567 * shows the critical path in the chart 568 */ 569 highlight_critical_path: boolean; 570 571 /** 572 * enables/disables horizontal scroll by the Shift|Alt|Meta key + mouse wheel movement 573 */ 574 horizontal_scroll_key: string|boolean; 575 576 /** 577 * defines whether tasks should inherit work calendars from their summary parents 578 */ 579 inherit_calendar: boolean; 580 581 /** 582 * specifies whether sub-scales shall use the scale_cell_class template by default 583 */ 584 inherit_scale_class: boolean; 585 586 /** 587 * sets whether the timeline area will be initially scrolled to display the earliest task 588 */ 589 initial_scroll: boolean; 590 591 /** 592 * keeps the duration of a task unchanged during editing of the start/end of a task 593 */ 594 inline_editors_date_processing: string; 595 596 /** 597 * 'says' to preserve the initial grid's width while resizing columns within 598 */ 599 keep_grid_width: boolean; 600 601 /** 602 * enables keyboard navigation in gantt 603 */ 604 keyboard_navigation: boolean; 605 606 /** 607 * enables keyboard navigation by cells 608 */ 609 keyboard_navigation_cells: boolean; 610 611 /** 612 * sets the name of the attribute of the task layer's DOM element 613 */ 614 layer_attribute: string; 615 616 /** 617 * specifies the layout object 618 */ 619 layout: any; 620 621 /** 622 * specifies the lightbox object 623 */ 624 lightbox: any; 625 626 /** 627 * increases the height of the lightbox 628 */ 629 lightbox_additional_height: number; 630 631 /** 632 * sets the size of the link arrow 633 */ 634 link_arrow_size: number; 635 636 /** 637 * sets the name of the attribute that will specify the id of the link's HTML element 638 */ 639 link_attribute: string; 640 641 /** 642 * sets the width of dependency links in the timeline area 643 */ 644 link_line_width: number; 645 646 /** 647 * sets the width of the area (over the link) sensitive to clicks 648 */ 649 link_wrapper_width: number; 650 651 /** 652 * stores the types of links dependencies 653 */ 654 links: any; 655 656 /** 657 * sets the minimum width for a column in the timeline area 658 */ 659 min_column_width: number; 660 661 /** 662 * Sets the minimum duration (in milliseconds) that can be set for a task during resizing. 663 */ 664 min_duration: number; 665 666 /** 667 * sets the minumum width for the grid (in pixels) while being resized 668 */ 669 min_grid_column_width: number; 670 671 /** 672 * enables/disables multi-task selection in the Gantt chart 673 */ 674 multiselect: boolean; 675 676 /** 677 * specifies whether multi-task selection will be available within one or any level 678 */ 679 multiselect_one_level: boolean; 680 681 /** 682 * enables the possibility to expand/collapse split tasks by clicking the +/- button 683 */ 684 open_split_tasks: boolean; 685 686 /** 687 * openes all branches initially 688 */ 689 open_tree_initially: boolean; 690 691 /** 692 * activates the 'branch' mode that allows vertically reordering tasks within the same tree level 693 */ 694 order_branch: string|boolean; 695 696 /** 697 * activates the 'branch' mode that allows reordering tasks within the whole gantt 698 */ 699 order_branch_free: boolean; 700 701 /** 702 * adds an empty row into the end of the list of tasks to simplify tasks editing via keyboard 703 */ 704 placeholder_task: boolean; 705 706 /** 707 * preserves the current position of the vertical and horizontal scrolls while re-drawing the gantt chart 708 */ 709 preserve_scroll: boolean; 710 711 /** 712 * specifies whether the gantt container should block the mousewheel event, or should it be propagated up to the window element 713 */ 714 prevent_default_scroll: boolean; 715 716 /** 717 * specifies the end date of a project 718 */ 719 project_end: Date; 720 721 /** 722 * specifies the start date of a project 723 */ 724 project_start: Date; 725 726 /** 727 * defines whether the task form will appear from the left/right side of the screen or near the selected task 728 */ 729 quick_info_detached: boolean; 730 731 /** 732 * stores a collection of buttons resided in the pop-up task's details form 733 */ 734 quickinfo_buttons: any[]; 735 736 /** 737 * activates the read-only mode for the Gantt chart 738 */ 739 readonly: boolean; 740 741 /** 742 * changes the name of a property that affects the read-only behaviour of tasks/links 743 */ 744 readonly_property: string; 745 746 /** 747 * enables the Redo functionality for the gantt 748 */ 749 redo: boolean; 750 751 /** 752 * defines a set of working calendars that can be assigned to a specific resource, e.g. a user 753 */ 754 resource_calendars: any; 755 756 /** 757 * defines the property of a task object that stores a resource id associated with resourceGrid/Timeline/Histogram 758 */ 759 resource_property: string; 760 761 /** 762 * tells the resource timeline to render elements and call templates for non-allocated cells 763 */ 764 resource_render_empty_cells: boolean; 765 766 /** 767 * specifies the name of the dataStore connected to the resourceGrid/resourceTimeline/resourceHistogram views 768 */ 769 resource_store: string; 770 771 /** 772 * sets the id of the virtual root element 773 */ 774 root_id: string|number; 775 776 /** 777 * enables rounding the task's start and end dates to the nearest scale marks 778 */ 779 round_dnd_dates: boolean; 780 781 /** 782 * sets the default height for rows of the table 783 */ 784 row_height: number; 785 786 /** 787 * switches gantt to the right-to-left mode 788 */ 789 rtl: boolean; 790 791 /** 792 * sets the height of the time scale and the header of the grid 793 */ 794 scale_height: number; 795 796 /** 797 * sets the minimal scale unit (in case multiple scales are used) as the interval of the leading/closing empty space 798 */ 799 scale_offset_minimal: boolean; 800 801 /** 802 * sets the unit of the time scale (X-Axis) 803 */ 804 scale_unit: string; 805 806 /** 807 * defines configuration settings of the time scale 808 */ 809 scales: any[]; 810 811 /** 812 * enables backward scheduling 813 */ 814 schedule_from_end: boolean; 815 816 /** 817 * specifies whether the timeline area shall be scrolled while selecting to display the selected task 818 */ 819 scroll_on_click: boolean; 820 821 /** 822 * set the sizes of the vertical (width) and horizontal (height) scrolls 823 */ 824 scroll_size: number; 825 826 /** 827 * enables selection of tasks in the Gantt chart 828 */ 829 select_task: boolean; 830 831 /** 832 * enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server 833 */ 834 server_utc: boolean; 835 836 /** 837 * shows the chart (timeline) area of the Gantt chart 838 */ 839 show_chart: boolean; 840 841 /** 842 * enables showing error alerts in case of unexpected behavior 843 */ 844 show_errors: boolean; 845 846 /** 847 * shows the grid area of the Gantt chart 848 */ 849 show_grid: boolean; 850 851 /** 852 * enables/disables displaying links in the Gantt chart 853 */ 854 show_links: boolean; 855 856 /** 857 * shows/hides markers on the page 858 */ 859 show_markers: boolean; 860 861 /** 862 * enables displaying of the progress inside the task bars 863 */ 864 show_progress: boolean; 865 866 /** 867 * activates/disables the 'quick_info' extension (pop-up task's details form) 868 */ 869 show_quick_info: boolean; 870 871 /** 872 * enables/disables displaying column borders in the chart area 873 */ 874 show_task_cells: boolean; 875 876 /** 877 * enables showing tasks that are outside the specified date range in the Gantt chart 878 */ 879 show_tasks_outside_timescale: boolean; 880 881 /** 882 * enables showing unscheduled tasks 883 */ 884 show_unscheduled: boolean; 885 886 /** 887 * hides non-working time from the time scale 888 */ 889 skip_off_time: boolean; 890 891 /** 892 * enables the smart rendering mode for gantt's tasks and links rendering 893 */ 894 smart_rendering: boolean; 895 896 /** 897 * specifies that only visible part of the time scale is rendered on the screen 898 */ 899 smart_scales: boolean; 900 901 /** 902 * enables sorting in the table 903 */ 904 sort: boolean; 905 906 /** 907 * sets the start value of the time scale 908 */ 909 start_date: Date; 910 911 /** 912 * sets the starting day of the week 913 */ 914 start_on_monday: boolean; 915 916 /** 917 * generates a background image for the timeline area instead of rendering actual columns' and rows' lines 918 */ 919 static_background: boolean; 920 921 /** 922 * enables rendering of highlighted cells in the static_background mode 923 */ 924 static_background_cells: boolean; 925 926 /** 927 * sets the step of the time scale (X-Axis) 928 */ 929 step: number; 930 931 /** 932 * specifies the second time scale(s) (deprecated) 933 */ 934 subscales: any[]; 935 936 /** 937 * sets the name of the attribute that will specify the id of the task's HTML element 938 */ 939 task_attribute: string; 940 941 /** 942 * sets the format of the date label in the 'Time period' section of the lightbox 943 */ 944 task_date: string; 945 946 /** 947 * sets the height of task bars in the timeline area 948 */ 949 task_height: number|string; 950 951 /** 952 * sets the offset (in pixels) of the nearest task from the left border in the timeline 953 */ 954 task_scroll_offset: number; 955 956 /** 957 * sets the format of the time drop-down selector in the lightbox 958 */ 959 time_picker: string; 960 961 /** 962 * sets the minimum step (in minutes) for the task's time values 963 */ 964 time_step: number; 965 966 /** 967 * sets the length of time, in milliseconds, before the tooltip hides 968 */ 969 tooltip_hide_timeout: number; 970 971 /** 972 * sets the right (if positive) offset of the tooltip's position 973 */ 974 tooltip_offset_x: number; 975 976 /** 977 * sets the top (if positive) offset of the tooltip's position 978 */ 979 tooltip_offset_y: number; 980 981 /** 982 * sets the timeout in milliseconds before the tooltip is displayed for a task 983 */ 984 tooltip_timeout: number; 985 986 /** 987 * enables/disables the touch support for the Gantt chart 988 */ 989 touch: boolean|string; 990 991 /** 992 * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture 993 */ 994 touch_drag: number|boolean; 995 996 /** 997 * returns vibration feedback before/after drag and drop on touch devices 998 */ 999 touch_feedback: boolean; 1000 1001 /** 1002 * defines the duration of vibration feedback before/after drag and drop on touch devices (in milliseconds) 1003 */ 1004 touch_feedback_duration: number; 1005 1006 /** 1007 * redefines functions responsible for displaying different types of tasks 1008 */ 1009 type_renderers: any; 1010 1011 /** 1012 * stores the names of lightbox's structures (used for different types of tasks) 1013 */ 1014 types: any; 1015 1016 /** 1017 * enables the Undo functionality for the gantt 1018 */ 1019 undo: boolean; 1020 1021 /** 1022 * sets the actions that the Undo operation will revert 1023 */ 1024 undo_actions: any; 1025 1026 /** 1027 * sets the number of steps that should be reverted by the undo method 1028 */ 1029 undo_steps: number; 1030 1031 /** 1032 * sets the types of entities for which the Undo operation will be applied 1033 */ 1034 undo_types: any; 1035 1036 /** 1037 * enables WAI-ARIA support to make the component recognizable for screen readers 1038 */ 1039 wai_aria_attributes: boolean; 1040 1041 /** 1042 * enables calculating the duration of tasks in working time instead of calendar time 1043 */ 1044 work_time: boolean; 1045 1046 /** 1047 * defines date formats that are used to parse data from a data set and to send data to a server 1048 */ 1049 xml_date: string; 1050} 1051 1052interface GanttDateHelpers { 1053 add(origin: Date, count: number, unit: string): Date; 1054 copy(origin: Date): Date; 1055 date_part(origin: Date): Date; 1056 time_part(origin: Date): Date; 1057 day_start(origin: Date): Date; 1058 month_start(origin: Date): Date; 1059 week_start(origin: Date): Date; 1060 year_start(origin: Date): Date; 1061 getISOWeek(origin: Date): number; 1062 getUTCISOWeek(origin: Date): number; 1063 date_to_str(format: string): any; 1064 str_to_date(format: string): any; 1065 convert_to_utc(origin: Date): Date; 1066 to_fixed(value: number): string; 1067} 1068 1069interface GanttHotkeys { 1070 edit_save: number; 1071 edit_cancel: number; 1072} 1073 1074interface GanttLocaleDate { 1075 month_full: string[]; 1076 month_short: string[]; 1077 day_full: string[]; 1078 day_short: string[]; 1079} 1080 1081interface GanttLocaleLabels { 1082 new_task: string; 1083 icon_save: string; 1084 icon_cancel: string; 1085 icon_details: string; 1086 icon_edit: string; 1087 icon_delete: string; 1088 confirm_closing: string; 1089 confirm_deleting: string; 1090 section_description: string; 1091 section_time: string; 1092 confirm_link_deleting: string; 1093 link_from: string; 1094 link_to: string; 1095 link_start: string; 1096 link_end: string; 1097 minutes: string; 1098 hours: string; 1099 days: string; 1100 weeks: string; 1101 months: string; 1102 years: string; 1103} 1104 1105interface GanttLocale { 1106 date: GanttLocaleDate; 1107 labels: GanttLocaleLabels; 1108} 1109 1110interface GanttEnterprise { 1111 getGanttInstance(): GanttStatic; 1112} 1113 1114interface GanttStatic { 1115 1116 /** 1117 * redefines the default click behavior for buttons of the Gantt chart 1118 */ 1119 $click: any; 1120 1121 /** 1122 * gantt ajax module 1123 */ 1124 ajax: any; 1125 1126 /** 1127 * the interface of the working calendar object 1128 */ 1129 calendar: any; 1130 1131 /** 1132 * defines configuration options for dates, scale, controls 1133 */ 1134 config: GanttConfigOptions; 1135 1136 /** 1137 * stores various constants to reduce the use of magic numbers in the code 1138 */ 1139 constants: any; 1140 1141 /** 1142 * a set of date formatting methods 1143 */ 1144 date: GanttDateHelpers; 1145 1146 /** 1147 * a set of flags which describe current environment 1148 */ 1149 env: any; 1150 1151 /** 1152 * an object that stores various extensions 1153 */ 1154 ext: any; 1155 1156 /** 1157 * specifies JSON serialization and parsing 1158 */ 1159 json: any; 1160 1161 /** 1162 * defines the hot keys for the Gantt chart 1163 */ 1164 keys: GanttHotkeys; 1165 1166 /** 1167 * returns the license name of dhtmlxGantt 1168 */ 1169 license: any; 1170 1171 /** 1172 * a locale object (region-specific labels) of the Gantt chart 1173 */ 1174 locale: GanttLocale; 1175 1176 /** 1177 * specifies serialization and parsing in the XML format of dhtmlxGantt 1.0 1178 */ 1179 oldxml: any; 1180 1181 /** 1182 * returns the current skin of the Gantt chart 1183 */ 1184 skin: string; 1185 1186 /** 1187 * returns objects of the available skins 1188 */ 1189 skins: any; 1190 1191 /** 1192 * defines formatting templates for dates, titles, tooltips in the Gantt chart 1193 */ 1194 templates: GanttTemplates; 1195 1196 /** 1197 * various helper modules 1198 */ 1199 utils: any; 1200 1201 /** 1202 * returns the version of dhtmlxGantt 1203 */ 1204 version: string; 1205 1206 /** 1207 * specifies XML serialization and parsing 1208 */ 1209 xml: any; 1210 1211 /** 1212 * Promise object constructor 1213 */ 1214 Promise(): void; 1215 1216 /** 1217 * adds a calendar into Gantt 1218 * @param calendar an object with configuration of the calendar 1219 */ 1220 addCalendar(calendar: any): number; 1221 1222 /** 1223 * adds a new dependency link 1224 * @param link the link object 1225 */ 1226 addLink(link: any): string|number; 1227 1228 /** 1229 * displays an additional layer with custom elements for a link in the timeline area 1230 * @param func a render function or a config object 1231 */ 1232 addLinkLayer(func: any): string; 1233 1234 /** 1235 * adds a marker to the timeline area 1236 * @param marker the marker's configuration object 1237 */ 1238 addMarker(marker: any): string; 1239 1240 /** 1241 * adds a new keyboard shortcut 1242 * @param shortcut the key name or the name of keys combination for a shortcut (<a href="desktop/keyboard_navigation.md#shortcutsyntax">shortcut syntax</a>) 1243 * @param handler the handler of the shortcut call 1244 * @param scope the name of the context element to attach the handler function to (<a href="desktop/keyboard_navigation.md#scopes">list of scopes</a>) 1245 */ 1246 addShortcut(shortcut: string, handler: GanttCallback, scope: string): void; 1247 1248 /** 1249 * adds a new task 1250 * @param task the task object 1251 * @param parent optional, optional, the parent's id 1252 * @param index optional, optional, the position the task will be added into (0 or greater) 1253 */ 1254 addTask(task: any, parent?: string|number, index?: number): string|number; 1255 1256 /** 1257 * displays an additional layer with custom elements for a task in the timeline area 1258 * @param func a render function or a config object 1259 */ 1260 addTaskLayer(func: any): string; 1261 1262 /** 1263 * calls an alert message box 1264 * @param config the alert box's configuration 1265 */ 1266 alert(config: any): HTMLElement; 1267 1268 /** 1269 * if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen 1270 * @param expression true to assert the expression, false - if assertion fails 1271 * @param errorMessage an error message that will be shown in the red popup 1272 */ 1273 assert(expression: boolean, errorMessage: string): void; 1274 1275 /** 1276 * attaches the handler to an inner event of dhtmlxGantt 1277 * @param name the event's name, case-insensitive 1278 * @param handler the handler function 1279 */ 1280 attachEvent(name: GanttEventName, handler: GanttCallback): string; 1281 1282 /** 1283 * recalculates the schedule of the project 1284 * @param taskId optional, optional, the task id 1285 */ 1286 autoSchedule(taskId?: string|number): void; 1287 1288 /** 1289 * updates multiple tasks/links at once 1290 * @param callback the callback function 1291 */ 1292 batchUpdate(callback: GanttCallback): void; 1293 1294 /** 1295 * creates a new function that, when called, has its <i>this</i> keyword set to the provided value 1296 * @param method the target function 1297 * @param thisArg the value to be passed as the <i>this</i> parameter to the target function when the bound function is called 1298 */ 1299 bind(method: GanttCallback, thisArg: any): GanttCallback; 1300 1301 /** 1302 * calculates the duration of a task 1303 * @param config the <a href="#configurationobjectproperties">configuration object</a> of a time span 1304 */ 1305 calculateDuration(config: any): number; 1306 1307 /** 1308 * calculates the end date of a task 1309 * @param config the <a href="#configurationobjectproperties">configuration object</a> of a time span 1310 */ 1311 calculateEndDate(config: any): Date; 1312 1313 /** 1314 * calculates the level of a task 1315 * @param task the task's object 1316 */ 1317 calculateTaskLevel(task: any): number; 1318 1319 /** 1320 * calls an inner event 1321 * @param name the event's name, case-insensitive 1322 * @param params an array of the event-related data 1323 */ 1324 callEvent(name: string, params: any[]): boolean; 1325 1326 /** 1327 * repaints the lighbox for the task according to its type 1328 * @param type the task type 1329 */ 1330 changeLightboxType(type: string): void; 1331 1332 /** 1333 * changes the link's id 1334 * @param id the current link's id 1335 * @param new_id the new link's id 1336 */ 1337 changeLinkId(id: string|number, new_id: string|number): void; 1338 1339 /** 1340 * changes the task's id 1341 * @param id the current task's id 1342 * @param new_id the new task's id 1343 */ 1344 changeTaskId(id: string|number, new_id: string|number): void; 1345 1346 /** 1347 * checks whether an event has some handler(s) specified 1348 * @param name the event's name 1349 */ 1350 checkEvent(name: GanttEventName): boolean; 1351 1352 /** 1353 * removes all tasks and additional elements (including markers) from the Gantt chart 1354 */ 1355 clearAll(): void; 1356 1357 /** 1358 * clears the stack of stored redo commands 1359 */ 1360 clearRedoStack(): void; 1361 1362 /** 1363 * clears the stack of stored undo commands 1364 */ 1365 clearUndoStack(): void; 1366 1367 /** 1368 * closes the branch with the specified id 1369 * @param id the branch id 1370 */ 1371 close(id: string|number): void; 1372 1373 /** 1374 * collapses gantt from the full screen mode to the normal mode 1375 */ 1376 collapse(): void; 1377 1378 /** 1379 * returns the index of the column by the date 1380 * @param date a date object 1381 */ 1382 columnIndexByDate(date: Date): void; 1383 1384 /** 1385 * calls a confirm message box 1386 * @param config the confirm box's configuration 1387 */ 1388 confirm(config: any): HTMLElement; 1389 1390 /** 1391 * creates a deep copy of provided object 1392 * @param task the object that needs to be copied 1393 */ 1394 copy(task: any): any; 1395 1396 /** 1397 * recalculates the task duration in the work time 1398 * @param task the task's object 1399 */ 1400 correctTaskWorkTime(task: any): void; 1401 1402 /** 1403 * creates a working calendar 1404 * @param parentCalendar optional, (optional) an existing calendar that is used for creating a new one on the base of it 1405 */ 1406 createCalendar(parentCalendar?: any): void; 1407 1408 /** 1409 * сreates a new dataProcessor instance and attaches it to gantt 1410 * @param config dataProcessor configuration object 1411 */ 1412 createDataProcessor(config: any): any; 1413 1414 /** 1415 * creates a datastore according to the provided configuration 1416 * @param config a configuration object of a datastore 1417 */ 1418 createDatastore(config: any): void; 1419 1420 /** 1421 * adds a new task and opens the lightbox to confirm 1422 * @param task the task object 1423 * @param parent the parent's id 1424 * @param index optional, optional, the position the task will be added into (0 or greater) 1425 */ 1426 createTask(task: any, parent: string, index?: number): string|number; 1427 1428 /** 1429 * dataProcessor constructor 1430 * @param url url to the data feed 1431 */ 1432 dataProcessor(url: string): void; 1433 1434 /** 1435 * gets the date of the specified horizontal position in the chart area 1436 * @param pos the relative horizontal position you want to know the date of 1437 */ 1438 dateFromPos(pos: number): Date; 1439 1440 /** 1441 * returns false if the provided argument is undefined, otherwise true 1442 * @param task the object that should be checked 1443 */ 1444 defined(task: any): boolean; 1445 1446 /** 1447 * deletes a task calendar by its id 1448 * @param id the id of the calendar 1449 */ 1450 deleteCalendar(id: string|number): void; 1451 1452 /** 1453 * deletes the specified dependency link 1454 * @param id the dependency link's id 1455 */ 1456 deleteLink(id: string|number): void; 1457 1458 /** 1459 * deletes the specified marker 1460 * @param markerId the marker's id 1461 */ 1462 deleteMarker(markerId: string): void; 1463 1464 /** 1465 * deletes the specified task 1466 * @param id the task's id 1467 */ 1468 deleteTask(id: string|number): void; 1469 1470 /** 1471 * destroys the gantt instance 1472 */ 1473 destructor(): void; 1474 1475 /** 1476 * detaches all events from dhtmlxGantt (both custom and inner ones) 1477 */ 1478 detachAllEvents(): void; 1479 1480 /** 1481 * detaches a handler from an event (which was attached before by the attachEvent() method) 1482 * @param id the event's id 1483 */ 1484 detachEvent(id: string): void; 1485 1486 /** 1487 * iterates over all parent tasks of the specified task in the Gantt chart 1488 * @param code a function that will iterate over tasks. Takes a task object as a parameter 1489 * @param startTask the id of the item the parent tasks of which should be iterated over 1490 * @param master optional, the object, that 'this' will refer to 1491 */ 1492 eachParent(code: GanttCallback, startTask: string|number, master?: any): void; 1493 1494 /** 1495 * iterates over all selected tasks in the Gantt chart 1496 * @param code a function that will iterate over tasks. Takes a task id as a parameter 1497 */ 1498 eachSelectedTask(code: GanttCallback): void; 1499 1500 /** 1501 * iterates over all child tasks of a specific task or the of whole Gantt chart 1502 * @param code a function that will iterate over tasks. Takes a task object as a parameter 1503 * @param parent optional, the parent id. If specified, the function will iterate over children of the <br> specified parent 1504 * @param master optional, the object, that 'this' will refer to 1505 */ 1506 eachTask(code: GanttCallback, parent?: string|number, master?: any): void; 1507 1508 /** 1509 * attaches an event handler to an HTML element 1510 * @param node the HTML node or its id 1511 * @param event the name of an HTML event (without the 'on' prefix) 1512 * @param handler the event handler 1513 * @param options optional, optional, the value of either the <i>useCapture</i> or <i>options</i> parameter. <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">Read details</a> 1514 */ 1515 event(node: HTMLElement|string, event: string, handler: GanttCallback, options?: any): void; 1516 1517 /** 1518 * removes an event handler from an HTML element 1519 * @param node the HTML node or its id 1520 * @param event the name of an HTML event (without the 'on' prefix) 1521 * @param handler the event handler 1522 * @param options optional, optional, the value of either the <i>useCapture</i> or <i>options</i> parameter. <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener">Read details</a> 1523 */ 1524 eventRemove(node: HTMLElement|string, event: string, handler: GanttCallback, options?: any): void; 1525 1526 /** 1527 * expands gantt to the full screen mode 1528 */ 1529 expand(): void; 1530 1531 /** 1532 * exports data from the Gantt chart to an Excel document 1533 * @param _export_ an object with export settings (see the details) 1534 */ 1535 exportToExcel(_export_: any): void; 1536 1537 /** 1538 * exports data from the Gantt chart to an iCal string 1539 * @param _export_ an object with export settings (see the details) 1540 */ 1541 exportToICal(_export_: any): void; 1542 1543 /** 1544 * exports the structure and data of a Gantt chart into a JSON object 1545 * @param config an object with Gantt configuration 1546 */ 1547 exportToJSON(config: any): void; 1548 1549 /** 1550 * exports data from the Gantt chart to MS Project 1551 * @param _export_ an object with export settings (see the details) 1552 */ 1553 exportToMSProject(_export_: any): void; 1554 1555 /** 1556 * exports a Gantt chart into the PDF format 1557 * @param _export_ an object with export settings (see the details) 1558 */ 1559 exportToPDF(_export_: any): void; 1560 1561 /** 1562 * exports a Gantt chart into the PNG format 1563 * @param _export_ an object with export settings (see the details) 1564 */ 1565 exportToPNG(_export_: any): void; 1566 1567 /** 1568 * returns all dependency loops in the chart 1569 */ 1570 findCycles(): any[]; 1571 1572 /** 1573 * sets focus on the gantt 1574 */ 1575 focus(): void; 1576 1577 /** 1578 * gets worktime calendar by id 1579 * @param calendarId the id of the global calendar or "global" 1580 */ 1581 getCalendar(calendarId: string|number): any; 1582 1583 /** 1584 * gets all the calendars added into Gantt 1585 */ 1586 getCalendars(): any[]; 1587 1588 /** 1589 * returns the 1st-level child tasks of the specified parent branch 1590 * @param id the parent branch's id 1591 */ 1592 getChildren(id: string|number): any[]; 1593 1594 /** 1595 * returns the closest working time 1596 * @param config the configuration object 1597 */ 1598 getClosestWorkTime(config: any): Date; 1599 1600 /** 1601 * returns the index of the column by its name 1602 * @param name the name of the column 1603 */ 1604 getColumnIndex(name: string): number; 1605 1606 /** 1607 * returns all tasks and links that a task is connected with 1608 * @param id optional, optional, the id of a task 1609 */ 1610 getConnectedGroup(id?: string|number): any; 1611 1612 /** 1613 * returns the earliest and latest dates allowed by the constraint applied to a task 1614 * @param task a task object 1615 */ 1616 getConstraintLimitations(task: any): void; 1617 1618 /** 1619 * returns the constraint type applied to the task 1620 * @param task a task object 1621 */ 1622 getConstraintType(task: any): string; 1623 1624 /** 1625 * returns the configuration object of a datastore 1626 * @param name the name of the datastore 1627 */ 1628 getDatastore(name: string): any; 1629 1630 /** 1631 * returns the free slack of a task 1632 * @param task the object of a task 1633 */ 1634 getFreeSlack(task: any): number; 1635 1636 /** 1637 * gets the index of a task in the tree 1638 * @param id the task id 1639 */ 1640 getGlobalTaskIndex(id: string|number): number; 1641 1642 /** 1643 * gets the configuration object of a column 1644 * @param name the column's name 1645 */ 1646 getGridColumn(name: string): any; 1647 1648 /** 1649 * gets columns of the Gantt chart 1650 */ 1651 getGridColumns(): any[]; 1652 1653 /** 1654 * gets the label of a select control in the lightbox 1655 * @param property the name of a data property that the control is mapped to 1656 * @param key the option's id. This parameter is compared with the task's data property to <br> assign the select's option to the task 1657 */ 1658 getLabel(property: string, key: string|number): string; 1659 1660 /** 1661 * returns the id of the last selected task 1662 */ 1663 getLastSelectedTask(): string|number; 1664 1665 /** 1666 * gets the lightbox's HTML object element 1667 */ 1668 getLightbox(): HTMLElement; 1669 1670 /** 1671 * returns the object of the lightbox's section 1672 * @param name the name of the section 1673 */ 1674 getLightboxSection(name: string): any; 1675 1676 /** 1677 * returns the name of the active lighbox's structure 1678 */ 1679 getLightboxType(): string; 1680 1681 /** 1682 * returns values of the lightbox's sections 1683 */ 1684 getLightboxValues(): any; 1685 1686 /** 1687 * returns the dependency link object by the specified id 1688 * @param id the link id 1689 */ 1690 getLink(id: string|number): any; 1691 1692 /** 1693 * returns the number of all dependency links presented in the Gantt chart 1694 */ 1695 getLinkCount(): number; 1696 1697 /** 1698 * returns the HTML element of the specified dependency link 1699 * @param id the link id 1700 */ 1701 getLinkNode(id: string|number): HTMLElement; 1702 1703 /** 1704 * returns all links presented in the Gantt chart 1705 */ 1706 getLinks(): any[]; 1707 1708 /** 1709 * gets the marker's object 1710 * @param markerId the marker's id 1711 */ 1712 getMarker(markerId: string): any; 1713 1714 /** 1715 * returns the id of the next item (no matter what the level of nesting is: the same or different) 1716 * @param id the task id 1717 */ 1718 getNext(id: string|number): string|number; 1719 1720 /** 1721 * returns the id of the next task of the same level 1722 * @param id the task id 1723 */ 1724 getNextSibling(id: string|number): string|number; 1725 1726 /** 1727 * returns the id of the parent task 1728 * @param id the task id 1729 */ 1730 getParent(id: string|number): string|number; 1731 1732 /** 1733 * returns the id of the previous item (no matter what the level of nesting is: the same or different) 1734 * @param id the task id 1735 */ 1736 getPrev(id: string|number): string|number; 1737 1738 /** 1739 * returns the id of the previous task of the same level 1740 * @param id the task id 1741 */ 1742 getPrevSibling(id: string|number): string|number; 1743 1744 /** 1745 * returns the stack of stored redo user actions 1746 */ 1747 getRedoStack(): any[]; 1748 1749 /** 1750 * returns all tasks assigned to the resource 1751 * @param resourceId the id of the resource 1752 */ 1753 getResourceAssignments(resourceId: string|number): any[]; 1754 1755 /** 1756 * returns the configuration of the time scale 1757 */ 1758 getScale(): any; 1759 1760 /** 1761 * returns the scroll position 1762 */ 1763 getScrollState(): any; 1764 1765 /** 1766 * returns the id of the selected task 1767 */ 1768 getSelectedId(): string; 1769 1770 /** 1771 * returns an array of the currently selected tasks 1772 */ 1773 getSelectedTasks(): any[]; 1774 1775 /** 1776 * gets a key navigation shortcut handler 1777 * @param shortcut the key name or the name of keys combination for a shortcut (<a href="desktop/keyboard_navigation.md#shortcutsyntax">shortcut syntax</a>) 1778 * @param scope the name of the context element to attach the handler function to (<a href="desktop/keyboard_navigation.md#scopes">list of scopes</a>) 1779 */ 1780 getShortcutHandler(shortcut: string, scope: string): GanttCallback; 1781 1782 /** 1783 * returns siblings of the specified task (including itself) 1784 * @param id the task id 1785 */ 1786 getSiblings(id: string|number): any[]; 1787 1788 /** 1789 * checks how much time (in the current duration unit) a task has before it starts to affect other tasks 1790 * @param task1 the object of the 1st task to check the slack for 1791 * @param task2 the object of the 2nd task to check the slack for 1792 */ 1793 getSlack(task1: any, task2: any): number|string; 1794 1795 /** 1796 * gets the current state of the Gantt chart 1797 */ 1798 getState(): any; 1799 1800 /** 1801 * calculates the combined start/end dates of tasks nested in a project or another task 1802 * @param task_id optional, the task's id, api/gantt_root_id_config.md will be used if not specified 1803 */ 1804 getSubtaskDates(task_id?: string|number): any; 1805 1806 /** 1807 * calculates the combined duration of tasks nested in a project or another task. 1808 * @param task_id optional, the task's id, api/gantt_root_id_config.md will be used if not specified 1809 */ 1810 getSubtaskDuration(task_id?: string|number): number; 1811 1812 /** 1813 * returns the task object 1814 * @param id the task id 1815 */ 1816 getTask(id: string|number): any; 1817 1818 /** 1819 * finds a task by the specified criteria 1820 * @param propertyName the name of the property to match, or a filter function 1821 * @param propertyValue the property value 1822 */ 1823 getTaskBy(propertyName: string|GanttCallback, propertyValue: any): any[]; 1824 1825 /** 1826 * returns a task by its global task index 1827 * @param index the task index in the tree (zero-based numbering) 1828 */ 1829 getTaskByIndex(index: number): any; 1830 1831 /** 1832 * returns a collection of tasks which occur during the specified period 1833 * @param from optional, the start date of the period 1834 * @param to optional, the end date of the period 1835 */ 1836 getTaskByTime(from?: Date, to?: Date): any[]; 1837 1838 /** 1839 * returns a task by its WBS code 1840 * @param code the WBS code of the task 1841 */ 1842 getTaskByWBSCode(code: string): any; 1843 1844 /** 1845 * gets a calendar assigned to the specified task (a task level calendar) 1846 * @param task the object of a task 1847 */ 1848 getTaskCalendar(task: any): any; 1849 1850 /** 1851 * gets the number of tasks that are currently loaded in the gantt 1852 */ 1853 getTaskCount(): number; 1854 1855 /** 1856 * returns the visible height of a task 1857 */ 1858 getTaskHeight(): number; 1859 1860 /** 1861 * gets the index of a task in the branch 1862 * @param id the task id 1863 */ 1864 getTaskIndex(id: string|number): number; 1865 1866 /** 1867 * returns the HTML element of the task bar 1868 * @param id the task id 1869 */ 1870 getTaskNode(id: string|number): HTMLElement; 1871 1872 /** 1873 * calculates the position and size of the task's DOM element in the timeline area 1874 * @param task the task object 1875 * @param from the start date of the item 1876 * @param to the end date of the item 1877 */ 1878 getTaskPosition(task: any, from: Date, to: Date): any; 1879 1880 /** 1881 * returns the HTML element of the task row in the table 1882 * @param id the task id 1883 */ 1884 getTaskRowNode(id: string|number): HTMLElement; 1885 1886 /** 1887 * gets the top position of the task's DOM element in the timeline area 1888 * @param id the task's id 1889 */ 1890 getTaskTop(id: number|string): number; 1891 1892 /** 1893 * returns the type of a task 1894 * @param task the task object 1895 */ 1896 getTaskType(task: any): string; 1897 1898 /** 1899 * returns the total slack of a task 1900 * @param task the object of a task 1901 */ 1902 getTotalSlack(task: any): number; 1903 1904 /** 1905 * returns the stack of stored undo user actions 1906 */ 1907 getUndoStack(): any[]; 1908 1909 /** 1910 * gets the number of tasks visible on the screen (those that are not collapsed) 1911 */ 1912 getVisibleTaskCount(): number; 1913 1914 /** 1915 * returns the WBS code (the outline number) of a task 1916 * @param task the object of a task 1917 */ 1918 getWBSCode(task: any): string; 1919 1920 /** 1921 * returns the working hours of the specified date 1922 * @param date a date to check 1923 */ 1924 getWorkHours(date: Date): any[]; 1925 1926 /** 1927 * groups tasks by the specified task's attribute 1928 * @param config the grouping configuration object, or false to ungroup tasks 1929 */ 1930 groupBy(config: any): void; 1931 1932 /** 1933 * checks whether the specified item has child tasks 1934 * @param id the task id 1935 */ 1936 hasChild(id: string|number): boolean; 1937 1938 /** 1939 * hides the lightbox modal overlay that blocks interactions with the remaining screen 1940 * @param box optional, an element to hide 1941 */ 1942 hideCover(box?: HTMLElement): void; 1943 1944 /** 1945 * closes the lightbox if it's currently active 1946 */ 1947 hideLightbox(): void; 1948 1949 /** 1950 * hides the pop-up task form (if it's currently active) 1951 */ 1952 hideQuickInfo(): void; 1953 1954 /** 1955 * converts an Excel file to JSON 1956 * @param config an object with configuration properties of an imported file 1957 */ 1958 importFromExcel(config: any): void; 1959 1960 /** 1961 * converts an XML or MPP MS Project file to JSON 1962 * @param config an object with configuration properties of an imported file 1963 */ 1964 importFromMSProject(config: any): void; 1965 1966 /** 1967 * initializes a dhtmlxGantt inside a container 1968 * @param container an HTML container (or its id) where a dhtmlxGantt object will be initialized 1969 * @param from optional, the start value of the time scale (X–Axis) 1970 * @param to optional, the end value of the time scale (X–Axis) 1971 */ 1972 init(container: string|HTMLElement, from?: Date, to?: Date): void; 1973 1974 /** 1975 * checks whether a task is a child of a different task 1976 * @param childId the id of a task that you want to check as a child 1977 * @param parentId the id of a task that you want to check as a parent 1978 */ 1979 isChildOf(childId: string|number, parentId: string|number): boolean; 1980 1981 /** 1982 * checks whether the link is circular 1983 * @param link the link object 1984 */ 1985 isCircularLink(link: any): boolean; 1986 1987 /** 1988 * checks whether the specified link is critical 1989 * @param link the link's object 1990 */ 1991 isCriticalLink(link: any): boolean; 1992 1993 /** 1994 * checks whether the specified task is critical 1995 * @param task the task's object 1996 */ 1997 isCriticalTask(task: any): boolean; 1998 1999 /** 2000 * checks whether the specified link is correct 2001 * @param link the link object 2002 */ 2003 isLinkAllowed(link: any): boolean; 2004 2005 /** 2006 * checks whether the specified link exists 2007 * @param id the link id 2008 */ 2009 isLinkExists(id: string|number): boolean; 2010 2011 /** 2012 * checks whether the specified task or link is read-only 2013 * @param id the task/link id 2014 */ 2015 isReadonly(id: string|number): boolean; 2016 2017 /** 2018 * checks whether the specified task is currently selected 2019 * @param task the task's id 2020 */ 2021 isSelectedTask(task: string|number): boolean; 2022 2023 /** 2024 * checks whether the specified task is split 2025 * @param task the object of a task 2026 */ 2027 isSplitTask(task: any): boolean; 2028 2029 /** 2030 * checks whether the specified task is summary 2031 * @param task the object of a task 2032 */ 2033 isSummaryTask(task: any): boolean; 2034 2035 /** 2036 * checks whether the specified task exists 2037 * @param id the task id 2038 */ 2039 isTaskExists(id: string|number): boolean; 2040 2041 /** 2042 * checks whether the specifies task is currently rendered in the Gantt chart 2043 * @param id the task's id 2044 */ 2045 isTaskVisible(id: string|number): boolean; 2046 2047 /** 2048 * checks if the task is unscheduled 2049 * @param task the task's object 2050 */ 2051 isUnscheduledTask(task: any): boolean; 2052 2053 /** 2054 * checks whether the specified date is working or not 2055 * @param config the configuration object of a time span 2056 */ 2057 isWorkTime(config: any): boolean; 2058 2059 /** 2060 * loads data to the gantt from an external data source 2061 * @param url the server-side url (may be a static file or a server side script that outputs data) 2062 * @param type optional, <i>('json', 'xml', 'oldxml')</i> the data type. The default value - <i>'json'</i> 2063 * @param callback optional, the callback function 2064 */ 2065 load(url: string, type?: string, callback?: GanttCallback): any; 2066 2067 /** 2068 * gets the id of a task from the specified HTML event 2069 * @param e a native event 2070 */ 2071 locate(e: Event): string|number; 2072 2073 /** 2074 * calls a message box of the specified type 2075 * @param config the message box's configuration 2076 */ 2077 message(config: any): HTMLElement; 2078 2079 /** 2080 * adds properties of the 'source' object into the 'target' object 2081 * @param target the target object 2082 * @param source the source object 2083 * @param force if true, properties of the 'source' will overwrite matching properties of the 'target', if there are any. If false, properties that already exist in the 'target' will be omitted 2084 */ 2085 mixin(target: any, source: any, force: boolean): void; 2086 2087 /** 2088 * calls a modalbox 2089 * @param config the modal box's configuration 2090 */ 2091 modalbox(config: any): HTMLElement; 2092 2093 /** 2094 * moves a task to a new position 2095 * @param sid the id of the task to move 2096 * @param tindex the index of the position that the task will be moved to <br> (the index within a branch) 2097 * @param parent optional, the parent id. If specified, the <b>tindex</b> will refer to the index in the <br> <b>'parent'</b> branch 2098 */ 2099 moveTask(sid: string|number, tindex: number, parent?: string|number): boolean; 2100 2101 /** 2102 * opens the branch with the specified id 2103 * @param id the branch id 2104 */ 2105 open(id: string|number): void; 2106 2107 /** 2108 * loads data from a client-side resource 2109 * @param url a string or object which represents data 2110 * @param type optional, optional, (<i>'json', 'xml'</i>) the data type. The default value - <i>'json'</i> 2111 */ 2112 parse(url: any, type?: string): void; 2113 2114 /** 2115 * gets the relative horizontal position of the specified date in the chart area 2116 * @param date a date you want to know the position of 2117 */ 2118 posFromDate(date: Date): number; 2119 2120 /** 2121 * applies the reverted changes to the gantt once again 2122 */ 2123 redo(): void; 2124 2125 /** 2126 * refreshes data in the Gantt chart 2127 */ 2128 refreshData(): void; 2129 2130 /** 2131 * refreshes the specifies link 2132 * @param id the link id 2133 */ 2134 refreshLink(id: string|number): void; 2135 2136 /** 2137 * refreshes the task and its related links 2138 * @param id the task id 2139 * @param refresh_links optional, optional, defines whether links related to the task should be refreshed, <em>true</em> by default 2140 */ 2141 refreshTask(id: string|number, refresh_links?: boolean): void; 2142 2143 /** 2144 * removes the specified layer related to a link 2145 * @param layerId a DOM element that will be displayed in the layer 2146 */ 2147 removeLinkLayer(layerId: string): void; 2148 2149 /** 2150 * removes a keyboard shortcut 2151 * @param shortcut the key name or the name of keys combination for a shortcut (<a href="desktop/keyboard_navigation.md#shortcutsyntax">shortcut syntax</a>) 2152 * @param scope the element to which the shortcut is attached (<a href="desktop/keyboard_navigation.md#scopes">list of scopes</a>) 2153 */ 2154 removeShortcut(shortcut: string, scope: any): void; 2155 2156 /** 2157 * removes the specified layer related to a task 2158 * @param layerId a DOM element that will be displayed in the layer 2159 */ 2160 removeTaskLayer(layerId: string): void; 2161 2162 /** 2163 * renders the whole Gantt chart 2164 */ 2165 render(): void; 2166 2167 /** 2168 * updates all markers on the page 2169 */ 2170 renderMarkers(): void; 2171 2172 /** 2173 * removes the current lightbox's HTML object element 2174 */ 2175 resetLightbox(): void; 2176 2177 /** 2178 * re-calculates the duration of a project task depending on the dates of its children 2179 * @param task the task's object 2180 */ 2181 resetProjectDates(task: any): void; 2182 2183 /** 2184 * re-calculates the skin's settings from the related attached skin CSS file 2185 */ 2186 resetSkin(): void; 2187 2188 /** 2189 * forces the lightbox to resize 2190 */ 2191 resizeLightbox(): void; 2192 2193 /** 2194 * rounds the specified date to the nearest date in the time scale 2195 * @param date the Date object to round 2196 */ 2197 roundDate(date: Date): Date; 2198 2199 /** 2200 * rounds the start and end task's dates to the nearest dates in the time scale 2201 * @param task the task object 2202 */ 2203 roundTaskDates(task: any): void; 2204 2205 /** 2206 * scrolls the Gantt container to the specified position 2207 * @param x value of horizontal scroll or 'null' (if the scroll position shouldn't be changed) 2208 * @param y value of vertical scroll or 'null' (if the scroll position shouldn't be changed) 2209 */ 2210 scrollTo(x: number|null, y: number|null): void; 2211 2212 /** 2213 * selects the specified task 2214 * @param id the task id 2215 */ 2216 selectTask(id: string|number): string|number; 2217 2218 /** 2219 * serializes the data into JSON or XML format 2220 * @param type optional, the format that the data will be serialized into. <br> Possible values: 'json' (<i>default</i> ), 'xml'. 2221 */ 2222 serialize(type?: string): void; 2223 2224 /** 2225 * returns a list of options 2226 * @param list_name the name of a list 2227 * @param options optional, an array of options 2228 */ 2229 serverList(list_name: string, options?: any[]): any[]; 2230 2231 /** 2232 * set the parent for a task 2233 * @param task the task id 2234 * @param pid the parent task id 2235 */ 2236 setParent(task: number|string, pid: number|string): void; 2237 2238 /** 2239 * resizes the Gantt chart 2240 */ 2241 setSizes(): void; 2242 2243 /** 2244 * sets the working time for the Gantt chart 2245 * @param config the configuration object of a time span 2246 */ 2247 setWorkTime(config: any): void; 2248 2249 /** 2250 * shows the lightbox modal overlay that blocks interactions with the remaining screen 2251 * @param box optional, an element to hide 2252 */ 2253 showCover(box?: HTMLElement): void; 2254 2255 /** 2256 * scrolls the chart area to makes the specified date visible 2257 * @param date the date to show in the chart 2258 */ 2259 showDate(date: Date): void; 2260 2261 /** 2262 * opens the lightbox for the specified task 2263 * @param id the task id 2264 */ 2265 showLightbox(id: string|number): void; 2266 2267 /** 2268 * displays the pop-up task form for the specified task 2269 * @param id the task id 2270 */ 2271 showQuickInfo(id: string|number): void; 2272 2273 /** 2274 * makes the specified task visible on the screen 2275 * @param id the task id 2276 */ 2277 showTask(id: string|number): void; 2278 2279 /** 2280 * sorts tasks in the grid 2281 * @param field the name of the column that the grid will be sorted by or a custom sorting function 2282 * @param desc optional, specifies the sorting direction: <i>true</i> - descending sort and <i>false</i> - ascending<br> sort. By default, <i>false</i> 2283 * @param parent optional, the id of the parent task. Specify the parameter if you want to sort tasks only in the branch of the specified parent. 2284 * @param silent optional, specifies whether rendering should be invoked after reordering items 2285 */ 2286 sort(field: string|GanttCallback, desc?: boolean, parent?: string|number, silent?: boolean): void; 2287 2288 /** 2289 * selects the specified task if it was unselected and vice versa 2290 * @param task the task's id 2291 */ 2292 toggleTaskSelection(task: string|number): void; 2293 2294 /** 2295 * returns a unique id 2296 */ 2297 uid(): number; 2298 2299 /** 2300 * reverts the changes made in the gantt 2301 */ 2302 undo(): void; 2303 2304 /** 2305 * removes selection from the selected task 2306 * @param id optional, optional, the id of the task to remove selection from, see details 2307 */ 2308 unselectTask(id?: string|number): void; 2309 2310 /** 2311 * unsets a working time in the Gantt Chart 2312 * @param config the configuration object of a time span 2313 */ 2314 unsetWorkTime(config: any): void; 2315 2316 /** 2317 * updates the specified collection with new options 2318 * @param collection the name of the collection to update 2319 * @param options the new values of the collection 2320 */ 2321 updateCollection(collection: string, options: any[]): boolean; 2322 2323 /** 2324 * updates the specified dependency link 2325 * @param id the task id 2326 */ 2327 updateLink(id: string): void; 2328 2329 /** 2330 * updates the specified marker 2331 * @param markerId the marker's id 2332 */ 2333 updateMarker(markerId: string): void; 2334 2335 /** 2336 * updates the specified task 2337 * @param id the task id 2338 */ 2339 updateTask(id: string): void; 2340} 2341 2342declare var gantt: GanttStatic; 2343 2344declare module "gantt" { 2345 export = gantt; 2346} 2347 2348declare var Gantt: GanttEnterprise; 2349 2350declare module "Gantt" { 2351 export = Gantt; 2352}