forked from n4kz/react-native-material-textfield
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.d.ts
122 lines (99 loc) · 2.64 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Type definitions for react-native-material-textfield 0.16
// Project: https://github.com/n4kz/react-native-material-textfield
// Definitions by: Ville Venäläinen <https://github.com/mindhivefi>
// Kyle Roach <https://github.com/iRoachie>
// Deividi Cavarzan <https://github.com/cavarzan>
// Neel bhasin <https://github.com/neelb2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
import {
StyleProp,
TextInputProps,
TextStyle,
ViewStyle,
} from 'react-native';
export interface ContentInset {
top?: number;
label?: number;
input?: number;
left?: number;
right?: number;
}
export interface TextFieldProps extends TextInputProps {
animationDuration?: number;
animationOffset?: number;
fontSize?: number;
labelFontSize?: number;
contentInset?: ContentInset;
style?: StyleProp<TextStyle>;
labelTextStyle?: StyleProp<TextStyle>;
titleTextStyle?: StyleProp<TextStyle>;
affixTextStyle?: StyleProp<TextStyle>;
tintColor?: string;
textColor?: string;
baseColor?: string;
label?: string;
title?: string;
characterRestriction?: number;
error?: string;
errorColor?: string;
errortTestId?: string;
lineWidth?: number;
activeLineWidth?: number;
disabled?: boolean;
disabledLineWidth?: number;
clearTextOnFocus?: boolean;
prefix?: string;
suffix?: string;
containerStyle?: StyleProp<ViewStyle>;
inputContainerStyle?: StyleProp<ViewStyle>;
onPress?(event: Event): void;
onChangeText?(text: string): void;
renderLeftAccessory?(): JSX.Element | boolean;
renderRightAccessory?(): JSX.Element | boolean;
disableLabelAnimation?: boolean;
lineType?: 'solid' | 'dotted' | 'dashed' | 'none';
disabledLineType?: 'solid' | 'dotted' | 'dashed' | 'none';
editable?: boolean;
multiline?: boolean;
formatText?(text: string): string;
}
/**
* Material Style Text Field
* @see https://github.com/n4kz/react-native-material-textfield/blob/master/src/components/field/index.js
*/
export class TextField extends React.Component<TextFieldProps, any> {
/*
* Acquire focus
*/
focus(): void;
/*
* Release focus
*/
blur(): void;
/*
* Clear text field
*/
clear(): void;
/*
* Get current value
*/
value(): string;
/*
* Get current focus state
*/
isFocused(): boolean;
/*
* Get current restriction state
*/
isRestricted(): boolean;
/*
* Set current value
*/
setValue(value?: string): void;
focused: boolean;
mounted: boolean;
}
export class OutlinedTextField extends TextField {}
export class FilledTextField extends TextField {}