@rdlabo/capacitor-brotherprint 6.2.0 → 6.3.0

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,63 +1,107 @@
1
1
  package jp.rdlabo.capacitor.plugin.brotherprint.models
2
2
 
3
- import com.brother.ptouch.sdk.Printer
4
- import com.brother.ptouch.sdk.PrinterInfo
3
+ import com.brother.sdk.lmprinter.setting.CustomPaperSize
4
+ import com.brother.sdk.lmprinter.setting.PrintImageSettings
5
+ import com.brother.sdk.lmprinter.setting.QLPrintSettings
6
+ import com.brother.sdk.lmprinter.setting.TDPrintSettings
5
7
  import com.getcapacitor.PluginCall
6
8
 
9
+
7
10
  class BrotherPrintSettings {
8
- public fun initialize(call: PluginCall, printer: Printer): PrinterInfo {
9
- val settings = printer.printerInfo
10
- settings.paperSize = PrinterInfo.PaperSize.CUSTOM
11
- settings.numberOfCopies = call.getInt("numberOfCopies", 1)!!
12
- settings.isAutoCut = call.getBoolean("autoCut", true)!!
11
+ public fun modelTDSettings(call: PluginCall, settings: TDPrintSettings): TDPrintSettings {
12
+ val baseSettings = this.baseSettings(call, settings);
13
+
14
+ val margins = CustomPaperSize.Margins(
15
+ call.getFloat("marginTop", 0f)!!,
16
+ call.getFloat("marginRight", 0f)!!,
17
+ call.getFloat("marginBottom", 0f)!!,
18
+ call.getFloat("marginLeft", 0f)!!,
19
+ )
20
+
21
+ val unit: CustomPaperSize.Unit = when(call.getString("paperUnit", "mm")) {
22
+ "mm" -> CustomPaperSize.Unit.Mm
23
+ "inch" -> CustomPaperSize.Unit.Inch
24
+ else -> {
25
+ throw RuntimeException(call.getString("paperUnit") + " is not supported.")
26
+ }
27
+ }
28
+
29
+ val customPaperSize: CustomPaperSize = when (call.getString("paperType")) {
30
+ "rollPaper" -> CustomPaperSize.newRollPaperSize(call.getFloat("tapeWidth", 0f)!!, margins, unit)
31
+ "dieCutPaper" -> CustomPaperSize.newDieCutPaperSize(call.getFloat("tapeWidth", 0f)!!, call.getFloat("tapeLength", 0f)!!, margins,
32
+ call.getFloat("gapLength", 0f)!!, unit)
33
+ "markRollPaper" -> CustomPaperSize.newMarkRollPaperSize(call.getFloat("tapeWidth", 0f)!!, call.getFloat("tapeLength", 0f)!!, margins,
34
+ call.getFloat("paperMarkPosition", 0f)!!, call.getFloat("paperMarkLength", 0f)!!, unit)
35
+ else -> {
36
+ throw RuntimeException(call.getString("paperType") + " is not supported.")
37
+ }
38
+ }
39
+
40
+ baseSettings.customPaperSize = customPaperSize
41
+ baseSettings.isAutoCut = call.getBoolean("autoCut", true)!!
42
+
43
+ return baseSettings
44
+ }
45
+
46
+ public fun modelQLSettings(call: PluginCall, settings: QLPrintSettings): QLPrintSettings {
47
+ val baseSettings = this.baseSettings(call, settings);
48
+
49
+ baseSettings.isAutoCut = call.getBoolean("autoCut", true)!!
50
+ baseSettings.labelSize = QLPrintSettings.LabelSize.entries.find { it.name == call.getString("labelName", "W62") }
51
+
52
+ return baseSettings;
53
+ }
54
+
55
+ private fun <T: PrintImageSettings> baseSettings(call: PluginCall, settings: T): T {
56
+ settings.numCopies = call.getInt("numberOfCopies", 1)!!
13
57
 
14
58
  when (call.getString("scaleMode")) {
15
- "ActualSize" -> settings.printMode = PrinterInfo.PrintMode.ORIGINAL
16
- "FitPageAspect" -> settings.printMode = PrinterInfo.PrintMode.FIT_TO_PAGE
17
- "FitPaperAspect" -> settings.printMode = PrinterInfo.PrintMode.FIT_TO_PAPER
59
+ "ActualSize" -> settings.scaleMode = PrintImageSettings.ScaleMode.ActualSize
60
+ "FitPageAspect" -> settings.scaleMode = PrintImageSettings.ScaleMode.FitPageAspect
61
+ "FitPaperAspect" -> settings.scaleMode = PrintImageSettings.ScaleMode.FitPaperAspect
18
62
  "ScaleValue" -> {
19
- settings.printMode = PrinterInfo.PrintMode.SCALE
63
+ settings.scaleMode = PrintImageSettings.ScaleMode.ScaleValue
20
64
  if (call.getDouble("scaleValue") !== null) {
21
- settings.scaleValue = call.getDouble("scaleValue")!!
65
+ settings.scaleValue = call.getFloat("scaleValue")!!
22
66
  }
23
67
  }
24
68
  }
25
69
 
26
70
  when (call.getString("halftone")) {
27
71
  "Threshold" -> {
28
- settings.halftone = PrinterInfo.Halftone.THRESHOLD
72
+ settings.halftone = PrintImageSettings.Halftone.Threshold
29
73
  if (call.getDouble("halftoneThreshold") !== null) {
30
- settings.thresholdingValue = call.getInt("halftoneThreshold")!!
74
+ settings.halftoneThreshold = call.getInt("halftoneThreshold")!!
31
75
  }
32
76
  }
33
- "ErrorDiffusion" -> settings.halftone = PrinterInfo.Halftone.ERRORDIFFUSION
34
- "PatternDither" -> settings.halftone = PrinterInfo.Halftone.PATTERNDITHER
77
+ "ErrorDiffusion" -> settings.halftone = PrintImageSettings.Halftone.ErrorDiffusion
78
+ "PatternDither" -> settings.halftone = PrintImageSettings.Halftone.PatternDither
35
79
  }
36
80
 
37
81
  when (call.getString("imageRotation")) {
38
- "Rotate0" -> settings.rotation = PrinterInfo.Rotation.Rotate0
39
- "Rotate90" -> settings.rotation = PrinterInfo.Rotation.Rotate90
40
- "Rotate180" -> settings.rotation = PrinterInfo.Rotation.Rotate180
41
- "Rotate270" -> settings.rotation = PrinterInfo.Rotation.Rotate270
82
+ "Rotate0" -> settings.imageRotation = PrintImageSettings.Rotation.Rotate0
83
+ "Rotate90" -> settings.imageRotation = PrintImageSettings.Rotation.Rotate90
84
+ "Rotate180" -> settings.imageRotation = PrintImageSettings.Rotation.Rotate180
85
+ "Rotate270" -> settings.imageRotation = PrintImageSettings.Rotation.Rotate270
42
86
  }
43
87
 
44
88
  when (call.getString("verticalAlignment")) {
45
- "Top" -> settings.valign = PrinterInfo.VAlign.TOP
46
- "Center" -> settings.valign = PrinterInfo.VAlign.MIDDLE
47
- "Bottom" -> settings.valign = PrinterInfo.VAlign.BOTTOM
89
+ "Top" -> settings.vAlignment = PrintImageSettings.VerticalAlignment.Top
90
+ "Center" -> settings.vAlignment = PrintImageSettings.VerticalAlignment.Center
91
+ "Bottom" -> settings.vAlignment = PrintImageSettings.VerticalAlignment.Bottom
48
92
  }
49
93
 
50
94
  when (call.getString("horizontalAlignment")) {
51
- "Left" -> settings.align = PrinterInfo.Align.LEFT
52
- "Center" -> settings.align = PrinterInfo.Align.CENTER
53
- "Right" -> settings.align = PrinterInfo.Align.RIGHT
95
+ "Left" -> settings.hAlignment = PrintImageSettings.HorizontalAlignment.Left
96
+ "Center" -> settings.hAlignment = PrintImageSettings.HorizontalAlignment.Center
97
+ "Right" -> settings.hAlignment = PrintImageSettings.HorizontalAlignment.Right
54
98
  }
55
99
 
56
100
  // when (call.getString("compressMode")) { }
57
101
 
58
102
  when (call.getString("printQuality")) {
59
- "Best" -> settings.printQuality = PrinterInfo.PrintQuality.HIGH_RESOLUTION
60
- "Fast" -> settings.printQuality = PrinterInfo.PrintQuality.DOUBLE_SPEED
103
+ "Best" -> settings.printQuality = PrintImageSettings.PrintQuality.Best
104
+ "Fast" -> settings.printQuality = PrintImageSettings.PrintQuality.Fast
61
105
  }
62
106
 
63
107
  // when (call.getString("resolution")) { }
package/dist/docs.json CHANGED
@@ -78,7 +78,7 @@
78
78
  ],
79
79
  "returns": "Promise<PluginListenerHandle>",
80
80
  "tags": [],
81
- "docs": "",
81
+ "docs": "Find the printer that can connected to the device.",
82
82
  "complexTypes": [
83
83
  "PluginListenerHandle",
84
84
  "BrotherPrintEventsEnum",
@@ -103,7 +103,7 @@
103
103
  ],
104
104
  "returns": "Promise<PluginListenerHandle>",
105
105
  "tags": [],
106
- "docs": "",
106
+ "docs": "Success Print Event",
107
107
  "complexTypes": [
108
108
  "PluginListenerHandle",
109
109
  "BrotherPrintEventsEnum"
@@ -127,7 +127,7 @@
127
127
  ],
128
128
  "returns": "Promise<PluginListenerHandle>",
129
129
  "tags": [],
130
- "docs": "",
130
+ "docs": "Failed to connect to the printer.\nex: Bluetooth is off, Printer is off, etc.",
131
131
  "complexTypes": [
132
132
  "PluginListenerHandle",
133
133
  "BrotherPrintEventsEnum",
@@ -152,7 +152,7 @@
152
152
  ],
153
153
  "returns": "Promise<PluginListenerHandle>",
154
154
  "tags": [],
155
- "docs": "",
155
+ "docs": "Failed to print.",
156
156
  "complexTypes": [
157
157
  "PluginListenerHandle",
158
158
  "BrotherPrintEventsEnum",
@@ -182,6 +182,42 @@
182
182
  }
183
183
  ],
184
184
  "enums": [
185
+ {
186
+ "name": "BRLMPrinterModelName",
187
+ "slug": "brlmprintermodelname",
188
+ "members": [
189
+ {
190
+ "name": "QL_810W",
191
+ "value": "'QL_810W'",
192
+ "tags": [],
193
+ "docs": ""
194
+ },
195
+ {
196
+ "name": "QL_820NWB",
197
+ "value": "'QL_820NWB'",
198
+ "tags": [],
199
+ "docs": ""
200
+ },
201
+ {
202
+ "name": "TD_2320D_203",
203
+ "value": "'TD_2320D_203'",
204
+ "tags": [],
205
+ "docs": ""
206
+ },
207
+ {
208
+ "name": "TD_2030AD",
209
+ "value": "'TD_2030AD'",
210
+ "tags": [],
211
+ "docs": ""
212
+ },
213
+ {
214
+ "name": "TD_2350D_300",
215
+ "value": "'TD_2350D_300'",
216
+ "tags": [],
217
+ "docs": ""
218
+ }
219
+ ]
220
+ },
185
221
  {
186
222
  "name": "BRLMPrinterLabelName",
187
223
  "slug": "brlmprinterlabelname",
@@ -332,42 +368,6 @@
332
368
  }
333
369
  ]
334
370
  },
