feat(app): socketBridge getConfig/setConfig + config_changed
This commit is contained in:
@@ -94,6 +94,7 @@ export type DaemonEvt =
|
|||||||
| { evt: "layout_changed"; data: { workspace_id: string } }
|
| { evt: "layout_changed"; data: { workspace_id: string } }
|
||||||
| { evt: "workspace_changed"; data: unknown }
|
| { evt: "workspace_changed"; data: unknown }
|
||||||
| { evt: "groups_changed"; data: unknown }
|
| { evt: "groups_changed"; data: unknown }
|
||||||
|
| { evt: "config_changed"; data: { config: ConfigView } }
|
||||||
| { evt: "event"; data: { record: EventRecord } }
|
| { evt: "event"; data: { record: EventRecord } }
|
||||||
| { evt: "events_read"; data: { ids: number[] } };
|
| { evt: "events_read"; data: { ids: number[] } };
|
||||||
|
|
||||||
@@ -186,3 +187,27 @@ export async function getHealth(): Promise<DaemonHealth> {
|
|||||||
export async function setZoom(workspaceId: string, surfaceId: string | null): Promise<void> {
|
export async function setZoom(workspaceId: string, surfaceId: string | null): Promise<void> {
|
||||||
await invoke("set_zoom", { workspaceId, surfaceId });
|
await invoke("set_zoom", { workspaceId, surfaceId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- Settings ----
|
||||||
|
|
||||||
|
export interface ConfigView {
|
||||||
|
default_shell: string;
|
||||||
|
font_family: string;
|
||||||
|
font_size: number;
|
||||||
|
theme: "dark" | "light";
|
||||||
|
accent: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getConfig(): Promise<ConfigView> {
|
||||||
|
return await invoke<ConfigView>("get_config");
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function setConfig(patch: Partial<Pick<ConfigView, "default_shell" | "font_family" | "font_size" | "theme" | "accent">>): Promise<void> {
|
||||||
|
await invoke("set_config", {
|
||||||
|
defaultShell: patch.default_shell ?? null,
|
||||||
|
fontFamily: patch.font_family ?? null,
|
||||||
|
fontSize: patch.font_size ?? null,
|
||||||
|
theme: patch.theme ?? null,
|
||||||
|
accent: patch.accent ?? null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user