@rdlabo/capacitor-brotherprint 8.2.1 → 8.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/brother-printer.enum.js","esm/events.enum.js","esm/models.js","esm/printer.js","esm/web.js","esm/index.js"],"sourcesContent":["export var BRLMPrinterPort;\n(function (BRLMPrinterPort) {\n BRLMPrinterPort[\"usb\"] = \"usb\";\n BRLMPrinterPort[\"wifi\"] = \"wifi\";\n BRLMPrinterPort[\"bluetooth\"] = \"bluetooth\";\n BRLMPrinterPort[\"bluetoothLowEnergy\"] = \"bluetoothLowEnergy\";\n})(BRLMPrinterPort || (BRLMPrinterPort = {}));\nexport var BRLMPrinterCustomPaperUnit;\n(function (BRLMPrinterCustomPaperUnit) {\n BRLMPrinterCustomPaperUnit[\"mm\"] = \"mm\";\n BRLMPrinterCustomPaperUnit[\"inch\"] = \"inch\";\n})(BRLMPrinterCustomPaperUnit || (BRLMPrinterCustomPaperUnit = {}));\nexport var BRLMPrinterCustomPaperType;\n(function (BRLMPrinterCustomPaperType) {\n BRLMPrinterCustomPaperType[\"rollPaper\"] = \"rollPaper\";\n BRLMPrinterCustomPaperType[\"dieCutPaper\"] = \"dieCutPaper\";\n BRLMPrinterCustomPaperType[\"markRollPaper\"] = \"markRollPaper\";\n})(BRLMPrinterCustomPaperType || (BRLMPrinterCustomPaperType = {}));\n/**\n * Note: If you update this file, you should update the following files:\n * - ios/Plugin/Model/PrinterModel.swift\n *\n * And name is follow android naming convention.\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html\n */\nexport var BRLMPrinterModelName;\n(function (BRLMPrinterModelName) {\n BRLMPrinterModelName[\"QL_800\"] = \"QL_800\";\n BRLMPrinterModelName[\"QL_810W\"] = \"QL_810W\";\n BRLMPrinterModelName[\"QL_820NWB\"] = \"QL_820NWB\";\n BRLMPrinterModelName[\"TD_2320D_203\"] = \"TD_2320D_203\";\n BRLMPrinterModelName[\"TD_2030AD\"] = \"TD_2030AD\";\n BRLMPrinterModelName[\"TD_2350D_300\"] = \"TD_2350D_300\";\n})(BRLMPrinterModelName || (BRLMPrinterModelName = {}));\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html\n */\nexport var BRLMPrinterLabelName;\n(function (BRLMPrinterLabelName) {\n BRLMPrinterLabelName[\"DieCutW17H54\"] = \"DieCutW17H54\";\n BRLMPrinterLabelName[\"DieCutW17H87\"] = \"DieCutW17H87\";\n BRLMPrinterLabelName[\"DieCutW23H23\"] = \"DieCutW23H23\";\n BRLMPrinterLabelName[\"DieCutW29H42\"] = \"DieCutW29H42\";\n BRLMPrinterLabelName[\"DieCutW29H90\"] = \"DieCutW29H90\";\n BRLMPrinterLabelName[\"DieCutW38H90\"] = \"DieCutW38H90\";\n BRLMPrinterLabelName[\"DieCutW39H48\"] = \"DieCutW39H48\";\n BRLMPrinterLabelName[\"DieCutW52H29\"] = \"DieCutW52H29\";\n BRLMPrinterLabelName[\"DieCutW62H29\"] = \"DieCutW62H29\";\n BRLMPrinterLabelName[\"DieCutW62H60\"] = \"DieCutW62H60\";\n BRLMPrinterLabelName[\"DieCutW62H75\"] = \"DieCutW62H75\";\n BRLMPrinterLabelName[\"DieCutW62H100\"] = \"DieCutW62H100\";\n BRLMPrinterLabelName[\"DieCutW60H86\"] = \"DieCutW60H86\";\n BRLMPrinterLabelName[\"DieCutW54H29\"] = \"DieCutW54H29\";\n BRLMPrinterLabelName[\"DieCutW102H51\"] = \"DieCutW102H51\";\n BRLMPrinterLabelName[\"DieCutW102H152\"] = \"DieCutW102H152\";\n BRLMPrinterLabelName[\"DieCutW103H164\"] = \"DieCutW103H164\";\n BRLMPrinterLabelName[\"RollW12\"] = \"RollW12\";\n BRLMPrinterLabelName[\"RollW29\"] = \"RollW29\";\n BRLMPrinterLabelName[\"RollW38\"] = \"RollW38\";\n BRLMPrinterLabelName[\"RollW50\"] = \"RollW50\";\n BRLMPrinterLabelName[\"RollW54\"] = \"RollW54\";\n BRLMPrinterLabelName[\"RollW62\"] = \"RollW62\";\n BRLMPrinterLabelName[\"RollW62RB\"] = \"RollW62RB\";\n BRLMPrinterLabelName[\"RollW102\"] = \"RollW102\";\n BRLMPrinterLabelName[\"RollW103\"] = \"RollW103\";\n BRLMPrinterLabelName[\"DTRollW90\"] = \"DTRollW90\";\n BRLMPrinterLabelName[\"DTRollW102\"] = \"DTRollW102\";\n BRLMPrinterLabelName[\"DTRollW102H51\"] = \"DTRollW102H51\";\n BRLMPrinterLabelName[\"DTRollW102H152\"] = \"DTRollW102H152\";\n BRLMPrinterLabelName[\"RoundW12DIA\"] = \"RoundW12DIA\";\n BRLMPrinterLabelName[\"RoundW24DIA\"] = \"RoundW24DIA\";\n BRLMPrinterLabelName[\"RoundW58DIA\"] = \"RoundW58DIA\";\n /**\n * For TD series\n * @url https://www.brother.co.jp/product/labelprinter/td2350d/accessory/index.aspx\n */\n BRLMPrinterLabelName[\"RDDieCutW60H60\"] = \"RDDieCutW60H60\";\n BRLMPrinterLabelName[\"RDDieCutW50H30\"] = \"RDDieCutW50H30\";\n BRLMPrinterLabelName[\"RDDieCutW40H60\"] = \"RDDieCutW40H60\";\n BRLMPrinterLabelName[\"RDDieCutW40H50\"] = \"RDDieCutW40H50\";\n BRLMPrinterLabelName[\"RDDieCutW40H40\"] = \"RDDieCutW40H40\";\n BRLMPrinterLabelName[\"RDDieCutW30H30\"] = \"RDDieCutW30H30\";\n BRLMPrinterLabelName[\"RDDieCutW50H35\"] = \"RDDieCutW50H35\";\n BRLMPrinterLabelName[\"RDDieCutW60H80\"] = \"RDDieCutW60H80\";\n BRLMPrinterLabelName[\"RDDieCutW60H100\"] = \"RDDieCutW60H100\";\n})(BRLMPrinterLabelName || (BRLMPrinterLabelName = {}));\n/**\n * @url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#imagerotation\n */\nexport var BRLMPrinterImageRotation;\n(function (BRLMPrinterImageRotation) {\n BRLMPrinterImageRotation[\"Rotate0\"] = \"Rotate0\";\n BRLMPrinterImageRotation[\"Rotate90\"] = \"Rotate90\";\n BRLMPrinterImageRotation[\"Rotate180\"] = \"Rotate180\";\n BRLMPrinterImageRotation[\"Rotate270\"] = \"Rotate270\";\n})(BRLMPrinterImageRotation || (BRLMPrinterImageRotation = {}));\n/**\n * url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#scalemode\n */\nexport var BRLMPrinterScaleMode;\n(function (BRLMPrinterScaleMode) {\n BRLMPrinterScaleMode[\"ActualSize\"] = \"ActualSize\";\n BRLMPrinterScaleMode[\"FitPageAspect\"] = \"FitPageAspect\";\n BRLMPrinterScaleMode[\"FitPaperAspect\"] = \"FitPaperAspect\";\n BRLMPrinterScaleMode[\"ScaleValue\"] = \"ScaleValue\";\n})(BRLMPrinterScaleMode || (BRLMPrinterScaleMode = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#halftone\n */\nexport var BRLMPrinterHalftone;\n(function (BRLMPrinterHalftone) {\n BRLMPrinterHalftone[\"Threshold\"] = \"Threshold\";\n BRLMPrinterHalftone[\"ErrorDiffusion\"] = \"ErrorDiffusion\";\n BRLMPrinterHalftone[\"PatternDither\"] = \"PatternDither\";\n})(BRLMPrinterHalftone || (BRLMPrinterHalftone = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#verticalalignment\n */\nexport var BRLMPrinterVerticalAlignment;\n(function (BRLMPrinterVerticalAlignment) {\n BRLMPrinterVerticalAlignment[\"Top\"] = \"Top\";\n BRLMPrinterVerticalAlignment[\"Center\"] = \"Center\";\n BRLMPrinterVerticalAlignment[\"Bottom\"] = \"Bottom\";\n})(BRLMPrinterVerticalAlignment || (BRLMPrinterVerticalAlignment = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#horizontalalignment\n */\nexport var BRLMPrinterHorizontalAlignment;\n(function (BRLMPrinterHorizontalAlignment) {\n BRLMPrinterHorizontalAlignment[\"Left\"] = \"Left\";\n BRLMPrinterHorizontalAlignment[\"Center\"] = \"Center\";\n BRLMPrinterHorizontalAlignment[\"Right\"] = \"Right\";\n})(BRLMPrinterHorizontalAlignment || (BRLMPrinterHorizontalAlignment = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#compressmode\n */\nexport var BRLMPrinterCompressMode;\n(function (BRLMPrinterCompressMode) {\n BRLMPrinterCompressMode[\"None\"] = \"None\";\n BRLMPrinterCompressMode[\"Tiff\"] = \"Tiff\";\n BRLMPrinterCompressMode[\"Mode9\"] = \"Mode9\";\n})(BRLMPrinterCompressMode || (BRLMPrinterCompressMode = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#printquality\n */\nexport var BRLMPrinterPrintQuality;\n(function (BRLMPrinterPrintQuality) {\n BRLMPrinterPrintQuality[\"Best\"] = \"Best\";\n BRLMPrinterPrintQuality[\"Fast\"] = \"Fast\";\n})(BRLMPrinterPrintQuality || (BRLMPrinterPrintQuality = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#resolution\n */\n// export enum BRLMPrinterPrintResolution {\n// Low = 'Low',\n// Normal = 'Normal',\n// High = 'High',\n// }\n//# sourceMappingURL=brother-printer.enum.js.map","export var BrotherPrintEventsEnum;\n(function (BrotherPrintEventsEnum) {\n BrotherPrintEventsEnum[\"onPrinterAvailable\"] = \"onPrinterAvailable\";\n BrotherPrintEventsEnum[\"onPrint\"] = \"onPrint\";\n BrotherPrintEventsEnum[\"onPrintFailedCommunication\"] = \"onPrintFailedCommunication\";\n BrotherPrintEventsEnum[\"onPrintError\"] = \"onPrintError\";\n})(BrotherPrintEventsEnum || (BrotherPrintEventsEnum = {}));\n//# sourceMappingURL=events.enum.js.map","import { BRLMPrinterModelName as Model, BRLMPrinterPort as Port } from './brother-printer.enum';\nexport const printerPorts = {\n [Model.QL_800]: [Port.usb],\n [Model.QL_810W]: [Port.wifi, Port.usb],\n [Model.QL_820NWB]: [Port.wifi, Port.bluetooth, Port.usb],\n [Model.TD_2320D_203]: [Port.wifi, Port.usb],\n [Model.TD_2030AD]: [Port.usb],\n [Model.TD_2350D_300]: [Port.wifi, Port.bluetooth, Port.usb, Port.bluetoothLowEnergy],\n};\n//# sourceMappingURL=models.js.map","import { Capacitor } from '@capacitor/core';\nimport { BRLMPrinterModelName, BRLMPrinterPort } from './brother-printer.enum';\nimport { printerPorts } from './models';\n/** Common display names for connection transports. */\nexport function brotherPrinterPortLabel(port) {\n switch (port) {\n case BRLMPrinterPort.wifi:\n return 'Wi-Fi';\n case BRLMPrinterPort.bluetooth:\n return 'Bluetooth';\n case BRLMPrinterPort.bluetoothLowEnergy:\n return 'Bluetooth LE';\n case BRLMPrinterPort.usb:\n return 'USB';\n default:\n return '';\n }\n}\n/** Connection choices for the existing models. USB is Android-only; wifi also covers Ethernet. */\nexport function brotherPrinterPorts(model, isAndroid = Capacitor.getPlatform() === 'android') {\n if (!Object.values(BRLMPrinterModelName).includes(model))\n return [];\n return printerPorts[model].filter((port) => isAndroid || port !== BRLMPrinterPort.usb);\n}\n/** Keep a supported saved port; otherwise prefer USB for QL-800/810W on Android. */\nexport function resolveBrotherPrinterPort(model, saved) {\n const ports = brotherPrinterPorts(model);\n if (saved && ports.includes(saved))\n return saved;\n if (ports.includes(BRLMPrinterPort.usb) &&\n (model === BRLMPrinterModelName.QL_800 || model === BRLMPrinterModelName.QL_810W))\n return BRLMPrinterPort.usb;\n return ports[0];\n}\n/** Match discovery names to an existing model enum, including documented product aliases. */\nexport function brotherPrinterModel(name) {\n const key = name\n .trim()\n .toUpperCase()\n .replace(/^BROTHER\\s+/, '')\n .replace(/[-_ ]/g, '');\n // Product names omit TD resolution; QL-820NWBc and TD-2030A use the existing enum spellings.\n const product = key === 'QL820NWBC' ? 'QL820NWB' : key === 'TD2030A' ? 'TD2030AD' : key;\n return Object.values(BRLMPrinterModelName).find((model) => model.replace(/_/g, '') === product || model.replace(/_(203|300)$/, '').replace(/_/g, '') === product);\n}\n//# sourceMappingURL=printer.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrotherPrintWeb extends WebPlugin {\n async printImage(options) {\n console.log('printImage', options);\n }\n async isChannelAvailable(options) {\n console.log('isChannelAvailable', options);\n return {\n result: false,\n };\n }\n async search(options) {\n console.log('search', options);\n }\n async cancelSearchWiFiPrinter() {\n console.log('cancelSearchWiFiPrinter');\n }\n async cancelSearchBluetoothPrinter() {\n console.log('cancelSearchBluetoothPrinter');\n }\n}\n//# sourceMappingURL=web.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BrotherPrinterSession_instances, _BrotherPrinterSession_closed, _BrotherPrinterSession_printers, _BrotherPrinterSession_listeners, _BrotherPrinterSession_listening, _BrotherPrinterSession_disposal, _BrotherPrinterSession_storage, _BrotherPrinterSession_storageKey, _BrotherPrinterSession_readSavedPrinter, _BrotherPrinterSession_savePrinter, _BrotherPrinterSession_discover;\nimport { registerPlugin } from '@capacitor/core';\nimport { BRLMPrinterPort } from './brother-printer.enum';\nimport { BrotherPrintEventsEnum } from './events.enum';\nimport { brotherPrinterModel } from './printer';\nconst BrotherPrint = registerPlugin('BrotherPrint', {\n web: () => import('./web').then((m) => new m.BrotherPrintWeb()),\n});\nexport * from './definitions';\nexport * from './web';\nexport * from './events.enum';\nexport * from './interfaces';\nexport * from './brother-printer.enum';\nexport { BrotherPrint };\nexport * from './printer';\n// Native discovery events are shared. Keep each helper call's listener scoped to its turn.\nlet connectionQueue = Promise.resolve();\nfunction queueConnection(run) {\n const result = connectionQueue.then(run);\n connectionQueue = result.catch(() => undefined);\n return result;\n}\n/** Collect discovery results, waiting for earlier helper calls to finish. */\nexport function searchBrotherPrinters(options, model) {\n return queueConnection(() => discoverPrinters(options, model));\n}\n/**\n * Reuse a matching, available previous channel; otherwise discover printers.\n * The caller owns storage. USB always discovers again through the native permission flow.\n * Availability errors propagate; only an unavailable channel triggers discovery.\n */\nexport function prepareBrotherPrinters(options, model, previous) {\n return queueConnection(() => preparePrinters(options, model, previous));\n}\n/**\n * Check an explicitly selected address without discovery or fallback to another printer.\n * Port must be supplied; an address does not identify its transport or printer model.\n */\nexport function checkBrotherPrinterChannel(channel) {\n return queueConnection(async () => {\n const { result } = await BrotherPrint.isChannelAvailable(Object.assign({ modelName: '', serialNumber: '', macAddress: '', nodeName: '', location: '' }, channel));\n return result;\n });\n}\nasync function discoverPrinters(options, model, active = () => true) {\n const printers = [];\n const listener = await BrotherPrint.addListener(BrotherPrintEventsEnum.onPrinterAvailable, (printer) => {\n if (printer.port !== options.port)\n return;\n if (printer.port !== BRLMPrinterPort.usb && model !== undefined && brotherPrinterModel(printer.modelName) !== model)\n return;\n const index = printers.findIndex((current) => current.port === printer.port && current.channelInfo === printer.channelInfo);\n if (index < 0)\n printers.push(printer);\n else\n printers[index] = printer;\n });\n await (active() ? BrotherPrint.search(options) : Promise.resolve()).finally(() => listener.remove());\n return printers;\n}\nasync function preparePrinters(options, model, previous, active = () => true) {\n if (options.port !== BRLMPrinterPort.usb &&\n (previous === null || previous === void 0 ? void 0 : previous.port) === options.port &&\n previous.channelInfo.trim() &&\n brotherPrinterModel(previous.modelName) === model) {\n const available = await BrotherPrint.isChannelAvailable(previous);\n if (available.result)\n return [previous];\n }\n return active() ? discoverPrinters(options, model, active) : [];\n}\n/** One print screen's discovery results and event subscriptions. Create a new session after disposal. */\nexport class BrotherPrinterSession {\n constructor(options = {}) {\n var _a;\n _BrotherPrinterSession_instances.add(this);\n _BrotherPrinterSession_closed.set(this, false);\n _BrotherPrinterSession_printers.set(this, []);\n _BrotherPrinterSession_listeners.set(this, []);\n _BrotherPrinterSession_listening.set(this, void 0);\n _BrotherPrinterSession_disposal.set(this, void 0);\n _BrotherPrinterSession_storage.set(this, void 0);\n _BrotherPrinterSession_storageKey.set(this, void 0);\n __classPrivateFieldSet(this, _BrotherPrinterSession_storage, options.storage, \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_storageKey, `${(_a = options.storagePrefix) !== null && _a !== void 0 ? _a : 'brotherprint:'}last-printer`, \"f\");\n }\n get closed() {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\");\n }\n get printers() {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_printers, \"f\");\n }\n search(options, model) {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_discover).call(this, () => discoverPrinters(options, model, () => !__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\")));\n }\n prepare(options, model, previous) {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_discover).call(this, async () => {\n const saved = previous === undefined ? await __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_readSavedPrinter).call(this).catch(() => undefined) : previous;\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n return preparePrinters(options, model, saved, () => !__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"));\n });\n }\n /** Forget the remembered connection. Storage removal errors propagate to the caller. */\n async clearSavedPrinter() {\n var _a;\n await ((_a = __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\")) === null || _a === void 0 ? void 0 : _a.remove(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\")));\n }\n /** Register print notifications once. Callbacks stop immediately when disposed. */\n listen(events) {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return Promise.resolve();\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_listening, \"f\")) {\n __classPrivateFieldSet(this, _BrotherPrinterSession_listeners, [\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrint, () => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrint) === null || _a === void 0 ? void 0 : _a.call(events);\n }),\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrintError, (info) => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrintError) === null || _a === void 0 ? void 0 : _a.call(events, info);\n }),\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrintFailedCommunication, (info) => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrintFailedCommunication) === null || _a === void 0 ? void 0 : _a.call(events, info);\n }),\n ], \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_listening, Promise.all(__classPrivateFieldGet(this, _BrotherPrinterSession_listeners, \"f\")).then(() => undefined), \"f\");\n }\n return __classPrivateFieldGet(this, _BrotherPrinterSession_listening, \"f\");\n }\n /** A closed session cannot start another print. Already started native printing is awaited. */\n async printImage(options) {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return;\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\"))\n await __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_savePrinter).call(this, options).catch(() => undefined);\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n await BrotherPrint.printImage(options);\n }\n /** Invalidate pending work immediately, then remove this session's print listeners. */\n dispose() {\n var _a;\n __classPrivateFieldSet(this, _BrotherPrinterSession_closed, true, \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, [], \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_disposal, (_a = __classPrivateFieldGet(this, _BrotherPrinterSession_disposal, \"f\")) !== null && _a !== void 0 ? _a : Promise.all(__classPrivateFieldGet(this, _BrotherPrinterSession_listeners, \"f\").map((listener) => listener.then((handle) => handle.remove()))).then(() => undefined), \"f\");\n return __classPrivateFieldGet(this, _BrotherPrinterSession_disposal, \"f\");\n }\n}\n_BrotherPrinterSession_closed = new WeakMap(), _BrotherPrinterSession_printers = new WeakMap(), _BrotherPrinterSession_listeners = new WeakMap(), _BrotherPrinterSession_listening = new WeakMap(), _BrotherPrinterSession_disposal = new WeakMap(), _BrotherPrinterSession_storage = new WeakMap(), _BrotherPrinterSession_storageKey = new WeakMap(), _BrotherPrinterSession_instances = new WeakSet(), _BrotherPrinterSession_readSavedPrinter = async function _BrotherPrinterSession_readSavedPrinter() {\n var _a;\n const value = await ((_a = __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\")) === null || _a === void 0 ? void 0 : _a.get(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\")));\n if (!value)\n return undefined;\n const channel = JSON.parse(value);\n if (channel &&\n Object.values(BRLMPrinterPort).includes(channel.port) &&\n ['modelName', 'channelInfo', 'serialNumber', 'macAddress', 'nodeName', 'location'].every((key) => typeof channel[key] === 'string'))\n return channel;\n return undefined;\n}, _BrotherPrinterSession_savePrinter = async function _BrotherPrinterSession_savePrinter(options) {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\") || !options.port || !((_a = options.channelInfo) === null || _a === void 0 ? void 0 : _a.trim()))\n return;\n const found = __classPrivateFieldGet(this, _BrotherPrinterSession_printers, \"f\").find((printer) => printer.port === options.port && printer.channelInfo === options.channelInfo);\n const channel = Object.assign(Object.assign({ serialNumber: '', macAddress: '', nodeName: '', location: '' }, found), { port: options.port, channelInfo: options.channelInfo, modelName: options.modelName });\n await __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\").set(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\"), JSON.stringify(channel));\n}, _BrotherPrinterSession_discover = function _BrotherPrinterSession_discover(run) {\n return queueConnection(async () => {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, [], \"f\");\n return run().then((printers) => {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, printers, \"f\");\n return printers;\n });\n });\n};\n//# sourceMappingURL=index.js.map"],"names":["BRLMPrinterPort","BRLMPrinterCustomPaperUnit","BRLMPrinterCustomPaperType","BRLMPrinterModelName","BRLMPrinterLabelName","BRLMPrinterImageRotation","BRLMPrinterScaleMode","BRLMPrinterHalftone","BRLMPrinterVerticalAlignment","BRLMPrinterHorizontalAlignment","BRLMPrinterCompressMode","BRLMPrinterPrintQuality","BrotherPrintEventsEnum","Model","Port","Capacitor","WebPlugin","this","registerPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,KAAK;IAClC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;IACpC,IAAI,eAAe,CAAC,WAAW,CAAC,GAAG,WAAW;IAC9C,IAAI,eAAe,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;IAChE,CAAC,EAAEA,uBAAe,KAA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,QAAQ,KAAK;IACxC,YAAY,IAAI,sBAAsB,CAAC,IAAI,EAAE,6BAA6B,EAAE,GAAG,CAAC;IAChF,gBAAgB,OAAO,EAAE;IACzB,YAAY,sBAAsB,CAAC,IAAI,EAAE,+BAA+B,EAAE,QAAQ,EAAE,GAAG,CAAC;IACxF,YAAY,OAAO,QAAQ;IAC3B,QAAQ,CAAC,CAAC;IACV,IAAI,CAAC,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/brother-printer.enum.js","esm/events.enum.js","esm/models.js","esm/printer.js","esm/web.js","esm/index.js"],"sourcesContent":["export var BRLMPrinterPort;\n(function (BRLMPrinterPort) {\n BRLMPrinterPort[\"usb\"] = \"usb\";\n BRLMPrinterPort[\"wifi\"] = \"wifi\";\n BRLMPrinterPort[\"bluetooth\"] = \"bluetooth\";\n BRLMPrinterPort[\"bluetoothLowEnergy\"] = \"bluetoothLowEnergy\";\n})(BRLMPrinterPort || (BRLMPrinterPort = {}));\nexport var BRLMPrinterCustomPaperUnit;\n(function (BRLMPrinterCustomPaperUnit) {\n BRLMPrinterCustomPaperUnit[\"mm\"] = \"mm\";\n BRLMPrinterCustomPaperUnit[\"inch\"] = \"inch\";\n})(BRLMPrinterCustomPaperUnit || (BRLMPrinterCustomPaperUnit = {}));\nexport var BRLMPrinterCustomPaperType;\n(function (BRLMPrinterCustomPaperType) {\n BRLMPrinterCustomPaperType[\"rollPaper\"] = \"rollPaper\";\n BRLMPrinterCustomPaperType[\"dieCutPaper\"] = \"dieCutPaper\";\n BRLMPrinterCustomPaperType[\"markRollPaper\"] = \"markRollPaper\";\n})(BRLMPrinterCustomPaperType || (BRLMPrinterCustomPaperType = {}));\n/**\n * Note: If you update this file, you should update the following files:\n * - ios/Plugin/Model/PrinterModel.swift\n *\n * And name is follow android naming convention.\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html\n */\nexport var BRLMPrinterModelName;\n(function (BRLMPrinterModelName) {\n BRLMPrinterModelName[\"QL_800\"] = \"QL_800\";\n BRLMPrinterModelName[\"QL_810W\"] = \"QL_810W\";\n BRLMPrinterModelName[\"QL_820NWB\"] = \"QL_820NWB\";\n BRLMPrinterModelName[\"TD_2320D_203\"] = \"TD_2320D_203\";\n BRLMPrinterModelName[\"TD_2030AD\"] = \"TD_2030AD\";\n BRLMPrinterModelName[\"TD_2350D_300\"] = \"TD_2350D_300\";\n})(BRLMPrinterModelName || (BRLMPrinterModelName = {}));\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html\n */\nexport var BRLMPrinterLabelName;\n(function (BRLMPrinterLabelName) {\n BRLMPrinterLabelName[\"DieCutW17H54\"] = \"DieCutW17H54\";\n BRLMPrinterLabelName[\"DieCutW17H87\"] = \"DieCutW17H87\";\n BRLMPrinterLabelName[\"DieCutW23H23\"] = \"DieCutW23H23\";\n BRLMPrinterLabelName[\"DieCutW29H42\"] = \"DieCutW29H42\";\n BRLMPrinterLabelName[\"DieCutW29H90\"] = \"DieCutW29H90\";\n BRLMPrinterLabelName[\"DieCutW38H90\"] = \"DieCutW38H90\";\n BRLMPrinterLabelName[\"DieCutW39H48\"] = \"DieCutW39H48\";\n BRLMPrinterLabelName[\"DieCutW52H29\"] = \"DieCutW52H29\";\n BRLMPrinterLabelName[\"DieCutW62H29\"] = \"DieCutW62H29\";\n BRLMPrinterLabelName[\"DieCutW62H60\"] = \"DieCutW62H60\";\n BRLMPrinterLabelName[\"DieCutW62H75\"] = \"DieCutW62H75\";\n BRLMPrinterLabelName[\"DieCutW62H100\"] = \"DieCutW62H100\";\n BRLMPrinterLabelName[\"DieCutW60H86\"] = \"DieCutW60H86\";\n BRLMPrinterLabelName[\"DieCutW54H29\"] = \"DieCutW54H29\";\n BRLMPrinterLabelName[\"DieCutW102H51\"] = \"DieCutW102H51\";\n BRLMPrinterLabelName[\"DieCutW102H152\"] = \"DieCutW102H152\";\n BRLMPrinterLabelName[\"DieCutW103H164\"] = \"DieCutW103H164\";\n BRLMPrinterLabelName[\"RollW12\"] = \"RollW12\";\n BRLMPrinterLabelName[\"RollW29\"] = \"RollW29\";\n BRLMPrinterLabelName[\"RollW38\"] = \"RollW38\";\n BRLMPrinterLabelName[\"RollW50\"] = \"RollW50\";\n BRLMPrinterLabelName[\"RollW54\"] = \"RollW54\";\n BRLMPrinterLabelName[\"RollW62\"] = \"RollW62\";\n BRLMPrinterLabelName[\"RollW62RB\"] = \"RollW62RB\";\n BRLMPrinterLabelName[\"RollW102\"] = \"RollW102\";\n BRLMPrinterLabelName[\"RollW103\"] = \"RollW103\";\n BRLMPrinterLabelName[\"DTRollW90\"] = \"DTRollW90\";\n BRLMPrinterLabelName[\"DTRollW102\"] = \"DTRollW102\";\n BRLMPrinterLabelName[\"DTRollW102H51\"] = \"DTRollW102H51\";\n BRLMPrinterLabelName[\"DTRollW102H152\"] = \"DTRollW102H152\";\n BRLMPrinterLabelName[\"RoundW12DIA\"] = \"RoundW12DIA\";\n BRLMPrinterLabelName[\"RoundW24DIA\"] = \"RoundW24DIA\";\n BRLMPrinterLabelName[\"RoundW58DIA\"] = \"RoundW58DIA\";\n /**\n * For TD series\n * @url https://www.brother.co.jp/product/labelprinter/td2350d/accessory/index.aspx\n */\n BRLMPrinterLabelName[\"RDDieCutW60H60\"] = \"RDDieCutW60H60\";\n BRLMPrinterLabelName[\"RDDieCutW50H30\"] = \"RDDieCutW50H30\";\n BRLMPrinterLabelName[\"RDDieCutW40H60\"] = \"RDDieCutW40H60\";\n BRLMPrinterLabelName[\"RDDieCutW40H50\"] = \"RDDieCutW40H50\";\n BRLMPrinterLabelName[\"RDDieCutW40H40\"] = \"RDDieCutW40H40\";\n BRLMPrinterLabelName[\"RDDieCutW30H30\"] = \"RDDieCutW30H30\";\n BRLMPrinterLabelName[\"RDDieCutW50H35\"] = \"RDDieCutW50H35\";\n BRLMPrinterLabelName[\"RDDieCutW60H80\"] = \"RDDieCutW60H80\";\n BRLMPrinterLabelName[\"RDDieCutW60H100\"] = \"RDDieCutW60H100\";\n})(BRLMPrinterLabelName || (BRLMPrinterLabelName = {}));\n/**\n * @url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#imagerotation\n */\nexport var BRLMPrinterImageRotation;\n(function (BRLMPrinterImageRotation) {\n BRLMPrinterImageRotation[\"Rotate0\"] = \"Rotate0\";\n BRLMPrinterImageRotation[\"Rotate90\"] = \"Rotate90\";\n BRLMPrinterImageRotation[\"Rotate180\"] = \"Rotate180\";\n BRLMPrinterImageRotation[\"Rotate270\"] = \"Rotate270\";\n})(BRLMPrinterImageRotation || (BRLMPrinterImageRotation = {}));\n/**\n * url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#scalemode\n */\nexport var BRLMPrinterScaleMode;\n(function (BRLMPrinterScaleMode) {\n BRLMPrinterScaleMode[\"ActualSize\"] = \"ActualSize\";\n BRLMPrinterScaleMode[\"FitPageAspect\"] = \"FitPageAspect\";\n BRLMPrinterScaleMode[\"FitPaperAspect\"] = \"FitPaperAspect\";\n BRLMPrinterScaleMode[\"ScaleValue\"] = \"ScaleValue\";\n})(BRLMPrinterScaleMode || (BRLMPrinterScaleMode = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#halftone\n */\nexport var BRLMPrinterHalftone;\n(function (BRLMPrinterHalftone) {\n BRLMPrinterHalftone[\"Threshold\"] = \"Threshold\";\n BRLMPrinterHalftone[\"ErrorDiffusion\"] = \"ErrorDiffusion\";\n BRLMPrinterHalftone[\"PatternDither\"] = \"PatternDither\";\n})(BRLMPrinterHalftone || (BRLMPrinterHalftone = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#verticalalignment\n */\nexport var BRLMPrinterVerticalAlignment;\n(function (BRLMPrinterVerticalAlignment) {\n BRLMPrinterVerticalAlignment[\"Top\"] = \"Top\";\n BRLMPrinterVerticalAlignment[\"Center\"] = \"Center\";\n BRLMPrinterVerticalAlignment[\"Bottom\"] = \"Bottom\";\n})(BRLMPrinterVerticalAlignment || (BRLMPrinterVerticalAlignment = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#horizontalalignment\n */\nexport var BRLMPrinterHorizontalAlignment;\n(function (BRLMPrinterHorizontalAlignment) {\n BRLMPrinterHorizontalAlignment[\"Left\"] = \"Left\";\n BRLMPrinterHorizontalAlignment[\"Center\"] = \"Center\";\n BRLMPrinterHorizontalAlignment[\"Right\"] = \"Right\";\n})(BRLMPrinterHorizontalAlignment || (BRLMPrinterHorizontalAlignment = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#compressmode\n */\nexport var BRLMPrinterCompressMode;\n(function (BRLMPrinterCompressMode) {\n BRLMPrinterCompressMode[\"None\"] = \"None\";\n BRLMPrinterCompressMode[\"Tiff\"] = \"Tiff\";\n BRLMPrinterCompressMode[\"Mode9\"] = \"Mode9\";\n})(BRLMPrinterCompressMode || (BRLMPrinterCompressMode = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#printquality\n */\nexport var BRLMPrinterPrintQuality;\n(function (BRLMPrinterPrintQuality) {\n BRLMPrinterPrintQuality[\"Best\"] = \"Best\";\n BRLMPrinterPrintQuality[\"Fast\"] = \"Fast\";\n})(BRLMPrinterPrintQuality || (BRLMPrinterPrintQuality = {}));\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#resolution\n */\n// export enum BRLMPrinterPrintResolution {\n// Low = 'Low',\n// Normal = 'Normal',\n// High = 'High',\n// }\n//# sourceMappingURL=brother-printer.enum.js.map","export var BrotherPrintEventsEnum;\n(function (BrotherPrintEventsEnum) {\n BrotherPrintEventsEnum[\"onPrinterAvailable\"] = \"onPrinterAvailable\";\n BrotherPrintEventsEnum[\"onPrint\"] = \"onPrint\";\n BrotherPrintEventsEnum[\"onPrintFailedCommunication\"] = \"onPrintFailedCommunication\";\n BrotherPrintEventsEnum[\"onPrintError\"] = \"onPrintError\";\n})(BrotherPrintEventsEnum || (BrotherPrintEventsEnum = {}));\n//# sourceMappingURL=events.enum.js.map","import { BRLMPrinterModelName as Model, BRLMPrinterPort as Port } from './brother-printer.enum';\nexport const printerPorts = {\n [Model.QL_800]: [Port.usb],\n [Model.QL_810W]: [Port.wifi, Port.usb],\n [Model.QL_820NWB]: [Port.wifi, Port.bluetooth, Port.usb],\n [Model.TD_2320D_203]: [Port.wifi, Port.usb],\n [Model.TD_2030AD]: [Port.usb],\n [Model.TD_2350D_300]: [Port.wifi, Port.bluetooth, Port.usb, Port.bluetoothLowEnergy],\n};\n//# sourceMappingURL=models.js.map","import { Capacitor } from '@capacitor/core';\nimport { BRLMPrinterModelName, BRLMPrinterPort } from './brother-printer.enum';\nimport { printerPorts } from './models';\n/** Common display names for connection transports. */\nexport function brotherPrinterPortLabel(port) {\n switch (port) {\n case BRLMPrinterPort.wifi:\n return 'Wi-Fi';\n case BRLMPrinterPort.bluetooth:\n return 'Bluetooth';\n case BRLMPrinterPort.bluetoothLowEnergy:\n return 'Bluetooth LE';\n case BRLMPrinterPort.usb:\n return 'USB';\n default:\n return '';\n }\n}\n/** Connection choices for the existing models. USB is Android-only; wifi also covers Ethernet. */\nexport function brotherPrinterPorts(model, isAndroid = Capacitor.getPlatform() === 'android') {\n if (!Object.values(BRLMPrinterModelName).includes(model))\n return [];\n return printerPorts[model].filter((port) => isAndroid || port !== BRLMPrinterPort.usb);\n}\n/** Keep a supported saved port; otherwise prefer USB for QL-800/810W on Android. */\nexport function resolveBrotherPrinterPort(model, saved) {\n const ports = brotherPrinterPorts(model);\n if (saved && ports.includes(saved))\n return saved;\n if (ports.includes(BRLMPrinterPort.usb) &&\n (model === BRLMPrinterModelName.QL_800 || model === BRLMPrinterModelName.QL_810W))\n return BRLMPrinterPort.usb;\n return ports[0];\n}\n/** Match discovery names to an existing model enum, including documented product aliases. */\nexport function brotherPrinterModel(name) {\n const key = name\n .trim()\n .toUpperCase()\n .replace(/^BROTHER\\s+/, '')\n .replace(/[-_ ]/g, '');\n // Product names omit TD resolution; QL-820NWBc and TD-2030A use the existing enum spellings.\n const product = key === 'QL820NWBC' ? 'QL820NWB' : key === 'TD2030A' ? 'TD2030AD' : key;\n return Object.values(BRLMPrinterModelName).find((model) => model.replace(/_/g, '') === product || model.replace(/_(203|300)$/, '').replace(/_/g, '') === product);\n}\n//# sourceMappingURL=printer.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrotherPrintWeb extends WebPlugin {\n async printImage(options) {\n console.log('printImage', options);\n }\n async isChannelAvailable(options) {\n console.log('isChannelAvailable', options);\n return {\n result: false,\n };\n }\n async search(options) {\n console.log('search', options);\n }\n async cancelSearchWiFiPrinter() {\n console.log('cancelSearchWiFiPrinter');\n }\n async cancelSearchBluetoothPrinter() {\n console.log('cancelSearchBluetoothPrinter');\n }\n}\n//# sourceMappingURL=web.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BrotherPrinterSession_instances, _BrotherPrinterSession_closed, _BrotherPrinterSession_printers, _BrotherPrinterSession_listeners, _BrotherPrinterSession_listening, _BrotherPrinterSession_disposal, _BrotherPrinterSession_storage, _BrotherPrinterSession_storageKey, _BrotherPrinterSession_readSavedPrinter, _BrotherPrinterSession_savePrinter, _BrotherPrinterSession_discover;\nimport { registerPlugin } from '@capacitor/core';\nimport { BRLMPrinterPort } from './brother-printer.enum';\nimport { BrotherPrintEventsEnum } from './events.enum';\nimport { brotherPrinterModel } from './printer';\nconst BrotherPrint = registerPlugin('BrotherPrint', {\n web: () => import('./web').then((m) => new m.BrotherPrintWeb()),\n});\nexport * from './definitions';\nexport * from './web';\nexport * from './events.enum';\nexport * from './interfaces';\nexport * from './brother-printer.enum';\nexport { BrotherPrint };\nexport * from './printer';\n// Native discovery events are shared. Keep each helper call's listener scoped to its turn.\nlet connectionQueue = Promise.resolve();\nfunction queueConnection(run) {\n const result = connectionQueue.then(run);\n connectionQueue = result.catch(() => undefined);\n return result;\n}\n/** Collect discovery results, waiting for earlier helper calls to finish. */\nexport function searchBrotherPrinters(options, _model) {\n return queueConnection(() => discoverPrinters(options));\n}\n/**\n * Reuse a matching, available previous channel; otherwise discover printers.\n * The caller owns storage. USB always discovers again through the native permission flow.\n * Availability errors propagate; only an unavailable channel triggers discovery.\n */\nexport function prepareBrotherPrinters(options, model, previous) {\n return queueConnection(() => preparePrinters(options, model, previous));\n}\n/**\n * Check an explicitly selected address without discovery or fallback to another printer.\n * Port must be supplied; an address does not identify its transport or printer model.\n */\nexport function checkBrotherPrinterChannel(channel) {\n return queueConnection(async () => {\n const { result } = await BrotherPrint.isChannelAvailable(Object.assign({ modelName: '', serialNumber: '', macAddress: '', nodeName: '', location: '' }, channel));\n return result;\n });\n}\nasync function discoverPrinters(options, active = () => true) {\n const printers = [];\n const listener = await BrotherPrint.addListener(BrotherPrintEventsEnum.onPrinterAvailable, (printer) => {\n if (printer.port !== options.port)\n return;\n const index = printers.findIndex((current) => current.port === printer.port && current.channelInfo === printer.channelInfo);\n if (index < 0)\n printers.push(printer);\n else\n printers[index] = printer;\n });\n await (active() ? BrotherPrint.search(options) : Promise.resolve()).finally(() => listener.remove());\n return printers;\n}\nasync function preparePrinters(options, model, previous, active = () => true) {\n if (options.port !== BRLMPrinterPort.usb &&\n (previous === null || previous === void 0 ? void 0 : previous.port) === options.port &&\n previous.channelInfo.trim() &&\n brotherPrinterModel(previous.modelName) === model) {\n const available = await BrotherPrint.isChannelAvailable(previous);\n if (available.result)\n return [previous];\n }\n return active() ? discoverPrinters(options, active) : [];\n}\n/** One print screen's discovery results and event subscriptions. Create a new session after disposal. */\nexport class BrotherPrinterSession {\n constructor(options = {}) {\n var _a;\n _BrotherPrinterSession_instances.add(this);\n _BrotherPrinterSession_closed.set(this, false);\n _BrotherPrinterSession_printers.set(this, []);\n _BrotherPrinterSession_listeners.set(this, []);\n _BrotherPrinterSession_listening.set(this, void 0);\n _BrotherPrinterSession_disposal.set(this, void 0);\n _BrotherPrinterSession_storage.set(this, void 0);\n _BrotherPrinterSession_storageKey.set(this, void 0);\n __classPrivateFieldSet(this, _BrotherPrinterSession_storage, options.storage, \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_storageKey, `${(_a = options.storagePrefix) !== null && _a !== void 0 ? _a : 'brotherprint:'}last-printer`, \"f\");\n }\n get closed() {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\");\n }\n get printers() {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_printers, \"f\");\n }\n search(options, _model) {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_discover).call(this, () => discoverPrinters(options, () => !__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\")));\n }\n prepare(options, model, previous) {\n return __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_discover).call(this, async () => {\n const saved = previous === undefined ? await __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_readSavedPrinter).call(this).catch(() => undefined) : previous;\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n return preparePrinters(options, model, saved, () => !__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"));\n });\n }\n /** Forget the remembered connection. Storage removal errors propagate to the caller. */\n async clearSavedPrinter() {\n var _a;\n await ((_a = __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\")) === null || _a === void 0 ? void 0 : _a.remove(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\")));\n }\n /** Register print notifications once. Callbacks stop immediately when disposed. */\n listen(events) {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return Promise.resolve();\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_listening, \"f\")) {\n __classPrivateFieldSet(this, _BrotherPrinterSession_listeners, [\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrint, () => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrint) === null || _a === void 0 ? void 0 : _a.call(events);\n }),\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrintError, (info) => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrintError) === null || _a === void 0 ? void 0 : _a.call(events, info);\n }),\n BrotherPrint.addListener(BrotherPrintEventsEnum.onPrintFailedCommunication, (info) => {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n (_a = events.onPrintFailedCommunication) === null || _a === void 0 ? void 0 : _a.call(events, info);\n }),\n ], \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_listening, Promise.all(__classPrivateFieldGet(this, _BrotherPrinterSession_listeners, \"f\")).then(() => undefined), \"f\");\n }\n return __classPrivateFieldGet(this, _BrotherPrinterSession_listening, \"f\");\n }\n /** A closed session cannot start another print. Already started native printing is awaited. */\n async printImage(options) {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return;\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\"))\n await __classPrivateFieldGet(this, _BrotherPrinterSession_instances, \"m\", _BrotherPrinterSession_savePrinter).call(this, options).catch(() => undefined);\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n await BrotherPrint.printImage(options);\n }\n /** Invalidate pending work immediately, then remove this session's print listeners. */\n dispose() {\n var _a;\n __classPrivateFieldSet(this, _BrotherPrinterSession_closed, true, \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, [], \"f\");\n __classPrivateFieldSet(this, _BrotherPrinterSession_disposal, (_a = __classPrivateFieldGet(this, _BrotherPrinterSession_disposal, \"f\")) !== null && _a !== void 0 ? _a : Promise.all(__classPrivateFieldGet(this, _BrotherPrinterSession_listeners, \"f\").map((listener) => listener.then((handle) => handle.remove()))).then(() => undefined), \"f\");\n return __classPrivateFieldGet(this, _BrotherPrinterSession_disposal, \"f\");\n }\n}\n_BrotherPrinterSession_closed = new WeakMap(), _BrotherPrinterSession_printers = new WeakMap(), _BrotherPrinterSession_listeners = new WeakMap(), _BrotherPrinterSession_listening = new WeakMap(), _BrotherPrinterSession_disposal = new WeakMap(), _BrotherPrinterSession_storage = new WeakMap(), _BrotherPrinterSession_storageKey = new WeakMap(), _BrotherPrinterSession_instances = new WeakSet(), _BrotherPrinterSession_readSavedPrinter = async function _BrotherPrinterSession_readSavedPrinter() {\n var _a;\n const value = await ((_a = __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\")) === null || _a === void 0 ? void 0 : _a.get(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\")));\n if (!value)\n return undefined;\n const channel = JSON.parse(value);\n if (channel &&\n Object.values(BRLMPrinterPort).includes(channel.port) &&\n ['modelName', 'channelInfo', 'serialNumber', 'macAddress', 'nodeName', 'location'].every((key) => typeof channel[key] === 'string'))\n return channel;\n return undefined;\n}, _BrotherPrinterSession_savePrinter = async function _BrotherPrinterSession_savePrinter(options) {\n var _a;\n if (!__classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\") || !options.port || !((_a = options.channelInfo) === null || _a === void 0 ? void 0 : _a.trim()))\n return;\n const found = __classPrivateFieldGet(this, _BrotherPrinterSession_printers, \"f\").find((printer) => printer.port === options.port && printer.channelInfo === options.channelInfo);\n const channel = Object.assign(Object.assign({ serialNumber: '', macAddress: '', nodeName: '', location: '' }, found), { port: options.port, channelInfo: options.channelInfo, modelName: options.modelName });\n await __classPrivateFieldGet(this, _BrotherPrinterSession_storage, \"f\").set(__classPrivateFieldGet(this, _BrotherPrinterSession_storageKey, \"f\"), JSON.stringify(channel));\n}, _BrotherPrinterSession_discover = function _BrotherPrinterSession_discover(run) {\n return queueConnection(async () => {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, [], \"f\");\n return run().then((printers) => {\n if (__classPrivateFieldGet(this, _BrotherPrinterSession_closed, \"f\"))\n return [];\n __classPrivateFieldSet(this, _BrotherPrinterSession_printers, printers, \"f\");\n return printers;\n });\n });\n};\n//# sourceMappingURL=index.js.map"],"names":["BRLMPrinterPort","BRLMPrinterCustomPaperUnit","BRLMPrinterCustomPaperType","BRLMPrinterModelName","BRLMPrinterLabelName","BRLMPrinterImageRotation","BRLMPrinterScaleMode","BRLMPrinterHalftone","BRLMPrinterVerticalAlignment","BRLMPrinterHorizontalAlignment","BRLMPrinterCompressMode","BRLMPrinterPrintQuality","BrotherPrintEventsEnum","Model","Port","Capacitor","WebPlugin","this","registerPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,KAAK;IAClC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;IACpC,IAAI,eAAe,CAAC,WAAW,CAAC,GAAG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IACzB,YAAY,sBAAsB,CAAC,IAAI,EAAE,+BAA+B,EAAE,QAAQ,EAAE,GAAG,CAAC;IACxF,YAAY,OAAO,QAAQ;IAC3B,QAAQ,CAAC,CAAC;IACV,IAAI,CAAC,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;"}
@@ -5,16 +5,21 @@ They have no Angular or Ionic dependency. Sessions optionally remember connectio
5
5
  application-supplied storage callbacks. All helpers share a queue to prevent overlapping
6
6
  discovery and connection checks.
7
7
 
8
- - `brotherPrinterPorts(model, isAndroid?)` returns connection choices for an existing
9
- model enum, using `Capacitor.getPlatform()` when the override is omitted. USB is
10
- Android-only. `wifi` also covers wired Ethernet. Unknown models return an empty array.
11
- - `resolveBrotherPrinterPort(model, saved?)` keeps a supported saved connection.
12
- Otherwise it prefers USB for QL-800/QL-810W on Android, then the first supported
13
- connection. It returns `undefined` when no connection is supported.
14
- - `brotherPrinterPortLabel(port)` returns a common display name: Wi-Fi, Bluetooth,
15
- Bluetooth LE or USB. An undefined or unknown port returns an empty string.
16
- - `brotherPrinterModel(name)` matches a discovery name to the existing model enum,
17
- including product aliases such as QL-820NWBc. Unknown names return `undefined`.
8
+ ## Choose an entry point
9
+
10
+ Complete [Installation](/docs/installation) first, including SDK and permission setup. Import helpers from the same plugin package.
11
+
12
+ | Task | Entry point |
13
+ | --- | --- |
14
+ | Manage discovery results, notifications and cleanup for a print screen | `BrotherPrinterSession` |
15
+ | Run one search without a screen lifetime | `searchBrotherPrinters` |
16
+ | Reuse a previous destination, with discovery if unavailable | `prepareBrotherPrinters` |
17
+ | Check only a manually entered destination | `checkBrotherPrinterChannel` |
18
+
19
+ For direct plugin calls, see [Search](/docs/search), [Print](/docs/print) and [Events](/docs/events).
20
+
21
+ ## Search without a session
22
+
18
23
  - `searchBrotherPrinters(options, model?)` collects discovery events into an
19
24
  array. It registers its listener before searching and removes it when the search
20
25
  succeeds or fails. No results returns an empty array; native errors propagate.
@@ -40,44 +45,17 @@ const printers = await searchBrotherPrinters(
40
45
  );
41
46
  ```
42
47
 
43
- Search, preparation and explicit connection checks share a queue. The next call begins after the previous
44
- native operation and listener cleanup finish, even if the previous call failed. No JS
45
- search timeout releases the queue early. Do not mix concurrent raw `BrotherPrint.search()`
46
- or connection-check calls with these helpers: raw calls bypass this queue and native
47
- events have no request ID. Printing also remains outside this queue; await connection
48
- preparation before calling `printImage`.
49
- The optional model filters non-USB results; USB results are retained even when the SDK
50
- returns an empty model or address. Connection choices do not extend native support;
51
- consult the existing README and SDK installation instructions.
52
48
 
53
- When using the stateless functions, the app owns loading indicators, selection UI and caching. Pass its saved channel to
54
- `prepareBrotherPrinters`, select a returned channel, and call the existing
55
- `BrotherPrint.printImage()` with the selected port and address. The helper does not
56
- retry printing. Store the chosen channel in the app for the next preparation.
49
+ ## Use a session on a print screen
57
50
 
58
- Use `searchDuration: 3` for a short preliminary search or `10` for a normal search;
59
- these are caller choices, not automatic retries. Cancellation through the existing
60
- native methods affects the active search; it does not remove queued helper calls.
61
- No controller instance or separate listener cleanup call is required.
51
+ 1. Create a session when the screen opens and register print notifications.
52
+ 2. Call `prepare` to obtain candidates. Show an empty result when none are found; let the user select when several are found.
53
+ 3. Pass the selected channel's `port` and `channelInfo`, plus the model, paper and image, to `session.printImage`. See [Print](/docs/print) for native print options.
54
+ 4. Call `dispose()` in the screen's exit handler. You do not need to wait for printing before disposing the screen.
62
55
 
63
- See the [plain TypeScript print example](https://github.com/rdlabo-dev/capacitor-brotherprint/blob/main/examples/plain-typescript.ts).
64
- In a source checkout, `npm test` tests the helpers and typechecks that example.
56
+ The following example shows session setup and cleanup. For selection and printing together, see the [TypeScript example](https://github.com/rdlabo-dev/capacitor-brotherprint/blob/main/examples/plain-typescript.ts).
65
57
 
66
58
 
67
- For a manually entered device, retain the selected port alongside its address. Do not
68
- infer Bluetooth from punctuation: iOS Bluetooth uses a serial number and BLE uses
69
- an SDK local name. Call `checkBrotherPrinterChannel` and print to that same channel
70
- only if it is available. Use `prepareBrotherPrinters` for USB discovery/permissions.
71
- The application supplies the model and label settings independently.
72
-
73
- A screen can ignore a completed result after it closes. The helper still awaits native
74
- completion and removes its listener. Periodic scanning intervals, screen cancellation
75
- policy, known-device lists and preferred-device sorting remain application decisions.
76
-
77
- See [design decisions](helper-design.md) for the practical scenarios behind these APIs.
78
-
79
- ## Screen lifetime
80
-
81
59
  Use one `BrotherPrinterSession` for each print screen. Connection helpers use the Capacitor platform directly; the session owns discovery results, print notifications and disposal.
82
60
  Do not reuse a disposed session. The stateless helpers remain available for
83
61
  operations that do not have a screen lifetime.
@@ -96,6 +74,8 @@ const printers = await session.prepare(
96
74
  await session.dispose();
97
75
  ```
98
76
 
77
+ ### Work that outlives the screen
78
+
99
79
  `closed` becomes true immediately on disposal and `printers` becomes empty.
100
80
  Queued searches are skipped and late results are ignored. Print callbacks stop
101
81
  immediately; disposal waits for this session's print listener handles to be removed,
@@ -105,7 +85,8 @@ After asynchronous app work (image generation, storage or a dialog), check `clos
105
85
  before presenting UI. Calls to `search`, `prepare` and `printImage` on a closed
106
86
  session do not start native work. No automatic print retry is added.
107
87
 
108
- ## Remembering a connection
88
+
89
+ ## Remember a connection
109
90
 
110
91
  Supply three callbacks to use localStorage, sessionStorage, Ionic Storage or another
111
92
  string store. The plugin does not detect or depend on a storage implementation.
@@ -133,6 +114,8 @@ const session = new BrotherPrinterSession({
133
114
  });
134
115
  ```
135
116
 
117
+ ### Stored data and reuse
118
+
136
119
  `get` returns a string or null/undefined; callbacks may complete synchronously or
137
120
  asynchronously. The session serializes connection metadata as JSON under
138
121
  `${storagePrefix}last-printer` (default: `brotherprint:last-printer`). It never stores
@@ -146,6 +129,59 @@ storage; passing `null` skips the saved connection. Storage read/write failures
146
129
  invalid saved JSON are ignored; native errors still propagate. Disposal during a
147
130
  storage operation prevents subsequent native work.
148
131
 
132
+ ### Forget a saved connection
133
+
149
134
  `await session.clearSavedPrinter()` removes the remembered connection; removal errors
150
135
  propagate so the app can report failure. Without storage callbacks, sessions keep only
151
136
  screen-local state. Stateless helpers continue to accept app-managed previous channels.
137
+
138
+ ## Check a manually entered destination
139
+
140
+ For a manually entered device, retain the selected port alongside its address. Do not
141
+ infer Bluetooth from punctuation: iOS Bluetooth uses a serial number and BLE uses
142
+ an SDK local name. Call `checkBrotherPrinterChannel` and print to that same channel
143
+ only if it is available. Use `prepareBrotherPrinters` for USB discovery/permissions.
144
+ The application supplies the model and label settings independently.
145
+
146
+
147
+ ## Connection and model utilities
148
+
149
+ - `brotherPrinterPorts(model, isAndroid?)` returns connection choices for an existing
150
+ model enum, using `Capacitor.getPlatform()` when the override is omitted. USB is
151
+ Android-only. `wifi` also covers wired Ethernet. Unknown models return an empty array.
152
+ - `resolveBrotherPrinterPort(model, saved?)` keeps a supported saved connection.
153
+ Otherwise it prefers USB for QL-800/QL-810W on Android, then the first supported
154
+ connection. It returns `undefined` when no connection is supported.
155
+ - `brotherPrinterPortLabel(port)` returns a common display name: Wi-Fi, Bluetooth,
156
+ Bluetooth LE or USB. An undefined or unknown port returns an empty string.
157
+ - `brotherPrinterModel(name)` matches a discovery name to the existing model enum,
158
+ including product aliases such as QL-820NWBc. Unknown names return `undefined`.
159
+
160
+ ## Search ordering and errors
161
+
162
+ Search, preparation and explicit connection checks share a queue. The next call begins after the previous
163
+ native operation and listener cleanup finish, even if the previous call failed. No JS
164
+ search timeout releases the queue early. Do not mix concurrent raw `BrotherPrint.search()`
165
+ or connection-check calls with these helpers: raw calls bypass this queue and native
166
+ events have no request ID. Printing also remains outside this queue; await connection
167
+ preparation before calling `printImage`.
168
+ Discovery keeps every matching-port result, including different models; it does not
169
+ exclude by model name. Results with a different port are dropped, and the same
170
+ port/address is deduplicated. An optional model argument on `searchBrotherPrinters`
171
+ and `session.search` is retained for compatibility and is unused. USB results are
172
+ retained even when the SDK returns an empty model or address. Connection choices do
173
+ not extend native support; consult the existing README and SDK installation
174
+ instructions.
175
+
176
+ When using the stateless functions, the app owns loading indicators, selection UI and caching. Pass its saved channel to
177
+ `prepareBrotherPrinters`, select a returned channel, and call the existing
178
+ `BrotherPrint.printImage()` with the selected port and address. The helper does not
179
+ retry printing. Store the chosen channel in the app for the next preparation.
180
+
181
+ Use `searchDuration: 3` for a short preliminary search or `10` for a normal search;
182
+ these are caller choices, not automatic retries. Cancellation through the existing
183
+ native methods affects the active search; it does not remove queued helper calls.
184
+ No controller instance or separate listener cleanup call is required.
185
+
186
+ See the [plain TypeScript print example](https://github.com/rdlabo-dev/capacitor-brotherprint/blob/main/examples/plain-typescript.ts).
187
+ In a source checkout, `npm test` tests the helpers and typechecks that example.
@@ -3,6 +3,8 @@
3
3
  These helpers extract recurring connection work from label-printing applications.
4
4
  They use the plugin bundled in this package and keep the existing native contract.
5
5
 
6
+ ## Responsibility boundaries
7
+
6
8
  | Observed application work | Shared behavior | Application responsibility |
7
9
  | --- | --- | --- |
8
10
  | Screens repeat platform and model connection checks | Read the Capacitor platform, filter supported ports and resolve the saved/default connection | Present connection choices |
@@ -12,31 +14,45 @@ They use the plugin bundled in this package and keep the existing native contrac
12
14
  | Discovery events repeat or use product-name aliases | Collect results and match existing model enums | Choose one printer or cancel the selection |
13
15
  | Screens attach listeners and later close | A session owns results, print listeners and a terminal closed state; skip queued native work and discard late results | Create one session per screen, dispose on exit, and check `closed` before showing UI after asynchronous image generation |
14
16
 
17
+ ## A reusable candidate versus an explicit destination
18
+
15
19
  The distinction between preparation and explicit checking is intentional. A previous
16
20
  printer is a convenience that may fall back to discovery. An explicitly chosen address
17
21
  is a destination: a failed check must not silently choose a different printer.
18
22
 
23
+ ## Serialize until native completion
24
+
19
25
  Actual application code used both short preliminary scans and longer user-requested
20
26
  scans, so duration remains an explicit native search option. Fixed JavaScript timers
21
27
  are not used to infer SDK completion. Multiple ports can be searched by awaiting one
22
28
  helper call after another; no automatic scan schedule or transport inference is added.
23
29
 
30
+ ## Application policy
31
+
24
32
  Selection dialogs, storage implementation, hidden-device lists, analytics, image generation,
25
33
  fonts, label layouts and user-facing messages belong to applications. Native SDK
26
34
  changes and automatic print retries are not part of these helpers. Existing native
27
35
  errors and availability results are preserved rather than reclassified.
28
36
 
29
- The tests exercise these connection flows through the built package using Node's
30
- standard test runner. They do not establish physical printer compatibility or model
31
- identity from an availability check.
37
+ ## Separate screen disposal from native completion
32
38
 
33
39
  `BrotherPrinterSession` is the stateful boundary for a print screen. It shares the
34
40
  same native connection queue as the stateless helpers, so creating a new screen
35
41
  cannot overlap a previous screen's unfinished discovery. Disposal does not claim
36
42
  to abort a native operation: an active search completes and removes its listener;
37
- an already started print is still awaited. The application does not need its own
43
+ an already started print continues. `dispose()` waits for print listener removal, not for discovery or printing to finish. Await the `printImage()` promise separately when the caller needs to wait for printing. The application does not need its own
38
44
  search queue, listener list or cancellation generation counter.
39
45
 
46
+ ## Application-supplied storage
47
+
40
48
  Optional session storage owns connection keys and JSON serialization through `get`,
41
49
  `set` and `remove` callbacks. Applications supply the store; printer preparation and
42
50
  remembering the selected destination do not need separate app persistence code.
51
+
52
+ For usage and code examples, see [JavaScript printer helpers](/docs/connection-management).
53
+
54
+ ## What the tests establish
55
+
56
+ The tests exercise these connection flows through the built package using Node's
57
+ standard test runner. They do not establish physical printer compatibility or model
58
+ identity from an availability check.
@@ -80,7 +80,7 @@ public class BrotherPrintPlugin: CAPPlugin, CAPBridgedPlugin {
80
80
 
81
81
  if modelName.hasPrefix("QL") {
82
82
  guard
83
- let _printSettings = BRLMQLPrintSettings(defaultPrintSettingsWith: printerModel)
83
+ let qlPrintSettings = BRLMQLPrintSettings(defaultPrintSettingsWith: printerModel)
84
84
  else {
85
85
  printerDriver.closeChannel()
86
86
  self.notifyListeners(BrotherPrinterEvent.onPrintError.rawValue, data: [
@@ -90,11 +90,11 @@ public class BrotherPrintPlugin: CAPPlugin, CAPBridgedPlugin {
90
90
  call.reject("Error - Create BRLMQLPrintSettings with " + modelName + " is failed.")
91
91
  return
92
92
  }
93
- printSettings = PrinterSettingsModel.QLModelSettings(call, printSettings: _printSettings)
93
+ printSettings = PrinterSettingsModel.QLModelSettings(call, printSettings: qlPrintSettings)
94
94
 
95
95
  } else if modelName.hasPrefix("TD") {
96
96
  guard
97
- let _printSettings = BRLMTDPrintSettings(defaultPrintSettingsWith: printerModel)
97
+ let tdPrintSettings = BRLMTDPrintSettings(defaultPrintSettingsWith: printerModel)
98
98
  else {
99
99
  printerDriver.closeChannel()
100
100
  self.notifyListeners(BrotherPrinterEvent.onPrintError.rawValue, data: [
@@ -104,7 +104,7 @@ public class BrotherPrintPlugin: CAPPlugin, CAPBridgedPlugin {
104
104
  call.reject("Error - Create BRLMTDPrintSettings with " + modelName + " is failed.")
105
105
  return
106
106
  }
107
- printSettings = PrinterSettingsModel.TDModelSettings(call, printSettings: _printSettings)
107
+ printSettings = PrinterSettingsModel.TDModelSettings(call, printSettings: tdPrintSettings)
108
108
 
109
109
  } else {
110
110
  printerDriver.closeChannel()
@@ -55,77 +55,47 @@ class BrotherModel {
55
55
  }
56
56
  }
57
57
 
58
+ private static let labelSizes: [String: BRLMQLPrintSettingsLabelSize] = [
59
+ "DieCutW17H54": .dieCutW17H54,
60
+ "DieCutW17H87": .dieCutW17H87,
61
+ "DieCutW23H23": .dieCutW23H23,
62
+ "DieCutW29H42": .dieCutW29H42,
63
+ "DieCutW29H90": .dieCutW29H90,
64
+ "DieCutW38H90": .dieCutW38H90,
65
+ "DieCutW39H48": .dieCutW39H48,
66
+ "DieCutW52H29": .dieCutW52H29,
67
+ "DieCutW62H29": .dieCutW62H29,
68
+ "DieCutW62H60": .dieCutW62H60,
69
+ "DieCutW62H75": .dieCutW62H75,
70
+ "DieCutW62H100": .dieCutW62H100,
71
+ "DieCutW60H86": .dieCutW60H86,
72
+ "DieCutW54H29": .dieCutW54H29,
73
+ "DieCutW102H51": .dieCutW102H51,
74
+ "DieCutW102H152": .dieCutW102H152,
75
+ "DieCutW103H164": .dieCutW103H164,
76
+ "RollW12": .rollW12,
77
+ "RollW29": .rollW29,
78
+ "RollW38": .rollW38,
79
+ "RollW50": .rollW50,
80
+ "RollW54": .rollW54,
81
+ "RollW62": .rollW62,
82
+ "RollW62RB": .rollW62RB,
83
+ "RollW102": .rollW102,
84
+ "RollW103": .rollW103,
85
+ "DTRollW90": .dtRollW90,
86
+ "DTRollW102": .dtRollW102,
87
+ "DTRollW102H51": .dtRollW102H51,
88
+ "DTRollW102H152": .dtRollW102H152,
89
+ "RoundW12DIA": .roundW12DIA,
90
+ "RoundW24DIA": .roundW24DIA,
91
+ "RoundW58DIA": .roundW58DIA
92
+ ]
93
+
58
94
  static func getLabelSize(from: String) -> BRLMQLPrintSettingsLabelSize {
59
- switch from {
60
- case "DieCutW17H54":
61
- return BRLMQLPrintSettingsLabelSize.dieCutW17H54
62
- case "DieCutW17H87":
63
- return BRLMQLPrintSettingsLabelSize.dieCutW17H87
64
- case "DieCutW23H23":
65
- return BRLMQLPrintSettingsLabelSize.dieCutW23H23
66
- case "DieCutW29H42":
67
- return BRLMQLPrintSettingsLabelSize.dieCutW29H42
68
- case "DieCutW29H90":
69
- return BRLMQLPrintSettingsLabelSize.dieCutW29H90
70
- case "DieCutW38H90":
71
- return BRLMQLPrintSettingsLabelSize.dieCutW38H90
72
- case "DieCutW39H48":
73
- return BRLMQLPrintSettingsLabelSize.dieCutW39H48
74
- case "DieCutW52H29":
75
- return BRLMQLPrintSettingsLabelSize.dieCutW52H29
76
- case "DieCutW62H29":
77
- return BRLMQLPrintSettingsLabelSize.dieCutW62H29
78
- case "DieCutW62H60":
79
- return BRLMQLPrintSettingsLabelSize.dieCutW62H60
80
- case "DieCutW62H75":
81
- return BRLMQLPrintSettingsLabelSize.dieCutW62H75
82
- case "DieCutW62H100":
83
- return BRLMQLPrintSettingsLabelSize.dieCutW62H100
84
- case "DieCutW60H86":
85
- return BRLMQLPrintSettingsLabelSize.dieCutW60H86
86
- case "DieCutW54H29":
87
- return BRLMQLPrintSettingsLabelSize.dieCutW54H29
88
- case "DieCutW102H51":
89
- return BRLMQLPrintSettingsLabelSize.dieCutW102H51
90
- case "DieCutW102H152":
91
- return BRLMQLPrintSettingsLabelSize.dieCutW102H152
92
- case "DieCutW103H164":
93
- return BRLMQLPrintSettingsLabelSize.dieCutW103H164
94
- case "RollW12":
95
- return BRLMQLPrintSettingsLabelSize.rollW12
96
- case "RollW29":
97
- return BRLMQLPrintSettingsLabelSize.rollW29
98
- case "RollW38":
99
- return BRLMQLPrintSettingsLabelSize.rollW38
100
- case "RollW50":
101
- return BRLMQLPrintSettingsLabelSize.rollW50
102
- case "RollW54":
103
- return BRLMQLPrintSettingsLabelSize.rollW54
104
- case "RollW62":
105
- return BRLMQLPrintSettingsLabelSize.rollW62
106
- case "RollW62RB":
107
- return BRLMQLPrintSettingsLabelSize.rollW62RB
108
- case "RollW102":
109
- return BRLMQLPrintSettingsLabelSize.rollW102
110
- case "RollW103":
111
- return BRLMQLPrintSettingsLabelSize.rollW103
112
- case "DTRollW90":
113
- return BRLMQLPrintSettingsLabelSize.dtRollW90
114
- case "DTRollW102":
115
- return BRLMQLPrintSettingsLabelSize.dtRollW102
116
- case "DTRollW102H51":
117
- return BRLMQLPrintSettingsLabelSize.dtRollW102H51
118
- case "DTRollW102H152":
119
- return BRLMQLPrintSettingsLabelSize.dtRollW102H152
120
- case "RoundW12DIA":
121
- return BRLMQLPrintSettingsLabelSize.roundW12DIA
122
- case "RoundW24DIA":
123
- return BRLMQLPrintSettingsLabelSize.roundW24DIA
124
- case "RoundW58DIA":
125
- return BRLMQLPrintSettingsLabelSize.roundW58DIA
126
- default:
95
+ guard let labelSize = labelSizes[from] else {
127
96
  fatalError("Unsupported label size: \(from)")
128
97
  }
98
+ return labelSize
129
99
  }
130
100
  }
131
101