From caaf192478df01ae59e5850db34fb3cd169f4370 Mon Sep 17 00:00:00 2001 From: Rigoberto Molina Date: Fri, 26 Apr 2019 13:00:35 -0700 Subject: [PATCH] [react-flatpickr]: Allow extra properties in DateTimePickerProps (#34979) * Allow extra properties in DateTimePickerProps * Tests for extra properties in DateTimePickerProps * Add myself to authors * Update index.d.ts * Partially extend HTMLInputElement * Update index.d.ts * Update index.d.ts --- types/react-flatpickr/index.d.ts | 5 ++++- types/react-flatpickr/react-flatpickr-tests.tsx | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 0ec95e5159..9d070494b4 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -2,13 +2,16 @@ // Project: https://github.com/coderhaoxin/react-flatpickr // Definitions by: begincalendar // snaveevans +// rigothedev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import { Component } from "react"; import flatpickr from "flatpickr"; -export interface DateTimePickerProps { +export type Omit = Pick>; + +export interface DateTimePickerProps extends Omit, 'value'> { defaultValue?: string; options?: flatpickr.Options.Options; onChange?: flatpickr.Options.Hook; diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index b80fd83888..cbad38fd58 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -42,3 +42,5 @@ const valueDateArrayElement = ( const valueNumberArrayElement = ( ); + +const extraInputPropertiesElement = ;