From c71a29462ab69c985bbfa68bf270d30be58b764e Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 20 Apr 2017 12:05:03 +1000 Subject: [PATCH] Created definitions for "react-flatpickr" v3.2. (#15933) --- types/react-flatpickr/index.d.ts | 17 +++++++++++++ .../react-flatpickr/react-flatpickr-tests.tsx | 20 ++++++++++++++++ types/react-flatpickr/tsconfig.json | 24 +++++++++++++++++++ types/react-flatpickr/tslint.json | 1 + 4 files changed, 62 insertions(+) create mode 100644 types/react-flatpickr/index.d.ts create mode 100644 types/react-flatpickr/react-flatpickr-tests.tsx create mode 100644 types/react-flatpickr/tsconfig.json create mode 100644 types/react-flatpickr/tslint.json diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts new file mode 100644 index 0000000000..8d77c689cb --- /dev/null +++ b/types/react-flatpickr/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for react-flatpickr 3.2 +// Project: https://github.com/coderhaoxin/react-flatpickr +// Definitions by: begincalendar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Component } from 'react'; +import { EventCallback, Options } from 'flatpickr'; + +export interface DateTimePickerProps { + defaultValue?: string; + options?: Options; + onChange?: EventCallback; + value?: string; +} + +export default class DatePicker extends Component {} diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx new file mode 100644 index 0000000000..948b65e84e --- /dev/null +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -0,0 +1,20 @@ +import * as Flatpickr from 'flatpickr'; +import * as React from 'react'; +import DatePicker from 'react-flatpickr'; + +const noParamsElement = ; + +const defaultValueElement = ; + +const options = { + dateFormat: 'YYYY-MM-DD' +}; +const optionsElement = ; + +const onChange = ( + selectedDates: Date[], dateStr: string, instance: Flatpickr, + elem: HTMLElement +) => null; +const onChangeElement = ; + +const valueElement = ; diff --git a/types/react-flatpickr/tsconfig.json b/types/react-flatpickr/tsconfig.json new file mode 100644 index 0000000000..ea43a6c994 --- /dev/null +++ b/types/react-flatpickr/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "jsx": "react", + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-flatpickr-tests.tsx" + ] +} diff --git a/types/react-flatpickr/tslint.json b/types/react-flatpickr/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-flatpickr/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }