@fedejm/capacitor-esc-pos-printer
v0.1.0
Published
CapacitorJS wrapper for ESC POS (native) printers.
Downloads
107
Readme
capacitor-esc-pos-printer
CapacitorJS wrapper for ESC POS (native) printers.
Install
npm install capacitor-esc-pos-printer
npx cap syncAPI
requestBluetoothEnable()getBluetoothPrinterDevices()createPrinter(...)disposePrinter(...)isPrinterConnected(...)connectPrinter(...)disconnectPrinter(...)sendToPrinter(...)readFromPrinter(...)- Interfaces
- Enums
requestBluetoothEnable()
requestBluetoothEnable() => Promise<ValueResult<boolean>>Returns: Promise<ValueResult<boolean>>
getBluetoothPrinterDevices()
getBluetoothPrinterDevices() => Promise<BluetoothDevicesResult>Returns: Promise<BluetoothDevicesResult>
createPrinter(...)
createPrinter(options: CreatePrinterOptions) => Promise<ValueResult<string>>| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options | CreatePrinterOptions |
Returns: Promise<ValueResult<string>>
disposePrinter(...)
disposePrinter(options: WithHashKey) => Promise<ValueResult<boolean>>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | WithHashKey |
Returns: Promise<ValueResult<boolean>>
isPrinterConnected(...)
isPrinterConnected(options: WithHashKey) => Promise<ValueResult<boolean>>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | WithHashKey |
Returns: Promise<ValueResult<boolean>>
connectPrinter(...)
connectPrinter(options: WithHashKey) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | WithHashKey |
disconnectPrinter(...)
disconnectPrinter(options: WithHashKey) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | WithHashKey |
sendToPrinter(...)
sendToPrinter(options: SendToPrinterOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options | SendToPrinterOptions |
readFromPrinter(...)
readFromPrinter(options: WithHashKey) => Promise<ValueResult<number[]>>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | WithHashKey |
Returns: Promise<ValueResult<number[]>>
Interfaces
ValueResult
| Prop | Type |
| ----------- | -------------- |
| value | T |
BluetoothDevicesResult
| Prop | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------- |
| devices | { address: string; alias?: string; name: string; bondState: number; type: number; uuids: string[]; }[] |
CreatePrinterOptions
| Prop | Type |
| -------------------- | ----------------------------------------------------------------------- |
| connectionType | PrinterConnectionType |
| address | string |
WithHashKey
| Prop | Type |
| ------------- | ------------------- |
| hashKey | string |
SendToPrinterOptions
| Prop | Type |
| ----------------- | --------------------- |
| data | number[] |
| waitingTime | number |
Enums
PrinterConnectionType
| Members | Value |
| --------------- | ------------------------ |
| Bluetooth | 'bluetooth' |
