Saltar al contenido

API

method printImage(...)

printImage(options: BRLMPrintOptions) => Promise<void>
Parámetro Tipo
options BRLMPrintOptions

search(option: BRLMSearchOption) => Promise<void>

Busca impresoras. Si no encuentra ninguna, devuelve una lista vacía sin producir un error.

Parámetro Tipo
option BRLMSearchOption

method isChannelAvailable(...)

isChannelAvailable(option: BRLMChannelResult) => Promise<isChannelAvailableResult>

Si guardaste el último BRLMChannelResult conectado, puedes usarlo para comprobar si sigue disponible.

Parámetro Tipo
option BRLMChannelResult

Devuelve: Promise<isChannelAvailableResult>


method cancelSearchWiFiPrinter()

cancelSearchWiFiPrinter() => Promise<void>

Detén la búsqueda activa antes de que se agote el tiempo de espera, también al salir de la pantalla.


method cancelSearchBluetoothPrinter()

cancelSearchBluetoothPrinter() => Promise<void>

Detén la búsqueda activa antes de que se agote el tiempo de espera, también al salir de la pantalla.


method addListener(BrotherPrintEventsEnum.onPrinterAvailable, ...)

addListener(eventName: BrotherPrintEventsEnum.onPrinterAvailable, listenerFunc: (printers: BRLMChannelResult) => void) => Promise<PluginListenerHandle>

Busca la impresora a la que se puede conectar el dispositivo.

Parámetro Tipo
eventName BrotherPrintEventsEnum.onPrinterAvailable
listenerFunc (printers: BRLMChannelResult) => void

Devuelve: Promise<PluginListenerHandle>


method addListener(BrotherPrintEventsEnum.onPrint, ...)

addListener(eventName: BrotherPrintEventsEnum.onPrint, listenerFunc: () => void) => Promise<PluginListenerHandle>

Evento de impresión correcta

Parámetro Tipo
eventName BrotherPrintEventsEnum.onPrint
listenerFunc () => void

Devuelve: Promise<PluginListenerHandle>


method addListener(BrotherPrintEventsEnum.onPrintFailedCommunication, ...)

addListener(eventName: BrotherPrintEventsEnum.onPrintFailedCommunication, listenerFunc: (info: ErrorInfo) => void) => Promise<PluginListenerHandle>

No se pudo conectar con la impresora. Por ejemplo, es posible que Bluetooth o la impresora estén apagados.

Parámetro Tipo
eventName BrotherPrintEventsEnum.onPrintFailedCommunication
listenerFunc (info: ErrorInfo) => void

Devuelve: Promise<PluginListenerHandle>


method addListener(BrotherPrintEventsEnum.onPrintError, ...)

addListener(eventName: BrotherPrintEventsEnum.onPrintError, listenerFunc: (info: ErrorInfo) => void) => Promise<PluginListenerHandle>

La impresión ha fallado.

Parámetro Tipo
eventName BrotherPrintEventsEnum.onPrintError
listenerFunc (info: ErrorInfo) => void

Devuelve: Promise<PluginListenerHandle>


Interfaces

interface PluginListenerHandle

Propiedad Tipo
remove () => Promise<void>

Alias de tipos

type alias BRLMPrintOptions

{ encodedImage: string; /** * Should use enum BRLMPrinterModelName */ modelName: BRLMPrinterModelName; } & Partial<BRLMChannelResult> & (BRLMPrinterQLModelSettings | BRLMPrinterTDModelSettings)

type alias Partial

Convierte en opcionales todas las propiedades de T

{ [P in keyof T]?: T[P]; }

type alias BRLMChannelResult

{ port: BRLMPrinterPort; modelName: string; serialNumber: string; macAddress: string; nodeName: string; location: string; /** * This need to connect to the printer. * wifi: IP Address * bluetooth: macAddress * bluetoothLowEnergy: modelName for bluetoothLowEnergy */ channelInfo: string; }

