From 9eb4b7dec9d64f0ad078baf36c2566cf8ec8e251 Mon Sep 17 00:00:00 2001 From: Tony Date: Sat, 4 Jul 2026 20:28:00 +0800 Subject: [PATCH] format --- plugins/dialog/guest-js/index.ts | 8 ++------ plugins/fs/guest-js/index.ts | 10 ++-------- plugins/haptics/guest-js/bindings.ts | 9 ++------- plugins/opener/guest-js/init.ts | 3 +-- plugins/stronghold/guest-js/index.ts | 20 ++++---------------- 5 files changed, 11 insertions(+), 39 deletions(-) diff --git a/plugins/dialog/guest-js/index.ts b/plugins/dialog/guest-js/index.ts index 90d6b26ae..c279b1202 100644 --- a/plugins/dialog/guest-js/index.ts +++ b/plugins/dialog/guest-js/index.ts @@ -152,10 +152,7 @@ export type FileAccessMode = 'copy' | 'scoped' * @since 2.4.0 */ export type MessageDialogDefaultButtons = - | 'Ok' - | 'OkCancel' - | 'YesNo' - | 'YesNoCancel' + 'Ok' | 'OkCancel' | 'YesNo' | 'YesNoCancel' /** All possible button keys. */ type ButtonKey = 'ok' | 'cancel' | 'yes' | 'no' @@ -217,8 +214,7 @@ export type MessageDialogCustomButtons = * @since 2.4.0 */ export type MessageDialogButtons = - | MessageDialogDefaultButtons - | MessageDialogCustomButtons + MessageDialogDefaultButtons | MessageDialogCustomButtons /** * @since 2.0.0 diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index 1bbe0ec6d..71de548ba 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -1236,10 +1236,7 @@ type WatchEventKindAccess = * @since 2.0.0 */ type WatchEventKindCreate = - | { kind: 'any' } - | { kind: 'file' } - | { kind: 'folder' } - | { kind: 'other' } + { kind: 'any' } | { kind: 'file' } | { kind: 'folder' } | { kind: 'other' } /** * @since 2.0.0 @@ -1265,10 +1262,7 @@ type WatchEventKindModify = * @since 2.0.0 */ type WatchEventKindRemove = - | { kind: 'any' } - | { kind: 'file' } - | { kind: 'folder' } - | { kind: 'other' } + { kind: 'any' } | { kind: 'file' } | { kind: 'folder' } | { kind: 'other' } // TODO: Remove this in v3, return `Watcher` instead /** diff --git a/plugins/haptics/guest-js/bindings.ts b/plugins/haptics/guest-js/bindings.ts index d12920d85..1ec0b3d02 100644 --- a/plugins/haptics/guest-js/bindings.ts +++ b/plugins/haptics/guest-js/bindings.ts @@ -74,11 +74,7 @@ export const commands = { export type Error = never export type ImpactFeedbackStyle = - | 'light' - | 'medium' - | 'heavy' - | 'soft' - | 'rigid' + 'light' | 'medium' | 'heavy' | 'soft' | 'rigid' export type NotificationFeedbackType = 'success' | 'warning' | 'error' //export type RandomNumber = number; @@ -101,8 +97,7 @@ type __EventObj__ = { } export type Result = - | { status: 'ok'; data: T } - | { status: 'error'; error: E } + { status: 'ok'; data: T } | { status: 'error'; error: E } function __makeEvents__>( mappings: Record diff --git a/plugins/opener/guest-js/init.ts b/plugins/opener/guest-js/init.ts index 4c2b631fb..ac588e955 100644 --- a/plugins/opener/guest-js/init.ts +++ b/plugins/opener/guest-js/init.ts @@ -22,8 +22,7 @@ window.addEventListener('click', function (evt) { const a = evt .composedPath() .find((el) => el instanceof Node && el.nodeName.toUpperCase() === 'A') as - | HTMLAnchorElement - | undefined + HTMLAnchorElement | undefined // return early if if ( diff --git a/plugins/stronghold/guest-js/index.ts b/plugins/stronghold/guest-js/index.ts index c1945a210..95161482e 100644 --- a/plugins/stronghold/guest-js/index.ts +++ b/plugins/stronghold/guest-js/index.ts @@ -5,25 +5,13 @@ import { invoke } from '@tauri-apps/api/core' export type ClientPath = - | string - | Iterable - | ArrayLike - | ArrayBuffer + string | Iterable | ArrayLike | ArrayBuffer export type VaultPath = - | string - | Iterable - | ArrayLike - | ArrayBuffer + string | Iterable | ArrayLike | ArrayBuffer export type RecordPath = - | string - | Iterable - | ArrayLike - | ArrayBuffer + string | Iterable | ArrayLike | ArrayBuffer export type StoreKey = - | string - | Iterable - | ArrayLike - | ArrayBuffer + string | Iterable | ArrayLike | ArrayBuffer export interface ConnectionLimits { maxPendingIncoming?: number