示例工程 37-local-persistence
37-local-persistence/app/src/api.d.ts
import type { Snapshot } from "../shared/ipc";
declare global {
interface Window {
api: {
store: {
snapshot: () => Promise<Snapshot>;
addNote: (text: string) => Promise<Snapshot>;
reload: () => Promise<Snapshot>;
corrupt: () => Promise<Snapshot>;
bench: (count: number) => Promise<Snapshot>;
refresh: () => Promise<Snapshot>;
onEvent: (
callback: (event: {
kind: string;
detail: string;
at: number;
}) => void,
) => () => void;
};
};
__prepareShots?: (stage: "json" | "sqlite" | "bench") => Promise<void>;
__smoke?: () => Promise<unknown>;
}
}
export {};