@openade/pem
Version:
Punto di Emissione (Emission Point) - Device library for fiscal receipts
46 lines • 1.44 kB
TypeScript
import type { DocumentoCommerciale, EmissionPointType } from '@openade/common';
import { type DocumentLine } from './document.builder';
import type { IPEMStorage } from './storage.interface';
export interface PEMConfig {
deviceType: EmissionPointType;
serialNumber: string;
vatNumber: string;
businessName: string;
pelUrl?: string;
}
export declare class PEMManager {
private config;
private documentBuilder;
private journal;
private storage;
private pelClient?;
private documentCounter;
private isSessionOpen;
private unsyncedDocuments;
constructor(config: PEMConfig, storage: IPEMStorage);
openSession(): Promise<void>;
emitReceipt(lines: DocumentLine[]): Promise<{
document: DocumentoCommerciale;
hash: string;
synced: boolean;
}>;
closeSession(): Promise<{
totalDocuments: number;
totalAmount: number;
journalSynced: boolean;
unsyncedDocuments: number;
}>;
getJournalEntries(): import("./journal.manager").JournalEntry[];
verifyJournal(): boolean;
getDocuments(): Promise<DocumentoCommerciale[]>;
getStatus(): {
isOpen: boolean;
deviceType: EmissionPointType;
serialNumber: string;
documentsCount: number;
journalVerified: boolean;
};
exportForSync(): Promise<string>;
exportJournal(): any;
}
//# sourceMappingURL=pem.manager.d.ts.map