UNPKG

webzlp

Version:

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

236 lines 8.57 kB
import { BasicCommand, CommandEffectFlags, CommandTypeBasic, IPrinterBasicCommand } from './Commands.js'; import * as Util from '../Util/index.js'; import * as Conf from '../Configs/index.js'; export declare class StartLabel extends BasicCommand { name: string; type: "StartLabel"; constructor(); } export declare class EndLabel extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } export declare class PrintCommand implements IPrinterBasicCommand { readonly labelCount: number; readonly additionalDuplicateOfEach: number; name: string; type: CommandTypeBasic; toDisplay(): string; constructor(labelCount?: number, additionalDuplicateOfEach?: number); effectFlags: CommandEffectFlags; } export declare class IdentifyDeviceCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } export declare class NoOp extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } export declare class GetStatusCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } export declare class CutNowCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } /** A command to clear the image buffer. */ export declare class ClearImageBufferCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } /** A command to have the printer send its configuration back over serial. */ export declare class QueryConfigurationCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } /** A command to have the printer print its configuration labels. */ export declare class PrintConfigurationCommand extends BasicCommand { get name(): string; type: CommandTypeBasic; constructor(); } /** A command to store the current configuration as the stored configuration. */ export declare class SaveCurrentConfigurationCommand extends BasicCommand { name: string; type: CommandTypeBasic; constructor(); } /** A command to set the darkness the printer prints at. */ export declare class SetDarknessCommand implements IPrinterBasicCommand { readonly darknessPercent: Conf.DarknessPercent; name: string; type: CommandTypeBasic; toDisplay(): string; constructor(darknessPercent: Conf.DarknessPercent); effectFlags: CommandEffectFlags; } export declare class SetBackfeedAfterTakenMode implements IPrinterBasicCommand { readonly mode: Conf.BackfeedAfterTaken; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(mode: Conf.BackfeedAfterTaken); } /** A command to set the direction a label prints, either upside down or not. */ export declare class SetPrintDirectionCommand implements IPrinterBasicCommand { readonly upsideDown: boolean; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(upsideDown: boolean); } /** A command to set the print speed a printer prints at. Support varies per printer. */ export declare class SetPrintSpeedCommand implements IPrinterBasicCommand { readonly speed: Conf.PrintSpeed; readonly mediaSlewSpeed: Conf.PrintSpeed; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(speed: Conf.PrintSpeed, mediaSlewSpeed: Conf.PrintSpeed); } /** A command to set the label dimensions of this label. */ export declare class SetLabelDimensionsCommand implements IPrinterBasicCommand { readonly widthInDots: number; readonly lengthInDots?: number | undefined; readonly gapLengthInDots?: number | undefined; name: string; type: CommandTypeBasic; toDisplay(): string; get setsLength(): boolean; constructor(widthInDots: number, lengthInDots?: number | undefined, gapLengthInDots?: number | undefined); effectFlags: CommandEffectFlags; } export declare class SetLabelHomeCommand implements IPrinterBasicCommand { offset: Conf.Coordinate; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(offset: Conf.Coordinate); } /** Command class to set the print offset from the top-left of the label. */ export declare class SetLabelPrintOriginOffsetCommand implements IPrinterBasicCommand { offset: Conf.Coordinate; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(offset: Conf.Coordinate); } /** A command to set the media tracking type to continuous media. */ export declare class SetMediaToContinuousMediaCommand implements IPrinterBasicCommand { mediaLengthInDots: number; formGapInDots: number; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(mediaLengthInDots: number, formGapInDots: number); } /** A command to set the media tracking type to web gap detection. */ export declare class SetMediaToWebGapMediaCommand implements IPrinterBasicCommand { mediaLengthInDots: number; mediaGapInDots: number; mediaGapOffsetInDots: number; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(mediaLengthInDots: number, mediaGapInDots: number, mediaGapOffsetInDots?: number); } /** A command to set the media tracking type to black mark detection. */ export declare class SetMediaToMarkMediaCommand implements IPrinterBasicCommand { mediaLengthInDots: number; blackLineThicknessInDots: number; blackLineOffset: number; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(mediaLengthInDots: number, blackLineThicknessInDots: number, blackLineOffset?: number); } /** Command to cause the printer to auto-sense the media length. */ export declare class AutosenseMediaDimensionsCommand extends BasicCommand { get name(): string; type: CommandTypeBasic; constructor(); toDisplay(): string; } /** Command class to modify an offset. */ export declare class OffsetCommand implements IPrinterBasicCommand { readonly horizontal: number; readonly vertical?: number | undefined; readonly absolute: boolean; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(horizontal: number, vertical?: number | undefined, absolute?: boolean); } /** Command class to force a printer to reset. */ export declare class RebootPrinterCommand extends BasicCommand { get name(): string; type: CommandTypeBasic; constructor(); } /** Command class to draw an image into the image buffer for immediate print. */ export declare class AddImageCommand implements IPrinterBasicCommand { bitmap: Util.BitmapGRF; imageConversionOptions: Util.ImageConversionOptions; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(bitmap: Util.BitmapGRF, imageConversionOptions: Util.ImageConversionOptions); } /** List of colors to draw elements with */ export declare enum DrawColor { /** Draw in black */ black = 0, /** Draw in white */ white = 1 } /** Command class to draw a straight line. */ export declare class AddLineCommand implements IPrinterBasicCommand { readonly widthInDots: number; readonly heightInDots: number; readonly color: DrawColor; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(widthInDots: number, heightInDots: number, color: DrawColor); } /** Command to draw a box on a label */ export declare class AddBoxCommand implements IPrinterBasicCommand { readonly widthInDots: number; readonly heightInDots: number; readonly thickness: number; name: string; type: CommandTypeBasic; toDisplay(): string; effectFlags: CommandEffectFlags; constructor(widthInDots: number, heightInDots: number, thickness: number); } /** Sending a raw instruction to the printer. */ export declare class Raw implements IPrinterBasicCommand { readonly rawDocument: string; readonly effectFlags: CommandEffectFlags; name: string; type: CommandTypeBasic; toDisplay(): string; constructor(rawDocument: string, effectFlags: CommandEffectFlags); } //# sourceMappingURL=BasicCommands.d.ts.map