2023-03-31 11:00:43 -07:00
|
|
|
/**
|
|
|
|
|
* All theseus API calls return serialized values (both return values and errors);
|
|
|
|
|
* So, for example, addDefaultInstance creates a blank Profile object, where the Rust struct is serialized,
|
|
|
|
|
* and deserialized into a usable JS object.
|
|
|
|
|
*/
|
2024-08-27 21:49:36 +02:00
|
|
|
import { invoke } from '@tauri-apps/api/core'
|
2023-03-31 11:00:43 -07:00
|
|
|
|
|
|
|
|
// Initialize the theseus API state
|
|
|
|
|
// This should be called during the initializion/opening of the launcher
|
|
|
|
|
export async function initialize_state() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('initialize_state')
|
2023-03-31 11:00:43 -07:00
|
|
|
}
|
2023-04-26 10:28:08 -07:00
|
|
|
|
|
|
|
|
// Gets active progress bars
|
|
|
|
|
export async function progress_bars_list() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('plugin:utils|progress_bars_list')
|
2023-04-26 10:28:08 -07:00
|
|
|
}
|
2023-06-30 08:11:32 -07:00
|
|
|
|
|
|
|
|
// Get opening command
|
|
|
|
|
// For example, if a user clicks on an .mrpack to open the app.
|
|
|
|
|
// This should be called once and only when the app is done booting up and ready to receive a command
|
|
|
|
|
// Returns a Command struct- see events.js
|
|
|
|
|
export async function get_opening_command() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('plugin:utils|get_opening_command')
|
2023-06-30 08:11:32 -07:00
|
|
|
}
|