335
- {
336
- "name": "BRLMPrinterModelName",
337
- "slug": "brlmprintermodelname",
338
- "members": [
339
- {
340
- "name": "QL_810W",
341
- "value": "'QL_810W'",
342
- "tags": [],
343
- "docs": ""
344
- },
345
- {
346
- "name": "QL_820NWB",
347
- "value": "'QL_820NWB'",
348
- "tags": [],
349
- "docs": ""
350
- },
351
- {
352
- "name": "TD_2320D_203",
353
- "value": "'TD_2320D_203'",
354
- "tags": [],
355
- "docs": ""
356
- },
357
- {
358
- "name": "TD_2030AD",
359
- "value": "'TD_2030AD'",
360
- "tags": [],
361
- "docs": ""
362
- },
363
- {
364
- "name": "TD_2350D_203",
365
- "value": "'TD_2350D_203'",
366
- "tags": [],
367
- "docs": ""
368
- }
369
- ]
370
- },
371
371
  {
372
372
  "name": "BRLMPrinterScaleMode",
373
373
  "slug": "brlmprinterscalemode",
@@ -542,6 +542,48 @@
542
542
  }
543
543
  ]
544
544
  },
545
+ {
546
+ "name": "BRKMPrinterCustomPaperType",
547
+ "slug": "brkmprintercustompapertype",
548
+ "members": [
549
+ {
550
+ "name": "rollPaper",
551
+ "value": "'rollPaper'",
552
+ "tags": [],
553
+ "docs": ""
554
+ },
555
+ {
556
+ "name": "dieCutPaper",
557
+ "value": "'dieCutPaper'",
558
+ "tags": [],
559
+ "docs": ""
560
+ },
561
+ {
562
+ "name": "markRollPaper",
563
+ "value": "'markRollPaper'",
564
+ "tags": [],
565
+ "docs": ""
566
+ }
567
+ ]
568
+ },
569
+ {
570
+ "name": "BRKMPrinterCustomPaperUnit",
571
+ "slug": "brkmprintercustompaperunit",
572
+ "members": [
573
+ {
574
+ "name": "mm",
575
+ "value": "'mm'",
576
+ "tags": [],
577
+ "docs": ""
578
+ },
579
+ {
580
+ "name": "inch",
581
+ "value": "'inch'",
582
+ "tags": [],
583
+ "docs": ""
584
+ }
585
+ ]
586
+ },
545
587
  {
546
588
  "name": "BrotherPrintEventsEnum",
547
589
  "slug": "brotherprinteventsenum",
@@ -580,13 +622,13 @@
580
622
  "docs": "",
581
623
  "types": [
582
624
  {
583
- "text": "{\n encodedImage: string;\n\n /**\n * Should use enum BRLMPrinterLabelName\n */\n labelName: BRLMPrinterLabelName;\n\n /**\n * Should use enum BRLMPrinterModelName\n */\n modelName: BRLMPrinterModelName;\n} & Partial<BRLMChannelResult> &\n BRLMPrinterSettings",
625
+ "text": "{\n encodedImage: string;\n\n /**\n * Should use enum BRLMPrinterModelName\n */\n modelName: BRLMPrinterModelName;\n} & Partial<BRLMChannelResult> &\n (BRLMPrinterQLModelSettings | BRLMPrinterTDModelSettings)",
584
626
  "complexTypes": [
585
- "BRLMPrinterLabelName",
586
627
  "BRLMPrinterModelName",
587
628
  "Partial",
588
629
  "BRLMChannelResult",
589
- "BRLMPrinterSettings"
630
+ "BRLMPrinterQLModelSettings",
631
+ "BRLMPrinterTDModelSettings"
590
632
  ]
591
633
  }
592
634
  ]
@@ -611,18 +653,32 @@
611
653
  "docs": "",
612
654
  "types": [
613
655
  {
614
- "text": "{\n port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n modelName: string;\n serialNumber: string;\n macAddress: string;\n nodeName: string;\n location: string;\n ipAddress: string;\n}",
656
+ "text": "{\n port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n modelName: string;\n serialNumber: string;\n macAddress: string;\n nodeName: string;\n location: string;\n\n /**\n * This need to connect to the printer.\n * wifi: IP Address\n * bluetooth: macAddress\n * bluetoothLowEnergy: modelName for bluetoothLowEnergy\n */\n channelInfo: string;\n}",
615
657
  "complexTypes": []
616
658
  }
617
659
  ]
618
660
  },
