git.iko.soy/rowtype-yoga/purescript-tauri
on main help sign in
21 lines 785 B history raw
1-- | Official Tauri app controls. `exit` requires @tauri-apps/api 2.12.0 or later,
2-- | core:app:allow-exit, and core:app:allow-set-dock-visibility as applicable.
3module Tauri.App (exit, setDockVisibility) where
5import Prelude (Unit)
7import Effect (Effect)
8import Effect.Aff (Aff)
9import Promise (Promise)
10import Promise.Aff (toAffE)
12-- | Terminate the native application with the supplied process exit code.
13exit :: Int -> Aff Unit
14exit code = toAffE (exitImpl code)
16-- | Show or hide the Dock icon. This is supported by Tauri on macOS only.
17setDockVisibility :: Boolean -> Aff Unit
18setDockVisibility visible = toAffE (setDockVisibilityImpl visible)
20foreign import exitImpl :: Int -> Effect (Promise Unit)
21foreign import setDockVisibilityImpl :: Boolean -> Effect (Promise Unit)