@public-js/bluetooth-printer-zj
v0.0.3
Published
Bluetooth printer support for Capacitor
Downloads
3
Maintainers
Readme
@public-js/bluetooth-printer-zj
Bluetooth printer support for Capacitor
Install
npm install @public-js/bluetooth-printer-zj
npx cap syncAPI
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
| Prop | Type |
| ------------ | ------------------- |
| device | string |
ConnectRequest
| Prop | Type |
| ------------- | ------------------- |
| address | string |
PrintRequest
| Prop | Type |
| --------------- | ------------------------- |
| blocks | PrintBlock[] |
| pageWidth | number |
| feed | number |
PrintBlock
| Prop | Type | Default |
| ---------- | --------------------------------------------------------- | --------------- |
| type | PrintBlockType | lf |
PrintBlockLf
| Prop | Type |
| ---------- | ----------------- |
| type | 'lf' |
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