661
+ {
662
+ "name": "BRLMPrinterQLModelSettings",
663
+ "slug": "brlmprinterqlmodelsettings",
664
+ "docs": "",
665
+ "types": [
666
+ {
667
+ "text": "{\n /**\n * Should use enum BRLMPrinterLabelName\n */\n labelName: BRLMPrinterLabelName;\n} & BRLMPrinterSettings",
668
+ "complexTypes": [
669
+ "BRLMPrinterLabelName",
670
+ "BRLMPrinterSettings"
671
+ ]
672
+ }
673
+ ]
674
+ },
619
675
  {
620
676
  "name": "BRLMPrinterSettings",
621
677
  "slug": "brlmprintersettings",
622
678
  "docs": "These are optional. If these are not set, default values are assigned by the printer.",
623
679
  "types": [
624
680
  {
625
- "text": "{\n /**\n * The number of copies you print.\n */\n numberOfCopies?: BRLMPrinterNumberOfCopies;\n\n /**\n * Whether the auto-cut is enabled or not. If true, your printer cut the paper each page.\n */\n autoCut?: BRLMPrinterAutoCutType;\n\n /**\n * A scale mode that specifies how your data is scaled in a print area of your printer.\n */\n scaleMode?: BRLMPrinterScaleMode;\n\n /**\n * A scale value. This is effective when ScaleMode is ScaleValue.\n */\n scaleValue?: BRLMPrinterScaleValueType;\n\n /**\n * A way to rasterize your data.\n */\n halftone?: BRLMPrinterHalftone;\n\n /**\n * A threshold value. This is effective when the Halftone is Threshold.\n */\n halftoneThreshold?: BRLMPrinterHalftoneThresholdType;\n\n /**\n * An image rotation that specifies the angle in which your data is placed in the print area. Rotation direction is clockwise.\n */\n imageRotation?: BRLMPrinterImageRotation;\n\n /**\n * A vertical alignment that specifies how your data is placed in the printable area.\n */\n verticalAlignment?: BRLMPrinterVerticalAlignment;\n\n /**\n * A horizontal alignment that specifies how your data is placed in the printable area.\n */\n horizontalAlignment?: BRLMPrinterHorizontalAlignment;\n\n /**\n * A compress mode that specifies how to compress your data.\n * note: This is ios only.\n */\n compressMode?: BRLMPrinterCompressMode;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n */\n printQuality?: BRLMPrinterPrintQuality;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n * note: This is ios only. And for some reason, the aspect ratio is broken, so we do not provide this as an API.\n * resolution?: BRLMPrinterPrintResolution;\n */\n}",
681
+ "text": "{\n /**\n * The number of copies you print.\n */\n numberOfCopies?: BRLMPrinterNumberOfCopies;\n\n /**\n * Whether the auto-cut is enabled or not. If true, your printer cut the paper each page.\n */\n autoCut?: BRLMPrinterAutoCutType;\n\n /**\n * A scale mode that specifies how your data is scaled in a print area of your printer.\n */\n scaleMode?: BRLMPrinterScaleMode;\n\n /**\n * A scale value. This is effective when ScaleMode is ScaleValue.\n */\n scaleValue?: BRLMPrinterScaleValueType;\n\n /**\n * A way to rasterize your data.\n */\n halftone?: BRLMPrinterHalftone;\n\n /**\n * A threshold value. This is effective when the Halftone is Threshold.\n */\n halftoneThreshold?: BRLMPrinterHalftoneThresholdType;\n\n /**\n * An image rotation that specifies the angle in which your data is placed in the print area. Rotation direction is clockwise.\n */\n imageRotation?: BRLMPrinterImageRotation;\n\n /**\n * A vertical alignment that specifies how your data is placed in the printable area.\n */\n verticalAlignment?: BRLMPrinterVerticalAlignment;\n\n /**\n * A horizontal alignment that specifies how your data is placed in the printable area.\n */\n horizontalAlignment?: BRLMPrinterHorizontalAlignment;\n\n /**\n * A compress mode that specifies how to compress your data.\n * note: This is ios only.\n */\n compressMode?: BRLMPrinterCompressMode;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n */\n printQuality?: BRLMPrinterPrintQuality;\n}",
626
682
  "complexTypes": [
627
683
  "BRLMPrinterNumberOfCopies",
628
684
  "BRLMPrinterAutoCutType",
@@ -683,13 +739,27 @@
683
739
  }
684
740
  ]
685
741
  },
742
+ {
743
+ "name": "BRLMPrinterTDModelSettings",
744
+ "slug": "brlmprintertdmodelsettings",
745
+ "docs": "",
746
+ "types": [
747
+ {
748
+ "text": "{\n /**\n * Should use enum BRKMPrinterCustomPaperType\n */\n paperType: BRKMPrinterCustomPaperType;\n\n /**\n * The width of the label. For example, the RD-U04J1 is 60.0 wide.\n */\n tapeWidth: number;\n\n /**\n * The length of the label. For example, the RD-U04J1 is 60.0 wide.\n */\n tapeLength: number;\n\n /**\n * It is the difference between a sticker and a mount.\n * For example, the RD-U04J1 is `1.0, 2.0, 1.0, 2.0`\n */\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n\n /**\n * The spacing between seals. For example, the RD-U04J1 is 0.2.\n */\n gapLength: number;\n\n paperMarkPosition: number;\n paperMarkLength: number;\n\n /**\n * Should use enum BRKMPrinterCustomPaperUnit.\n * For example, the RD-U04J1 is mm.\n */\n paperUnit: BRKMPrinterCustomPaperUnit;\n}",
749
+ "complexTypes": [
750
+ "BRKMPrinterCustomPaperType",
751
+ "BRKMPrinterCustomPaperUnit"
752
+ ]
753
+ }
754
+ ]
755
+ },
686
756
  {
687
757
  "name": "BRLMSearchOption",
688
758
  "slug": "brlmsearchoption",
689
759
  "docs": "",
690
760
  "types": [
691
761
  {
692
- "text": "{\n port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n /**\n * searchDuration is the time to end search for devices.\n * default is 15 seconds.\n * use only port is 'wifi' or 'bluetoothLowEnergy'.\n */\n searchDuration: number;\n}",
762
+ "text": "{\n /**\n * 'usb' is android only, and now developing.\n */\n port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n\n /**\n * searchDuration is the time to end search for devices.\n * default is 15 seconds.\n * use only port is 'wifi' or 'bluetoothLowEnergy'.\n */\n searchDuration: number;\n}",
693
763
  "complexTypes": []
694
764
  }
695
765
  ]
@@ -4,6 +4,15 @@
4
4
  *
5
5
  * And name is follow android naming convention.
6
6
  */
7
+ export declare enum BRKMPrinterCustomPaperUnit {
8
+ mm = "mm",
9
+ inch = "inch"
10
+ }
11
+ export declare enum BRKMPrinterCustomPaperType {
12
+ rollPaper = "rollPaper",
13
+ dieCutPaper = "dieCutPaper",
14
+ markRollPaper = "markRollPaper"
15
+ }
7
16
  /**
8
17
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html
9
18
  */
@@ -12,7 +21,7 @@ export declare enum BRLMPrinterModelName {
12
21
  QL_820NWB = "QL_820NWB",
13
22
  TD_2320D_203 = "TD_2320D_203",
14
23
  TD_2030AD = "TD_2030AD",
15
- TD_2350D_203 = "TD_2350D_203"
24
+ TD_2350D_300 = "TD_2350D_300"
16
25
  }
17
26
  /**
18
27
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html
@@ -4,6 +4,17 @@
4
4
  *
5
5
  * And name is follow android naming convention.
6
6
  */
7
+ export var BRKMPrinterCustomPaperUnit;
8
+ (function (BRKMPrinterCustomPaperUnit) {
9
+ BRKMPrinterCustomPaperUnit["mm"] = "mm";
10
+ BRKMPrinterCustomPaperUnit["inch"] = "inch";
11
+ })(BRKMPrinterCustomPaperUnit || (BRKMPrinterCustomPaperUnit = {}));
12
+ export var BRKMPrinterCustomPaperType;
13
+ (function (BRKMPrinterCustomPaperType) {
14
+ BRKMPrinterCustomPaperType["rollPaper"] = "rollPaper";
15
+ BRKMPrinterCustomPaperType["dieCutPaper"] = "dieCutPaper";
16
+ BRKMPrinterCustomPaperType["markRollPaper"] = "markRollPaper";
17
+ })(BRKMPrinterCustomPaperType || (BRKMPrinterCustomPaperType = {}));
7
18
  /**
8
19
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html
9
20
  */
@@ -13,7 +24,7 @@ export var BRLMPrinterModelName;
13
24
  BRLMPrinterModelName["QL_820NWB"] = "QL_820NWB";
14
25
  BRLMPrinterModelName["TD_2320D_203"] = "TD_2320D_203";
15
26
  BRLMPrinterModelName["TD_2030AD"] = "TD_2030AD";
16
- BRLMPrinterModelName["TD_2350D_203"] = "TD_2350D_203";
27
+ BRLMPrinterModelName["TD_2350D_300"] = "TD_2350D_300";
17
28
  })(BRLMPrinterModelName || (BRLMPrinterModelName = {}));
