Interface Validators
interface Validators {
get enabled(): boolean;
set enabled(enabled: boolean): void;
get length(): number;
"[iterator]"(): IterableIterator<ValidatorData>;
add(...validators: (ValidatorFn | ValidatorData)[]): void;
clear(): void;
remove(...validators: (ValidatorFn | ValidatorData)[]): void;
removeBy(callback: RemoveByCallback): void;
removeById(...ids: any[]): void;
}
get enabled(): boolean;
set enabled(enabled: boolean): void;
get length(): number;
"[iterator]"(): IterableIterator<ValidatorData>;
add(...validators: (ValidatorFn | ValidatorData)[]): void;
clear(): void;
remove(...validators: (ValidatorFn | ValidatorData)[]): void;
removeBy(callback: RemoveByCallback): void;
removeById(...ids: any[]): void;
}
Index
Accessors
Methods
Accessors
enabled
- get enabled(): boolean
Returns boolean
Returns the enabled state.
- set enabled(enabled: boolean): void
Parameters
- enabled: boolean
Sets enabled state.
Returns void
- enabled: boolean
length
- get length(): number
Returns number
Returns the length of the validators array.
Methods
[iterator]
add
Adds the given validators.
Parameters
- ...validators: (ValidatorFn | ValidatorData)[]
Validators to add.
Returns void
- ...validators: (ValidatorFn | ValidatorData)[]
clear
Clears / removes all validators.
Returns void
remove
Removes one or more given validators.
Parameters
- ...validators: (ValidatorFn | ValidatorData)[]
Validators to remove.
Returns void
- ...validators: (ValidatorFn | ValidatorData)[]
removeBy
Remove validators by the provided callback. The callback takes 3 parameters:
id,validator, andweight. Any truthy value returned will remove that validator.Parameters
- callback: RemoveByCallback
Callback function to evaluate each validator entry.
Returns void
- callback: RemoveByCallback
removeById
Removes any validators with matching IDs.
Parameters
- ...ids: any[]
IDs to remove.
Returns void
- ...ids: any[]
Provides the validator API implementation for TJSPosition.validators. You may add one or more validator functions which evaluate changes in the associated TJSPosition instance. This allows standard validation for browser bounds / transform checking available via TJSPosition.Validators or custom validators added which may provide unique bounding validation / constraints.