Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/frappe-gantt/frappe-gantt-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const gantt1 = new Gantt('#gantt', tasks);
const gantt2 = new Gantt(new HTMLElement(), tasks);
const gantt3 = new Gantt(new SVGElement(), tasks);

gantt1.change_view_mode('Week');
gantt1.change_view_mode(Gantt.VIEW_MODE.WEEK);
gantt1.refresh(tasks);

new Gantt('#gantt', tasks, {
Expand Down
13 changes: 10 additions & 3 deletions types/frappe-gantt/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Type definitions for frappe-gantt 0.4
// Type definitions for frappe-gantt 0.6
// Project: https://github.com/frappe/gantt
// Definitions by: Sam Alexander <https://github.com/samalexander>, Elijah Lucian <https://github.com/eli7vh>
// Definitions by: Sam Alexander <https://github.com/samalexander>,
// Elijah Lucian <https://github.com/eli7vh>,
// R2C <https://github.com/zhengruncai>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = Gantt;
Expand All @@ -27,6 +29,7 @@ declare namespace Gantt {
_start: Date;
_end: Date;
_index: number;
invalid?: boolean | undefined;
}

interface Options {
Expand All @@ -48,5 +51,9 @@ declare namespace Gantt {
on_view_change?: ((mode: viewMode) => void) | undefined;
}

type viewMode = 'Quarter Day' | 'Half Day' | 'Day' | 'Week' | 'Month';
type viewMode = 'Quarter Day' | 'Half Day' | 'Day' | 'Week' | 'Month' | 'Year';

type viewModeKey = 'QUARTER_DAY' | 'HALF_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';

const VIEW_MODE: Record<viewModeKey, viewMode>;
}