type alias BRLMPrinterQLModelSettings

{ /** * Should use enum BRLMPrinterLabelName */ labelName: BRLMPrinterLabelName; } & BRLMPrinterSettings

type alias BRLMPrinterSettings

Estos parámetros son opcionales. Si se omiten, la impresora asigna los valores predeterminados.

{ /** * The number of copies you print. */ numberOfCopies?: BRLMPrinterNumberOfCopies; /** * Whether the auto-cut is enabled or not. If true, your printer cut the paper each page. */ autoCut?: BRLMPrinterAutoCutType; /** * A scale mode that specifies how your data is scaled in a print area of your printer. */ scaleMode?: BRLMPrinterScaleMode; /** * A scale value. This is effective when ScaleMode is ScaleValue. */ scaleValue?: BRLMPrinterScaleValueType; /** * A way to rasterize your data. */ halftone?: BRLMPrinterHalftone; /** * A threshold value. This is effective when the Halftone is Threshold. */ halftoneThreshold?: BRLMPrinterHalftoneThresholdType; /** * An image rotation that specifies the angle in which your data is placed in the print area. Rotation direction is clockwise. */ imageRotation?: BRLMPrinterImageRotation; /** * A vertical alignment that specifies how your data is placed in the printable area. */ verticalAlignment?: BRLMPrinterVerticalAlignment; /** * A horizontal alignment that specifies how your data is placed in the printable area. */ horizontalAlignment?: BRLMPrinterHorizontalAlignment; /** * A compress mode that specifies how to compress your data. * note: This is ios only. */ compressMode?: BRLMPrinterCompressMode; /** * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer. */ printQuality?: BRLMPrinterPrintQuality; }

type alias BRLMPrinterNumberOfCopies

number

type alias BRLMPrinterAutoCutType

boolean

type alias BRLMPrinterScaleValueType

number

type alias BRLMPrinterHalftoneThresholdType

number

type alias BRLMPrinterTDModelSettings

{ /** * Should use enum BRKMPrinterCustomPaperType */ paperType: BRLMPrinterCustomPaperType; /** * The width of the label. For example, the RD-U04J1 is 60.0 wide. */ tapeWidth: number; /** * The length of the label. For example, the RD-U04J1 is 60.0 wide. */ tapeLength: number; /** * It is the difference between a sticker and a mount. * For example, the RD-U04J1 is `1.0, 2.0, 1.0, 2.0` */ marginTop: number; marginRight: number; marginBottom: number; marginLeft: number; /** * The spacing between seals. For example, the RD-U04J1 is 0.2. */ gapLength: number; paperMarkPosition: number; paperMarkLength: number; /** * Should use enum BRKMPrinterCustomPaperUnit. * For example, the RD-U04J1 is mm. */ paperUnit: BRLMPrinterCustomPaperUnit; }

type alias BRLMSearchOption

{ /** * 'usb' is android only, and now developing. */ port: BRLMPrinterPort; /** * searchDuration is the time to end search for devices. * default is 15 seconds. * Used for Wi-Fi, BLE, and the iOS Bluetooth accessory picker wait. * Timing out does not dismiss the system accessory picker; close it before retrying. */ searchDuration: number; /** * Android Bluetooth Classic only. Include only devices whose Bluetooth class * reports a printer. Defaults to false; ignored for other ports and on iOS. * This does not identify Brother devices. Devices with an unknown class are excluded when true. */ bluetoothPrintersOnly?: boolean; }

type alias isChannelAvailableResult

{ result: boolean; }

type alias ErrorInfo

{ message: string; code: number; }

Enumeraciones

enum BRLMPrinterModelName

Miembros Valor
QL_800 'QL_800'
QL_810W 'QL_810W'
QL_820NWB 'QL_820NWB'
TD_2320D_203 'TD_2320D_203'
TD_2030AD 'TD_2030AD'
TD_2350D_300 'TD_2350D_300'

enum BRLMPrinterPort

