import { type ThisComputerHost, type ThisComputerPermissionId, type ThisComputerStatus } from "@opengeni/sdk/this-computer"; export interface UseThisComputerResult { /** Null until the first reading, and outside a desktop app. */ status: ThisComputerStatus | null; /** An action from these screens is in progress. */ acting: boolean; /** The last action's failure from these screens, if the host didn't report one. */ actionError: string | null; /** The app can turn this computer off for the workspace. */ canDisconnect: boolean; /** Computer use is being turned on ("on") or off ("off") from these screens. */ pending: "on" | "off" | null; /** * While turning on: the permission the system is being asked for (its * prompt, or its System Settings list with the app's guide). Null once it * is granted with nothing else missing, or the person came back without * allowing it. */ asking: ThisComputerPermissionId | null; /** * On, but still not usable (`status.reconnecting`) after waiting longer than * turning on should take: screens stop the spinner and say what it waits * for (`status.waitingOn`), with Try again. Clears once it is usable, or * when it is turned on or off again. */ stalled?: boolean; refresh(): void; connect(options: { screenControl: boolean; }): Promise; pause(): Promise; resume(): Promise; disconnect(): Promise; /** * Turns computer use on, doing whatever it takes: resumes a paused agent, * restarts one that failed or is stuck connecting, registers this computer * (again) when it never was, its registration is gone (e.g. removed from * Machines) or the server needs it connected again, and starts the agent. Then it asks for * each missing permission in turn (see `asking`), so turning on is one step. * Resolves with the status before any permission is asked for. */ turnOn(): Promise; /** * Asks for the missing permissions, one after another as each is granted, * until the person comes back without allowing one. Nothing when none is missing. * Pass a reading just returned by an action, as the hook's may not have caught up. */ allowPermissions(status?: ThisComputerStatus | null): void; /** Turns computer use off: pauses the agent, keeping its registration so on is instant. */ turnOff(): Promise; requestPermission(id: ThisComputerPermissionId): Promise; } /** The bridge's error text without Electron's IPC prefix. */ export declare function hostErrorText(caught: unknown): string | null; /** * Where this computer stands for the workspace, kept current: the host says * when something changes, and the window coming back to the front reads it * again (permissions are granted in System Settings, outside the app). */ export declare function useThisComputer(host: ThisComputerHost | null | undefined, workspaceId: string, options?: { pollMs?: number; /** How long asking waits in the app with no system window shown before it stops. */ askQuietMs?: number; /** How long on may stay unusable (`reconnecting`) before it counts as `stalled`. */ turnOnLimitMs?: number; }): UseThisComputerResult;