0.0.3 • Published 10 months ago
Last release10 months ago
@public-js/bluetooth-printer-zj
Bluetooth printer support for Capacitor
Install
npm install @public-js/bluetooth-printer-zj
npx cap sync
API
discover()
discover() => Promise<DiscoverResponse>
Returns: Promise<DiscoverResponse>
connect(...)
connect(data: ConnectRequest) => Promise<ConnectResponse>
| Param | Type |
|---|
data | ConnectRequest |
Returns: Promise<ConnectResponse>
disconnect()
disconnect() => Promise<void>
print(...)
print(data: PrintRequest) => Promise<void>
| Param | Type |
|---|
data | PrintRequest |
Interfaces
DiscoverResponse
| Prop | Type |
|---|
devices | DiscoveredDevice[] |
DiscoveredDevice
| Prop | Type |
|---|
address | string |
name | string |
bonded | boolean |
ConnectResponse
ConnectRequest
PrintRequest
| Prop | Type |
|---|
blocks | PrintBlock[] |
pageWidth | number |
feed | number |
PrintBlock
| Prop | Type | Default |
|---|
type | PrintBlockType | lf |
PrintBlockLf
PrintBlockTextRaw
| Prop | Type | Default |
|---|
type | 'textRaw' | |
encoding | string | GBK |
codepage | number | 0 |
scaleWidth | number | 0 |
scaleHeight | number | 0 |
fontStyle | number | 0 |
align | number | 0 |
PrintBlockTextDraw
| Prop | Type | Default |
|---|
type | 'textDraw' | |
lineCount | number | |
fontSize | number | 16 |
mode | number | 0 |
PrintBlockTextQr
| Prop | Type | Default |
|---|
type | 'textQr' | |
codeWidth | number | |
mode | number | 0 |
Type Aliases
PrintBlockType
'lf' | 'textRaw' | 'textDraw' | 'textQr'
PrintBlock
PrintBlockLf | PrintBlockTextRaw | PrintBlockTextDraw | PrintBlockTextQr