@thermal-label/brother-ql-core 0.5.0 → 0.6.1

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.
Files changed (46) hide show
  1. package/README.md +83 -12
  2. package/data/devices.json +666 -26
  3. package/data/media.json +68 -68
  4. package/dist/__tests__/devices.test.js +1 -0
  5. package/dist/__tests__/devices.test.js.map +1 -1
  6. package/dist/__tests__/media.test.js +7 -7
  7. package/dist/__tests__/protocol.test.js +1 -1
  8. package/dist/__tests__/status.test.js +56 -15
  9. package/dist/__tests__/status.test.js.map +1 -1
  10. package/dist/devices.d.ts +737 -2
  11. package/dist/devices.d.ts.map +1 -1
  12. package/dist/devices.generated.d.ts +72 -13
  13. package/dist/devices.generated.d.ts.map +1 -1
  14. package/dist/devices.generated.js +109 -34
  15. package/dist/devices.generated.js.map +1 -1
  16. package/dist/devices.js +6 -2
  17. package/dist/devices.js.map +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/media.d.ts +1 -1
  23. package/dist/media.generated.d.ts.map +1 -1
  24. package/dist/media.generated.js +138 -136
  25. package/dist/media.generated.js.map +1 -1
  26. package/dist/media.js +3 -3
  27. package/dist/protocol.js +4 -4
  28. package/dist/status.d.ts +8 -5
  29. package/dist/status.d.ts.map +1 -1
  30. package/dist/status.js +43 -7
  31. package/dist/status.js.map +1 -1
  32. package/dist/types.d.ts +7 -14
  33. package/dist/types.d.ts.map +1 -1
  34. package/package.json +3 -3
  35. package/src/__tests__/devices.test.ts +1 -0
  36. package/src/__tests__/media.test.ts +7 -7
  37. package/src/__tests__/protocol.test.ts +1 -1
  38. package/src/__tests__/status.test.ts +66 -16
  39. package/src/devices.generated.ts +130 -42
  40. package/src/devices.ts +7 -2
  41. package/src/index.ts +2 -0
  42. package/src/media.generated.ts +139 -138
  43. package/src/media.ts +3 -3
  44. package/src/protocol.ts +4 -4
  45. package/src/status.ts +47 -8
  46. package/src/types.ts +7 -14
package/README.md CHANGED
@@ -1,23 +1,94 @@
1
1
  # @thermal-label/brother-ql-core
2
2
 
3
- Protocol encoding, device registry, and media registry for Brother QL label printers.
3
+ Protocol encoder, device registry, and media registry for Brother
4
+ **QL** label printers (DK paper labels) and **PT-P / PT-E** label
5
+ printers (TZe laminated tape + HSe heat-shrink). Both families share
6
+ the raster command set — the encoder branches on `engine.protocol`
7
+ (`ql-raster` vs `pt-raster`).
4
8
 
5
- > Consumers rarely import this package directly — use `@thermal-label/brother-ql-node` (Node.js) or `@thermal-label/brother-ql-web` (browser) instead. This package is for porting or advanced use cases.
9
+ Consumers rarely import this package directly. Use one of the
10
+ runtime packages instead:
6
11
 
