Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions www/thermal-printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ module.exports = {
cordova.exec(successCallback, errorCallback, 'ThermalPrinter', 'printFormattedTextAndCut', [data]);
},

/**
* Get the printer encoding when available
*
* @param {Object[]} data - Data object
* @param {"bluetooth"|"tcp"|"usb"} data.type - List all bluetooth or usb printers
* @param {string|number} [data.id] - ID of printer to find (Bluetooth: address, TCP: Use address + port instead, USB: deviceId)
* @param {string} [data.address] - If type is "tcp" then the IP Address of the printer
* @param {number} [data.port] - If type is "tcp" then the Port of the printer
* @param {function} successCallback - Result on success
* @param {function} errorCallback - Result on failure
*/
openCashBox: function(data, successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'ThermalPrinter', 'openCashBox', [data]);
},

/**
* Get the printer encoding when available
*
Expand Down