From 6e78cc48a4bc0ef13cc443ca3291e441fa561b33 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Mon, 15 May 2017 13:23:49 -0400 Subject: [PATCH] Remove react-day-picker typings --- notNeededPackages.json | 6 + types/react-day-picker/index.d.ts | 165 ------------------ .../react-day-picker-tests.tsx | 52 ------ types/react-day-picker/tsconfig.json | 24 --- types/react-day-picker/tslint.json | 3 - 5 files changed, 6 insertions(+), 244 deletions(-) delete mode 100644 types/react-day-picker/index.d.ts delete mode 100644 types/react-day-picker/react-day-picker-tests.tsx delete mode 100644 types/react-day-picker/tsconfig.json delete mode 100644 types/react-day-picker/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index ca42f4d9f5..25205b3c04 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -402,6 +402,12 @@ "sourceRepoURL": "https://github.com/getsentry/raven-js", "asOfVersion": "3.10.0" }, + { + "libraryName": "react-day-picker", + "typingsPackageName": "react-day-picker", + "sourceRepoURL": "https://github.com/gpbl/react-day-picker", + "asOfVersion": "5.3.0" + }, { "libraryName": "Redux", "typingsPackageName": "redux", diff --git a/types/react-day-picker/index.d.ts b/types/react-day-picker/index.d.ts deleted file mode 100644 index 8dc5fcd12e..0000000000 --- a/types/react-day-picker/index.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Type definitions for react-day-picker 5.2 -// Project: https://github.com/gpbl/react-day-picker -// Definitions by: Giampaolo Bellavite , Jason Killian -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -import * as React from 'react'; - -declare namespace DayPicker { - interface LocaleUtils { - formatDay(day: Date, locale: string): string; - formatMonthTitle(month: Date, locale: string): string; - formatWeekdayLong(weekday: number, locale: string): string; - formatWeekdayShort(weekday: number, locale: string): string; - getFirstDayOfWeek(locale: string): number; - getMonths(locale: string): [string, string, string, string, string, string, string, string, string, string, string, string]; - } - - interface DateUtils { - addMonths(d: Date, n: number): Date; - clone(d: Date): Date; - isSameDay(d1: Date, d2: Date): Date; - isPastDay(d: Date): boolean; - isFutureDay(d: Date): boolean; - isDayBetween(day: Date, begin: Date, end: Date): boolean; - addDayToRange(day: Date, range: RangeModifier): RangeModifier; - isDayInRange(day: Date, range: RangeModifier): boolean; - } - - interface CaptionElementProps { - date: Date; - classNames: ClassNames; - localeUtils: LocaleUtils; - locale: string; - months: undefined; - onClick?: React.MouseEventHandler; - } - - interface NavbarElementProps { - className: string; - classNames: ClassNames; - previousMonth: Date; - nextMonth: Date; - showPreviousButton: boolean; - showNextButton: boolean; - onPreviousClick(callback?: () => void): void; - onNextClick(callback?: () => void): void; - dir?: string; - labels: { previousMonth: string; nextMonth: string; }; - localeUtils: LocaleUtils; - locale: string; - } - - interface WeekdayElementProps { - weekday: number; - className: string; - localeUtils: LocaleUtils; - locale: string; - } - - interface ClassNames { - container: string; - interactionDisabled: string; - navBar: string; - navButtonPrev: string; - navButtonNext: string; - - month: string; - caption: string; - weekdays: string; - weekdaysRow: string; - weekday: string; - body: string; - week: string; - day: string; - - today: string; - selected: string; - disabled: string; - outside: string; - } - - interface RangeModifier { - from: Date; - to: Date; - } - interface BeforeModifier { - before: Date; - } - interface AfterModifier { - after: Date; - } - type FunctionModifier = (date: Date) => boolean; - type Modifier = Date | RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; - - interface Modifiers { - today: Modifier | Modifier[]; - outside: Modifier | Modifier[]; - [other: string]: Modifier | Modifier[] | undefined; - } - - interface Props { - canChangeMonth?: boolean; - captionElement?: React.ReactElement> | - React.ComponentClass | - React.SFC; - className?: string; - classNames?: ClassNames; - containerProps?: React.HTMLAttributes; - disabledDays?: Modifier | Modifier[]; - enableOutsideDays?: boolean; - firstDayOfWeek?: number; - fixedWeeks?: boolean; - fromMonth?: Date; - initialMonth?: Date; - labels?: { previousMonth: string; nextMonth: string; }; - locale?: string; - localeUtils?: LocaleUtils; - modifiers?: Partial; - month?: Date; - months?: [string, string, string, string, string, string, string, string, string, string, string, string]; - navbarElement?: React.ReactElement> | - React.ComponentClass | - React.SFC; - numberOfMonths?: number; - onBlur?(e: React.FocusEvent): void; - onCaptionClick?(month: Date, e: React.MouseEvent): void; - onDayClick?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayKeyDown?(day: Date, modifiers: Modifiers, e: React.KeyboardEvent): void; - onDayMouseEnter?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayMouseLeave?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayTouchEnd?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; - onDayTouchStart?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; - onFocus?(e: React.FocusEvent): void; - onKeyDown?(e: React.KeyboardEvent): void; - onMonthChange?(month: Date): void; - pagedNavigation?: boolean; - renderDay?(date: Date, modifiers: Modifiers): React.ReactNode; - reverseMonths?: boolean; - selectedDays?: Modifier | Modifier[]; - toMonth?: Date; - weekdayElement?: React.ReactElement> | - React.ComponentClass | - React.SFC; - weekdaysLong?: [string, string, string, string, string, string, string]; - weekdaysShort?: [string, string, string, string, string, string, string]; - } - const VERSION: string; - const LocaleUtils: DayPicker.LocaleUtils; - const DateUtils: DayPicker.DateUtils; -} - -declare class DayPicker extends React.Component { - showMonth(month: Date): void; - - showPreviousMonth(): void; - - showNextMonth(): void; - - showPreviousYear(): void; - - showNextYear(): void; -} - -export = DayPicker; diff --git a/types/react-day-picker/react-day-picker-tests.tsx b/types/react-day-picker/react-day-picker-tests.tsx deleted file mode 100644 index 1733b713dd..0000000000 --- a/types/react-day-picker/react-day-picker-tests.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import * as React from 'react'; -import DayPicker = require('react-day-picker'); - -function isSunday(day: Date) { - return day.getDay() === 0; -} - -function MyComponent() { - return ( - - ); -} -DayPicker.DateUtils.clone(new Date()); -DayPicker.DateUtils.isDayInRange(new Date(), { from: new Date(), to: new Date(2050) }); - -interface MyCaptionProps extends DayPicker.CaptionElementProps { - myProp: number; -} -class Caption extends React.Component { - render() { - const { date, locale, localeUtils, onClick } = this.props; - - if (!date || !localeUtils || !onClick || typeof locale === 'undefined') { - return null; - } - - return ( -
- { localeUtils.formatMonthTitle(date, locale) } -
- ); - } -} -; - -type CaptionElementProps = Partial; -class CaptionElement extends React.Component { - render() { - const { date, locale, localeUtils, onClick } = this.props; - if (!date || !locale || !localeUtils || !onClick) { - return
; - } - return ( -
- { localeUtils.formatMonthTitle(date, locale) } -
- ); - } -} - }/>; diff --git a/types/react-day-picker/tsconfig.json b/types/react-day-picker/tsconfig.json deleted file mode 100644 index 823be84e03..0000000000 --- a/types/react-day-picker/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "jsx": "react", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "react-day-picker-tests.tsx" - ] -} diff --git a/types/react-day-picker/tslint.json b/types/react-day-picker/tslint.json deleted file mode 100644 index d88586e5bd..0000000000 --- a/types/react-day-picker/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -}