Provides an interface of the draggableGsap action options support / Readable store to make updating / setting draggableGsap options much easier. When subscribing to the options instance returned by draggableGsap.options the Subscriber handler receives the entire instance.

interface DraggableGsapOptionsStore {
    inertia: boolean;
    inertiaOptions: GsapInertiaOptions;
    tween: boolean;
    tweenOptions: GsapTweenOptions;
    set inertiaDuration(duration: { max: number; min: number }): void;
    get inertiaDurationMax(): number;
    set inertiaDurationMax(max: number): void;
    get inertiaDurationMin(): number;
    set inertiaDurationMin(min: number): void;
    get inertiaEnd(): number | Function | any[];
    set inertiaEnd(end: number | Function | any[]): void;
    get inertiaResistance(): number;
    set inertiaResistance(resistance: number): void;
    get inertiaVelocityScale(): number;
    set inertiaVelocityScale(velocityScale: number): void;
    get tweenDuration(): number;
    set tweenDuration(duration: number): void;
    get tweenEase(): string | Function;
    set tweenEase(value: string | Function): void;
    reset(): void;
    resetInertia(): void;
    resetInertiaOptions(): void;
    resetTween(): void;
    resetTweenOptions(): void;
    subscribe(
        this: void,
        run: Subscriber<DraggableGsapOptionsStore>,
        invalidate?: Invalidator<DraggableGsapOptionsStore>,
    ): Unsubscriber;
}
Hierarchy

Accessors

  • set inertiaDuration(duration: { max: number; min: number }): void
  • Parameters

    • duration: { max: number; min: number }

      Set inertia duration min & max.

    Returns void

  • get inertiaDurationMax(): number
  • Returns number

    Get inertia duration max time (seconds)

  • set inertiaDurationMax(max: number): void
  • Parameters

    • max: number

      Set inertia duration max.

    Returns void

  • get inertiaDurationMin(): number
  • Returns number

    Get inertia duration min time (seconds)

  • set inertiaDurationMin(min: number): void
  • Parameters

    • min: number

      Set inertia duration min.

    Returns void

  • get inertiaResistance(): number
  • Returns number

    Get inertia resistance (1000 is default).

  • set inertiaResistance(resistance: number): void
  • Parameters

    • resistance: number

      Set inertia resistance. Default: 1000

    Returns void

  • get inertiaVelocityScale(): number
  • Returns number

    Get inertia velocity scale.

  • set inertiaVelocityScale(velocityScale: number): void
  • Parameters

    • velocityScale: number

      Set inertia velocity scale.

    Returns void

  • get tweenDuration(): number
  • Returns number

    Get ease duration

  • set tweenDuration(duration: number): void
  • Parameters

    • duration: number

      Set ease duration.

    Returns void

  • get tweenEase(): string | Function
  • Returns string | Function

    Get easing function value.

  • set tweenEase(value: string | Function): void
  • Parameters

    • value: string | Function

      Get easing function value.

    Returns void

Methods

  • Resets all options data to initial values.

    Returns void

  • Resets inertia enabled state to initial value.

    Returns void

  • Resets inertia options to initial values.

    Returns void

  • Resets tween enabled state to initial value.

    Returns void

  • Resets tween options to initial values.

    Returns void

Properties

inertia: boolean

Inertia enabled state.

inertiaOptions: GsapInertiaOptions

Inertia options.

tween: boolean

Tweening enabled state.

tweenOptions: GsapTweenOptions

GSAP tween options for easing function and duration.