Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not working with tsx file. #7

Open
dakshineshwar opened this issue Jun 22, 2018 · 2 comments
Open

It is not working with tsx file. #7

dakshineshwar opened this issue Jun 22, 2018 · 2 comments

Comments

@dakshineshwar
Copy link

dakshineshwar commented Jun 22, 2018

@hustcc Please suggest the solution to work with tsx file.

@hustcc
Copy link
Owner

hustcc commented Aug 1, 2018

Can you help me to add types def.

@mariobdom
Copy link

`
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants