1.1.1 • Published 1 year ago

datecs-printer-capacitor v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

datecs-printer-capacitor

Capacitor plugin for Datecs Mobile printers

All SDK API are imported from this https://github.com/giorgiofellipe/cordova-plugin-datecs-printer

Example: https://github.com/megaxayda/test-plugin

Install

npm install datecs-printer-capacitor
npx cap sync

API

getConnectionStatus()

getConnectionStatus() => Promise<ConnectionStatus>

Returns the bluetooth datecs printer connection status.

Returns: Promise<ConnectionStatus>


getBluetoothPairedDevices()

getBluetoothPairedDevices() => Promise<any>

Returns the bluetooth paired devices.

Returns: Promise<any>


addListener('bluetoothChange', ...)

addListener(eventName: 'bluetoothChange', listenerFunc: (res: ConnectionStatus) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for bluetooth datecs printer connection status changes.

ParamType
eventName'bluetoothChange'
listenerFunc(res: ConnectionStatus) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener('bluetoothSearchChange', ...)

addListener(eventName: 'bluetoothSearchChange', listenerFunc: (res: Device) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for bluetooth datecs printer connection status changes.

ParamType
eventName'bluetoothSearchChange'
listenerFunc(res: Device) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


scanBluetoothDevice()

scanBluetoothDevice() => Promise<void>

Scan bluetooth device, automatically ask for permission.


removeAllListeners()

removeAllListeners() => Promise<void>

Removes all listeners


connect(...)

connect(connectParam: ConnectParam) => Promise<void>
ParamType
connectParamConnectParam

print(...)

print(param: PrintParam) => Promise<void>
ParamType
paramPrintParam

Interfaces

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

ConnectionStatus

{ status: string; }

Device

{ name: string; address: string; }

ConnectParam

{ address: string; }

PrintParam

{ content: string; }