interface PositionStateAPI {
    clear(): void;
    get(options: {
        name: string;
    }): TJSPositionDataExtra;
    getDefault(): TJSPositionDataExtra;
    keys(): IterableIterator<string, any, any>;
    remove(options: {
        name: string;
    }): TJSPositionDataExtra;
    reset(options?: {
        invokeSet?: boolean;
        keepZIndex?: boolean;
    }): boolean;
    restore(options: {
        animateTo?: boolean;
        async?: boolean;
        duration?: number;
        ease?: EasingReference;
        name: string;
        properties?: Iterable<string, any, any>;
        remove?: boolean;
        silent?: boolean;
    }): TJSPositionDataExtra | Promise<TJSPositionDataExtra>;
    save(options: {
        name: string;
        [key: string]: any;
    }, optionsGet?: OptionsGet): TJSPositionDataExtra;
    set(options: {
        name: string;
        [key: string]: any;
    }): void;
}

Methods

  • Clears all saved position data except any default state.

    Returns void

  • Gets any stored saved position data by name.

    Parameters

    • options: {
          name: string;
      }

      Options.

      • name: string

        Saved data name.

    Returns TJSPositionDataExtra

    Any saved position data.

  • Removes and returns any position data by name.

    Parameters

    • options: {
          name: string;
      }

      Options.

      • name: string

        Name to remove and retrieve.

    Returns TJSPositionDataExtra

    Any saved position data.

  • Resets position instance to default data and invokes set.

    Parameters

    • Optionaloptions: {
          invokeSet?: boolean;
          keepZIndex?: boolean;
      }

      Optional parameters.

      • OptionalinvokeSet?: boolean

        When true invokes set method.

      • OptionalkeepZIndex?: boolean

        When true keeps current z-index.

    Returns boolean

    Operation successful.

  • Restores a saved positional state returning the data. Several optional parameters are available to control whether the restore action occurs silently (no store / inline styles updates), animates to the stored data, or simply sets the stored data. Restoring via AnimationAPI.to allows specification of the duration and easing along with configuring a Promise to be returned if awaiting the end of the animation.

    Parameters

    • options: {
          animateTo?: boolean;
          async?: boolean;
          duration?: number;
          ease?: EasingReference;
          name: string;
          properties?: Iterable<string, any, any>;
          remove?: boolean;
          silent?: boolean;
      }

      Parameters

      • OptionalanimateTo?: boolean

        Animate to restore data.

      • Optionalasync?: boolean

        If animating return a Promise that resolves with any saved data.

      • Optionalduration?: number

        Duration in seconds.

      • Optionalease?: EasingReference

        Easing function name or function.

      • name: string

        Saved data set name.

      • Optionalproperties?: Iterable<string, any, any>

        Specific properties to set / animate.

      • Optionalremove?: boolean

        Remove data set.

      • Optionalsilent?: boolean

        Set position data directly; no store or style updates.

    Returns TJSPositionDataExtra | Promise<TJSPositionDataExtra>

    Any saved position data.

  • Saves current position state with the opportunity to add extra data to the saved state. Simply include extra properties in options to save extra data.

    Parameters

    • options: {
          name: string;
          [key: string]: any;
      }

      Options.

      • [key: string]: any
      • name: string

        name to index this saved data.

    • OptionaloptionsGet: OptionsGet

      Additional options for TJSPosition.get when serializing position state. By default, nullable values are included.

    Returns TJSPositionDataExtra

    Current position data

  • Directly sets a saved position state. Simply include extra properties in options to set extra data.

    Parameters

    • options: {
          name: string;
          [key: string]: any;
      }

      Options.

      • [key: string]: any
      • name: string

        name to index this saved data.

    Returns void