示例工程 06-dev-debug-logging
06-dev-debug-logging/app/.tsc/shared/ipc.d.ts
/**
* 三端唯一来源:通道名与类型。
* 本文件不 import electron,渲染进程也能安全引用。
*/
export declare const CH: {
readonly info: "debug:info";
readonly log: "debug:log";
readonly clear: "debug:clear";
readonly devtools: "debug:devtools";
};
export type LogLevel = "debug" | "info" | "warn" | "error";
export type LogRecord = {
at: number;
level: LogLevel;
evt: string;
msg?: string;
};
export type DebugInfo = {
logs: LogRecord[];
logFile: string;
logSize: number;
logLimit: number;
devToolsOpen: boolean;
enableLogging: boolean;
execArgv: string[];
isPackaged: boolean;
};
export type Api = {
info(): Promise<DebugInfo>;
log(level: LogLevel, msg: string): Promise<{
ok: boolean;
}>;
clear(): Promise<{
ok: boolean;
}>;
devtools(): Promise<{
ok: boolean;
}>;
};
export declare function isLogLevel(value: unknown): value is LogLevel;
//# sourceMappingURL=ipc.d.ts.map