mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Correct onSelect signature for unenhanced calendars
This commit is contained in:
+16
-7
@@ -8,6 +8,21 @@ import * as React from 'react';
|
||||
|
||||
export type DateType = Date | string | number;
|
||||
|
||||
export enum EVENT_TYPE {
|
||||
START = 1,
|
||||
HOVER,
|
||||
END
|
||||
}
|
||||
|
||||
export interface RangedSelection {
|
||||
eventType: EVENT_TYPE;
|
||||
start: Date;
|
||||
end: Date;
|
||||
}
|
||||
|
||||
type RangedSelectFunction = (rangedDate: RangedSelection) => void;
|
||||
type DateSelectFunction = (date: string) => void;
|
||||
|
||||
export interface ReactInfiniteCalendarProps {
|
||||
selected?: DateType | false | { start: DateType; end: DateType };
|
||||
width?: number | 'auto' | '100%';
|
||||
@@ -57,7 +72,7 @@ export interface ReactInfiniteCalendarProps {
|
||||
weekdayColor?: string;
|
||||
};
|
||||
className?: string;
|
||||
onSelect?: (date: string | { eventType: EVENT_TYPE; start: Date; end: Date }) => void;
|
||||
onSelect?: DateSelectFunction | RangedSelectFunction;
|
||||
onScroll?: (scrollTop: number) => void;
|
||||
onScrollEnd?: (scrollTop: number) => void;
|
||||
rowHeight?: number;
|
||||
@@ -75,10 +90,4 @@ export function withMultipleDates(component: CalendarClass): CalendarClass;
|
||||
export function withKeyboardSupport(component: CalendarClass): CalendarClass;
|
||||
export function defaultMultipleDateInterpolation(component: CalendarClass): CalendarClass;
|
||||
|
||||
export enum EVENT_TYPE {
|
||||
START = 1,
|
||||
HOVER,
|
||||
END
|
||||
}
|
||||
|
||||
export default class ReactInfiniteCalendar extends React.Component<ReactInfiniteCalendarProps> {}
|
||||
|
||||
Reference in New Issue
Block a user