BrianM
January 30, 2020, 5:16pm
#1
Hi, I wanted to know the preferred method of including the dhtmlx Gantt definitely typed file to a gantt project -
Should we be using the npm @types /dhtmlxganttt package or including the definitions manually in the tsconfig?
ramil
February 3, 2020, 12:27pm
#2
Hello Brian,
As I see, the definitely typed
types are very old (6.0) version:
Starting from the 6.1 version, the types are included in the package:
https://docs.dhtmlx.com/gantt/whatsnew.html#61
Unfortunately, there are some missing types. We are aware of that. That bug will be fixed in the future, but I cannot give you any ETA.
Are there any updates for missing types issue? Have it fixed?
Do you have gantt types in 7th version of Gantt?
ramil
September 8, 2021, 6:03am
#4
Hello Brian,
The dev team added some types, but some other types are still missing. Unfortunately, I cannot give you any ETA on when it is going to be fixed.
1 Like
ramil
August 18, 2023, 9:46am
#5
Hello Brian and Anton,
I would like to inform you that the dev team added more types in the 8.0 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#x6629x80x6630x:~:text=Updated%20TypeScript%20type%20definitions
https://docs.dhtmlx.com/gantt/whatsnew.html#x6629x80x6630x:~:text=Type%20definitions%20are%20updated
Now there are types for the tasks, links, grid columns, scales, extensions, and almost everything in the others
category:
https://docs.dhtmlx.com/gantt/desktop__task_properties.html
https://docs.dhtmlx.com/gantt/desktop__link_properties.html
https://docs.dhtmlx.com/gantt/api__gantt_columns_config.html
https://docs.dhtmlx.com/gantt/api__gantt_scales_config.html
https://docs.dhtmlx.com/gantt/api__gantt_ext_other.html
https://docs.dhtmlx.com/gantt/api__refs__gantt_others.html
You can update to the latest version to get more features and improvements, including the better Typescript Support.
However, even if you are using the older version and don’t have plans to upgrade, you can still use the updated version of the dhtmlxgantt.d.ts
file as the Gantt API is mostly the same:
// Type definitions for dhtmlxGantt 8.0.4
// Project: https://dhtmlx.com/docs/products/dhtmlxGantt
type GanttCallback = (...args: any[]) => any;
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" | "onBeforeRollupTaskDisplay" | "onBeforeRowDragEnd" | "onBeforeRowDragMove" | "onBeforeRowResize" | "onBeforeRowResizeEnd" | "onBeforeSplitTaskDisplay" | "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";
export interface GanttTemplates {
/**
* specifies the content of start date or end date columns in grid
* @param date the date which needs formatting
* @param task the task object
* @param column the name of the column that called the template
*/
date_grid(date: Date, task: Task, column: string): string;
/**
This file has been truncated. show original
There are still ways to improve, so in the future versions, the dev team will add more types for Gantt.