Miembros Valor
usb 'usb'
wifi 'wifi'
bluetooth 'bluetooth'
bluetoothLowEnergy 'bluetoothLowEnergy'

enum BRLMPrinterLabelName

Miembros Valor Descripción
DieCutW17H54 'DieCutW17H54'
DieCutW17H87 'DieCutW17H87'
DieCutW23H23 'DieCutW23H23'
DieCutW29H42 'DieCutW29H42'
DieCutW29H90 'DieCutW29H90'
DieCutW38H90 'DieCutW38H90'
DieCutW39H48 'DieCutW39H48'
DieCutW52H29 'DieCutW52H29'
DieCutW62H29 'DieCutW62H29'
DieCutW62H60 'DieCutW62H60'
DieCutW62H75 'DieCutW62H75'
DieCutW62H100 'DieCutW62H100'
DieCutW60H86 'DieCutW60H86'
DieCutW54H29 'DieCutW54H29'
DieCutW102H51 'DieCutW102H51'
DieCutW102H152 'DieCutW102H152'
DieCutW103H164 'DieCutW103H164'
RollW12 'RollW12'
RollW29 'RollW29'
RollW38 'RollW38'
RollW50 'RollW50'
RollW54 'RollW54'
RollW62 'RollW62'
RollW62RB 'RollW62RB'
RollW102 'RollW102'
RollW103 'RollW103'
DTRollW90 'DTRollW90'
DTRollW102 'DTRollW102'
DTRollW102H51 'DTRollW102H51'
DTRollW102H152 'DTRollW102H152'
RoundW12DIA 'RoundW12DIA'
RoundW24DIA 'RoundW24DIA'
RoundW58DIA 'RoundW58DIA'
RDDieCutW60H60 'RDDieCutW60H60' Para la serie TD.
RDDieCutW50H30 'RDDieCutW50H30'
RDDieCutW40H60 'RDDieCutW40H60'
RDDieCutW40H50 'RDDieCutW40H50'
RDDieCutW40H40 'RDDieCutW40H40'
RDDieCutW30H30 'RDDieCutW30H30'
RDDieCutW50H35 'RDDieCutW50H35'
RDDieCutW60H80 'RDDieCutW60H80'
RDDieCutW60H100 'RDDieCutW60H100'

enum BRLMPrinterScaleMode

Miembros Valor
ActualSize 'ActualSize'
FitPageAspect 'FitPageAspect'
FitPaperAspect 'FitPaperAspect'
ScaleValue 'ScaleValue'

enum BRLMPrinterHalftone

Miembros Valor
Threshold 'Threshold'
ErrorDiffusion 'ErrorDiffusion'
PatternDither 'PatternDither'

enum BRLMPrinterImageRotation

Miembros Valor
Rotate0 'Rotate0'
Rotate90 'Rotate90'
Rotate180 'Rotate180'
Rotate270 'Rotate270'

enum BRLMPrinterVerticalAlignment

Miembros Valor
Top 'Top'
Center 'Center'
Bottom 'Bottom'

enum BRLMPrinterHorizontalAlignment

Miembros Valor
Left 'Left'
Center 'Center'
Right 'Right'

enum BRLMPrinterCompressMode

Miembros Valor
None 'None'
Tiff 'Tiff'
Mode9 'Mode9'

enum BRLMPrinterPrintQuality

Miembros Valor
Best 'Best'
Fast 'Fast'

enum BRLMPrinterCustomPaperType

Miembros Valor
rollPaper 'rollPaper'
dieCutPaper 'dieCutPaper'
markRollPaper 'markRollPaper'

enum BRLMPrinterCustomPaperUnit

Miembros Valor
mm 'mm'
inch 'inch'

enum BrotherPrintEventsEnum

Miembros Valor
onPrinterAvailable 'onPrinterAvailable'
onPrint 'onPrint'
onPrintFailedCommunication 'onPrintFailedCommunication'
onPrintError 'onPrintError'