Skip to content

Latest commit

 

History

History
179 lines (104 loc) · 4.39 KB

readme.md

File metadata and controls

179 lines (104 loc) · 4.39 KB

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.

Param Type
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.

Param Type
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>
Param Type
connectParam ConnectParam

print(...)

print(param: PrintParam) => Promise<void>
Param Type
param PrintParam

Interfaces

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

ConnectionStatus

{ status: string; }

Device

{ name: string; address: string; }

ConnectParam

{ address: string; }

PrintParam

{ content: string; }