process.d.ts 703 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Exits immediately with the given `exitCode`.
  3. * @example
  4. * ```typescript
  5. * import { exit } from '@tauri-apps/api/process';
  6. * await exit(1);
  7. * ```
  8. *
  9. * @param exitCode The exit code to use.
  10. * @returns A promise indicating the success or failure of the operation.
  11. *
  12. * @since 1.0.0
  13. */
  14. declare function exit(exitCode?: number): Promise<void>;
  15. /**
  16. * Exits the current instance of the app then relaunches it.
  17. * @example
  18. * ```typescript
  19. * import { relaunch } from '@tauri-apps/api/process';
  20. * await relaunch();
  21. * ```
  22. *
  23. * @returns A promise indicating the success or failure of the operation.
  24. *
  25. * @since 1.0.0
  26. */
  27. declare function relaunch(): Promise<void>;
  28. export { exit, relaunch };