forked from attently/riek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
123 lines (103 loc) · 3.36 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
123
declare module 'rieke' {
import {ReactElement} from "react";
import * as React from "react";
export interface IRIETagProps {
text: string;
removeHandler?: Function;
className?: string;
}
export interface IRIEBaseState {
editing: boolean;
loading: boolean;
disabled: boolean;
invalid: boolean;
}
export interface IRIEBaseProps {
propName: string;
change: Function;
value: any;
editProps?: any;
defaultProps?: any;
isDisabled?: boolean;
validate?: Function;
shouldBlockWhileLoading?: boolean,
classLoading?: string;
classEditing?: string;
classDisabled?: string;
classInvalid?: string;
className?: string;
options?: IRIESelectOption[];
editing?: boolean;
shouldStartEditOnDoubleClick?: boolean;
}
export interface IRIENumberProps extends IRIEBaseProps {
format?: Function;
}
export interface IRIEToggleProps {
textTrue: boolean;
textFalse: boolean;
}
export interface IRIEToggleState {
value: string;
loading: boolean;
}
export interface IRIETagsProps {
value: any;
maxTags?: number;
minTags?: number;
separator?: string;
elementClass?: string;
blurDelay?: number;
placeholder: string;
wrapper?: string;
wrapperClass?: string;
wrapperEditing?: string;
}
export interface IRIETagsState {
currentText: string;
blurTimer: any;
}
export interface IRIETextAreaProps extends IRIEBaseProps {
rows?: number;
cols?: number;
}
export class RIEBase<P,S> extends React.Component<IRIEBaseProps, IRIEBaseState> {
doValidations(value: number|string): any;
selectInputText(element: any): void;
elementClick(event): any;
commit(value: string|number): void;
makeClassString(): void
}
export class RIEStatefulBase<P,S> extends RIEBase<IRIEBaseProps, IRIEBaseState> {
startEditing(): void;
finishEditing(): void;
cancelEditing(): void;
keyDown(event: any): void;
textChanged(event: any): void;
renderEditingComponent(): ReactElement<any>;
renderNormalComponent(): ReactElement<any>;
elementBlur(event: any): void;
elementClick(event: any): void;
}
export class RIEInput extends RIEStatefulBase<IRIEBaseProps, IRIEBaseState> {}
export class RIESelect extends RIEStatefulBase<IRIEBaseProps, IRIEBaseState> {}
export class RIENumber extends RIEStatefulBase<IRIENumberProps, IRIEBaseState> {
validate(value: string|number): boolean;
}
export class RIETextArea extends RIEStatefulBase<IRIETextAreaProps, IRIEBaseState> {}
export interface IRIESelectOption {
id: number|string;
text: number|string
}
export class RIEToggle extends RIEBase<IRIEToggleProps, IRIEToggleState> {}
export class RIETag<P, S> extends React.Component<IRIETagProps, any>{
remove(): void;
}
export class RIETags extends RIEStatefulBase<IRIETagsProps, IRIETagsState> {
addTag(tag: any): void;
removeTag(tag: any): void;
cancelEditingDelayed(): void;
cancelEditing(): void;
makeTagElement(text: string): any
}
}