1- // Type definitions for dhtmlxGantt 7.1.0
1+ // Type definitions for dhtmlxGantt 7.1.1
22// Project: https://dhtmlx.com/docs/products/dhtmlxGantt
33
44type GanttCallback = ( ...args : any [ ] ) => any ;
55
66
7- export type GanttEventName = "onAfterAutoSchedule" | "onAfterBatchUpdate" | "onAfterBranchLoading" | "onAfterLightbox" | "onAfterLinkAdd" | "onAfterLinkDelete" | "onAfterLinkUpdate" | "onAfterQuickInfo" | "onAfterRedo" | "onAfterSort" | "onAfterTaskAdd" | "onAfterTaskAutoSchedule" | "onAfterTaskDelete" | "onAfterTaskDrag" | "onAfterTaskMove" | "onAfterTaskUpdate" | "onAfterUndo" | "onAjaxError" | "onAutoScheduleCircularLink" | "onBeforeAutoSchedule" | "onBeforeBatchUpdate" | "onBeforeBranchLoading" | "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" ;
7+ export type GanttEventName = "onAfterAutoSchedule" | "onAfterBatchUpdate" | "onAfterBranchLoading" | "onAfterLightbox" | "onAfterLinkAdd" | "onAfterLinkDelete" | "onAfterLinkUpdate" | "onAfterQuickInfo" | "onAfterRedo" | "onAfterRowResize" | "onAfterSort" | "onAfterTaskAdd" | "onAfterTaskAutoSchedule" | "onAfterTaskDelete" | "onAfterTaskDrag" | "onAfterTaskMove" | "onAfterTaskUpdate" | "onAfterUndo" | "onAjaxError" | "onAutoScheduleCircularLink" | "onBeforeAutoSchedule" | "onBeforeBatchUpdate" | "onBeforeBranchLoading" | "onBeforeCollapse" | "onBeforeDataRender" | "onBeforeExpand" | "onBeforeGanttReady" | "onBeforeGanttRender" | "onBeforeLightbox" | "onBeforeLinkAdd" | "onBeforeLinkDelete" | "onBeforeLinkDisplay" | "onBeforeLinkUpdate" | "onBeforeMultiSelect" | "onBeforeParse" | "onBeforeRedo" | "onBeforeRedoStack" | "onBeforeRowDragEnd" | "onBeforeRowDragMove" | "onBeforeRowResize" | "onBeforeRowResizeEnd" | "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" | "onRowResize" | "onScaleAdjusted" | "onScaleClick" | "onTaskClick" | "onTaskClosed" | "onTaskCreated" | "onTaskDblClick" | "onTaskDrag" | "onTaskIdChange" | "onTaskLoading" | "onTaskMultiSelect" | "onTaskOpened" | "onTaskRowClick" | "onTaskSelected" | "onTaskUnselected" | "onTemplatesReady" ;
88
99
1010export interface GanttTemplates {
@@ -99,35 +99,39 @@ export interface GanttTemplates {
9999 * @param end_date end date of the scale cell
100100 * @param resource the resource object
101101 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell
102+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
102103 */
103- histogram_cell_allocated ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : void ;
104+ histogram_cell_allocated ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : void ;
104105
105106 /**
106107 * specifies the height of the line that defines the available capacity of the resource
107108 * @param start_date start date of the scale cell
108109 * @param end_date end date of the scale cell
109110 * @param resource the resource object
110111 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell
112+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
111113 */
112- histogram_cell_capacity ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : void ;
114+ histogram_cell_capacity ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : void ;
113115
114116 /**
115117 * defines the CSS class which is applied to a cell of the resource panel
116118 * @param start_date start date of the scale cell
117119 * @param end_date end date of the scale cell
118120 * @param resource the resource object
119121 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell
122+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
120123 */
121- histogram_cell_class ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : void ;
124+ histogram_cell_class ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : void ;
122125
123126 /**
124127 * defines the label inside a cell
125128 * @param start_date start date of the scale cell
126129 * @param end_date end date of the scale cell
127130 * @param resource the resource object
128131 * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell
132+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
129133 */
130- histogram_cell_label ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : void ;
134+ histogram_cell_label ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : void ;
131135
132136 /**
133137 * specifies the CSS class that will be applied to a link
@@ -193,17 +197,19 @@ export interface GanttTemplates {
193197 * @param end_date end date of the scale cell
194198 * @param resource the resource object
195199 * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell
200+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
196201 */
197- resource_cell_class ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : string ;
202+ resource_cell_class ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : string ;
198203
199204 /**
200205 * defines the HTML content of resource timeline cells
201206 * @param start_date start date of the scale cell
202207 * @param end_date end date of the scale cell
203208 * @param resource the resource object
204209 * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell
210+ * @param assignments resource assignments that are assigned to the specified start/end dates of the task
205211 */
206- resource_cell_value ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] ) : string ;
212+ resource_cell_value ( start_date : Date , end_date : Date , resource : any , tasks : any [ ] , assignments : any [ ] ) : string ;
207213
208214 /**
209215 * specifies the CSS class that will be applied to cells of the time scale of the timeline area
@@ -329,6 +335,8 @@ export interface GanttTemplates {
329335 * @param task the task's object
330336 */
331337 lightbox_header ( start_date : Date , end_date : Date , task : any ) : string ;
338+
339+ [ customTemplate : string ] : any ;
332340}
333341
334342export interface GanttConfigOptions {
@@ -393,6 +401,11 @@ export interface GanttConfigOptions {
393401 */
394402 autosize_min_width : number ;
395403
404+ /**
405+ * sets the height of task bars in the timeline area
406+ */
407+ bar_height : number | string ;
408+
396409 /**
397410 * enables dynamic loading in the Gantt chart
398411 */
@@ -438,6 +451,11 @@ export interface GanttConfigOptions {
438451 */
439452 constraint_types : any ;
440453
454+ /**
455+ * specifies the delay (in milliseconds) before redrawing the gantt when resizing the container
456+ */
457+ container_resize_timeout : number ;
458+
441459 /**
442460 * enables adjusting the task's start and end dates to the work time (while dragging)
443461 */
@@ -463,6 +481,11 @@ export interface GanttConfigOptions {
463481 */
464482 date_scale : string ;
465483
484+ /**
485+ * defines whether gantt will perform a deep copy of data objects passed into the gantt.parse() method
486+ */
487+ deepcopy_on_parse : boolean ;
488+
466489 /**
467490 * 'says' to open the lightbox while creating new events by clicking the '+' button
468491 */
@@ -548,6 +571,11 @@ export interface GanttConfigOptions {
548571 */
549572 end_date : Date ;
550573
574+ /**
575+ * renders an external component into the DOM
576+ */
577+ external_render : any ;
578+
551579 /**
552580 * 'says' the Gantt chart to automatically extend the time scale in order to fit all displayed tasks
553581 */
@@ -683,6 +711,11 @@ export interface GanttConfigOptions {
683711 */
684712 min_grid_column_width : number ;
685713
714+ /**
715+ * sets the minimal row height that can be set for a task during resizing
716+ */
717+ min_task_grid_row_height : number ;
718+
686719 /**
687720 * enables/disables multi-task selection in the Gantt chart
688721 */
@@ -728,6 +761,11 @@ export interface GanttConfigOptions {
728761 */
729762 prevent_default_scroll : boolean ;
730763
764+ /**
765+ * enables/disables parsing of the resource assignments
766+ */
767+ process_resource_assignments : boolean ;
768+
731769 /**
732770 * specifies the end date of a project
733771 */
@@ -768,6 +806,16 @@ export interface GanttConfigOptions {
768806 */
769807 reorder_grid_columns : boolean ;
770808
809+ /**
810+ * enables the ability to adjust the row height by drag-and-drop
811+ */
812+ resize_rows : boolean ;
813+
814+ /**
815+ * specifies the name of the dataStore which stores resource assignments
816+ */
817+ resource_assignment_store : string ;
818+
771819 /**
772820 * changes the name of the attribute that Gantt uses to find which resource the task row in the resource grid/timeline is referring to
773821 */
@@ -968,6 +1016,11 @@ export interface GanttConfigOptions {
9681016 */
9691017 task_date : string ;
9701018
1019+ /**
1020+ *
1021+ */
1022+ task_grid_row_resizer_attribute : any ;
1023+
9711024 /**
9721025 * sets the height of task bars in the timeline area
9731026 */
@@ -1063,6 +1116,11 @@ export interface GanttConfigOptions {
10631116 */
10641117 wai_aria_attributes : boolean ;
10651118
1119+ /**
1120+ * specifies the speed of scrolling the gantt by the mouse wheel
1121+ */
1122+ wheel_scroll_sensitivity : any ;
1123+
10661124 /**
10671125 * sets both the section and its label on the same line
10681126 */
@@ -1077,6 +1135,8 @@ export interface GanttConfigOptions {
10771135 * defines date formats that are used to parse data from a data set and to send data to a server
10781136 */
10791137 xml_date : string ;
1138+
1139+ [ customConfig : string ] : any ;
10801140}
10811141
10821142export interface GanttDateHelpers {
@@ -1094,6 +1154,7 @@ export interface GanttDateHelpers {
10941154 str_to_date ( format : string ) : any ;
10951155 convert_to_utc ( origin : Date ) : Date ;
10961156 to_fixed ( value : number ) : string ;
1157+ [ customMethod : string ] : any ;
10971158}
10981159
10991160export interface GanttHotkeys {
@@ -1168,6 +1229,8 @@ export interface GanttLocaleLabels {
11681229 /* resource control */
11691230 resources_filter_placeholder : string ;
11701231 resources_filter_label : string ;
1232+
1233+ [ customLabel : string ] : any ;
11711234}
11721235
11731236export interface GanttLocale {
@@ -1241,6 +1304,11 @@ export interface GanttStatic {
12411304 */
12421305 constants : any ;
12431306
1307+ /**
1308+ * a set of datastore methods
1309+ */
1310+ datastore : any ;
1311+
12441312 /**
12451313 * a set of date formatting methods
12461314 */
@@ -1301,6 +1369,11 @@ export interface GanttStatic {
13011369 */
13021370 templates : GanttTemplates ;
13031371
1372+ /**
1373+ * a set of treeDatastore methods
1374+ */
1375+ treeDatastore : any ;
1376+
13041377 /**
13051378 * various helper modules
13061379 */
@@ -1716,8 +1789,9 @@ export interface GanttStatic {
17161789 /**
17171790 * returns the index of the column by its name
17181791 * @param name the name of the column
1792+ * @param excludeHidden optional, skips indexes of the hidden columns
17191793 */
1720- getColumnIndex ( name : string ) : number ;
1794+ getColumnIndex ( name : string , excludeHidden ?: boolean ) : number ;
17211795
17221796 /**
17231797 * returns all tasks and links that a task is connected with
@@ -1937,6 +2011,18 @@ export interface GanttStatic {
19372011 */
19382012 getTask ( id : string | number ) : any ;
19392013
2014+ /**
2015+ * returns the parsed resource assignments of a specific task from the datastore
2016+ * @param taskId the task id
2017+ */
2018+ getTaskAssignments ( taskId : string | number ) : any [ ] ;
2019+
2020+ /**
2021+ * returns the height (in pixels) of the DOM element of the task
2022+ * @param taskId the task's id
2023+ */
2024+ getTaskBarHeight ( taskId : number | string ) : number ;
2025+
19402026 /**
19412027 * finds a task by the specified criteria
19422028 * @param propertyName the name of the property to match, or a filter function
@@ -2240,10 +2326,10 @@ export interface GanttStatic {
22402326
22412327 /**
22422328 * loads data from a client-side resource
2243- * @param url a string or object which represents data
2329+ * @param data a string or object which represents data
22442330 * @param type optional, optional, (<i>'json', 'xml'</i>) the data type. The default value - <i>'json'</i>
22452331 */
2246- parse ( url : any , type ?: string ) : void ;
2332+ parse ( data : any , type ?: string ) : void ;
22472333
22482334 /**
22492335 * activates specified extensions
@@ -2489,6 +2575,12 @@ export interface GanttStatic {
24892575 * @param newState the new values of the task
24902576 */
24912577 updateTask ( id : string , newState : any ) : void ;
2578+
2579+ /**
2580+ * updates the resource property of the task object with the values of the resource assignments from the datastore
2581+ * @param taskId the task id
2582+ */
2583+ updateTaskAssignments ( taskId : number | string ) : void ;
24922584}
24932585
24942586declare var gantt : GanttStatic ;
0 commit comments