DHTMLX / gantt

GPL version of Javascript Gantt Chart
https://dhtmlx.com/docs/products/dhtmlxGantt/
GNU General Public License v2.0
1.44k stars 320 forks source link

Type definition for config.start_date and config.end_date #83

Closed DanielRose closed 11 months ago

DanielRose commented 2 years ago

In the type definition file, the configuration values GanttConfigOptions.start_date and GanttConfigOptions.end_date are set as Date. However, they are undefined when the Gantt is initialized.

Since they are typed without undefined, this also means that the values cannot be set to undefined again in Typescript code (at least when strictNullChecks is true). Could this be fixed in a future version?

gearcoded commented 1 year ago

@DanielRose, Thank you for letting us know about that issue. We are aware that there are missing types in the Typescript file. I added the information about the gantt.config.start_date and gantt.config.end_date parameters to our internal bug tracker. The dev team will fix that issue in the future, but I cannot give you any ETA.

gearcoded commented 1 year ago

@DanielRose, 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: https://github.com/DHTMLX/gantt/blob/master/codebase/dhtmlxgantt.d.ts

There are still ways to improve, so in the future versions, the dev team will add more types for Gantt.