UNPKG

dhtmlx-gantt

Version:

An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.

1,783 lines (1,465 loc) 72.1 kB
// Type definitions for dhtmlxGantt 7.1.12 // 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"|"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"; 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: any, column: string): string; /** * specifies the text of tooltips that are displayed when the user creates a new dependency link * @param from the id of the source task * @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task */ drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; /** * specifies the CSS class that will be applied to the pop-up that appears when a user drags a link * @param from the id of the source task * @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task */ drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; /** * converts a date object to a date string. Used to send data back to the server * @param date the date which needs formatting */ format_date(date: Date): string; /** * specifies the custom content inserted before the labels of child items in the tree column * @param task the task object */ grid_blank(task: any): string; /** * specifies the format of dates in the "Start time" column * @param date the date which needs formatting * @param column the name of the column that called the template */ grid_date_format(date: Date, column: string): string; /** * specifies the icon of child items in the tree column * @param task the task object */ grid_file(task: any): string; /** * specifies the icon of parent items in the tree column * @param task the task object */ grid_folder(task: any): string; /** * specifies the CSS class that will be applied to the headers of the table's columns * @param columnName the column's name (as specified in the "name" property of the column object) * @param column column object (as specified in the <i>gantt.config.columns</i> config) */ grid_header_class(columnName: string, column: any): string; /** * specifies the indent of the child items in a branch (in the tree column) * @param task the task object */ grid_indent(task: any): string; /** * specifies the icon of the open/close sign in the tree column * @param task the task object */ grid_open(task: any): string; /** * specifies the CSS class that will be applied to a grid row * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ grid_row_class(start: Date, end: Date, task: any): string; /** * defines the height of the filled area in the resourceHistogram * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): void; /** * specifies the height of the line that defines the available capacity of the resource * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): void; /** * defines the CSS class which is applied to a cell of the resource panel * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): void; /** * defines the label inside a cell * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): void; /** * specifies the CSS class that will be applied to a link * @param link the link object */ link_class(link: any): string; /** * specifies the text in the header of the link's "delete" confirm window * @param link the link object */ link_description(link: any): string; /** * converts date string into a Date object * @param date the string which need to be parsed */ parse_date(date: string): Date; /** * specifies the text in the completed part of the task bar * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ progress_text(start: Date, end: Date, task: any): string; /** * specifies the CSS class that will be applied to the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_class(start: Date, end: Date, task: any): void; /** * specifies the content of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_content(start: Date, end: Date, task: any): string; /** * specifies the date of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_date(start: Date, end: Date, task: any): string; /** * specifies the title of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_title(start: Date, end: Date, task: any): string; /** * defines the CSS class names of cells in the resource timeline cells * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): string; /** * defines the HTML content of resource timeline cells * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: any[], assignments: any[]): string; /** * specifies the CSS class that will be applied to cells of the time scale of the timeline area * @param date the date of a cell */ scale_cell_class(date: Date): string; /** * specifies the CSS class that will be applied to the time scale * @param scale the scale's configuration object */ scale_row_class(scale: any): string; /** * specifies the CSS class that will be applied to task bars * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_class(start: Date, end: Date, task: any): string; /** * specifies the date format of the label in the 'Time period' section of the lightbox * @param date the date which needs formatting */ task_date(date: Date): string; /** * specifies the format for the end dates of tasks in the lightbox * @param date the date which needs formatting */ task_end_date(date: Date): string; /** * specifies the CSS class that will be applied to the row of the timeline area * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_row_class(start: Date, end: Date, task: any): string; /** * specifies the text in the task bars and the header of the lightbox * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_text(start: Date, end: Date, task: any): string; /** * specifies the date period in the header of the lightbox * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_time(start: Date, end: Date, task: any): string; /** * specifies the dates of unscheduled tasks * @param task the task object */ task_unscheduled_time(task: any): void; /** * specifies the format of the drop-down time selector in the lightbox * @param date the date which needs formatting */ time_picker(date: Date): string; /** * specifies the CSS class that will be applied to the cells of the timeline area * @param item the task object assigned to the row * @param date the date of a cell */ timeline_cell_class(item: any, date: Date): string; /** * specifies the format of start and end dates displayed in the tooltip * @param date the date which needs formatting */ tooltip_date_format(date: Date): string; /** * specifies the text of tooltips * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ tooltip_text(start: Date, end: Date, task: any): string; /** * a string from an XML file is converted into a date object in conformity with this template * @param date the date which needs formatting */ xml_date(date: Date): string; /** * a date object is converted into a string in conformity with this template. Used to send data back to the server * @param date the date which needs formatting */ xml_format(date: Date): string; /** * specifies the text assigned to tasks bars on the right side * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ rightside_text(start: Date, end: Date, task: any): string; /** * specifies the text assigned to tasks bars on the left side * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ leftside_text(start: Date, end: Date, task: any): string; /** * specifies the lightbox's header * @param start_date the date when a task is scheduled to begin * @param end_date the date when a task is scheduled to be completed * @param task the task's object */ lightbox_header(start_date: Date, end_date: Date, task: any): string; [customTemplate: string]: any; } export interface GanttConfigOptions { /** * enables auto scheduling */ auto_scheduling: boolean; /** * disables usage of time contraints for tasks */ auto_scheduling_compatibility: boolean; /** * allows or forbids creating links from parent tasks (projects) to their children */ auto_scheduling_descendant_links: boolean; /** * defines whether gantt will do autoscheduling on data loading/parsing */ auto_scheduling_initial: boolean; /** * defines whether the whole project will be moved (see the details below) */ auto_scheduling_move_projects: boolean; /** * enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date */ auto_scheduling_strict: boolean; /** * automatically converts tasks with subtasks to projects and projects without subtasks back to tasks */ auto_types: boolean; /** * enables automatic adjusting of the grid's columns to the grid's width */ autofit: boolean; /** * enables autoscrolling while dragging a task or link out of the current browser screen */ autoscroll: boolean; /** * defines the speed of autoscrolling (in ms) while dragging a task or link out of the current browser screen */ autoscroll_speed: number; /** * forces the Gantt chart to automatically change its size to show all tasks without scrolling */ autosize: boolean|string; /** * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode */ autosize_min_width: number; /** * sets the height of task bars in the timeline area */ bar_height: number|string; /** * enables dynamic loading in the Gantt chart */ branch_loading: boolean; /** * specifies that the task has children that are not yet loaded from the backend */ branch_loading_property: string; /** * stores a collection of buttons resided in the left bottom corner of the lightbox */ buttons_left: any[]; /** * stores a collection of buttons resided in the right bottom corner of the lightbox */ buttons_right: any[]; /** * changes the name of the property that affects binding of a calendar to a task/group of tasks */ calendar_property: string; /** * enables cascade deleting of nested tasks and links */ cascade_delete: boolean; /** * enables advanced drag-n-drop */ click_drag: any; /** * configures the columns of the table */ columns: any[]; /** * contains all available constraint types */ constraint_types: any; /** * specifies the delay (in milliseconds) before redrawing the gantt when resizing the container */ container_resize_timeout: number; /** * enables adjusting the task's start and end dates to the work time (while dragging) */ correct_work_time: boolean; /** * defines internal implementation of the code of date formatting methods */ csp: boolean|string; /** * sets the date format that is used to parse data from a data set and to send dates back to the server */ date_format: string; /** * sets the format of dates in the "Start time" column of the table */ date_grid: string; /** * sets the format of the time scale (X-Axis) */ date_scale: string; /** * defines whether gantt will perform a deep copy of data objects passed into the gantt.parse() method */ deepcopy_on_parse: boolean; /** * 'says' to open the lightbox while creating new events by clicking the '+' button */ details_on_create: boolean; /** * 'says' to open the lightbox after double clicking on a task */ details_on_dblclick: boolean; /** * enables the possibility to drag the lightbox by the header */ drag_lightbox: boolean; /** * enables creating dependency links by drag-and-drop */ drag_links: boolean; /** * stores the types of available drag-and-drop modes */ drag_mode: any; /** * enables the possibility to move tasks by drag-and-drop */ drag_move: boolean; /** * enables the possibility to drag several selected tasks at once */ drag_multiple: boolean; /** * enables the possibility to change the task progress by dragging the progress knob */ drag_progress: boolean; /** * enables drag and drop of items of the project type */ drag_project: boolean; /** * enables the possibility to resize tasks by drag-and-drop */ drag_resize: boolean; /** * configures the behavior of the drag_timeline extension */ drag_timeline: any; /** * sets the number of 'gantt.config.duration_unit' units that will correspond to one unit of the 'duration' data property. */ duration_step: number; /** * sets the duration unit */ duration_unit: string; /** * enables automatic merging of multiple resource calendars into one */ dynamic_resource_calendars: boolean; /** * changes the name of a property that affects the editing ability of tasks/links in the read-only Gantt chart */ editable_property: string; /** * an object that contains definitions of inline editors */ editor_types: any; /** * sets the end value of the time scale */ end_date: Date; /** * renders an external component into the DOM */ external_render: any; /** * 'says' the Gantt chart to automatically extend the time scale in order to fit all displayed tasks */ fit_tasks: boolean; /** * adjusts the width of columns inside a scrollable grid */ grid_elastic_columns: boolean; /** * makes the grid resizable by dragging the right grid's border */ grid_resize: boolean; /** * sets the name of the attribute of the grid resizer's DOM element */ grid_resizer_attribute: string; /** * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index */ grid_resizer_column_attribute: string; /** * sets the width of the grid */ grid_width: number; /** * shows the critical path in the chart */ highlight_critical_path: boolean; /** * enables/disables horizontal scroll by the Shift|Alt|Meta key + mouse wheel movement */ horizontal_scroll_key: string|boolean; /** * defines whether tasks should inherit work calendars from their summary parents */ inherit_calendar: boolean; /** * specifies whether sub-scales shall use the scale_cell_class template by default */ inherit_scale_class: boolean; /** * sets whether the timeline area will be initially scrolled to display the earliest task */ initial_scroll: boolean; /** * keeps the duration of a task unchanged during editing of the start/end of a task */ inline_editors_date_processing: string; /** * 'says' to preserve the initial grid's width while resizing columns within */ keep_grid_width: boolean; /** * enables keyboard navigation in gantt */ keyboard_navigation: boolean; /** * enables keyboard navigation by cells */ keyboard_navigation_cells: boolean; /** * sets the name of the attribute of the task layer's DOM element */ layer_attribute: string; /** * specifies the layout object */ layout: any; /** * specifies the lightbox object */ lightbox: any; /** * increases the height of the lightbox */ lightbox_additional_height: number; /** * sets the size of the link arrow */ link_arrow_size: number; /** * sets the name of the attribute that will specify the id of the link's HTML element */ link_attribute: string; /** * sets the width of dependency links in the timeline area */ link_line_width: number; /** * sets the width of the area (over the link) sensitive to clicks */ link_wrapper_width: number; /** * stores the types of links dependencies */ links: any; /** * sets the minimum width for a column in the timeline area */ min_column_width: number; /** * sets the minimum duration (in milliseconds) that can be set for a task during resizing. */ min_duration: number; /** * sets the minumum width for the grid (in pixels) while being resized */ min_grid_column_width: number; /** * sets the minimal row height that can be set for a task during resizing */ min_task_grid_row_height: number; /** * enables/disables multi-task selection in the Gantt chart */ multiselect: boolean; /** * specifies whether multi-task selection will be available within one or any level */ multiselect_one_level: boolean; /** * enables the possibility to expand/collapse split tasks by clicking the +/- button */ open_split_tasks: boolean; /** * openes all branches initially */ open_tree_initially: boolean; /** * activates the 'branch' mode that allows vertically reordering tasks within the same tree level */ order_branch: string|boolean; /** * activates the 'branch' mode that allows reordering tasks within the whole gantt */ order_branch_free: boolean; /** * adds an empty row into the end of the list of tasks to simplify tasks editing via keyboard */ placeholder_task: boolean; /** * preserves the current position of the vertical and horizontal scrolls while re-drawing the gantt chart */ preserve_scroll: boolean; /** * specifies whether the gantt container should block the mousewheel event, or should it be propagated up to the window element */ prevent_default_scroll: boolean; /** * enables/disables parsing of the resource assignments */ process_resource_assignments: boolean; /** * specifies the end date of a project */ project_end: Date; /** * specifies the start date of a project */ project_start: Date; /** * defines whether the task form will appear from the left/right side of the screen or near the selected task */ quick_info_detached: boolean; /** * stores a collection of buttons resided in the pop-up task's details form */ quickinfo_buttons: any[]; /** * activates the read-only mode for the Gantt chart */ readonly: boolean; /** * changes the name of a property that affects the read-only behaviour of tasks/links */ readonly_property: string; /** * enables the Redo functionality for the gantt */ redo: boolean; /** * enables the possibility to reorder grid columns by drag and drop */ reorder_grid_columns: boolean; /** * enables the ability to adjust the row height by drag-and-drop */ resize_rows: boolean; /** * specifies the name of the dataStore which stores resource assignments */ resource_assignment_store: string; /** * changes the name of the attribute that Gantt uses to find which resource the task row in the resource grid/timeline is referring to */ resource_attribute: string; /** * defines a set of working calendars that can be assigned to a specific resource, e.g. a user */ resource_calendars: any; /** * defines the property of a task object that stores a resource id associated with resourceGrid/Timeline/Histogram/Calendar */ resource_property: string; /** * tells the resource timeline to render elements and call templates for non-allocated cells */ resource_render_empty_cells: boolean; /** * specifies the name of the dataStore connected to the resourceGrid/resourceTimeline/resourceHistogram views */ resource_store: string; /** * sets the id of the virtual root element */ root_id: string|number; /** * enables rounding the task's start and end dates to the nearest scale marks */ round_dnd_dates: boolean; /** * sets the default height for rows of the table */ row_height: number; /** * switches gantt to the right-to-left mode */ rtl: boolean; /** * sets the height of the time scale and the header of the grid */ scale_height: number; /** * sets the minimal scale unit (in case multiple scales are used) as the interval of the leading/closing empty space */ scale_offset_minimal: boolean; /** * sets the unit of the time scale (X-Axis) */ scale_unit: string; /** * defines configuration settings of the time scale */ scales: any[]; /** * enables backward scheduling */ schedule_from_end: boolean; /** * specifies whether the timeline area shall be scrolled while selecting to display the selected task */ scroll_on_click: boolean; /** * set the sizes of the vertical (width) and horizontal (height) scrolls */ scroll_size: number; /** * enables selection of tasks in the Gantt chart */ select_task: boolean; /** * enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server */ server_utc: boolean; /** * shows the chart (timeline) area of the Gantt chart */ show_chart: boolean; /** * enables showing error alerts in case of unexpected behavior */ show_errors: boolean; /** * shows the grid area of the Gantt chart */ show_grid: boolean; /** * enables/disables displaying links in the Gantt chart */ show_links: boolean; /** * shows/hides markers on the page */ show_markers: boolean; /** * enables displaying of the progress inside the task bars */ show_progress: boolean; /** * activates/disables the 'quick_info' extension (pop-up task's details form) */ show_quick_info: boolean; /** * enables/disables displaying column borders in the chart area */ show_task_cells: boolean; /** * enables showing tasks that are outside the specified date range in the Gantt chart */ show_tasks_outside_timescale: boolean; /** * enables showing unscheduled tasks */ show_unscheduled: boolean; /** * hides non-working time from the time scale */ skip_off_time: boolean; /** * enables the smart rendering mode for gantt's tasks and links rendering */ smart_rendering: boolean; /** * specifies that only visible part of the time scale is rendered on the screen */ smart_scales: boolean; /** * enables sorting in the table */ sort: boolean; /** * sets the start value of the time scale */ start_date: Date; /** * sets the starting day of the week */ start_on_monday: boolean; /** * generates a background image for the timeline area instead of rendering actual columns' and rows' lines */ static_background: boolean; /** * enables rendering of highlighted cells in the static_background mode */ static_background_cells: boolean; /** * sets the step of the time scale (X-Axis) */ step: number; /** * specifies the second time scale(s) (deprecated) */ subscales: any[]; /** * sets the name of the attribute that will specify the id of the task's HTML element */ task_attribute: string; /** * sets the format of the date label in the 'Time period' section of the lightbox */ task_date: string; /** * */ task_grid_row_resizer_attribute: any; /** * sets the height of task bars in the timeline area */ task_height: number|string; /** * sets the offset (in pixels) of the nearest task from the left border in the timeline */ task_scroll_offset: number; /** * sets the format of the time drop-down selector in the lightbox */ time_picker: string; /** * sets the minimum step (in minutes) for the task's time values */ time_step: number; /** * sets the length of time, in milliseconds, before the tooltip hides */ tooltip_hide_timeout: number; /** * sets the right (if positive) offset of the tooltip's position */ tooltip_offset_x: number; /** * sets the top (if positive) offset of the tooltip's position */ tooltip_offset_y: number; /** * sets the timeout in milliseconds before the tooltip is displayed for a task */ tooltip_timeout: number; /** * enables/disables the touch support for the Gantt chart */ touch: boolean|string; /** * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture */ touch_drag: number|boolean; /** * returns vibration feedback before/after drag and drop on touch devices */ touch_feedback: boolean; /** * defines the duration of vibration feedback before/after drag and drop on touch devices (in milliseconds) */ touch_feedback_duration: number; /** * redefines functions responsible for displaying different types of tasks */ type_renderers: any; /** * stores the names of lightbox's structures (used for different types of tasks) */ types: any; /** * enables the Undo functionality for the gantt */ undo: boolean; /** * sets the actions that the Undo operation will revert */ undo_actions: any; /** * sets the number of steps that should be reverted by the undo method */ undo_steps: number; /** * sets the types of entities for which the Undo operation will be applied */ undo_types: any; /** * enables WAI-ARIA support to make the component recognizable for screen readers */ wai_aria_attributes: boolean; /** * specifies the speed of scrolling the gantt by the mouse wheel */ wheel_scroll_sensitivity: any; /** * sets both the section and its label on the same line */ wide_form: boolean; /** * enables calculating the duration of tasks in working time instead of calendar time */ work_time: boolean; /** * defines date formats that are used to parse data from a data set and to send data to a server */ xml_date: string; [customConfig: string]: any; } export interface GanttDateHelpers { add(origin: Date, count: number, unit: string): Date; copy(origin: Date): Date; date_part(origin: Date): Date; time_part(origin: Date): Date; day_start(origin: Date): Date; month_start(origin: Date): Date; week_start(origin: Date): Date; year_start(origin: Date): Date; getISOWeek(origin: Date): number; getUTCISOWeek(origin: Date): number; date_to_str(format: string): any; str_to_date(format: string): any; convert_to_utc(origin: Date): Date; to_fixed(value: number): string; [customMethod: string]: any; } export interface GanttHotkeys { edit_save: number; edit_cancel: number; } export type MonthLabelList = [string, string, string, string, string, string, string, string, string, string, string, string]; export type WeekDayLabelList = [string, string, string, string, string, string, string]; export interface GanttLocaleDate { month_full: MonthLabelList; month_short: MonthLabelList; day_full: WeekDayLabelList; day_short: WeekDayLabelList; } export interface GanttLocaleLabels { new_task: string; icon_save: string; icon_cancel: string; icon_details: string; icon_edit: string; icon_delete: string; confirm_closing: string; confirm_deleting: string; section_description: string; section_time: string; section_type: string; /* grid columns */ column_wbs: string; column_text: string; column_start_date: string; column_duration: string; column_add: string; /* link confirmation */ link: string; confirm_link_deleting: string; link_start: string; link_end: string; type_task: string; type_project: string; type_milestone: string; minutes: string; hours: string; days: string; weeks: string; months: string; years: string; /* message popup */ message_ok: string; message_cancel: string; /* constraints */ section_constraint: string; constraint_type: string; constraint_date: string; asap: string; alap: string; snet: string; snlt: string; fnet: string; fnlt: string; mso: string; mfo: string; /* resource control */ resources_filter_placeholder: string; resources_filter_label: string; [customLabel: string]: any; } export interface GanttLocale { date: GanttLocaleDate; labels: GanttLocaleLabels; } export interface GanttPlugins { auto_scheduling?: boolean; click_drag?: boolean; critical_path?: boolean; drag_timeline?: boolean; fullscreen?: boolean; keyboard_navigation?: boolean; quick_info?: boolean; tooltip?: boolean; undo?: boolean; grouping?: boolean; marker?: boolean; multiselect?: boolean; overlay?: boolean; } export interface GanttInitializationConfig { container?: string|HTMLElement; config?: any; templates?: any; events?: any; data?: any; plugins?: GanttPlugins; locale?: any; } export interface GanttInternationalization { setLocale(locale: any): void; getLocale(language?: string): GanttLocale; addLocale(language: string, locale: GanttLocale): void; } export type GanttPlugin = (gantt: GanttStatic) => void; export interface GanttEnterprise { plugin(plugin: GanttPlugin): void; getGanttInstance(settings?: GanttInitializationConfig) : GanttStatic; } export interface GanttStatic { /** * redefines the default click behavior for buttons of the Gantt chart */ $click: any; /** * gantt ajax module */ ajax: any; /** * the interface of the working calendar object */ calendar: any; /** * defines configuration options for dates, scale, controls */ config: GanttConfigOptions; /** * stores various constants to reduce the use of magic numbers in the code */ constants: any; /** * a set of datastore methods */ datastore: any; /** * a set of date formatting methods */ date: GanttDateHelpers; /** * a set of flags which describe current environment */ env: any; /** * an object that stores various extensions */ ext: any; /** * a set of methods for Gantt chart localization */ i18n: GanttInternationalization; /** * specifies JSON serialization and parsing */ json: any; /** * defines the hot keys for the Gantt chart */ keys: GanttHotkeys; /** * returns the license name of dhtmlxGantt */ license: any; /** * the current locale object (region-specific labels) of the Gantt chart */ locale: GanttLocale; /** * specifies serialization and parsing in the XML format of dhtmlxGantt 1.0 */ oldxml: any; /** * returns the current skin of the Gantt chart */ skin: string; /** * returns objects of the available skins */ skins: any; /** * defines formatting templates for dates, titles, tooltips in the Gantt chart */ templates: GanttTemplates; /** * a set of treeDatastore methods */ treeDatastore: any; /** * various helper modules */ utils: any; /** * returns the version of dhtmlxGantt */ version: string; /** * specifies XML serialization and parsing */ xml: any; /** * Promise object constructor * @param executor a callback used to initialize the promise */ Promise: new (executor: (resolve: (value?: any) => void, reject: (reason?: any) => void) => void) => Promise<unknown>; /** * adds a calendar into Gantt * @param calendar an object with configuration of the calendar */ addCalendar(calendar: any): number; /** * adds a new dependency link * @param link the link object */ addLink(link: any): string|number; /** * displays an additional layer with custom elements for a link in the timeline area * @param func a render function or a config object */ addLinkLayer(func: any): string; /** * adds a marker to the timeline area * @param marker the marker's configuration object */ addMarker(marker: any): string; /** * adds a new keyboard shortcut * @param shortcut the key name or the name of keys combination for a shortcut (<a href="desktop/keyboard_navigation.md#shortcutsyntax">shortcut syntax</a>) * @param handler the handler of the shortcut call * @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>) */ addShortcut(shortcut: string, handler: GanttCallback, scope: string): void; /** * adds a new task * @param task the task object * @param parent optional, optional, the parent's id * @param index optional, optional, the position the task will be added into (0 or greater) */ addTask(task: any, parent?: string|number, index?: number): string|number; /** * displays an additional layer with custom elements for a task in the timeline area * @param func a render function or a config object */ addTaskLayer(func: any): string; /** * calls an alert message box * @param config the alert box's configuration */ alert(config: any): HTMLElement; /** * if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen * @param expression true to assert the expression, false - if assertion fails * @param errorMessage an error message that will be shown in the red popup */ assert(expression: boolean, errorMessage: string): void; /** * attaches the handler to an inner event of dhtmlxGantt * @param name the event's name, case-insensitive * @param handler the handler function * @param settings optional, an <a href="#propertiesofsettingsobject">object with settings</a> for the event handler */ attachEvent(name: GanttEventName, handler: GanttCallback, settings: any): string; /** * recalculates the schedule of the project * @param taskId optional, optional, the task id */ autoSchedule(taskId?: string|number): void; /** * updates multiple tasks/links at once * @param callback the callback function */ batchUpdate(callback: GanttCallback): void; /** * creates a new function that, when called, has its <i>this</i> keyword set to the provided value * @param method the target function * @param thisArg the value to be passed as the <i>this</i> parameter to the target function when the bound function is called */ bind(method: GanttCallback, thisArg: any): GanttCallback; /** * calculates the duration of a task * @param config the <a href="#configurationobjectproperties">configuration object</a> of a time span */ calculateDuration(config: any): number; /** * calculates the end date of a task * @param config the <a href="#configurationobjectproperties">configuration object</a> of a time span */ calculateEndDate(config: any): Date; /** * calculates the level of nesting of a task * @param task the task's object */ calculateTaskLevel(task: any): number; /** * calls an inner event * @param name the event's name, case-insensitive * @param params an array of the event-related data */ callEvent(name: string, params: any[]): boolean; /** * repaints the lighbox for the task according to its type * @param type the task type */ changeLightboxType(type: string): void; /** * changes the link's id * @param id the current link's id * @param new_id the new link's id */ changeLinkId(id: string|number, new_id: string|number): void; /** * changes the task's id * @param id the current task's id * @param new_id the new task's id */ changeTaskId(id: string|number, new_id: string|number): void; /** * checks whether an event has some handler(s) specified * @param name the event's name */ checkEvent(name: GanttEventName): boolean; /** * removes all tasks and additional elements (including markers) from the Gantt chart */ clearAll(): void; /** * clears the stack of stored redo commands */ clearRedoStack(): void; /** * clears the stack of stored undo commands */ clearUndoStack(): void; /** * closes the branch with the specified id * @param id the branch id */ close(id: string|number): void; /** * collapses gantt from the full screen mode to the normal mode */ collapse(): void; /** * returns the index of the column by the date * @param date a date object */ columnIndexByDate(date: Date): number; /** * calls a confirm message box * @param config the confirm box's configuration */ confirm(config: any): HTMLElement; /** * creates a deep copy of provided object * @param task the object that needs to be copied */ copy(task: any): any; /** * recalculates the task duration in the work time * @param task the task's object */ correctTaskWorkTime(task: any): void; /** * creates a working calendar * @param parentCalendar optional, (optional) an existing calendar that is used for creating a new one on the base of it */ createCalendar(parentCalendar?: any): void; /** * creates a new dataProcessor instance and attaches it to gantt * @param config dataProcessor configuration object */ createDataProcessor(config: any): any; /** * creates a datastore according to the provided configuration * @param config a configuration object of a datastore */ createDatastore(config: any): void; /** * adds a new task and opens the lightbox to confirm * @param task the task object * @param parent the parent's id * @param index optional, optional, the position the task will be added into (0 or greater) */ createTask(task: any, parent: string, index?: number): string|number; /** * dataProcessor constructor * @param url url to the data feed */ dataProcessor(url: string): void; /** * gets the date of the specified horizontal position in the chart area * @param pos the relative horizontal position you want to know the date of */ dateFromPos(pos: number): Date; /** * returns false if the provided argument is undefined, otherwise true * @param task the object that should be checked */ defined(task: any): boolean; /** * deletes a task calendar by its id * @param id the id of the calendar */ deleteCalendar(id: string|number): void; /** * deletes the specified dependency link * @param id the dependency link's id */ deleteLink(id: string|number): void; /** * deletes the specified marker * @param markerId the marker's id */ deleteMarker(markerId: string): void; /** * deletes the specified task * @param id the task's id */ deleteTask(id: string|number): void; /** * destroys the gantt instance */ destructor(): void; /** * detaches all events from dhtmlxGantt (both custom and inner ones) */ detachAllEvents(): void; /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param id the event's id */ detachEvent(id: string): void; /** * iterates over all parent tasks of the specified task in the Gantt chart * @param code a function that will iterate over tasks. Takes a task object as a parameter * @param startTask the id of the item the parent tasks of which should be iterated over * @param master optional, the object, that 'this' will refer to */ eachParent(code: GanttCallback, startTask: string|number, master?: any): void; /** * iterates over all selected tasks in the Gantt chart * @param code a function that will iterate over tasks. Takes a task id as a parameter */ eachSelectedTask(code: GanttCallback): void; /** * iterates over all child tasks of a specific task or the of whole Gantt chart * @param code a function that will iterate over tasks. Takes a task object as a parameter * @param parent optional, the parent id. If specified, the function will iterate over children of the <br> specified parent * @param master optional, the object, that 'this' will refer to */ eachTask(code: GanttCallback, parent?: string|number, master?: any): void; /** * attaches an event handler to an HTML element * @param node the HTML node or its id * @param event the name of an HTML event (without the 'on' prefix) * @param handler the event handler * @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> */ event(node: HTMLElement|string, event: string, handler: GanttCallback, options?: any): void; /** * removes an event handler from an HTML element * @param node the HTML node or its id * @param event the name of an HTML event (without the 'on' prefix) * @param handler the event handler * @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> */ eventRemove(node: HTMLElement|string, event: string, handler: GanttCallback, options?: any): void; /** * expands gantt to the full screen mode */ expand(): void; /** * exports data from the Gantt chart to an Excel document * @param _export_ an object with export settings (see the details) */ exportToExcel(_export_: any): void; /** * exports data from the Gantt chart to an iCal string * @param _export_ an object with export settings (see the details) */ exportToICal(_export_: any): void; /** * exports the structure and data of a Gantt chart into a JSON object * @param config an object with Gantt configuration */ exportToJSON(config: any): void; /** * exports data from the Gantt chart to MS Project * @param _export_ an object with export settings (see the details) */ exportToMSProject(_export_: any): void; /** * exports a Gantt chart into the PDF format * @param _export_ an object with export settings (see the details) */ exportToPDF(_export_: any): void; /** * exports a Gantt chart into the PNG format * @param _export_ an object with export settings (see the details) */ exportToPNG(_export_: any): void; /** * exports data from the Gantt chart to Primavera P6 * @param _export_ an object with export settings (see the details) */ exportToPrimaveraP6(_export_: any): void; /** * returns all dependency loops in the chart */ findCycles(): any[]; /** * sets focus on the gantt */ focus(): void; /** * gets worktime calendar by id * @param calendarId the id of the global calendar or "global" */ getCalendar(calendarId: string|number): any; /** * gets all the calendars added into Gantt */ getCalendars(): any[]; /** * returns the 1st-level child tasks of the specified parent branch * @param id the parent branch's id */ getChildren(id: string|number): any[];