-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathreact-bootstrap-validation.d.ts
118 lines (97 loc) · 4.04 KB
/
react-bootstrap-validation.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
// Type definitions for react-bootstrap-validation 0.1.11
// Project: https://github.com/heilhead/react-bootstrap-validation
// Definitions by: Jason Turner <https://github.com/brewsoftware>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../react/react.d.ts"/>
declare module 'react-bootstrap-validation' {
import React = require("react");
// Form component
var Form: FormClass;
interface Form extends React.ReactElement<FormProps> { }
interface FormClass extends React.ComponentClass<FormProps> { }
interface FormProps extends React.Props<FormClass> {
validateOne?: any;
validateAll?: any;
errorHelp?: string | any;
validationEvent?: string; //Input event that triggers field validation. Can be one of onChange, onBlur or onFocus. Default value is onChange.
onValidSubmit?: any;
onInvalidSubmit?: any;
model?:any;
id?: string | any;
}
// Validated Input
var ValidatedInput: ValidatedInputClass;
interface ValidatedInput extends React.ReactElement<ValidatedInputProps> { }
interface ValidatedInputClass extends React.ComponentClass<ValidatedInputProps> { }
interface ValidatedInputProps extends React.Props<ValidatedInputClass> {
name: string;
validationEvent?: string;
validate?: any;
type: any;
label: any;
errorHelp?: any;
maxLength?: string;
id?: string | number;
placeholder?: string;
className?: string;
}
// Radio ComponentA
var Radio: RadioClass;
interface Radio extends React.ReactElement<RadioProps> { }
interface RadioClass extends React.ComponentClass<RadioProps> { }
interface RadioProps extends RadioClass {
name?: string;
type?: string;
value: string;
label: string;
className?: string;
}
// Radio Group Component
var RadioGroup: RadioGroupClass;
interface RadioGroup extends React.ReactElement<RadioGroupProps> { }
interface RadioGroupClass extends React.ComponentClass<RadioGroupProps> { }
interface RadioGroupProps extends React.Props<RadioGroupClass> {
name?: string;
value?: any;
label?: any;
validate?: string;
errorHelp?: string;
labelClassName?: string;
wrapperClassName?: string;
}
// Validator Component
var Validator: ValidatorClass;
interface Validator extends React.ReactElement<ValidatorProps> { }
interface ValidatorClass extends React.ComponentClass<ValidatorProps> { }
interface ValidatorProps extends React.Props<ValidatorClass> {
validationEvent: any;
}
// TODO: Map out the following items below
//var FileValidator: FileValidatorClass;
//interface FileValidatorClass extends ValidatedInputClass {
// ref: any;
// name: any;
// type :any;
// label:any;
// multiple: any;
// validate: any;
// isEmpty(files: FileList);
// /// Returns true if there are no files in file list.
// isSingle(files: FileList);
// // Returns true if files count equals to 1.
// isMultiple(files: FileList);
// //Returns true if files count is more than 1.
// isFilesCount(files: FileList, min: Number, max:Array<Number> );
// //Returns true if files count is within allowed range.If max is not supplied, checks if files count equals min.
// isTotalSize(files: FileList, min: Number, max: Array<Number>);
// //Returns true if total size of all files is within allowed range.
// isEachFileSize(files: FileList, min: Number, max: Array<Number>);
// //Returns true if each file's size is within allowed range.
// isExtension(files: FileList, extensions: Array<any>);
// //Returns true if each file's extension is in the extensions array.
// isType(files: FileList, types: Array<any>);
// }
//var InputContainer: InputContainerClass;
//interface InputContainerClass extends ValidatedInputClass{
// }
}