Interface ValidatorSystem
interface ValidatorSystem {
id?: any;
validate: ValidatorFn;
weight?: number;
constrain: boolean;
element: HTMLElement;
enabled: boolean;
height: number;
get locked(): boolean;
width: number;
setDimension(width: number, height: number): void;
subscribe?(this: void, run: Subscriber<any>, invalidate?: Invalidator<any>): Unsubscriber;
}
id?: any;
validate: ValidatorFn;
weight?: number;
constrain: boolean;
element: HTMLElement;
enabled: boolean;
height: number;
get locked(): boolean;
width: number;
setDimension(width: number, height: number): void;
subscribe?(this: void, run: Subscriber<any>, invalidate?: Invalidator<any>): Unsubscriber;
}
Hierarchy
- SystemBase
- ValidatorSystem (view full)
Accessors
constrain
- get constrain(): boolean
Returns boolean
The current constrain state.
- set constrain(constrain): void
Parameters
- constrain: boolean
Set constrain state.
Returns void
- constrain: boolean
element
- get element(): HTMLElement
Returns HTMLElement
Target element.
- set element(element): void
Parameters
- element: HTMLElement
Set target element.
Returns void
- element: HTMLElement
enabled
- get enabled(): boolean
Returns boolean
Get enabled state.
- set enabled(enabled): void
Parameters
- enabled: boolean
Set enabled state.
Returns void
- enabled: boolean
height
- get height(): number
Returns number
Get manual height.
- set height(height): 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): void
Parameters
- width: number
Set manual width.
Returns void
- width: number
Methods
setDimension
Optional
subscribe
- subscribe(this, run, invalidate?): 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.