18
29
  /**
19
30
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html
@@ -1 +1 @@
1
- {"version":3,"file":"brother-printer.enum.js","sourceRoot":"","sources":["../../src/brother-printer.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,+CAAuB,CAAA;IACvB,qDAA6B,CAAA;IAC7B,+CAAuB,CAAA;IACvB,qDAA6B,CAAA;AAC/B,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBAyBX;AAzBD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,uCAAe,CAAA;IACf,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EAzBW,oBAAoB,KAApB,oBAAoB,QAyB/B;AAOD;;GAEG;AACH,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,mDAAuB,CAAA;IACvB,mDAAuB,CAAA;AACzB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,iDAAyB,CAAA;IACzB,uDAA+B,CAAA;IAC/B,yDAAiC,CAAA;IACjC,iDAAyB,CAAA;AAC3B,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;AACjC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,2CAAW,CAAA;IACX,iDAAiB,CAAA;IACjB,iDAAiB,CAAA;AACnB,CAAC,EAJW,4BAA4B,KAA5B,4BAA4B,QAIvC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,+CAAa,CAAA;IACb,mDAAiB,CAAA;IACjB,iDAAe,CAAA;AACjB,CAAC,EAJW,8BAA8B,KAA9B,8BAA8B,QAIzC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,wCAAa,CAAA;IACb,wCAAa,CAAA;IACb,0CAAe,CAAA;AACjB,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAa,CAAA;IACb,wCAAa,CAAA;AACf,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED;;GAEG;AACH,2CAA2C;AAC3C,iBAAiB;AACjB,uBAAuB;AACvB,mBAAmB;AACnB,IAAI","sourcesContent":["/**\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 */\n\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html\n */\nexport enum BRLMPrinterModelName {\n QL_810W = 'QL_810W',\n QL_820NWB = 'QL_820NWB',\n TD_2320D_203 = 'TD_2320D_203',\n TD_2030AD = 'TD_2030AD',\n TD_2350D_203 = 'TD_2350D_203',\n}\n\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html\n */\nexport enum BRLMPrinterLabelName {\n W17H54 = 'W17H54',\n W17H87 = 'W17H87',\n W23H23 = 'W23H23',\n W29H42 = 'W29H42',\n W29H90 = 'W29H90',\n W38H90 = 'W38H90',\n W39H48 = 'W39H48',\n W52H29 = 'W52H29',\n W62H29 = 'W62H29',\n W62H100 = 'W62H100',\n W12 = 'W12',\n W29 = 'W29',\n W38 = 'W38',\n W50 = 'W50',\n W54 = 'W54',\n W62 = 'W62',\n W60H86 = 'W60H86',\n W62RB = 'W62RB',\n W54H29 = 'W54H29',\n W12DIA = 'W12DIA',\n W24DIA = 'W24DIA',\n W58DIA = 'W58DIA',\n W62H60 = 'W62H60',\n W62H75 = 'W62H75',\n}\n\nexport type BRLMPrinterAutoCutType = boolean;\nexport type BRLMPrinterScaleValueType = number;\nexport type BRLMPrinterHalftoneThresholdType = number;\nexport type BRLMPrinterNumberOfCopies = number;\n\n/**\n * @url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#imagerotation\n */\nexport enum BRLMPrinterImageRotation {\n Rotate0 = 'Rotate0',\n Rotate90 = 'Rotate90',\n Rotate180 = 'Rotate180',\n Rotate270 = 'Rotate270',\n}\n\n/**\n * url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#scalemode\n */\nexport enum BRLMPrinterScaleMode {\n ActualSize = 'ActualSize',\n FitPageAspect = 'FitPageAspect',\n FitPaperAspect = 'FitPaperAspect',\n ScaleValue = 'ScaleValue',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#halftone\n */\nexport enum BRLMPrinterHalftone {\n Threshold = 'Threshold',\n ErrorDiffusion = 'ErrorDiffusion',\n PatternDither = 'PatternDither',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#verticalalignment\n */\nexport enum BRLMPrinterVerticalAlignment {\n Top = 'Top',\n Center = 'Center',\n Bottom = 'Bottom',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#horizontalalignment\n */\nexport enum BRLMPrinterHorizontalAlignment {\n Left = 'Left',\n Center = 'Center',\n Right = 'Right',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#compressmode\n */\nexport enum BRLMPrinterCompressMode {\n None = 'None',\n Tiff = 'Tiff',\n Mode9 = 'Mode9',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#printquality\n */\nexport enum BRLMPrinterPrintQuality {\n Best = 'Best',\n Fast = 'Fast',\n}\n\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"]}
1
+ {"version":3,"file":"brother-printer.enum.js","sourceRoot":"","sources":["../../src/brother-printer.enum.ts"],"names":[],"mappings":"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","sourcesContent":["/**\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 */\n\nexport enum BRKMPrinterCustomPaperUnit {\n mm = 'mm',\n inch = 'inch',\n}\n\nexport enum BRKMPrinterCustomPaperType {\n rollPaper = 'rollPaper',\n dieCutPaper = 'dieCutPaper',\n markRollPaper = 'markRollPaper',\n}\n\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html\n */\nexport enum BRLMPrinterModelName {\n QL_810W = 'QL_810W',\n QL_820NWB = 'QL_820NWB',\n TD_2320D_203 = 'TD_2320D_203',\n TD_2030AD = 'TD_2030AD',\n TD_2350D_300 = 'TD_2350D_300',\n}\n\n/**\n * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html\n */\nexport enum BRLMPrinterLabelName {\n W17H54 = 'W17H54',\n W17H87 = 'W17H87',\n W23H23 = 'W23H23',\n W29H42 = 'W29H42',\n W29H90 = 'W29H90',\n W38H90 = 'W38H90',\n W39H48 = 'W39H48',\n W52H29 = 'W52H29',\n W62H29 = 'W62H29',\n W62H100 = 'W62H100',\n W12 = 'W12',\n W29 = 'W29',\n W38 = 'W38',\n W50 = 'W50',\n W54 = 'W54',\n W62 = 'W62',\n W60H86 = 'W60H86',\n W62RB = 'W62RB',\n W54H29 = 'W54H29',\n W12DIA = 'W12DIA',\n W24DIA = 'W24DIA',\n W58DIA = 'W58DIA',\n W62H60 = 'W62H60',\n W62H75 = 'W62H75',\n}\n\nexport type BRLMPrinterAutoCutType = boolean;\nexport type BRLMPrinterScaleValueType = number;\nexport type BRLMPrinterHalftoneThresholdType = number;\nexport type BRLMPrinterNumberOfCopies = number;\n\n/**\n * @url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#imagerotation\n */\nexport enum BRLMPrinterImageRotation {\n Rotate0 = 'Rotate0',\n Rotate90 = 'Rotate90',\n Rotate180 = 'Rotate180',\n Rotate270 = 'Rotate270',\n}\n\n/**\n * url https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#scalemode\n */\nexport enum BRLMPrinterScaleMode {\n ActualSize = 'ActualSize',\n FitPageAspect = 'FitPageAspect',\n FitPaperAspect = 'FitPaperAspect',\n ScaleValue = 'ScaleValue',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#halftone\n */\nexport enum BRLMPrinterHalftone {\n Threshold = 'Threshold',\n ErrorDiffusion = 'ErrorDiffusion',\n PatternDither = 'PatternDither',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#verticalalignment\n */\nexport enum BRLMPrinterVerticalAlignment {\n Top = 'Top',\n Center = 'Center',\n Bottom = 'Bottom',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#horizontalalignment\n */\nexport enum BRLMPrinterHorizontalAlignment {\n Left = 'Left',\n Center = 'Center',\n Right = 'Right',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#compressmode\n */\nexport enum BRLMPrinterCompressMode {\n None = 'None',\n Tiff = 'Tiff',\n Mode9 = 'Mode9',\n}\n\n/**\n * url: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printimagesettings.html#printquality\n */\nexport enum BRLMPrinterPrintQuality {\n Best = 'Best',\n Fast = 'Fast',\n}\n\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"]}
@@ -1,26 +1,67 @@
1
1
  import type { PluginListenerHandle } from '@capacitor/core';
2
- import type { BRLMPrinterLabelName, BRLMPrinterModelName, BRLMPrinterAutoCutType, BRLMPrinterCompressMode, BRLMPrinterHalftone, BRLMPrinterHalftoneThresholdType, BRLMPrinterHorizontalAlignment, BRLMPrinterNumberOfCopies, BRLMPrinterPrintQuality, BRLMPrinterImageRotation, BRLMPrinterScaleMode, BRLMPrinterScaleValueType, BRLMPrinterVerticalAlignment } from './brother-printer.enum';
2
+ import type { BRLMPrinterLabelName, BRLMPrinterModelName, BRLMPrinterAutoCutType, BRLMPrinterCompressMode, BRLMPrinterHalftone, BRLMPrinterHalftoneThresholdType, BRLMPrinterHorizontalAlignment, BRLMPrinterNumberOfCopies, BRLMPrinterPrintQuality, BRLMPrinterImageRotation, BRLMPrinterScaleMode, BRLMPrinterScaleValueType, BRLMPrinterVerticalAlignment, BRKMPrinterCustomPaperType, BRKMPrinterCustomPaperUnit } from './brother-printer.enum';
3
3
  import type { BrotherPrintEventsEnum } from './events.enum';
4
4
  export declare type BRLMChannelResult = {
5
- port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';
5
+ port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';
6
6
  modelName: string;
7
7
  serialNumber: string;
8
8
  macAddress: string;
9
9
  nodeName: string;
10
10
  location: string;
11
- ipAddress: string;
11
+ /**
12
+ * This need to connect to the printer.
13
+ * wifi: IP Address
14
+ * bluetooth: macAddress
15
+ * bluetoothLowEnergy: modelName for bluetoothLowEnergy
16
+ */
17
+ channelInfo: string;
12
18
  };
13
19
  export declare type BRLMPrintOptions = {
14
20
  encodedImage: string;
15
- /**
16
- * Should use enum BRLMPrinterLabelName
17
- */
18
- labelName: BRLMPrinterLabelName;
19
21
  /**
20
22
  * Should use enum BRLMPrinterModelName
21
23
  */
22
24
  modelName: BRLMPrinterModelName;
23
- } & Partial<BRLMChannelResult> & BRLMPrinterSettings;
25
+ } & Partial<BRLMChannelResult> & (BRLMPrinterQLModelSettings | BRLMPrinterTDModelSettings);
26
+ export declare type BRLMPrinterTDModelSettings = {
27
+ /**
28
+ * Should use enum BRKMPrinterCustomPaperType
29
+ */
30
+ paperType: BRKMPrinterCustomPaperType;
31
+ /**
32
+ * The width of the label. For example, the RD-U04J1 is 60.0 wide.
33
+ */
34
+ tapeWidth: number;
35
+ /**
36
+ * The length of the label. For example, the RD-U04J1 is 60.0 wide.
37
+ */
38
+ tapeLength: number;
39
+ /**
40
+ * It is the difference between a sticker and a mount.
41
+ * For example, the RD-U04J1 is `1.0, 2.0, 1.0, 2.0`
42
+ */
43
+ marginTop: number;
44
+ marginRight: number;
45
+ marginBottom: number;
46
+ marginLeft: number;
47
+ /**
48
+ * The spacing between seals. For example, the RD-U04J1 is 0.2.
49
+ */
50
+ gapLength: number;
51
+ paperMarkPosition: number;
52
+ paperMarkLength: number;
53
+ /**
54
+ * Should use enum BRKMPrinterCustomPaperUnit.
55
+ * For example, the RD-U04J1 is mm.
56
+ */
57
+ paperUnit: BRKMPrinterCustomPaperUnit;
58
+ };
59
+ export declare type BRLMPrinterQLModelSettings = {
60
+ /**
61
+ * Should use enum BRLMPrinterLabelName
62
+ */
63
+ labelName: BRLMPrinterLabelName;
64
+ } & BRLMPrinterSettings;
24
65
  /**
25
66
  * These are optional. If these are not set, default values are assigned by the printer.
26
67
  */
