import type { TSKRType } from './skr.types.js'; export interface IExportOptions { exportPath: string; fiscalYear: number; dateFrom: Date; dateTo: Date; includeDocuments?: boolean; generatePdfReports?: boolean; signExport?: boolean; timestampExport?: boolean; companyInfo?: { name: string; taxId: string; registrationNumber?: string; address?: string; }; } export interface IExportMetadata { exportVersion: string; exportTimestamp: string; generator: { name: string; version: string; }; company?: { name: string; taxId: string; registrationNumber?: string; address?: string; }; fiscalYear: number; dateRange: { from: string; to: string; }; skrType: TSKRType; schemaVersion: string; crypto: { digestAlgorithms: string[]; signatureType?: string; timestampPolicy?: string; merkleTree: boolean; }; options: { packagedAs: 'bagit'; compression: 'none' | 'deflate'; deduplication: boolean; }; } export interface IBagItManifest { [filePath: string]: string; } export interface IDocumentIndex { contentHash: string; sizeBytes: number; mimeType: string; createdAt: string; originalFilename?: string; pdfaAvailable: boolean; zugferdXml?: string; retentionClass: string; } export declare class SkrExport { private logger; private options; private exportDir; private manifest; private tagManifest; constructor(options: IExportOptions); /** * Creates the BagIt directory structure for the export */ createBagItStructure(): Promise; /** * Creates the bagit.txt declaration file */ private createBagItDeclaration; /** * Creates the README.txt file with Verfahrensdokumentation */ private createReadme; /** * Creates the export metadata JSON file */ createExportMetadata(skrType: TSKRType): Promise; /** * Creates JSON schemas for the export data structures */ createSchemas(): Promise; /** * Writes the BagIt manifest files */ writeManifests(): Promise; /** * Calculates SHA-256 hash of a file */ private hashFile; /** * Stores a document in content-addressed storage */ /** The bag directory (`/jahresabschluss_`). */ get directory(): string; /** * Writes a payload file into the bag and records its hash in the manifest. * The path is relative to the bag root and must lie under `data/`. */ addFile(relativePathArg: string, contentArg: Buffer | string): Promise; /** Records the hash of a payload file that was written into the bag by other means. */ registerFile(relativePathArg: string): Promise; /** * Records every payload file under `data/` that the manifest does not list * yet, so files written by the exporters end up in the manifest before it * is written. Returns the paths that were added. */ registerUnlistedDataFiles(): Promise; private requireDataPath; storeDocument(content: Buffer, originalFilename?: string): Promise; /** * Creates a Merkle tree from all file hashes */ createMerkleTree(): Promise; /** * Validates the BagIt structure */ validateBagIt(): Promise; }