baff51295a
- Open a dedicated settings BrowserWindow with general / login / diagnostics / about tabs - Persist openAtLogin and keepRunningInBackground via desktop-settings.json; hide main window instead of quitting when background mode is on - Default API base URL now points to api.shengxintui.com; LoginView and SettingsView share a single constant - Restore wangyihao session cookies on probe and silent refresh, and accept the legacy http://mp.163.com console origin - Drop the standalone diagnostics view in favor of the settings tab Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
65 lines
2.4 KiB
TypeScript
65 lines
2.4 KiB
TypeScript
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 DesktopAppSettings {
|
|
openAtLogin: boolean;
|
|
keepRunningInBackground: boolean;
|
|
}
|
|
|
|
interface Window {
|
|
desktopBridge: {
|
|
app: {
|
|
ping(): Promise<string>;
|
|
deviceInfo(): Promise<{
|
|
device_name: string;
|
|
os: string;
|
|
cpu_arch: string;
|
|
}>;
|
|
clientId(scope: {
|
|
tenant_id: number;
|
|
workspace_id: number;
|
|
user_id: number;
|
|
}): Promise<string>;
|
|
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>;
|
|
runtimeAccountSnapshot(accountId: string): Promise<DesktopRuntimeSnapshot["accounts"][number] | null>;
|
|
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>;
|
|
refreshRuntimeAccounts(): Promise<null>;
|
|
probeRuntimeAccount(accountId: string): Promise<DesktopRuntimeSnapshot["accounts"][number] | 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>;
|
|
openSettingsWindow(): Promise<null>;
|
|
getAppSettings(): Promise<DesktopAppSettings>;
|
|
setAppSetting(key: keyof DesktopAppSettings, value: boolean): Promise<DesktopAppSettings>;
|
|
syncRuntimeSession(session: DesktopRuntimeSessionSyncRequest | null): Promise<null>;
|
|
releaseRuntimeSession(revoke?: boolean): Promise<null>;
|
|
setWindowMode(mode: "login" | "main", request?: {
|
|
source?: "auth-state" | "login" | "logout";
|
|
animate?: boolean;
|
|
}): Promise<null>;
|
|
onRuntimeInvalidated(
|
|
listener: (event: { reason: "account-health"; at: number; accountId?: string }) => void,
|
|
): () => void;
|
|
onNetworkObserved(listener: (event: DesktopObservedRequest) => void): () => void;
|
|
};
|
|
};
|
|
}
|
|
}
|