Files
geo/apps/desktop-client/src/renderer/env.d.ts
T

43 lines
1.6 KiB
TypeScript
Raw Normal View History

import type {
CreatePublishJobResponse,
DesktopAccountInfo,
DesktopPublishTaskListResponse,
DesktopRuntimeSessionSyncRequest,
ListDesktopPublishTasksParams,
} from "@geo/shared-types";
import type { DesktopObservedRequest } from "../shared/network-debug";
import type { DesktopRuntimeSnapshot } from "./types";
export {};
declare global {
interface Window {
desktopBridge: {
app: {
ping(): Promise<string>;
deviceInfo(): Promise<{ device_name: string; os: string; cpu_arch: string }>;
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>;
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>;
refreshRuntimeAccounts(): Promise<null>;
openPublishAccountConsole(account: {
id: string;
platform: string;
platformUid: string;
displayName: string;
}): Promise<null>;
unbindPublishAccount(accountId: string, syncVersion: number): Promise<null>;
listPublishTasks(params?: ListDesktopPublishTasksParams): Promise<DesktopPublishTaskListResponse>;
retryPublishTask(taskId: string): Promise<CreatePublishJobResponse>;
openExternalUrl(url: string): Promise<null>;
syncRuntimeSession(session: DesktopRuntimeSessionSyncRequest | null): Promise<null>;
releaseRuntimeSession(revoke?: boolean): Promise<null>;
setWindowMode(mode: "login" | "main"): Promise<null>;
onRuntimeInvalidated(
listener: (event: { reason: "account-health"; at: number }) => void,
): () => void;
onNetworkObserved(listener: (event: DesktopObservedRequest) => void): () => void;
};
};
}
}