import "./wasm_exec.js"; export declare const ZEBRASH_VERSION: string; export type ZplApi = { /** * Render a ZPL label into a PNG image (Base64-encoded string). * * @param zpl - The raw ZPL code to render. * @param widthMm - Label width in millimeters. Defaults to 101.6 mm (~4 inches). * @param heightMm - Label height in millimeters. Defaults to 203.2 mm (~8 inches). * @param dpmm - Dots per millimeter (print resolution). Defaults to 8 (~203 DPI). * @returns A Base64-encoded PNG image string representing the rendered label. * @deprecated Use `zplToBase64Async` instead. */ Render: (zpl: string, widthMm?: number, heightMm?: number, dpmm?: number) => string; /** * Asynchronously render a ZPL label into a PNG image (Base64-encoded string). * * @param zpl - The raw ZPL code to render. * @param widthMm - Label width in millimeters. Defaults to 101.6 mm (~4 inches). * @param heightMm - Label height in millimeters. Defaults to 203.2 mm (~8 inches). * @param dpmm - Dots per millimeter (print resolution). Defaults to 8 (~203 DPI). * @returns A Promise that resolves to a Base64-encoded PNG image string representing the rendered label. * @throws Will throw an error if the ZPL is invalid or rendering fails. * @example * ```typescript * import { ready } from "zpl-renderer-js" * const { api } = await ready; * const label = await api.zplToBase64Async("^XA^FO50,50^ADN,36,20^FDHello^FS^XZ"); * console.log(label); * ``` */ zplToBase64Async: (zpl: string, widthMm?: number, heightMm?: number, dpmm?: number) => Promise; /** * Asynchronously render multiple ZPL labels into PNG images (Base64-encoded strings). * * @param zpl - The raw ZPL code containing multiple labels to render. * @param widthMm - Label width in millimeters. Defaults to 101.6 mm (~4 inches). * @param heightMm - Label height in millimeters. Defaults to 203.2 mm (~8 inches). * @param dpmm - Dots per millimeter (print resolution). Defaults to 8 (~203 DPI). * @returns A Promise that resolves to an array of Base64-encoded PNG image strings representing the rendered labels. * @throws Will throw an error if the ZPL is invalid or rendering fails. * @example * ```typescript * import { ready } from "zpl-renderer-js" * const { api } = await ready; * const labels = await api.zplToBase64MultipleAsync("^XA^FO50,50^ADN,36,20^FDLabel 1^FS^XZ^XA^FO50,50^ADN,36,20^FDLabel 2^FS^XZ"); * for (const label in labels) { console.log(label); } // Base64-encoded PNG strings * ``` */ zplToBase64MultipleAsync: (zpl: string, widthMm?: number, heightMm?: number, dpmm?: number) => Promise; }; export declare const ready: Promise<{ api: ZplApi; }>; export declare function getApi(): Promise; export declare function Render(zpl: string, widthMm?: number, heightMm?: number, dpmm?: number): Promise; export declare function zplToBase64Async(zpl: string, widthMm?: number, heightMm?: number, dpmm?: number): Promise; export declare function zplToBase64MultipleAsync(zpl: string, widthMm?: number, heightMm?: number, dpmm?: number): Promise;