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:
@@ -503,6 +503,30 @@ export async function set_display_layout({
|
|||||||
return await native.set_display_layout({ mode, configStr });
|
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({
|
export async function power_control({
|
||||||
action
|
action
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
Reference in New Issue
Block a user