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.
|
|
|
|
|
*/
|
|
|
|
|
import { invoke } from '@tauri-apps/api/tauri'
|
|
|
|
|
|
|
|
|
|
/// 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) {
|
|
|
|
|
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() {
|
|
|
|
|
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-07-24 11:03:19 -07:00
|
|
|
export async function kill(pid) {
|
|
|
|
|
return await invoke('plugin:process|process_kill', { pid })
|
2023-04-05 10:07:59 -07:00
|
|
|
}
|