7
- ## Key Exports
12
+ - [`@thermal-label/brother-ql-node`](https://www.npmjs.com/package/@thermal-label/brother-ql-node)
13
+ — Node.js (USB + TCP).
14
+ - [`@thermal-label/brother-ql-web`](https://www.npmjs.com/package/@thermal-label/brother-ql-web)
15
+ — browser (WebUSB).
8
16
 
9
- - `encodeJob(pages, options?)` — encode a complete print job to a `Uint8Array` byte stream
10
- - `DEVICES` — registry of all supported Brother QL devices
11
- - `MEDIA` — registry of all supported label media
12
- - `findDevice(vid, pid)` — look up a device descriptor by USB VID+PID
13
- - `findMedia(id)` — look up a media descriptor by ID
14
- - `renderText`, `renderImage` — re-exported from `@mbtech-nl/bitmap`
17
+ ## Install
18
+
19
+ ```bash
20
+ pnpm add @thermal-label/brother-ql-core
21
+ ```
22
+
23
+ ## Quick start
24
+
25
+ ```ts
26
+ import { encodeJob, findDevice, findMedia, renderText } from '@thermal-label/brother-ql-core';
27
+
28
+ const device = findDevice(0x04f9, 0x209d);
29
+ if (!device) throw new Error('Unknown Brother device');
30
+
31
+ const media = findMedia('dk-22205')!;
32
+ const bitmap = renderText('Hello QL', { mediaWidth: media.printableWidthDots });
33
+ const bytes = encodeJob([{ bitmap }], { engine: device.engines[0], media });
34
+ ```
35
+
36
+ `bytes` is a contiguous `Uint8Array` the transport ships unchanged.
37
+
38
+ ## What's inside
39
+
40
+ - `encodeJob(pages, options)` — encode a complete print job to a byte stream.
41
+ - `parseStatus(bytes)` + `STATUS_REQUEST` — status decoder + request frame.
42
+ - `DEVICES` / `findDevice` / `getUsbIds` / `isMassStorageMode`.
43
+ - `MEDIA` / `findMedia` — DK label + TZe / HSe tape registry.
44
+ - Bitmap renderers re-exported from `@mbtech-nl/bitmap`.
15
45
 
16
46
  ## Requirements
17
47
 
18
- - Node.js `>=20.9.0` (Node 24 LTS recommended)
19
- - Runs in browser and Node.js — no Node.js built-ins used
48
+ - Node.js `>=20.9.0` (Node 24 LTS recommended).
49
+ - Runs in browser and Node.js — no Node.js built-ins.
50
+
51
+ ## Documentation
52
+
53
+ <https://thermal-label.github.io/brother-ql/core>
20
54
 
21
55
  ## License
22
56
 
23
- MIT © Mannes Brak
57
+ MIT
58
+
59
+ ## Supported hardware
60
+
61
+ <!-- HARDWARE_TABLE:START -->
62
+
63
+ **24 devices** — 3 verified · 0 partial · 15 expected · 0 unsupported · 6 unverified
64
+
65
+ | Model | Key | USB PID | Transports | Status |
66
+ | ---------------------------------------------------------------------------- | ------------ | ------- | ---------------- | ------------- |
67
+ | [PT-E550W](https://thermal-label.github.io/hardware/brother-ql/pt-e550w) | `PT_E550W` | 0x2060 | USB, TCP | ⏳ unverified |
68
+ | [PT-P750W](https://thermal-label.github.io/hardware/brother-ql/pt-p750w) | `PT_P750W` | 0x2062 | USB, TCP | ⏳ unverified |
69
+ | [PT-P900](https://thermal-label.github.io/hardware/brother-ql/pt-p900) | `PT_P900` | 0x2083 | USB | ⏳ unverified |
70
+ | [PT-P900W](https://thermal-label.github.io/hardware/brother-ql/pt-p900w) | `PT_P900W` | 0x2085 | USB, TCP | ⏳ unverified |
71
+ | [PT-P910BT](https://thermal-label.github.io/hardware/brother-ql/pt-p910bt) | `PT_P910BT` | 0x20c7 | USB, BT SPP | ⏳ unverified |
72
+ | [PT-P950NW](https://thermal-label.github.io/hardware/brother-ql/pt-p950nw) | `PT_P950NW` | 0x2086 | USB, TCP | ⏳ unverified |
73
+ | [QL-500](https://thermal-label.github.io/hardware/brother-ql/ql-500) | `QL_500` | 0x2013 | USB | 🔄 expected |
74
+ | [QL-550](https://thermal-label.github.io/hardware/brother-ql/ql-550) | `QL_550` | 0x2016 | USB | 🔄 expected |
75
+ | [QL-560](https://thermal-label.github.io/hardware/brother-ql/ql-560) | `QL_560` | 0x2018 | USB | 🔄 expected |
76
+ | [QL-570](https://thermal-label.github.io/hardware/brother-ql/ql-570) | `QL_570` | 0x2019 | USB | 🔄 expected |
77
+ | [QL-580N](https://thermal-label.github.io/hardware/brother-ql/ql-580n) | `QL_580N` | 0x201b | USB, TCP | 🔄 expected |
78
+ | [QL-600](https://thermal-label.github.io/hardware/brother-ql/ql-600) | `QL_600` | 0x2100 | USB | 🔄 expected |
79
+ | [QL-650TD](https://thermal-label.github.io/hardware/brother-ql/ql-650td) | `QL_650TD` | 0x201c | USB | 🔄 expected |
80
+ | [QL-700](https://thermal-label.github.io/hardware/brother-ql/ql-700) | `QL_700` | 0x2042 | USB | ✅ verified |
81
+ | [QL-710W](https://thermal-label.github.io/hardware/brother-ql/ql-710w) | `QL_710W` | 0x2044 | USB, TCP | 🔄 expected |
82
+ | [QL-720NW](https://thermal-label.github.io/hardware/brother-ql/ql-720nw) | `QL_720NW` | 0x2045 | USB, TCP | 🔄 expected |
83
+ | [QL-800](https://thermal-label.github.io/hardware/brother-ql/ql-800) | `QL_800` | 0x209b | USB | ✅ verified |
84
+ | [QL-810W](https://thermal-label.github.io/hardware/brother-ql/ql-810w) | `QL_810W` | 0x209c | USB, TCP | 🔄 expected |
85
+ | [QL-820NWBc](https://thermal-label.github.io/hardware/brother-ql/ql-820nwbc) | `QL_820NWBc` | 0x209d | USB, TCP, BT SPP | ✅ verified |
86
+ | [QL-1050](https://thermal-label.github.io/hardware/brother-ql/ql-1050) | `QL_1050` | 0x2027 | USB | 🔄 expected |
87
+ | [QL-1060N](https://thermal-label.github.io/hardware/brother-ql/ql-1060n) | `QL_1060N` | 0x2028 | USB, TCP | 🔄 expected |
88
+ | [QL-1100](https://thermal-label.github.io/hardware/brother-ql/ql-1100) | `QL_1100` | 0x20a7 | USB | 🔄 expected |
89
+ | [QL-1110NWB](https://thermal-label.github.io/hardware/brother-ql/ql-1110nwb) | `QL_1110NWB` | 0x20a8 | USB, TCP | 🔄 expected |
90
+ | [QL-1115NWB](https://thermal-label.github.io/hardware/brother-ql/ql-1115nwb) | `QL_1115NWB` | 0x20ab | USB, TCP | 🔄 expected |
91
+
92
+ Click any model to open its detail page on the docs site, where engines, supported media, and verification reports live. The same data backs the [interactive cross-driver table](https://thermal-label.github.io/hardware/).
93
+
94
+ <!-- HARDWARE_TABLE:END -->