source: node_modules/react-debounce-input/src/index.d.ts@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[d24f17c]1/*
2 * check usage examples in ./example/typescript-example.tsx
3 */
4
5import * as React from 'react';
6
7interface PropConstraints<T> {
8 readonly value?: string | number;
9 readonly onChange: React.ChangeEventHandler<T>;
10}
11
12export type DebounceInputProps<WrappedComponent, WrappedComponentProps> = WrappedComponentProps & {
13 readonly element?: string | React.ComponentType<PropConstraints<WrappedComponent>>;
14 readonly type?: string;
15 readonly onChange: React.ChangeEventHandler<WrappedComponent>;
16 readonly onKeyDown?: React.KeyboardEventHandler<WrappedComponent>;
17 readonly onBlur?: React.FocusEventHandler<WrappedComponent>;
18 readonly value?: string | number;
19 readonly placeholder?: string | number;
20 readonly minLength?: number;
21 readonly debounceTimeout?: number;
22 readonly forceNotifyByEnter?: boolean;
23 readonly forceNotifyOnBlur?: boolean;
24 readonly inputRef?: React.Ref<WrappedComponent>;
25};
26
27export declare class DebounceInput<
28 WrappedComponent = HTMLInputElement,
29 WrappedComponentProps = React.InputHTMLAttributes<HTMLInputElement>
30> extends React.PureComponent<DebounceInputProps<WrappedComponent, WrappedComponentProps>> {
31
32}
33
34export type Debounced<
35 WrappedComponent,
36 WrappedComponentProps
37> = React.ComponentType<DebounceInputProps<WrappedComponent, WrappedComponentProps>>;
38
39export type DebounceTextArea = Debounced<
40 HTMLTextAreaElement,
41 React.TextareaHTMLAttributes<HTMLTextAreaElement>
42>;
Note: See TracBrowser for help on using the repository browser.