tauri plugin power manager
1.0.0
Este plug -in fornece uma maneira cruzada de desligar, reiniciar ou registrar operações.
Plataformas suportadas: Linux , Windows e macOS .
Para instalar o plug -in de ferrugem, execute:
cargo add tauri-plugin-power-managerEm seguida, carregue o plug -in no seu aplicativo Tauri da seguinte forma:
tauri :: Builder :: default ( )
. plugin ( tauri_plugin_power_manager :: init ( ) ) // THIS LINE
// More builder methods
. run ( tauri :: generate_context! ( ) )
. expect ( "error while running tauri application" ) ;Por fim, instale as ligações do cliente JS:
pnpm add tauri-plugin-power-manager-api /**
* Calls the OS-specific function to force to log out the user.
*/
export declare const forceLogout : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to force to reboot the machine.
*/
export declare const forceReboot : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to force to shut down the machine.
*/
export declare const forceShutdown : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to hibernate the machine.
*/
export declare const hibernate : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to log out the user.
*/
export declare const logout : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to reboot the machine.
*/
export declare const reboot : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to shut down the machine.
*/
export declare const shutdown : ( ) => Promise < void > ;
/**
* Calls the OS-specific function to put the machine to sleep.
*/
export declare const sleep : ( ) => Promise < void > ;