/** * ImportParser — parses password manager export files into VaultEntry arrays. * * Supports CSV, JSON, XML, and 1PUX formats from major password managers. * Maps source fields to VaultEntry types with fallback to secure_note. * * Browser-compatible: uses ArrayBuffer | string input and TextDecoder. * * Requirements: 4.1, 4.2, 4.3, 4.4, 4.5, 4.6 */ import { ImportFormat, VaultEntry } from '../../interfaces/brightpass'; /** Raw parsed record before type mapping */ interface RawRecord { name?: string; title?: string; url?: string; username?: string; password?: string; notes?: string; type?: string; cardholderName?: string; cardNumber?: string; expirationDate?: string; cvv?: string; firstName?: string; lastName?: string; email?: string; phone?: string; address?: string; totp?: string; favorite?: string | boolean; folder?: string; tags?: string; [key: string]: string | boolean | undefined; } export declare class ImportParser { /** * Convert ArrayBuffer or string content to text string. * Uses TextDecoder for browser compatibility. */ private static contentToText; /** * Parse a file content into VaultEntry array based on format. * Accepts ArrayBuffer (from FileReader) or string for browser compatibility. */ static parse(format: ImportFormat, content: ArrayBuffer | string): { entries: VaultEntry[]; errors: Array<{ recordIndex: number; error: string; }>; }; /** * Parse CSV text into rows. Handles quoted fields with commas (Req 4.6). * Quoted fields preserve their exact content including whitespace. * Unquoted fields are trimmed. */ private static parseCsvRows; /** * Convert CSV rows to RawRecord array using header row. */ private static csvToRecords; /** * Parse Chrome/Firefox CSV exports (Req 4.2). */ private static parseBrowserCsv; /** * Parse LastPass CSV exports (Req 4.2). */ private static parseLastPassCsv; /** * Parse generic CSV format (1Password CSV, Bitwarden CSV). */ private static parseGenericCsv; /** * Parse Bitwarden JSON exports (Req 4.1, 4.2). */ private static parseBitwardenJson; /** * Parse Dashlane JSON exports (Req 4.2). */ private static parseDashlaneJson; /** * Parse 1Password 1PUX exports (Req 4.1, 4.2). */ private static parse1Pux; /** * Parse KeePass XML exports (Req 4.1, 4.2). */ private static parseKeePassXml; /** * Map raw records to typed VaultEntry objects. * Determines type based on available fields, falls back to secure_note (Req 4.3, 4.4). * Returns both entries and errors for failed records (Req 4.5). */ static mapToEntries(rawRecords: RawRecord[]): { entries: VaultEntry[]; errors: Array<{ recordIndex: number; error: string; }>; }; } export {}; //# sourceMappingURL=importParser.d.ts.map