@@ -72,7 +113,10 @@ export declare type BRLMPrinterSettings = {
72
113
  printQuality?: BRLMPrinterPrintQuality;
73
114
  };
74
115
  export declare type BRLMSearchOption = {
75
- port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';
116
+ /**
117
+ * 'usb' is android only, and now developing.
118
+ */
119
+ port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';
76
120
  /**
77
121
  * searchDuration is the time to end search for devices.
78
122
  * default is 15 seconds.
@@ -98,8 +142,21 @@ export interface BrotherPrintPlugin {
98
142
  * Basically, it times out, so there is no need to use it. Use it when you want to run multiple connectType searches at the same time and time out any of them manually.
99
143
  */
100
144
  cancelSearchBluetoothPrinter(): Promise<void>;
145
+ /**
146
+ * Find the printer that can connected to the device.
147
+ */
101
148
  addListener(eventName: BrotherPrintEventsEnum.onPrinterAvailable, listenerFunc: (printers: BRLMChannelResult) => void): Promise<PluginListenerHandle>;
149
+ /**
150
+ * Success Print Event
151
+ */
102
152
  addListener(eventName: BrotherPrintEventsEnum.onPrint, listenerFunc: () => void): Promise<PluginListenerHandle>;
153
+ /**
154
+ * Failed to connect to the printer.
155
+ * ex: Bluetooth is off, Printer is off, etc.
156
+ */
103
157
  addListener(eventName: BrotherPrintEventsEnum.onPrintFailedCommunication, listenerFunc: (info: ErrorInfo) => void): Promise<PluginListenerHandle>;
158
+ /**
159
+ * Failed to print.
160
+ */
104
161
  addListener(eventName: BrotherPrintEventsEnum.onPrintError, listenerFunc: (info: ErrorInfo) => void): Promise<PluginListenerHandle>;
105
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n BRLMPrinterLabelName,\n BRLMPrinterModelName,\n BRLMPrinterAutoCutType,\n BRLMPrinterCompressMode,\n BRLMPrinterHalftone,\n BRLMPrinterHalftoneThresholdType,\n BRLMPrinterHorizontalAlignment,\n BRLMPrinterNumberOfCopies,\n BRLMPrinterPrintQuality,\n BRLMPrinterImageRotation,\n BRLMPrinterScaleMode,\n BRLMPrinterScaleValueType,\n BRLMPrinterVerticalAlignment,\n} from './brother-printer.enum';\nimport type { BrotherPrintEventsEnum } from './events.enum';\n\nexport type BRLMChannelResult = {\n port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n modelName: string;\n serialNumber: string;\n macAddress: string;\n nodeName: string;\n location: string;\n ipAddress: string;\n};\n\nexport type BRLMPrintOptions = {\n encodedImage: string;\n\n /**\n * Should use enum BRLMPrinterLabelName\n */\n labelName: BRLMPrinterLabelName;\n\n /**\n * Should use enum BRLMPrinterModelName\n */\n modelName: BRLMPrinterModelName;\n} & Partial<BRLMChannelResult> &\n BRLMPrinterSettings;\n\n/**\n * These are optional. If these are not set, default values are assigned by the printer.\n */\nexport type BRLMPrinterSettings = {\n /**\n * The number of copies you print.\n */\n numberOfCopies?: BRLMPrinterNumberOfCopies;\n\n /**\n * Whether the auto-cut is enabled or not. If true, your printer cut the paper each page.\n */\n autoCut?: BRLMPrinterAutoCutType;\n\n /**\n * A scale mode that specifies how your data is scaled in a print area of your printer.\n */\n scaleMode?: BRLMPrinterScaleMode;\n\n /**\n * A scale value. This is effective when ScaleMode is ScaleValue.\n */\n scaleValue?: BRLMPrinterScaleValueType;\n\n /**\n * A way to rasterize your data.\n */\n halftone?: BRLMPrinterHalftone;\n\n /**\n * A threshold value. This is effective when the Halftone is Threshold.\n */\n halftoneThreshold?: BRLMPrinterHalftoneThresholdType;\n\n /**\n * An image rotation that specifies the angle in which your data is placed in the print area. Rotation direction is clockwise.\n */\n imageRotation?: BRLMPrinterImageRotation;\n\n /**\n * A vertical alignment that specifies how your data is placed in the printable area.\n */\n verticalAlignment?: BRLMPrinterVerticalAlignment;\n\n /**\n * A horizontal alignment that specifies how your data is placed in the printable area.\n */\n horizontalAlignment?: BRLMPrinterHorizontalAlignment;\n\n /**\n * A compress mode that specifies how to compress your data.\n * note: This is ios only.\n */\n compressMode?: BRLMPrinterCompressMode;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n */\n printQuality?: BRLMPrinterPrintQuality;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n * note: This is ios only. And for some reason, the aspect ratio is broken, so we do not provide this as an API.\n * resolution?: BRLMPrinterPrintResolution;\n */\n};\n\nexport type BRLMSearchOption = {\n port: 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n /**\n * searchDuration is the time to end search for devices.\n * default is 15 seconds.\n * use only port is 'wifi' or 'bluetoothLowEnergy'.\n */\n searchDuration: number;\n};\n\nexport type ErrorInfo = {\n message: string;\n code: number;\n};\n\nexport interface BrotherPrintPlugin {\n printImage(options: BRLMPrintOptions): Promise<void>;\n\n /**\n * Search for printers. If not found, it will return an empty array.(not error)\n */\n search(option: BRLMSearchOption): Promise<void>;\n\n /**\n * Basically, it times out, so there is no need to use it. Use it when you want to run multiple connectType searches at the same time and time out any of them manually.\n */\n cancelSearchWiFiPrinter(): Promise<void>;\n\n /**\n * Basically, it times out, so there is no need to use it. Use it when you want to run multiple connectType searches at the same time and time out any of them manually.\n */\n cancelSearchBluetoothPrinter(): Promise<void>;\n\n addListener(\n eventName: BrotherPrintEventsEnum.onPrinterAvailable,\n listenerFunc: (printers: BRLMChannelResult) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: BrotherPrintEventsEnum.onPrint,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: BrotherPrintEventsEnum.onPrintFailedCommunication,\n listenerFunc: (info: ErrorInfo) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: BrotherPrintEventsEnum.onPrintError,\n listenerFunc: (info: ErrorInfo) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n BRLMPrinterLabelName,\n BRLMPrinterModelName,\n BRLMPrinterAutoCutType,\n BRLMPrinterCompressMode,\n BRLMPrinterHalftone,\n BRLMPrinterHalftoneThresholdType,\n BRLMPrinterHorizontalAlignment,\n BRLMPrinterNumberOfCopies,\n BRLMPrinterPrintQuality,\n BRLMPrinterImageRotation,\n BRLMPrinterScaleMode,\n BRLMPrinterScaleValueType,\n BRLMPrinterVerticalAlignment,\n BRKMPrinterCustomPaperType,\n BRKMPrinterCustomPaperUnit,\n} from './brother-printer.enum';\nimport type { BrotherPrintEventsEnum } from './events.enum';\n\nexport type BRLMChannelResult = {\n port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n modelName: string;\n serialNumber: string;\n macAddress: string;\n nodeName: string;\n location: string;\n\n /**\n * This need to connect to the printer.\n * wifi: IP Address\n * bluetooth: macAddress\n * bluetoothLowEnergy: modelName for bluetoothLowEnergy\n */\n channelInfo: string;\n};\n\nexport type BRLMPrintOptions = {\n encodedImage: string;\n\n /**\n * Should use enum BRLMPrinterModelName\n */\n modelName: BRLMPrinterModelName;\n} & Partial<BRLMChannelResult> &\n (BRLMPrinterQLModelSettings | BRLMPrinterTDModelSettings);\n\nexport type BRLMPrinterTDModelSettings = {\n /**\n * Should use enum BRKMPrinterCustomPaperType\n */\n paperType: BRKMPrinterCustomPaperType;\n\n /**\n * The width of the label. For example, the RD-U04J1 is 60.0 wide.\n */\n tapeWidth: number;\n\n /**\n * The length of the label. For example, the RD-U04J1 is 60.0 wide.\n */\n tapeLength: number;\n\n /**\n * It is the difference between a sticker and a mount.\n * For example, the RD-U04J1 is `1.0, 2.0, 1.0, 2.0`\n */\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n\n /**\n * The spacing between seals. For example, the RD-U04J1 is 0.2.\n */\n gapLength: number;\n\n paperMarkPosition: number;\n paperMarkLength: number;\n\n /**\n * Should use enum BRKMPrinterCustomPaperUnit.\n * For example, the RD-U04J1 is mm.\n */\n paperUnit: BRKMPrinterCustomPaperUnit;\n};\n\nexport type BRLMPrinterQLModelSettings = {\n /**\n * Should use enum BRLMPrinterLabelName\n */\n labelName: BRLMPrinterLabelName;\n} & BRLMPrinterSettings;\n\n/**\n * These are optional. If these are not set, default values are assigned by the printer.\n */\nexport type BRLMPrinterSettings = {\n /**\n * The number of copies you print.\n */\n numberOfCopies?: BRLMPrinterNumberOfCopies;\n\n /**\n * Whether the auto-cut is enabled or not. If true, your printer cut the paper each page.\n */\n autoCut?: BRLMPrinterAutoCutType;\n\n /**\n * A scale mode that specifies how your data is scaled in a print area of your printer.\n */\n scaleMode?: BRLMPrinterScaleMode;\n\n /**\n * A scale value. This is effective when ScaleMode is ScaleValue.\n */\n scaleValue?: BRLMPrinterScaleValueType;\n\n /**\n * A way to rasterize your data.\n */\n halftone?: BRLMPrinterHalftone;\n\n /**\n * A threshold value. This is effective when the Halftone is Threshold.\n */\n halftoneThreshold?: BRLMPrinterHalftoneThresholdType;\n\n /**\n * An image rotation that specifies the angle in which your data is placed in the print area. Rotation direction is clockwise.\n */\n imageRotation?: BRLMPrinterImageRotation;\n\n /**\n * A vertical alignment that specifies how your data is placed in the printable area.\n */\n verticalAlignment?: BRLMPrinterVerticalAlignment;\n\n /**\n * A horizontal alignment that specifies how your data is placed in the printable area.\n */\n horizontalAlignment?: BRLMPrinterHorizontalAlignment;\n\n /**\n * A compress mode that specifies how to compress your data.\n * note: This is ios only.\n */\n compressMode?: BRLMPrinterCompressMode;\n\n /**\n * A priority that is print speed or print quality. Whether or not this has an effect is depend on your printer.\n */\n printQuality?: BRLMPrinterPrintQuality;\n};\n\nexport type BRLMSearchOption = {\n /**\n * 'usb' is android only, and now developing.\n */\n port: 'usb' | 'wifi' | 'bluetooth' | 'bluetoothLowEnergy';\n\n /**\n * searchDuration is the time to end search for devices.\n * default is 15 seconds.\n * use only port is 'wifi' or 'bluetoothLowEnergy'.\n */\n searchDuration: number;\n};\n\nexport type ErrorInfo = {\n message: string;\n code: number;\n};\n\nexport interface BrotherPrintPlugin {\n printImage(options: BRLMPrintOptions): Promise<void>;\n\n /**\n * Search for printers. If not found, it will return an empty array.(not error)\n */\n search(option: BRLMSearchOption): Promise<void>;\n\n /**\n * Basically, it times out, so there is no need to use it. Use it when you want to run multiple connectType searches at the same time and time out any of them manually.\n */\n cancelSearchWiFiPrinter(): Promise<void>;\n\n /**\n * Basically, it times out, so there is no need to use it. Use it when you want to run multiple connectType searches at the same time and time out any of them manually.\n */\n cancelSearchBluetoothPrinter(): Promise<void>;\n\n /**\n * Find the printer that can connected to the device.\n */\n addListener(\n eventName: BrotherPrintEventsEnum.onPrinterAvailable,\n listenerFunc: (printers: BRLMChannelResult) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Success Print Event\n */\n addListener(\n eventName: BrotherPrintEventsEnum.onPrint,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Failed to connect to the printer.\n * ex: Bluetooth is off, Printer is off, etc.\n */\n addListener(\n eventName: BrotherPrintEventsEnum.onPrintFailedCommunication,\n listenerFunc: (info: ErrorInfo) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Failed to print.\n */\n addListener(\n eventName: BrotherPrintEventsEnum.onPrintError,\n listenerFunc: (info: ErrorInfo) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
@@ -38,6 +38,17 @@ exports.BrotherPrintEventsEnum = void 0;
38
38
  *
39
39
  * And name is follow android naming convention.
40
40
  */
41
+ exports.BRKMPrinterCustomPaperUnit = void 0;
42
+ (function (BRKMPrinterCustomPaperUnit) {
43
+ BRKMPrinterCustomPaperUnit["mm"] = "mm";
44
+ BRKMPrinterCustomPaperUnit["inch"] = "inch";
45
+ })(exports.BRKMPrinterCustomPaperUnit || (exports.BRKMPrinterCustomPaperUnit = {}));
46
+ exports.BRKMPrinterCustomPaperType = void 0;
47
+ (function (BRKMPrinterCustomPaperType) {
48
+ BRKMPrinterCustomPaperType["rollPaper"] = "rollPaper";
49
+ BRKMPrinterCustomPaperType["dieCutPaper"] = "dieCutPaper";
50
+ BRKMPrinterCustomPaperType["markRollPaper"] = "markRollPaper";
51
+ })(exports.BRKMPrinterCustomPaperType || (exports.BRKMPrinterCustomPaperType = {}));
41
52
  /**
42
53
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android_v4/printermodel.html
43
54
  */
@@ -47,7 +58,7 @@ exports.BRLMPrinterModelName = void 0;
47
58
  BRLMPrinterModelName["QL_820NWB"] = "QL_820NWB";
48
59
  BRLMPrinterModelName["TD_2320D_203"] = "TD_2320D_203";
49
60
  BRLMPrinterModelName["TD_2030AD"] = "TD_2030AD";
50
- BRLMPrinterModelName["TD_2350D_203"] = "TD_2350D_203";
61
+ BRLMPrinterModelName["TD_2350D_300"] = "TD_2350D_300";
51
62
  })(exports.BRLMPrinterModelName || (exports.BRLMPrinterModelName = {}));
52
63
  /**
53
64
  * Android naming: https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/labelinfo.html