summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/context/platform.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/desktop/src/context/platform.tsx')
-rw-r--r--packages/desktop/src/context/platform.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/desktop/src/context/platform.tsx b/packages/desktop/src/context/platform.tsx
index 2ac9f64d4..73d4c7f3e 100644
--- a/packages/desktop/src/context/platform.tsx
+++ b/packages/desktop/src/context/platform.tsx
@@ -5,6 +5,12 @@ export type Platform = {
/** Platform discriminator */
platform: "web" | "tauri"
+ /** Open a URL in the default browser */
+ openLink(url: string): void
+
+ /** Restart the app */
+ restart(): Promise<void>
+
/** Open native directory picker dialog (Tauri only) */
openDirectoryPickerDialog?(opts?: { title?: string; multiple?: boolean }): Promise<string | string[] | null>
@@ -14,9 +20,6 @@ export type Platform = {
/** Save file picker dialog (Tauri only) */
saveFilePickerDialog?(opts?: { title?: string; defaultPath?: string }): Promise<string | null>
- /** Open a URL in the default browser */
- openLink(url: string): void
-
/** Storage mechanism, defaults to localStorage */
storage?: (name?: string) => SyncStorage | AsyncStorage
@@ -25,6 +28,9 @@ export type Platform = {
/** Install updates (Tauri only) */
update?(): Promise<void>
+
+ /** Fetch override */
+ fetch?: typeof fetch
}
export const { use: usePlatform, provider: PlatformProvider } = createSimpleContext({