Files
archived-tauri-plugin-process/guest-js/index.ts
renovate[bot] f19a4f06cb chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 (#1228)
* chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0

* actually apply the rules lol

* rebuild

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>

Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/8791882915

Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
2024-04-22 22:41:51 +00:00

46 lines
1.0 KiB
TypeScript

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/**
* Perform operations on the current process.
* @module
*/
import { invoke } from "@tauri-apps/api/core";
/**
* Exits immediately with the given `exitCode`.
* @example
* ```typescript
* import { exit } from '@tauri-apps/plugin-process';
* await exit(1);
* ```
*
* @param code The exit code to use.
* @returns A promise indicating the success or failure of the operation.
*
* @since 2.0.0
*/
async function exit(code = 0): Promise<void> {
await invoke("plugin:process|exit", { code });
}
/**
* Exits the current instance of the app then relaunches it.
* @example
* ```typescript
* import { relaunch } from '@tauri-apps/plugin-process';
* await relaunch();
* ```
*
* @returns A promise indicating the success or failure of the operation.
*
* @since 2.0.0
*/
async function relaunch(): Promise<void> {
await invoke("plugin:process|restart");
}
export { exit, relaunch };