year-calendar / js-year-calendar

A fully customizable year calendar widget
https://year-calendar.github.io/
Apache License 2.0
194 stars 71 forks source link

Wrong DataSource typing #81

Open julianklose opened 2 years ago

julianklose commented 2 years ago

The DataSource typ in the options and in the setDataSource method is: T[] | ((currentYear: number) => T[] | Promise<T[]>) | ((currentYear: number, done: (result: T[]) => void) => void) But the fetch parameters are: { year: number, startDate: Date, endDate: Date }

So there should be an interface DateSourceFetchParameters and the DataSource type should be: T[] | ((params: DateSourceFetchParameters) => T[] | Promise<T[]>) | ((params: DateSourceFetchParameters, done: (result: T[]) => void) => void)