Interface State
clear(): void;
current(extra?: object): SvelteApp.API.State.Data;
get(options: { name: string }): SvelteApp.API.State.Data;
keys(): IterableIterator<string>;
remove(options: { name: string }): SvelteApp.API.State.Data;
restore(
options: {
animateTo?: boolean;
duration?: number;
ease?: EasingReference;
name: string;
remove?: boolean;
},
): SvelteApp.API.State.Data;
save(options: { extra?: any[]; name: string }): SvelteApp.API.State.Data;
set(
data: SvelteApp.API.State.Data,
options?: {
animateTo?: boolean;
async?: boolean;
duration?: number;
ease?: EasingReference;
},
): void;
}
Methods
clear
Clears all saved application state.
Returns void
current
get
keys
Returns IterableIterator<string>
The saved application state names / keys.
remove
restore
- restore(
options: {
animateTo?: boolean;
duration?: number;
ease?: EasingReference;
name: string;
remove?: boolean;
},
): SvelteApp.API.State.DataRestores a previously saved application state by
namereturning the data. Several optional parameters are available to animate / tween to the new state. WhenanimateTois true, an animation is scheduled via #runtime/svelte/store/position!TJSPosition.API.Animation.to and the duration and easing name or function may be specified.Parameters
- options: {
animateTo?: boolean;
duration?: number;
ease?: EasingReference;
name: string;
remove?: boolean;
}Parameters
OptionalanimateTo?: booleanAnimate to restore data.
Optionalduration?: numberDuration in seconds.
Optionalease?: EasingReferenceEasing function name or function.
name: string
Saved data set name.
Optionalremove?: booleanRemove data set.
Returns SvelteApp.API.State.Data
Any saved application state.
- options: {
save
Saves the current application state with the opportunity to add extra data to the saved state.
Parameters
- options: { extra?: any[]; name: string }
Options.
Optionalextra?: any[]Extra data to add to saved state.
name: string
Name to index this saved state.
Returns SvelteApp.API.State.Data
Current saved application state.
- options: { extra?: any[]; name: string }
set
- set(
data: SvelteApp.API.State.Data,
options?: {
animateTo?: boolean;
async?: boolean;
duration?: number;
ease?: EasingReference;
},
): voidSets application state from the given State.Data instance. Several optional parameters are available to animate / tween to the new state. When
animateTois true, an animation is scheduled via #runtime/svelte/store/position!TJSPosition.API.Animation.to and the duration and easing name or function may be specified.Note: If serializing application state, any minimized apps will use the before minimized state on initial render of the app as it is currently not possible to render apps with Foundry VTT core API in the minimized state.
Parameters
- data: SvelteApp.API.State.Data
Saved data set name.
Optionaloptions: {
animateTo?: boolean;
async?: boolean;
duration?: number;
ease?: EasingReference;
}Optional parameters
OptionalanimateTo?: booleanAnimate to restore data.
Optionalasync?: booleanOptionalduration?: numberDuration in seconds.
Optionalease?: EasingReferenceEasing function.
Returns void
- data: SvelteApp.API.State.Data
Provides the ability the save / restore / serialize application state for positional and UI state such as minimized status.
You can restore a saved state with animation; please see the options of State.restore.