Open dakshineshwar opened 6 years ago
Can you help me to add types def.
` declare module 'gantt-for-react' { import { Component, ReactNode } from 'react';
export interface Task {
id: number;
name: string;
start: Date;
end: Date;
progress?: number;
dependencies?: number[];
custom_class?: string;
}
export type ViewMode = 'Quarter Day' | 'Half Day' | 'Day' | 'Week' | 'Month';
export type PopupHtmlFunction = (task: Task) => ReactNode;
export interface GanttProps {
tasks: Task[];
viewMode: ViewMode;
customPopupHtml?: string | PopupHtmlFunction;
onClick?: (task: Task) => void;
onDateChange?: (task: Task, start: Date, end: Date) => void;
onProgressChange?: (task: Task, progress: number) => void;
onViewChange?: (mode: ViewMode) => void;
}
export class Gantt extends Component<GanttProps> {}
} `
Something like this
add gantt-for-react.d.ts and it should be done
@hustcc Please suggest the solution to work with tsx file.