2023-04-05 10:07:59 -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-04-05 10:07:59 -07:00
|
|
|
|
|
|
|
|
/// Gets all running process IDs with a given profile path
|
|
|
|
|
/// Returns [u32]
|
2024-07-24 11:03:19 -07:00
|
|
|
export async function get_by_profile_path(path) {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('plugin:process|process_get_by_profile_path', { path })
|
2023-04-05 10:07:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Gets all running process IDs with a given profile path
|
|
|
|
|
/// Returns [u32]
|
2024-07-24 11:03:19 -07:00
|
|
|
export async function get_all() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('plugin:process|process_get_all')
|
2023-04-05 10:07:59 -07:00
|
|
|
}
|
|
|
|
|
|
2023-04-17 12:40:27 -07:00
|
|
|
/// Kills a process by UUID
|
2024-08-16 23:20:11 -07:00
|
|
|
export async function kill(uuid) {
|
2025-08-14 21:48:38 +01:00
|
|
|
return await invoke('plugin:process|process_kill', { uuid })
|
2023-04-05 10:07:59 -07:00
|
|
|
}
|