import type { NewEntry } from '../interfaces/Entry.mjs'; import type Entry from '../interfaces/Entry.mjs'; import type { EntryId } from '../interfaces/Entry.mjs'; import type { QrCodeLib } from '../interfaces/QrCodeLib.mjs'; import type { OpenPgpLib } from '../interfaces/OpenPgpLib.mjs'; import type { UrlParser } from '../interfaces/UrlParserLib.mjs'; /** * Parses an OTP URI and extracts the relevant information to create a new entry. * @param parseUrl - The platform's URL parser. * @param otpUri - The OTP URI to parse. * @returns An object representing the new entry. * @throws {ExportImportError} If the URI is invalid or contains unsupported features. */ export declare const parseOtpUri: (parseUrl: UrlParser, otpUri: string) => NewEntry; /** * Generates the otpauth:// URI for a single entry. * @param entry - The OTP entry. * @returns The otpauth:// URI string. */ export declare const generateOtpUrl: (entry: Entry) => string; /** * Generates an HTML page with QR codes for the provided OTP entries. * @param qrGeneratorLib - The QR code generation library. * @param entries - An array of OTP entries. * @returns A promise that resolves to the HTML string. */ export declare const generateHtmlExport: (qrGeneratorLib: QrCodeLib, entries: Entry[]) => Promise; /** * Generates a text export of OTP URIs for the provided entries. * @param entries - An array of OTP entries. * @returns A version comment followed by the OTP URIs, one per line. */ export declare const generateTextExport: (entries: Entry[]) => string; /** * Processes the lines of a text file containing OTP URIs and returns an array of objects, each containing the line number, * the EntryId or null if it was not a valid entry and the error if there was one. * @param lines - An array of strings, each containing an OTP URI. * @param importFromUri - A function that takes a URI and returns a promise that resolves to the EntryId. * @returns A promise that resolves to an array of objects, each containing the line number, * the EntryId or null if it was not a valid entry and the error if there was one. */ export declare const processImportLines: (lines: string[], importFromUri: (uri: string) => Promise) => Promise<{ lineNr: number; entryId: EntryId | null; error: unknown; }[]>; /** * Encrypts the given data using OpenPGP. * @param openPgpLib - The OpenPGP library. * @param data - The data to encrypt. * @param password - The password to use for encryption. * @returns A promise that resolves to the encrypted data. */ export declare const encryptExport: (openPgpLib: OpenPgpLib, data: string, password: string) => Promise; /** * Decrypts the given data using OpenPGP. * @param openPgpLib - The OpenPGP library. * @param data - The data to decrypt. * @param password - The password to use for decryption. * @returns A promise that resolves to the decrypted data. */ export declare const decryptExport: (openPgpLib: OpenPgpLib, data: string, password: string) => Promise;