mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-02-23 07:22:17 +08:00
37 lines
827 B
TypeScript
37 lines
827 B
TypeScript
|
import { invoke } from '@tauri-apps/api/core';
|
||
|
|
||
|
interface Device {
|
||
|
id: string;
|
||
|
status: string;
|
||
|
}
|
||
|
|
||
|
export async function adbDevices(): Promise<Device[]> {
|
||
|
return await invoke("adb_devices");
|
||
|
}
|
||
|
|
||
|
export async function getScreenSize(id: string): Promise<[number, number]> {
|
||
|
return await invoke("get_screen_size", { id });
|
||
|
}
|
||
|
|
||
|
export async function forwardServerPort(
|
||
|
id: string,
|
||
|
scid: string,
|
||
|
port: number
|
||
|
): Promise<void> {
|
||
|
return await invoke("forward_server_port", { id, scid, port });
|
||
|
}
|
||
|
|
||
|
export async function pushServerFile(id: string): Promise<void> {
|
||
|
return await invoke("push_server_file", { id });
|
||
|
}
|
||
|
|
||
|
export async function startScrcpyServer(
|
||
|
id: string,
|
||
|
scid: string,
|
||
|
address: string
|
||
|
): Promise<void> {
|
||
|
return await invoke("start_scrcpy_server", { id, scid, address });
|
||
|
}
|
||
|
|
||
|
export type { Device };
|