import { FeatheryFieldTypes } from '../init'; import { FieldStyles, OptionType } from '../fieldHelperFunctions'; import { OPERATOR_CODE, ResolvedComparisonRule } from '../logic'; /** * Represents a field in a form. Part of the SDK coding model. * For repeating fields, value is an array. * * myField.value is the raw value of the field and will either be a single value or an array * This enables the following sorts of syntax in rules: * myField.value = 'blaa' if it is not repeating * myField.value[0] = 'blaa' if it is repeating * myField.equals('something') (non-repeating or repeating) * myField.value[0] === 'something' (repeating) * myField.value === ['something','another'] (repeating - all fields) * * NOTE: I tried to make this a subclass of Array but that didn't work out. Extending * the builtin array type requires native true ES6 syntax and with webpack it seems to be * not supported. It would have been a much cleaner implementation and cleaner and simpler syntax * for working with repeats. * The syntax above is a bit more verbose but will have to do for now. * SEE: https://stackoverflow.com/questions/35128241/extreme-es6-array-extension-weirdness-it-reverts-to-regular-array-with-webpack */ export default class Field { _fieldKey: string; _formUuid: string; _hiddenField: boolean; _sourceField: any; constructor(fieldKey: string, formUuid: string, hiddenField?: boolean); get id(): string; _runFieldUpdate(): Promise; clear(): void; get value(): FeatheryFieldTypes; set value(val: FeatheryFieldTypes); _getFormSpecificProps(): { type: string; displayText: string; required: boolean; onThisForm: boolean; }; _getSourceField(): any; get type(): string; set type(val: string); get displayText(): string; set displayText(val: string); get onThisForm(): boolean; set onThisForm(val: boolean); get isHiddenField(): boolean; set isHiddenField(val: boolean); get required(): boolean; set required(flag: boolean); get options(): OptionType[]; set options(newOptions: OptionType[]); setStyles(newStyles: FieldStyles): void; get placeholder(): string; set placeholder(val: string | string[]); get disabled(): boolean; set disabled(flag: boolean); setError(errors: string | { index: number; message: string; }): void; _comparisonRule(comparison: OPERATOR_CODE, values?: ({ id: string; } | string)[]): ResolvedComparisonRule; _executeLogic(comparison: OPERATOR_CODE, values?: ({ id: string; } | string)[]): boolean; equals(...values: ({ id: string; } | string)[]): boolean; notEquals(...values: ({ id: string; } | string)[]): boolean; equalsIgnoreCase(...values: ({ id: string; } | string)[]): boolean; notEqualsIgnoreCase(...values: ({ id: string; } | string)[]): boolean; greaterThan(...values: ({ id: string; } | string)[]): boolean; greaterThanOrEqual(...values: ({ id: string; } | string)[]): boolean; lessThan(...values: ({ id: string; } | string)[]): boolean; lessThanOrEqual(...values: ({ id: string; } | string)[]): boolean; isFilled(): boolean; isEmpty(): boolean; isTrue(): boolean; isFalse(): boolean; contains(...values: ({ id: string; } | string)[]): boolean; doesNotContain(...values: ({ id: string; } | string)[]): boolean; containsIgnoreCase(...values: ({ id: string; } | string)[]): boolean; doesNotContainIgnoreCase(...values: ({ id: string; } | string)[]): boolean; startsWith(...values: ({ id: string; } | string)[]): boolean; doesNotStartWith(...values: ({ id: string; } | string)[]): boolean; endsWith(...values: ({ id: string; } | string)[]): boolean; doesNotEndWith(...values: ({ id: string; } | string)[]): boolean; isNumerical(): boolean; isText(): boolean; selectionsInclude(...values: ({ id: string; } | string)[]): boolean; selectionsDoNotInclude(...values: ({ id: string; } | string)[]): boolean; } export declare function parseUserVal(userVal: FeatheryFieldTypes, key: string): FeatheryFieldTypes; //# sourceMappingURL=Field.d.ts.map