label-printer 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -854,6 +854,13 @@ declare abstract class Printer {
854
854
  * @param text String to send to the printer
855
855
  */
856
856
  writeRawString(text: string): Promise<void>;
857
+ /**
858
+ * Writes raw bytes to the printer. Useful when bytes were built elsewhere
859
+ * (e.g. via Command.commandBytes) and transferred over the network to a service
860
+ * that is responsible for the physical printing.
861
+ * @param data Bytes to send to the printer
862
+ */
863
+ writeRawBytes(data: Uint8Array | ArrayBuffer): Promise<void>;
857
864
  /**
858
865
  * Check if the device is indeed a printer
859
866
  * @param device
package/dist/index.d.ts CHANGED
@@ -854,6 +854,13 @@ declare abstract class Printer {
854
854
  * @param text String to send to the printer
855
855
  */
856
856
  writeRawString(text: string): Promise<void>;
857
+ /**
858
+ * Writes raw bytes to the printer. Useful when bytes were built elsewhere
859
+ * (e.g. via Command.commandBytes) and transferred over the network to a service
860
+ * that is responsible for the physical printing.
861
+ * @param data Bytes to send to the printer
862
+ */
863
+ writeRawBytes(data: Uint8Array | ArrayBuffer): Promise<void>;
857
864
  /**
858
865
  * Check if the device is indeed a printer
859
866
  * @param device
package/dist/index.js CHANGED
@@ -1610,6 +1610,18 @@ var Printer = class {
1610
1610
  yield this.device.writeString(text);
1611
1611
  });
1612
1612
  }
1613
+ /**
1614
+ * Writes raw bytes to the printer. Useful when bytes were built elsewhere
1615
+ * (e.g. via Command.commandBytes) and transferred over the network to a service
1616
+ * that is responsible for the physical printing.
1617
+ * @param data Bytes to send to the printer
1618
+ */
1619
+ writeRawBytes(data) {
1620
+ return __async(this, null, function* () {
1621
+ if (!this.device.opened) yield this.device.openAndConfigure();
1622
+ yield this.device.writeData(data);
1623
+ });
1624
+ }
1613
1625
  /**
1614
1626
  * Check if the device is indeed a printer
1615
1627
  * @param device