@intuitionrobotics/thunderstorm
Version:
44 lines (43 loc) • 1.28 kB
TypeScript
import * as React from 'react';
import { Stylable } from "../tools/Stylable";
export type TS_InputProps<Key> = Stylable & {
onChange: (value: string, id: Key) => void;
onAccept?: () => void;
onCancel?: () => void;
onBlur?: () => void;
handleKeyEvent?: (e: KeyboardEvent) => void;
value?: string;
type: 'text' | 'number' | 'password';
name?: string;
placeholder?: string;
id: Key;
focus?: boolean;
spellCheck?: boolean;
};
type State = {
id: string;
name?: string;
initialValue?: string;
value?: string;
};
export declare class TS_Input<Key extends string = string> extends React.Component<TS_InputProps<Key>, State> {
private ref?;
private clickedTimestamp?;
private timeout?;
constructor(props: TS_InputProps<Key>);
private static getInitialState;
static getDerivedStateFromProps(props: TS_InputProps<any>, state: State): {
id: any;
name: string | undefined;
initialValue: string | undefined;
value: string;
} | {
value: string | undefined;
};
componentWillUnmount(): void;
private handleKeyEvent;
private onClick;
changeValue: (event: React.ChangeEvent<HTMLInputElement>) => void;
render(): React.JSX.Element;
}
export {};