You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of version 0.4.0 of @node-escpos/core, I can´t find a way to actually use printer.getStatus due to the fact that the status classes are not exported.
The text was updated successfully, but these errors were encountered:
/**
* get one specific status from the printer using it's class
* @param {string} StatusClass
* @return {Promise} promise returning given status
*/
getStatus<T extends DeviceStatus>(StatusClass: StatusClassConstructor<T>): Promise<T> {
return new Promise((resolve) => {
this.adapter.read((data) => {
const byte = data.readInt8(0);
resolve(new StatusClass(byte));
});
StatusClass.commands().forEach((c) => {
this.buffer.write(c);
});
});
}
The JSDOC declares that StatusClass should be a string but in the later code it uses the parameter as a constructor new StatusClass(byte). it's not PHP :) At the same time the module doesn't export status classes to be able to pass it as a parameter. As a result there is no way to use getStatus()
As of version 0.4.0 of
@node-escpos/core
, I can´t find a way to actually useprinter.getStatus
due to the fact that the status classes are not exported.The text was updated successfully, but these errors were encountered: