@ombori/ga-thermal-printer
Advanced tools
Comparing version 2.57.0 to 2.57.1
@@ -0,6 +1,12 @@ | ||
import { types as PrinterTypes } from 'node-thermal-printer'; | ||
import ReactNativeAdapter from './adapters/ReactNativeAdapter'; | ||
import SocketAdapter from './adapters/SocketAdapter'; | ||
import { PrinterAdapter } from './adapters/PrinterAdapter'; | ||
export { PrinterTypes } from 'node-thermal-printer'; | ||
declare type PrinterConfig = { | ||
adapter?: PrinterAdapter; | ||
type?: PrinterTypes; | ||
}; | ||
export declare const defaultAdapter: ReactNativeAdapter | SocketAdapter; | ||
declare const createPrinter: (adapter?: PrinterAdapter) => { | ||
declare const createPrinter: (options?: PrinterConfig) => { | ||
/** | ||
@@ -7,0 +13,0 @@ * Send printing buffer to printer |
@@ -11,7 +11,10 @@ "use strict"; | ||
const messages_1 = require("./utils/messages"); | ||
var node_thermal_printer_2 = require("node-thermal-printer"); | ||
Object.defineProperty(exports, "PrinterTypes", { enumerable: true, get: function () { return node_thermal_printer_2.PrinterTypes; } }); | ||
exports.defaultAdapter = window.ReactNativeWebView ? | ||
new ReactNativeAdapter_1.default() : new SocketAdapter_1.default(); | ||
const createPrinter = (adapter = exports.defaultAdapter) => { | ||
const createPrinter = (options) => { | ||
const { adapter = exports.defaultAdapter, type = node_thermal_printer_1.types.EPSON, } = options !== null && options !== void 0 ? options : {}; | ||
const thermalPrinter = new node_thermal_printer_1.printer({ | ||
type: node_thermal_printer_1.types.EPSON, | ||
type, | ||
interface: '', | ||
@@ -18,0 +21,0 @@ }); |
{ | ||
"name": "@ombori/ga-thermal-printer", | ||
"version": "2.57.0", | ||
"version": "2.57.1", | ||
"main": "dist/index.js", | ||
@@ -11,3 +11,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"node-thermal-printer": "^4.1.2" | ||
"node-thermal-printer": "^4.2.1" | ||
}, | ||
@@ -20,4 +20,3 @@ "devDependencies": { | ||
"typescript": "^3.9.5" | ||
}, | ||
"gitHead": "3cc275b6d36ade53ce8357f51242c07c2b741870" | ||
} | ||
} |
@@ -6,9 +6,20 @@ import { printer as ThermalPrinter, types as PrinterTypes } from 'node-thermal-printer'; | ||
import { enablePrinting, printText } from './utils/messages'; | ||
export { PrinterTypes } from 'node-thermal-printer'; | ||
type PrinterConfig = { | ||
adapter?: PrinterAdapter; | ||
type?: PrinterTypes; | ||
}; | ||
export const defaultAdapter = window.ReactNativeWebView ? | ||
new ReactNativeAdapter() : new SocketAdapter(); | ||
const createPrinter = (adapter: PrinterAdapter = defaultAdapter) => { | ||
const createPrinter = (options?: PrinterConfig ) => { | ||
const { | ||
adapter = defaultAdapter, | ||
type = PrinterTypes.EPSON, | ||
} = options ?? {}; | ||
const thermalPrinter = new ThermalPrinter({ | ||
type: PrinterTypes.EPSON, | ||
type, | ||
interface: '', | ||
@@ -15,0 +26,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29445
766
1
Updatednode-thermal-printer@^4.2.1