diff --git a/types/react-infinite-calendar/index.d.ts b/types/react-infinite-calendar/index.d.ts new file mode 100644 index 0000000000..8a1adbff14 --- /dev/null +++ b/types/react-infinite-calendar/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for react-infinite-calendar 2.3 +// Project: https://github.com/clauderic/react-infinite-calendar +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactInfiniteCalendarProps { + selected?: Date | boolean; + width?: number; + height?: number; + min?: Date; + max?: Date; + minDate?: Date; + maxDate?: Date; + disabledDays?: Array<0 | 1 | 2 | 3 | 4 | 5 | 6>; + disabledDates?: Date[]; + display?: 'days' | 'years'; + displayOptions?: { + hideYearsOnSelect?: boolean; + layout?: 'portrait' | 'landscape'; + overscanMonthCount?: number; + shouldHeaderAnimate?: boolean; + showHeader?: boolean; + showMonthsForYears?: boolean; + showOverlay?: boolean; + showTodayHelper?: boolean; + showWeekdays?: boolean; + todayHelperRowOffset?: number; + }; + locale?: { + blank?: string; + headerFormat?: string; + todayLabel?: { + long: string; + }; + weekdays?: string[]; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + }; + theme?: { + accentColor?: string; + floatingNav: { + background?: string; + chevron?: string; + color?: string; + }; + headerColor?: string; + selectionColor?: string; + textColor?: { + active?: string; + default?: string; + }; + todayColor?: string; + weekdayColor?: string; + }; + className?: string; + onSelect?: () => void; + onScroll?: (scrollTop: number) => void; + onScrollEnd?: (scrollTop: number) => void; + rowHeight?: number; + autoFocus?: boolean; + tabIndex?: number; +} + +export default class ReactInfiniteCalendar extends React.Component {} diff --git a/types/react-infinite-calendar/react-infinite-calendar-tests.tsx b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx new file mode 100644 index 0000000000..ff1918d539 --- /dev/null +++ b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx @@ -0,0 +1,61 @@ +import * as React from 'react'; +import ReactInfiniteCalendar from 'react-infinite-calendar'; + +const test: React.SFC = () => ( + {}} + onScroll={(scrollTop: number) => { console.log(scrollTop); }} + onScrollEnd={(scrollTop: number) => { console.log(scrollTop); }} + rowHeight={40} + autoFocus={false} + tabIndex={1} + /> +); diff --git a/types/react-infinite-calendar/tsconfig.json b/types/react-infinite-calendar/tsconfig.json new file mode 100644 index 0000000000..bf57e148ca --- /dev/null +++ b/types/react-infinite-calendar/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-infinite-calendar-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-infinite-calendar/tslint.json b/types/react-infinite-calendar/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-infinite-calendar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file