import { AdapterProvider, AdapterRegistration, IDocumentConverter } from './types'; import { ConverterOptions, DocumentElement, InitOptions, Middleware } from './types'; export declare class Converter { private _middlewareManager; private _parser; private _registry; constructor(options: ConverterOptions); useMiddleware(mw: Middleware): void; registerConverter(format: string, converter: IDocumentConverter): void; /** * Converts the provided content into a specified file format (e.g., DOCX, PDF, Markdown, etc.). * * @param content - The input content to convert. Can be either: * - A raw HTML string to be parsed before conversion, or * - A pre-parsed array of `DocumentElement` objects. * @param format - The target output format (e.g., `'docx'`, `'pdf'`, `'md'`, etc.). * @returns A `Promise` that resolves to a `Buffer` (for Node environments) or a `Blob` (for browser environments), * representing the generated file in the specified format. * * @throws Will throw an error if the specified format does not have a registered adapter. */ convert(content: string | DocumentElement[], format: string): Promise; /** * Parses an HTML string into a structured array of `DocumentElement` objects. * * This method first executes any registered middleware transformations on the HTML, * then uses the configured parser to convert the modified HTML into a document-agnostic * intermediate format (`DocumentElement[]`), which can be used by format adapters (e.g., DOCX, PDF). * * @param html - The raw HTML string to be parsed. * @returns A `Promise` that resolves to an array of `DocumentElement` objects representing the parsed content. */ parse(html: string): Promise; } /** * A helper function that provides type inference for creating registrations. * Using this function is key to ensuring the `config` object is correctly typed. */ export declare const createRegistration: >(registration: AdapterRegistration) => AdapterRegistration; export declare const init: []>(options?: InitOptions) => Converter; //# sourceMappingURL=converter.d.ts.map