feat: add accordion overlay controls and icon API
This commit is contained in:
@@ -2,6 +2,7 @@ import {invokeCommand} from "../../../shared/tauri/invoke";
|
||||
import type {
|
||||
CountdownCommand,
|
||||
CountdownPayload,
|
||||
OverlayConfigPayload,
|
||||
CountdownSnapshot,
|
||||
CountdownSnapshotDto
|
||||
} from "../model/countdown.types";
|
||||
@@ -50,3 +51,18 @@ export async function resetCountdown(id: number): Promise<void> {
|
||||
export async function fetchCountdownSnapshot(id: number): Promise<CountdownSnapshot> {
|
||||
return mapSnapshotDtoToSnapshot(await invokeCommand<CountdownSnapshotDto>("countdown_snapshot", {id}));
|
||||
}
|
||||
|
||||
export async function setOverlayConfig(
|
||||
id: number,
|
||||
icon: string,
|
||||
textColor: string,
|
||||
bgColor: string,
|
||||
): Promise<void> {
|
||||
const payload: OverlayConfigPayload = {
|
||||
id,
|
||||
icon,
|
||||
text_color: textColor,
|
||||
bg_color: bgColor,
|
||||
};
|
||||
await invokeCommand<void>("set_overlay_config", payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user