mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
[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
This commit is contained in:
committed by
Pranav Senthilnathan
parent
8a86268b66
commit
caaf192478
Vendored
+4
-1
@@ -2,13 +2,16 @@
|
||||
// Project: https://github.com/coderhaoxin/react-flatpickr
|
||||
// Definitions by: begincalendar <https://github.com/begincalendar>
|
||||
// snaveevans <https://github.com/snaveevans>
|
||||
// rigothedev <https://github.com/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<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
export interface DateTimePickerProps extends Omit<Partial<HTMLInputElement>, 'value'> {
|
||||
defaultValue?: string;
|
||||
options?: flatpickr.Options.Options;
|
||||
onChange?: flatpickr.Options.Hook;
|
||||
|
||||
@@ -42,3 +42,5 @@ const valueDateArrayElement = (
|
||||
const valueNumberArrayElement = (
|
||||
<DatePicker value={[1543516477474, 1544549477474]} />
|
||||
);
|
||||
|
||||
const extraInputPropertiesElement = <DatePicker placeholder="Enter a date..." id="datepicker-1" />;
|
||||
|
||||
Reference in New Issue
Block a user