Provides a system to validate positional changes.

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;
}
Hierarchy

Accessors

  • get constrain(): boolean
  • Returns boolean

    The current constrain state.

  • set constrain(constrain): void
  • Parameters

    • constrain: boolean

      Set constrain state.

    Returns void

  • get element(): HTMLElement
  • Returns HTMLElement

    Target element.

  • set element(element): void
  • Parameters

    Returns void

  • get enabled(): boolean
  • Returns boolean

    Get enabled state.

  • set enabled(enabled): void
  • Parameters

    • enabled: boolean

      Set enabled state.

    Returns void

  • get height(): number
  • Returns number

    Get manual height.

  • set height(height): void
  • Parameters

    • height: number

      Set manual height.

    Returns void

  • get locked(): boolean
  • Returns boolean

    Get locked state.

  • get width(): number
  • Returns number

    Get manual width.

  • set width(width): void
  • Parameters

    • width: number

      Set manual width.

    Returns void

Methods

  • Set manual width & height.

    Parameters

    • width: number

      New manual width.

    • height: number

      New manual height.

    Returns void

  • Optional subscribe function following the Svelte store / subscribe pattern. On updates validation will be processed again.

    Parameters

    Returns Unsubscriber

Properties

id?: any

An ID associated with this validator. Can be used to remove the validator; default: undefined.

validate: ValidatorFn

Provides a validator that respects transforms in positional data constraining the position to within the target elements bounds.

The associated validation data for position updates.

Potentially adjusted position data.

weight?: number

A number between 0 and 1 inclusive to position this validator against others; default: 1.