Creates an instance of the Application. This class is a singleton; an assertion will fail if multiple instances are created.
Configuration properties for the application.
Static ReadonlyprocessProvides access to process-related information, such as touch capabilities.
Dispatches an event with a given name and payload to all registered listeners. If no listeners are registered for the event name, or if no EventSource has been initialized, this method does nothing.
Moves focus to the next or previous focusable element within the application. Handles Tab and Shift+Tab key presses.
If true, focus moves to the next element; if false, to the previous.
true if focus was successfully moved, false otherwise.
Retrieves an environment variable from the application's environment map.
The name of the environment variable.
Optionaldef_value: T
An optional default value to return if the variable is not found.
The value of the environment variable, or def_value if not found.
Retrieves the main view component of the application.
The application's main view component.
Retrieves a value from the browser's local storage.
The key of the value to retrieve.
The stored value as a string, or null if not found.
Retrieves and parses a JSON value from the browser's local storage.
The key of the JSON value to retrieve.
The parsed JSON object, or undefined if not found or parsing fails.
Removes a previously registered event listener. If the listener was not found or no events were registered, this method does nothing.
Registers an event listener for a specific event name.
The listener will be invoked when an event with the given name is fired.
Returns an object with an off() method, which can be used to conveniently remove this specific listener.
An object containing an off() method to unsubscribe the listener.
Sets an environment variable in the application's environment map.
The name of the environment variable.
The value to store for the environment variable.
Sets an interval that repeatedly executes a callback function after a specified delay. If a timeout with the same name already exists, it will be cleared before the new one is set.
A unique string identifier for this timeout.
The delay in milliseconds before the callback is executed.
The function to execute after the delay.
Sets the main view component for the application. This component will be mounted to the DOM.
The component to set as the main view.
Stores a string or number value in the browser's local storage. The value will be converted to a string before storage.
The key under which to store the value.
The value to store.
Stores an object as a JSON string in the browser's local storage.
The key under which to store the JSON value.
The object to serialize and store.
Sets a timeout that executes a callback function after a specified delay. If a timeout with the same name already exists, it will be cleared before the new one is set.
A unique string identifier for this timeout.
The delay in milliseconds before the callback is executed.
The function to execute after the delay.
Sets up WebSocket messaging for the application. All 'global' messages fired via the application will be sent over the WebSocket, and messages received from the WebSocket will be re-fired as 'global' messages.
Optionalpath: string
Optional WebSocket path. If not provided, it defaults to ws://hostname:port/ws.
OptionallooseCallback: () => void
A callback function to be executed when the WebSocket connection is closed unexpectedly.
StaticfireOptionalparams: anyStaticinstanceReturns the singleton instance of the Application.
The application instance.
The main application class, acting as a singleton. It manages the main view, environment variables, keyboard navigation, and provides utilities for local storage and WebSocket communication.
Assertions ensure only one instance of
Applicationcan exist.