1+ // Type definitions for react-code-input 3.8.2
2+ // Project: React Code Input
3+ // Definitions by: Siraj Alam https://github.com/sirajalam049
4+
5+ import React , { Component } from 'react' ;
6+
7+ export type InputModeTypes =
8+ 'verbatim' | 'latin' | 'latin-name' | 'latin-prose' |
9+ 'full-width-latin' | 'kana' | 'kana-name' | 'katakana' |
10+ 'numeric' | 'tel' | 'email' | 'url'
11+
12+ export interface ReactCodeInputProps {
13+
14+ // Type of input accept
15+ type ?: 'text' | 'number' | 'password' | 'tel'
16+
17+ // Allowed amount of characters to enter.
18+ fields ?: number
19+
20+ // Value of the input
21+ value ?: string
22+
23+ // Get the full value of the input on every change
24+ onChange ?: ( value : string ) => void
25+
26+ // Setting the name of component.
27+ name : string
28+
29+ // Marks the given fields as "touched" to show errors.
30+ touch ?: ( name : string ) => void
31+
32+ // Clears the "touched" flag for the given fields.
33+ untouch ?: ( name : string ) => void
34+
35+ // Add classname to the root element.
36+ className ?: string
37+
38+ isValid ?: boolean
39+
40+ // When present, it specifies that the element should be disabled.
41+ disabled ?: boolean
42+
43+ // Setting the styles of container element.
44+ style ?: React . CSSProperties
45+
46+ // Setting the styles of each input field.
47+ inputStyle ?: React . CSSProperties
48+
49+ // Setting the styles of each input field if isValid prop is false.
50+ inputStyleInvalid ?: React . CSSProperties
51+
52+ // Setup autofocus on the first input, true by default.
53+ autoFocus ?: boolean
54+
55+ //
56+ forceUppercase ?: boolean
57+
58+ // Filter characters on key down.
59+ filterKeyCodes ?: Array < number >
60+
61+ // Filter characters.
62+ filterChars ?: Array < string >
63+
64+ // The pattern prop specifies a regular expression that the element's value is checked against.
65+ pattern ?: string
66+
67+ // The inputMode prop tells the browser on devices with dynamic keyboards which keyboard to display.
68+ inputMode : InputModeTypes
69+
70+ }
71+
72+ declare class ReactCodeInput extends Component < ReactCodeInputProps , any > {
73+ constructor ( props : ReactCodeInputProps ) ;
74+ }
75+
76+ export default ReactCodeInput
0 commit comments