/** * Shared barcode convenience methods for printer drivers * Eliminates code duplication across CpclDriver, ZplDriver, etc. * * Uses mixin pattern: methods are applied to driver instances, * so they don't appear in the source of individual drivers. */ /** Function type for the underlying barcode method */ type BarcodeFn = (content: string, options: any) => unknown; /** Barcode convenience methods that get mixed into driver instances */ export interface BarcodeMixins { code128(content: string, x?: number, y?: number, height?: number): unknown; code39(content: string, x?: number, y?: number, height?: number): unknown; } /** * Apply barcode convenience methods to a driver instance. * Call this in the driver's constructor or after instantiation. * * @param target - The driver instance to augment * @param barcodeFn - The driver's `barcode()` method * @param code39Extra - Driver-specific code39 options * * @example * ```typescript * class CpclDriver { * constructor() { * applyBarcodeMixins(this, this.barcode.bind(this), { wide: 2, narrow: 1 }); * } * } * ``` */ export declare function applyBarcodeMixins(target: T, barcodeFn: BarcodeFn, code39Extra?: Record): T & BarcodeMixins; export {};