35 lines
908 B
TypeScript
35 lines
908 B
TypeScript
// Electron API 类型声明
|
|
interface ElectronPrinterInfo {
|
|
name: string;
|
|
displayName?: string;
|
|
description?: string;
|
|
status?: number;
|
|
isDefault?: boolean;
|
|
options?: Record<string, string>;
|
|
}
|
|
|
|
interface ElectronAPI {
|
|
fetchPdf: (
|
|
pdfUrl: string
|
|
) => Promise<{ success: boolean; data?: string; error?: string }>;
|
|
printPdf: (
|
|
pdfUrl: string,
|
|
options?: { printerName?: string }
|
|
) => Promise<{ success: boolean; error?: string }>;
|
|
getPrinters: () => Promise<{
|
|
success: boolean;
|
|
printers?: ElectronPrinterInfo[];
|
|
error?: string;
|
|
}>;
|
|
startIdCardListen: () => Promise<any>;
|
|
stopIdCardListen: () => Promise<any>;
|
|
onIdCardData: (callback: (data: any) => void) => void;
|
|
onIdCardError: (callback: (error: any) => void) => void;
|
|
log: (level: string, message: any) => void;
|
|
removeIdCardListeners: () => void;
|
|
}
|
|
|
|
interface Window {
|
|
electronAPI: ElectronAPI;
|
|
}
|