示例工程 02-first-app

02-first-app/app/shared/ipc.ts

typescript · 0.5 KB

/**
 * 三端唯一来源:通道名与类型。
 * 本文件不 import electron,渲染进程也能安全引用。
 */
export const CH = {
  info: "project:info",
} as const;

export type ProjectInfo = {
  appName: string;
  appVersion: string;
  isPackaged: boolean;
  appPath: string;
  resourcesPath: string;
  hasDevServerUrl: boolean;
  electron: string;
  node: string;
  chrome: string;
  scripts: Record<string, string>;
};

export type Api = {
  info(): Promise<ProjectInfo>;
};