forked from alioguzhan/react-editext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
87 lines (82 loc) · 2.86 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
declare module 'react-editext' {
import * as React from 'react';
export type EdiTextType = "text" | "textarea" | "email" | "number" | "date" | "datetime-local" | "time" | "month" | "url" | "week" | "tel";
export interface EdiTextProps {
/**
* Props to be passed to input element.
* Any kind of valid DOM attributes are welcome
*/
inputProps?: Object;
/**
* Props to be passed to div element that shows the text.
* You can specify your own `styles` or `className`
*/
viewProps?: Object;
/**
* Value of the content [in view mode] and input [in edit mode]
*/
value: string;
/**
* A simple hint message appears at the bottom of input element.
* Any valid element is allowed.
*/
hint?: React.ReactNode;
/**
If validation fails this message will appear
*/
validationMessage?: string;
/** Pass your own validation function.
* takes one param -> `value`.
* It must return `true` or `false`
*/
validation?: (...args: string[]) => boolean;
/**
* will be called when validation fails.
* takes one param <value> which is the current value of input
*/
onValidationFail?: (...args: string[]) => any;
/**
* Input type. Possible options are:
* `text`, `number`, `email`, `textarea`, `date`,
* `datetime-local`, `time`, `month`, `url`, `week`, `tel`
*/
type: EdiTextType;
/**
* will be called when user clicked cancel button
*/
onCancel?: (...args: any[]) => any;
/**
* will be called when user clicked save button.
* takes one param <value> which is the current value of input
*/
onSave: (...args: string[]) => any;
/**
* Custom class name for SAVE button.
* */
saveButtonClassName?: string;
/**
* Custom class name for EDIT button.
* */
editButtonClassName?: string;
/**
* Custom class name for CANCEL button. */
cancelButtonClassName?: string;
/**
* Content for CANCEL button. Any valid element and node are allowed. */
cancelButtonContent?: any;
/**
* Content for SAVE button. Any valid element and node are allowed. */
saveButtonContent?: any;
/**
* Content for EDIT button. Any valid element and node are allowed. */
editButtonContent?: any;
/**
* Set it to `true` if you don't want to see default icons
* on action buttons.See Examples page for more details.
*/
hideIcons?: boolean;
}
export default class EdiText extends React.Component<EdiTextProps, any> {
render(): JSX.Element;
}
}