Skip to content

Commit 62dd953

Browse files
committed
chore: revert bindings.ts to upstream version
1 parent aa5889d commit 62dd953

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/bindings.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ async changeMuteWhileRecordingSetting(enabled: boolean) : Promise<Result<null, s
244244
else return { status: "error", error: e as any };
245245
}
246246
},
247+
async changeUpdateChecksSetting(enabled: boolean) : Promise<Result<null, string>> {
248+
try {
249+
return { status: "ok", data: await TAURI_INVOKE("change_update_checks_setting", { enabled }) };
250+
} catch (e) {
251+
if(e instanceof Error) throw e;
252+
else return { status: "error", error: e as any };
253+
}
254+
},
247255
async triggerUpdateCheck() : Promise<Result<null, string>> {
248256
try {
249257
return { status: "ok", data: await TAURI_INVOKE("trigger_update_check") };
@@ -569,8 +577,10 @@ async updateRecordingRetentionPeriod(period: string) : Promise<Result<null, stri
569577
}
570578
},
571579
/**
572-
* Stub implementation for non-macOS platforms
573-
* Always returns false since laptop detection is macOS-specific
580+
* Checks if the Mac is a laptop by detecting battery presence
581+
*
582+
* This uses pmset to check for battery information.
583+
* Returns true if a battery is detected (laptop), false otherwise (desktop)
574584
*/
575585
async isLaptop() : Promise<Result<boolean, string>> {
576586
try {
@@ -592,7 +602,7 @@ async isLaptop() : Promise<Result<boolean, string>> {
592602

593603
/** user-defined types **/
594604

595-
export type AppSettings = { bindings: Partial<{ [key in string]: ShortcutBinding }>; push_to_talk: boolean; audio_feedback: boolean; audio_feedback_volume?: number; sound_theme?: SoundTheme; start_hidden?: boolean; autostart_enabled?: boolean; selected_model?: string; always_on_microphone?: boolean; selected_microphone?: string | null; clamshell_microphone?: string | null; selected_output_device?: string | null; translate_to_english?: boolean; selected_language?: string; overlay_position?: OverlayPosition; debug_mode?: boolean; log_level?: LogLevel; custom_words?: string[]; model_unload_timeout?: ModelUnloadTimeout; word_correction_threshold?: number; history_limit?: string; recording_retention_period?: RecordingRetentionPeriod; paste_method?: PasteMethod; clipboard_handling?: ClipboardHandling; post_process_enabled?: boolean; post_process_provider_id?: string; post_process_providers?: PostProcessProvider[]; post_process_api_keys?: Partial<{ [key in string]: string }>; post_process_models?: Partial<{ [key in string]: string }>; post_process_prompts?: LLMPrompt[]; post_process_selected_prompt_id?: string | null; mute_while_recording?: boolean }
605+
export type AppSettings = { bindings: Partial<{ [key in string]: ShortcutBinding }>; push_to_talk: boolean; audio_feedback: boolean; audio_feedback_volume?: number; sound_theme?: SoundTheme; start_hidden?: boolean; autostart_enabled?: boolean; update_checks_enabled?: boolean; selected_model?: string; always_on_microphone?: boolean; selected_microphone?: string | null; clamshell_microphone?: string | null; selected_output_device?: string | null; translate_to_english?: boolean; selected_language?: string; overlay_position?: OverlayPosition; debug_mode?: boolean; log_level?: LogLevel; custom_words?: string[]; model_unload_timeout?: ModelUnloadTimeout; word_correction_threshold?: number; history_limit?: string; recording_retention_period?: RecordingRetentionPeriod; paste_method?: PasteMethod; clipboard_handling?: ClipboardHandling; post_process_enabled?: boolean; post_process_provider_id?: string; post_process_providers?: PostProcessProvider[]; post_process_api_keys?: Partial<{ [key in string]: string }>; post_process_models?: Partial<{ [key in string]: string }>; post_process_prompts?: LLMPrompt[]; post_process_selected_prompt_id?: string | null; mute_while_recording?: boolean }
596606
export type AudioDevice = { index: string; name: string; is_default: boolean }
597607
export type BindingResponse = { success: boolean; binding: ShortcutBinding | null; error: string | null }
598608
export type ClipboardHandling = "dont_modify" | "copy_to_clipboard"

0 commit comments

Comments
 (0)