/
types.d.ts
80 lines (72 loc) · 2.05 KB
/
types.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
import { Helper, Types } from "gd-sprest";
import { IFormControl, IFormControlProps, IFormControlValidationResult } from "gd-bs/src/components/form/controlTypes";
/**
* Field
*/
export const Field: (props: IFieldProps) => IField;
/**
* Field
*/
export interface IField {
control: IFormControl;
controlProps: IFormControlProps;
getValue: () => IFieldValue;
isValid: () => boolean;
}
/**
* Field Properties
*/
export interface IFieldProps {
assignTo?: (obj: IField) => void;
controlMode?: number;
errorMessage?: string;
field: Types.SP.Field;
listInfo: Helper.IListFormResult;
lookupFilter?: string | Types.IODataQuery;
onError?: (msg: string) => void;
onControlRendered?: (control: IFormControl, field: Types.SP.Field) => void | Promise<IFormControl>;
onControlRendering?: (control: IFormControlProps, field: Types.SP.Field) => void | Promise<IFormControlProps>;
onValidate?: (field: Types.SP.Field, control: IFormControl, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
value?: any;
}
/**
* Field Image Information
*/
export interface IFieldImageInfo extends Helper.IListFormAttachmentInfo {
fieldId: string;
fieldName: string;
}
/**
* Field Image Value
*/
export interface IFieldImageValue {
fieldId: string;
fieldName: string;
fileName: string;
id: string;
nativeFile?: any;
serverRelativeUrl: string;
serverUrl: string;
type: string;
}
/**
* Field Value
*/
export interface IFieldValue {
name: string;
value: any;
}
/**
* Form Control Lookup Properties
*/
export interface IFormControlLookupProps extends IFormControlProps {
lookupFilter?: string | Types.IODataQuery;
onControlRendering?: (control: IFieldLookupProps, field: Types.SP.Field) => void | Promise<IFieldLookupProps>;
}
/**
* Form Control Url Properties
*/
export interface IFormControlUrlProps extends IFormControlProps {
showDescription?: boolean;
onControlRendering?: (control: IFieldUrlProps, field: Types.SP.Field) => void | Promise<IFieldUrlProps>;
}