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): TJSPositionDataExtra
Gets any stored saved position data by name.
Parameters
- options: {
name: string;
}Options.
name: string
Saved data name.
Returns TJSPositionDataExtra
Any saved position data.
- options: {
getDefault
- get
Default (): 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): TJSPositionDataExtra
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.
- options: {
reset
- reset(options?): boolean
Resets position instance to default data and invokes set.
Parameters
Optional
options: {
invokeSet?: boolean;
keepZIndex?: boolean;
}Optional parameters.
Optional
invokeSet ?: booleanWhen true invokes set method.
Optional
keepZIndex?: booleanWhen true keeps current z-index.
Returns boolean
Operation successful.
restore
- restore(options): 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, 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.
[key: string]: any
name: string
name to index this saved data.
Optional
optionsGet: OptionsGetAdditional options for TJSPosition.get when serializing position state. By default,
nullable
values are included.
Returns TJSPositionDataExtra
Current position data
- options: {
Clears all saved position data except any default state.