UNPKG

webzlp

Version:

A small library using WebUSB to print labels on label printers.

37 lines 1.89 kB
import * as Conf from '../Configs/index.js'; import * as Cmds from '../Commands/index.js'; /** A prepared document, ready to be compiled and sent. */ export interface IDocument { /** Gets the series of commands this document contains. */ commands: ReadonlyArray<Cmds.IPrinterCommand>; } /** Stream of commands, with zero or more commands expected to return messages. */ export declare class Transaction { readonly commands: Conf.MessageArrayLike; readonly awaitedCommands: Cmds.IPrinterCommand[]; constructor(commands: Conf.MessageArrayLike, awaitedCommands: Cmds.IPrinterCommand[]); } /** Compiled document of commands ready to be sent to a printer which supports the PCL. */ export declare class CompiledDocument { readonly language: Conf.PrinterCommandLanguage; readonly effects: Cmds.CommandEffectFlags; readonly transactions: Transaction[]; constructor(language: Conf.PrinterCommandLanguage, effects: Cmds.CommandEffectFlags, transactions: Transaction[]); } /** A basic document builder, containing internal state to construct a document. */ export declare abstract class DocumentBuilder<TBuilder extends DocumentBuilder<TBuilder>> { private _commands; protected _config: Cmds.PrinterConfig; /** The reordering behavior for commands that should not be present within a document. */ abstract get commandReorderBehavior(): Cmds.CommandReorderBehavior; constructor(config: Cmds.PrinterConfig); /** Clear the commands in this document and reset it to the starting blank. */ clear(): TBuilder; /** Return the list of commands that will be performed in human-readable format. */ showCommands(): string; /** Return the final built document. */ finalize(): IDocument; /** Add an arbitrary command to the document. */ andThen(...command: Cmds.IPrinterCommand[]): this; } //# sourceMappingURL=Document.d.ts.map