Interface ValidatorSystem
interface ValidatorSystem {
id?: any;
validate: ValidatorFn;
weight?: number;
get constrain(): boolean;
set constrain(constrain: boolean): void;
get element(): HTMLElement;
set element(element: HTMLElement): void;
get enabled(): boolean;
set enabled(enabled: boolean): void;
get height(): number;
set height(height: number): void;
get locked(): boolean;
get width(): number;
set width(width: number): void;
setDimension(width: number, height: number): void;
subscribe(
this: void,
run: Subscriber<any>,
invalidate?: Invalidator<any>,
): Unsubscriber;
}
id?: any;
validate: ValidatorFn;
weight?: number;
get constrain(): boolean;
set constrain(constrain: boolean): void;
get element(): HTMLElement;
set element(element: HTMLElement): void;
get enabled(): boolean;
set enabled(enabled: boolean): void;
get height(): number;
set height(height: number): void;
get locked(): boolean;
get width(): number;
set width(width: number): void;
setDimension(width: number, height: number): void;
subscribe(
this: void,
run: Subscriber<any>,
invalidate?: Invalidator<any>,
): Unsubscriber;
}
Hierarchy
- SystemBase
- ValidatorSystem (View Summary)
Accessors
constrain
- get constrain(): boolean
Returns boolean
The current constrain state.
- set constrain(constrain: boolean): void
Parameters
- constrain: boolean
Set constrain state.
Returns void
- constrain: boolean
element
- get element(): HTMLElement
Returns HTMLElement
Target element.
- set element(element: HTMLElement): void
Parameters
- element: HTMLElement
Set target element.
Returns void
- element: HTMLElement
enabled
- get enabled(): boolean
Returns boolean
Get enabled state.
- set enabled(enabled: boolean): void
Parameters
- enabled: boolean
Set enabled state.
Returns void
- enabled: boolean
height
- get height(): number
Returns number
Get manual height.
- set height(height: number): void
Parameters
- height: number
Set manual height.
Returns void
- height: number
locked
- get locked(): boolean
Returns boolean
Get locked state.
width
- get width(): number
Returns number
Get manual width.
- set width(width: number): void
Parameters
- width: number
Set manual width.
Returns void
- width: number
Methods
setDimension
Optional
subscribe
- subscribe(
this: void,
run: Subscriber<any>,
invalidate?: Invalidator<any>,
): Unsubscriber Optional subscribe function following the Svelte store / subscribe pattern. On updates validation will be processed again.
Parameters
- this: void
- run: Subscriber<any>
Optional
invalidate: Invalidator<any>
Returns Unsubscriber
Properties
Optional
id
id?: any
An ID associated with this validator. Can be used to remove the validator; default: undefined
.
validate
Provides a validator that respects transforms in positional data constraining the position to within the target elements bounds.
Optional
weight
weight?: number
A number between 0 and 1 inclusive to position this validator against others; default: 1
.
Provides a system to validate positional changes.