Class SvelteApplication
Implements
Index
Constructors
Accessors
Methods
Constructors
constructor
- new
Svelte (options?): SvelteApplicationApplication Parameters
Optional
options: SvelteApplicationOptionsThe options for the application.
Returns SvelteApplication
Accessors
elementContent
- get elementContent(): HTMLElement
Returns the content element if an application shell is mounted.
Returns HTMLElement
Content element.
elementTarget
- get elementTarget(): HTMLElement
Returns the target element or main element if no target defined.
Returns HTMLElement
Target element.
position
- get position(): TJSPosition
Returns the TJSPosition instance.
Returns TJSPosition
The TJSPosition instance.
reactive
- get reactive(): SvelteReactive
Returns the reactive accessors & Svelte stores for SvelteApplication.
Returns SvelteReactive
The reactive accessors & Svelte stores.
state
- get state(): ApplicationState
Returns the application state manager.
Returns ApplicationState
The application state manager.
svelte
- get svelte(): GetSvelteData
Returns the Svelte helper class w/ various methods to access mounted Svelte components.
Returns GetSvelteData
GetSvelteData
Methods
maximize
- maximize(opts?): Promise<void>
Provides a mechanism to update the UI options store for maximized.
Note: the sanity check is duplicated from Application.maximize the store is updated before performing the rest of animations. This allows application shells to remove / show any resize handlers correctly. Extra constraint data is stored in a saved position state in SvelteApplication.minimize to animate the content area.
Parameters
Optional
opts: {
animate?: boolean;
duration?: number;
}Optional parameters.
Optional
animate?: booleanWhen true perform default maximizing animation.
Optional
duration?: numberControls content area animation duration in seconds.
Returns Promise<void>
minimize
- minimize(opts?): Promise<void>
Provides a mechanism to update the UI options store for minimized.
Note: the sanity check is duplicated from Application.minimize the store is updated before performing the rest of animations. This allows application shells to remove / show any resize handlers correctly. Extra constraint data is stored in a saved position state in SvelteApplication.minimize to animate the content area.
Parameters
Optional
opts: {
animate?: boolean;
duration?: number;
}Optional parameters.
Optional
animate?: booleanWhen true perform default minimizing animation.
Optional
duration?: numberControls content area animation duration in seconds.
Returns Promise<void>
onSvelteMount
- on
Svelte (mountedAppShell?): voidMount Provides a callback after all Svelte components are initialized.
Parameters
Optional
mountedAppShell: MountedAppShellThe mounted app shell elements.
Returns void
onSvelteRemount
- on
Svelte (mountedAppShell?): voidRemount Provides a callback after the main application shell is remounted. This may occur during HMR / hot module replacement or directly invoked from the
elementRootUpdate
callback passed to the application shell component context.Parameters
Optional
mountedAppShell: MountedAppShellThe mounted app shell elements.
Returns void
Provides a Svelte aware extension to the Foundry Application class to manage the app lifecycle appropriately. You can declaratively load one or more components from
defaultOptions
using a TJSSvelteConfig object in the SvelteApplicationOptionsoptions
SvelteApplicationOptions.svelte property.