app.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Gets the application version.
  3. * @example
  4. * ```typescript
  5. * import { getVersion } from '@tauri-apps/api/app';
  6. * const appVersion = await getVersion();
  7. * ```
  8. *
  9. * @since 1.0.0
  10. */
  11. declare function getVersion(): Promise<string>;
  12. /**
  13. * Gets the application name.
  14. * @example
  15. * ```typescript
  16. * import { getName } from '@tauri-apps/api/app';
  17. * const appName = await getName();
  18. * ```
  19. *
  20. * @since 1.0.0
  21. */
  22. declare function getName(): Promise<string>;
  23. /**
  24. * Gets the Tauri version.
  25. *
  26. * @example
  27. * ```typescript
  28. * import { getTauriVersion } from '@tauri-apps/api/app';
  29. * const tauriVersion = await getTauriVersion();
  30. * ```
  31. *
  32. * @since 1.0.0
  33. */
  34. declare function getTauriVersion(): Promise<string>;
  35. /**
  36. * Shows the application on macOS. This function does not automatically focus any specific app window.
  37. *
  38. * @example
  39. * ```typescript
  40. * import { show } from '@tauri-apps/api/app';
  41. * await show();
  42. * ```
  43. *
  44. * @since 1.2.0
  45. */
  46. declare function show(): Promise<void>;
  47. /**
  48. * Hides the application on macOS.
  49. *
  50. * @example
  51. * ```typescript
  52. * import { hide } from '@tauri-apps/api/app';
  53. * await hide();
  54. * ```
  55. *
  56. * @since 1.2.0
  57. */
  58. declare function hide(): Promise<void>;
  59. export { getName, getVersion, getTauriVersion, show, hide };