2026-04-20 09:52:48 +08:00
|
|
|
import type {
|
|
|
|
|
CreatePublishJobResponse,
|
|
|
|
|
DesktopAccountInfo,
|
|
|
|
|
DesktopPublishTaskListResponse,
|
|
|
|
|
DesktopRuntimeSessionSyncRequest,
|
|
|
|
|
ListDesktopPublishTasksParams,
|
|
|
|
|
} from "@geo/shared-types";
|
2026-04-22 00:24:21 +08:00
|
|
|
import type { DesktopObservedRequest } from "../shared/network-debug";
|
2026-04-19 14:18:20 +08:00
|
|
|
import type { DesktopRuntimeSnapshot } from "./types";
|
|
|
|
|
|
|
|
|
|
export {};
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
interface Window {
|
|
|
|
|
desktopBridge: {
|
|
|
|
|
app: {
|
|
|
|
|
ping(): Promise<string>;
|
2026-04-20 11:59:35 +08:00
|
|
|
deviceInfo(): Promise<{ device_name: string; os: string; cpu_arch: string }>;
|
2026-04-19 14:18:20 +08:00
|
|
|
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>;
|
|
|
|
|
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>;
|
2026-04-20 09:52:48 +08:00
|
|
|
refreshRuntimeAccounts(): Promise<null>;
|
2026-04-19 14:18:20 +08:00
|
|
|
openPublishAccountConsole(account: {
|
|
|
|
|
id: string;
|
|
|
|
|
platform: string;
|
|
|
|
|
platformUid: string;
|
|
|
|
|
displayName: string;
|
|
|
|
|
}): Promise<null>;
|
2026-04-20 09:52:48 +08:00
|
|
|
unbindPublishAccount(accountId: string, syncVersion: number): Promise<null>;
|
|
|
|
|
listPublishTasks(params?: ListDesktopPublishTasksParams): Promise<DesktopPublishTaskListResponse>;
|
|
|
|
|
retryPublishTask(taskId: string): Promise<CreatePublishJobResponse>;
|
2026-04-26 19:47:35 +08:00
|
|
|
openExternalUrl(url: string): Promise<null>;
|
2026-04-19 14:18:20 +08:00
|
|
|
syncRuntimeSession(session: DesktopRuntimeSessionSyncRequest | null): Promise<null>;
|
2026-04-20 09:52:48 +08:00
|
|
|
releaseRuntimeSession(revoke?: boolean): Promise<null>;
|
2026-04-22 00:24:21 +08:00
|
|
|
setWindowMode(mode: "login" | "main"): Promise<null>;
|
2026-04-20 17:16:15 +08:00
|
|
|
onRuntimeInvalidated(
|
|
|
|
|
listener: (event: { reason: "account-health"; at: number }) => void,
|
|
|
|
|
): () => void;
|
2026-04-22 00:24:21 +08:00
|
|
|
onNetworkObserved(listener: (event: DesktopObservedRequest) => void): () => void;
|
2026-04-19 14:18:20 +08:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|