import { BaseAdapter } from './base-adapter'; import { ComponentMapping } from './types'; /** * Custom adapter that allows users to define their own component name mappings. * This enables the use of custom React components while still generating * valid ESC/POS commands. * * @example * ```typescript * // Define custom components * const Receipt = ({ children }) =>
{children}
; * const ItemRow = ({ children }) =>
{children}
; * const Price = ({ children }) => {children}; * * // Create custom mapping * const customMapping = { * Receipt: 'document', * ItemRow: 'view', * Price: 'text' * }; * * // Use with custom adapter * const adapter = new CustomAdapter(customMapping); * const buffer = await convertToESCPOS( * * * $10.00 * * , * { adapter } * ); * ``` */ export declare class CustomAdapter extends BaseAdapter { private readonly componentMap; private readonly userMapping; /** * Creates a new CustomAdapter with the provided component mapping. * * @param mapping - Component name to standard element type mapping * @throws Error if the mapping is empty or invalid */ constructor(mapping: ComponentMapping); /** * Adds standard element types as fallbacks to support mixing * custom components with standard @react-pdf/renderer components. */ private addStandardTypeFallbacks; /** * Normalizes custom component types to standard element types * using the user-provided mapping. * * @param type - The component type name (e.g., "Receipt", "ItemRow") * @returns The normalized standard element type (e.g., "document", "view") */ normalizeElementType(type: string): string; /** * Gets the original user-provided component mapping. * * @returns The component mapping configuration */ getMapping(): ComponentMapping; } //# sourceMappingURL=custom-adapter.d.ts.map