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
current
get
keys
- keys(): IterableIterator<string>
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.Data Restores a previously saved application state by
name
returning the data. Several optional parameters are available to animate / tween to the new state. WhenanimateTo
is true an animation is scheduled via #runtime/svelte/store/position!AnimationAPI.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
Optional
animateTo?: booleanAnimate to restore data.
Optional
duration?: numberDuration in seconds.
Optional
ease?: EasingReferenceEasing function name or function.
name: string
Saved data set name.
Optional
remove?: booleanRemove data set.
Returns SvelteApp.API.State.Data
Any saved application state.
- options: {
save
- save(options: { extra?: any[]; name: string }): SvelteApp.API.State.Data
Saves current application state with the opportunity to add extra data to the saved state.
Parameters
- options: { extra?: any[]; name: string }
Options.
Optional
extra?: 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;
},
): void Sets application state from the given State.Data instance. Several optional parameters are available to animate / tween to the new state. When
animateTo
is 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.
Optional
options: {
animateTo?: boolean;
async?: boolean;
duration?: number;
ease?: EasingReference;
}Optional parameters
Optional
animateTo?: booleanAnimate to restore data.
Optional
async?: booleanOptional
duration?: numberDuration in seconds.
Optional
ease?: 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.