@psdk/esc 0.2.53 → 0.2.55
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/build/args/backlinedot.d.ts.map +1 -1
- package/build/args/image.d.ts +2 -2
- package/build/args/image.d.ts.map +1 -1
- package/build/args/image.js +5 -5
- package/build/args/line.d.ts.map +1 -1
- package/build/args/linedot.d.ts.map +1 -1
- package/build/args/location.d.ts.map +1 -1
- package/build/args/papertype.d.ts +1 -1
- package/build/args/papertype.d.ts.map +1 -1
- package/build/args/papertype.js +2 -2
- package/build/args/setshutdowntime.d.ts.map +1 -1
- package/build/args/thickness.d.ts.map +1 -1
- package/build/impls/basic.js +9 -9
- package/build/types/image.d.ts +1 -1
- package/build/types/image.d.ts.map +1 -1
- package/build/types/image.js +8 -8
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +18 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backlinedot.d.ts","sourceRoot":"","sources":["../../src/args/backlinedot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"backlinedot.d.ts","sourceRoot":"","sources":["../../src/args/backlinedot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW,CAAC,YAAY,CAAC;IACzD,OAAO,CAAC,GAAG,CAAS;gBAER,OAAO,EAAE;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;IAKD,MAAM,IAAI,aAAa;IAKvB,MAAM,IAAI,UAAU;CAIrB"}
|
package/build/args/image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BasicESCArg } from "./basic";
|
|
2
2
|
import { CommandClause } from "@psdk/frame-father";
|
|
3
|
-
import {
|
|
3
|
+
import { EImageMode } from "../types";
|
|
4
4
|
/**
|
|
5
5
|
* Image
|
|
6
6
|
*/
|
|
@@ -30,7 +30,7 @@ export declare class EImage extends BasicESCArg<EImage> {
|
|
|
30
30
|
* 2: DOUBLE_HEIGHT
|
|
31
31
|
* 3: DOUBLE_WIDTH_HEIGHT
|
|
32
32
|
*/
|
|
33
|
-
mode?:
|
|
33
|
+
mode?: EImageMode;
|
|
34
34
|
/**
|
|
35
35
|
* image canvas
|
|
36
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/args/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/args/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW,CAAC,MAAM,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE;QAEnB;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;;;;;WAMG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,KAAK,EAAE,iBAAiB,CAAC;KAC1B;IASD,MAAM,IAAI,aAAa;IA0CvB,MAAM,IAAI,UAAU;CAIrB"}
|
package/build/args/image.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EImage = void 0;
|
|
4
4
|
const basic_1 = require("./basic");
|
|
5
5
|
const frame_father_1 = require("@psdk/frame-father");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const frame_imageb_1 = require("@psdk/frame-imageb");
|
|
8
8
|
/**
|
|
9
9
|
* Image
|
|
10
10
|
*/
|
|
@@ -15,11 +15,11 @@ class EImage extends basic_1.BasicESCArg {
|
|
|
15
15
|
this.compress = (_a = options.compress) !== null && _a !== void 0 ? _a : false;
|
|
16
16
|
this.reverse = (_b = options.reverse) !== null && _b !== void 0 ? _b : false;
|
|
17
17
|
this.threshold = (_c = options.threshold) !== null && _c !== void 0 ? _c : 190;
|
|
18
|
-
this.mode = (_d = options.mode) !== null && _d !== void 0 ? _d :
|
|
18
|
+
this.mode = (_d = options.mode) !== null && _d !== void 0 ? _d : types_1.EImageMode.NORMAL;
|
|
19
19
|
this.image = options.image;
|
|
20
20
|
}
|
|
21
21
|
clause() {
|
|
22
|
-
const processer = new
|
|
22
|
+
const processer = new frame_imageb_1.Pbita({
|
|
23
23
|
threshold: this.threshold,
|
|
24
24
|
compress: this.compress,
|
|
25
25
|
reverse: this.reverse,
|
|
@@ -56,7 +56,7 @@ class EImage extends basic_1.BasicESCArg {
|
|
|
56
56
|
.clause();
|
|
57
57
|
}
|
|
58
58
|
header() {
|
|
59
|
-
return new Uint8Array([0x1D, 0x76, 0x30]);
|
|
59
|
+
return new Uint8Array(this.compress ? [0x1F, 0x00] : [0x1D, 0x76, 0x30]);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
exports.EImage = EImage;
|
package/build/args/line.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/args/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/args/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW,CAAC,KAAK,CAAC;IAC3C,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,CAAC,CAAS;gBAEN,OAAO,EAAE;QACnB,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ;IAMD,MAAM,IAAI,aAAa;IAOvB,MAAM,IAAI,UAAU;CAIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linedot.d.ts","sourceRoot":"","sources":["../../src/args/linedot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"linedot.d.ts","sourceRoot":"","sources":["../../src/args/linedot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW,CAAC,QAAQ,CAAC;IACjD,OAAO,CAAC,GAAG,CAAS;gBAER,OAAO,EAAE;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;IAKD,MAAM,IAAI,aAAa;IAKvB,MAAM,IAAI,UAAU;CAIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/args/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/args/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW,CAAC,SAAS,CAAC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,EAAE;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAKD,MAAM,IAAI,aAAa;IAKvB,MAAM,IAAI,UAAU;CAIrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BasicESCArg } from "./basic";
|
|
2
2
|
import { CommandClause } from "@psdk/frame-father";
|
|
3
|
-
import { PaperType } from "../types
|
|
3
|
+
import { PaperType } from "../types";
|
|
4
4
|
export declare class EPaperType extends BasicESCArg<EPaperType> {
|
|
5
5
|
private readonly paperType;
|
|
6
6
|
constructor(options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"papertype.d.ts","sourceRoot":"","sources":["../../src/args/papertype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"papertype.d.ts","sourceRoot":"","sources":["../../src/args/papertype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAInC,qBAAa,UAAW,SAAQ,WAAW,CAAC,UAAU,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,OAAO,EAAE;QACnB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB;IAKD,MAAM,IAAI,aAAa;IAKvB,MAAM,IAAI,UAAU;CAIrB"}
|
package/build/args/papertype.js
CHANGED
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EPaperType = void 0;
|
|
4
4
|
const basic_1 = require("./basic");
|
|
5
5
|
const frame_father_1 = require("@psdk/frame-father");
|
|
6
|
-
const
|
|
6
|
+
const types_1 = require("../types");
|
|
7
7
|
class EPaperType extends basic_1.BasicESCArg {
|
|
8
8
|
constructor(options) {
|
|
9
9
|
var _a;
|
|
10
10
|
super();
|
|
11
|
-
this.paperType = (_a = options.paperType) !== null && _a !== void 0 ? _a :
|
|
11
|
+
this.paperType = (_a = options.paperType) !== null && _a !== void 0 ? _a : types_1.PaperType.FOLDED_BLACK_LABEL_PAPER;
|
|
12
12
|
}
|
|
13
13
|
clause() {
|
|
14
14
|
return frame_father_1.BinaryCommand.with(this.header())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setshutdowntime.d.ts","sourceRoot":"","sources":["../../src/args/setshutdowntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"setshutdowntime.d.ts","sourceRoot":"","sources":["../../src/args/setshutdowntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAGhE,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,gBAAgB,CAAC;IACjE,OAAO,CAAC,IAAI,CAAS;gBACT,OAAO,EAAE;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAKD,MAAM,IAAI,aAAa;IAOvB,MAAM,IAAI,UAAU;CAIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thickness.d.ts","sourceRoot":"","sources":["../../src/args/thickness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"thickness.d.ts","sourceRoot":"","sources":["../../src/args/thickness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAGhE,qBAAa,UAAW,SAAQ,WAAW,CAAC,UAAU,CAAC;IACrD,OAAO,CAAC,SAAS,CAAS;gBAEd,OAAO,EAAE;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAKD,MAAM,IAAI,aAAa;IAKvB,MAAM,IAAI,UAAU;CAIrB"}
|
package/build/impls/basic.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BasicESC = void 0;
|
|
4
4
|
const frame_father_1 = require("@psdk/frame-father");
|
|
5
5
|
const args_1 = require("../args");
|
|
6
|
-
const
|
|
6
|
+
const types_1 = require("../types");
|
|
7
7
|
class BasicESC extends frame_father_1.PSDK {
|
|
8
8
|
constructor(lifecycle) {
|
|
9
9
|
super();
|
|
@@ -96,7 +96,7 @@ class BasicESC extends frame_father_1.PSDK {
|
|
|
96
96
|
*纸张类型
|
|
97
97
|
*/
|
|
98
98
|
paperType(arg) {
|
|
99
|
-
return super.push(arg !== null && arg !== void 0 ? arg : new args_1.EPaperType({ paperType:
|
|
99
|
+
return super.push(arg !== null && arg !== void 0 ? arg : new args_1.EPaperType({ paperType: types_1.PaperType.FOLDED_BLACK_LABEL_PAPER }));
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* 打印定位
|
|
@@ -108,13 +108,13 @@ class BasicESC extends frame_father_1.PSDK {
|
|
|
108
108
|
* 查询打印机固件版本
|
|
109
109
|
*/
|
|
110
110
|
printerVersion() {
|
|
111
|
-
return
|
|
111
|
+
return super.push(new args_1.EPrinterVersion());
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* 设置关机时间
|
|
115
115
|
*/
|
|
116
116
|
setShutdownTime(arg) {
|
|
117
|
-
return
|
|
117
|
+
return super.push(new args_1.ESetShutdownTime({ time: arg }));
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
*查询SN
|
|
@@ -126,32 +126,32 @@ class BasicESC extends frame_father_1.PSDK {
|
|
|
126
126
|
*查询打印机状态
|
|
127
127
|
*/
|
|
128
128
|
state() {
|
|
129
|
-
return
|
|
129
|
+
return super.push(new args_1.EState());
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
*结束打印任务
|
|
133
133
|
*/
|
|
134
134
|
stopJob() {
|
|
135
|
-
return
|
|
135
|
+
return super.push(new args_1.EStopJob());
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* 设置打印机浓度(0-2)
|
|
139
139
|
* @param arg 0:低浓度 1:中浓度 2:高浓度
|
|
140
140
|
*/
|
|
141
141
|
thickness(arg) {
|
|
142
|
-
return
|
|
142
|
+
return super.push(new args_1.EThickness({ thickness: arg }));
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
*查询蓝牙固件版本
|
|
146
146
|
*/
|
|
147
147
|
version() {
|
|
148
|
-
return
|
|
148
|
+
return super.push(new args_1.EVersion());
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
*唤醒打印机
|
|
152
152
|
*/
|
|
153
153
|
wakeup() {
|
|
154
|
-
return
|
|
154
|
+
return super.push(new args_1.EWakeup());
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
exports.BasicESC = BasicESC;
|
package/build/types/image.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/types/image.ts"],"names":[],"mappings":"AACA,oBAAY,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/types/image.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU;IACpB,MAAM,IAAE;IACR,YAAY,IAAE;IACd,aAAa,IAAE;IACf,mBAAmB,IAAE;CACtB"}
|
package/build/types/image.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
3
|
+
exports.EImageMode = void 0;
|
|
4
|
+
var EImageMode;
|
|
5
|
+
(function (EImageMode) {
|
|
6
|
+
EImageMode[EImageMode["NORMAL"] = 0] = "NORMAL";
|
|
7
|
+
EImageMode[EImageMode["DOUBLE_WIDTH"] = 1] = "DOUBLE_WIDTH";
|
|
8
|
+
EImageMode[EImageMode["DOUBLE_HEIGHT"] = 2] = "DOUBLE_HEIGHT";
|
|
9
|
+
EImageMode[EImageMode["DOUBLE_WIDTH_HEIGHT"] = 3] = "DOUBLE_WIDTH_HEIGHT";
|
|
10
|
+
})(EImageMode = exports.EImageMode || (exports.EImageMode = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./image"), exports);
|
|
18
|
+
__exportStar(require("./papertype"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@psdk/esc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"description": "psdk",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"webpack-cli": "^4.9.2"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@psdk/frame-father": "0.2.
|
|
49
|
-
"@psdk/frame-imageb": "0.2.
|
|
48
|
+
"@psdk/frame-father": "0.2.55",
|
|
49
|
+
"@psdk/frame-imageb": "0.2.55"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"build",
|
|
53
53
|
"!build/browser/psdk*"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7c6391f1508dfee01d447694aef4200d3741414f"
|
|
56
56
|
}
|