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
clear
get
- get(options: { name: string }): TJSPositionDataExtra
Gets any stored saved position data by name.
Returns TJSPositionDataExtra
Any saved position data.
getDefault
- getDefault(): TJSPositionDataExtra
Returns any associated default position data.
Returns TJSPositionDataExtra
Any saved default position data.
keys
- keys(): IterableIterator<string, any, any>
Returns IterableIterator<string, any, any>
The saved position data names / keys.
remove
- remove(options: { name: string }): TJSPositionDataExtra
Removes and returns any position data by name.
Returns TJSPositionDataExtra
Any saved position data.
reset
restore
- restore(
options: {
animateTo?: boolean;
async?: boolean;
duration?: number;
ease?: EasingReference;
name: string;
properties?: Iterable<string, any, any>;
remove?: boolean;
silent?: boolean;
},
): TJSPositionDataExtra
| Promise<TJSPositionDataExtra> 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
Optional
animateTo?: booleanAnimate to restore data.
Optional
async?: booleanIf animating return a Promise that resolves with any saved data.
Optional
duration?: numberDuration in seconds.
Optional
ease?: EasingReferenceEasing function name or function.
name: string
Saved data set name.
Optional
properties?: Iterable<string, any, any>Specific properties to set / animate.
Optional
remove?: booleanRemove data set.
Optional
silent?: booleanSet position data directly; no store or style updates.
Returns TJSPositionDataExtra | Promise<TJSPositionDataExtra>
Any saved position data.
- options: {
save
- save(
options: { name: string; [key: string]: any },
optionsGet?: OptionsGet,
): TJSPositionDataExtra 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.
Optional
optionsGet: OptionsGetAdditional options for TJSPosition.get when serializing position state. By default,
nullable
values are included.
Returns TJSPositionDataExtra
Current position data
- options: { name: string; [key: string]: any }
Clears all saved position data except any default state.