feat(display): expose list_display_modes and set_display_mode in relay

Svelte callers can now enumerate all display modes and set resolution/
refresh/HiDPI per display through the native bridge.
This commit is contained in:
Scott Idem
2026-05-20 18:16:43 -04:00
parent 7621e044b4
commit 5bb06c4904

View File

@@ -503,6 +503,30 @@ export async function set_display_layout({
return await native.set_display_layout({ mode, configStr });
}
export async function list_display_modes() {
if (!native || !native.list_display_modes)
return { success: false, error: 'Native handler list_display_modes not available' };
return await native.list_display_modes();
}
export async function set_display_mode({
display_index,
width,
height,
refresh_rate,
hidpi
}: {
display_index: number;
width: number;
height: number;
refresh_rate?: number;
hidpi?: boolean | null;
}) {
if (!native || !native.set_display_mode)
return { success: false, error: 'Native handler set_display_mode not available' };
return await native.set_display_mode({ display_index, width, height, refresh_rate, hidpi });
}
export async function power_control({
action
}: {