Socket
Socket
Sign inDemoInstall

@psdk/cpcl

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@psdk/cpcl - npm Package Compare versions

Comparing version 0.2.67 to 0.3.0

36

build/args/bar.js

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CBar = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const types_1 = require("../types");
class CBar extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CCodeRotation, CCodeType } from "../types";
export class CBar extends BasicCPCLArg {
constructor(options) {

@@ -16,4 +13,4 @@ var _a, _b, _c, _d, _e, _f, _g;

this.height = (_e = options === null || options === void 0 ? void 0 : options.height) !== null && _e !== void 0 ? _e : 0;
this.codeType = (_f = options === null || options === void 0 ? void 0 : options.codeType) !== null && _f !== void 0 ? _f : types_1.CCodeType.CODE128;
this.codeRotation = (_g = options.codeRotation) !== null && _g !== void 0 ? _g : types_1.CCodeRotation.ROTATION_0;
this.codeType = (_f = options === null || options === void 0 ? void 0 : options.codeType) !== null && _f !== void 0 ? _f : CCodeType.CODE128;
this.codeRotation = (_g = options.codeRotation) !== null && _g !== void 0 ? _g : CCodeRotation.ROTATION_0;
}

@@ -23,31 +20,31 @@ clause() {

switch (this.codeType) {
case types_1.CCodeType.CODE39:
case CCodeType.CODE39:
code = new CodeTypeEntity('39', '2');
break;
case types_1.CCodeType.CODE128:
case CCodeType.CODE128:
code = new CodeTypeEntity('128', '2');
break;
case types_1.CCodeType.CODE93:
case CCodeType.CODE93:
code = new CodeTypeEntity('93', '1');
break;
case types_1.CCodeType.CODABAR:
case CCodeType.CODABAR:
code = new CodeTypeEntity('CODABAR', '2');
break;
case types_1.CCodeType.EAN8:
case CCodeType.EAN8:
code = new CodeTypeEntity('EAN8', '2');
break;
case types_1.CCodeType.EAN13:
case CCodeType.EAN13:
code = new CodeTypeEntity('EAN13', '2');
break;
case types_1.CCodeType.UPCA:
case CCodeType.UPCA:
code = new CodeTypeEntity('UPCA', '2');
break;
case types_1.CCodeType.UPCE:
case CCodeType.UPCE:
code = new CodeTypeEntity('UPCE', '2');
break;
case types_1.CCodeType.I2OF5:
case CCodeType.I2OF5:
code = new CodeTypeEntity('I2OF5', '2');
break;
}
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendText(this.codeRotation.toString())

@@ -67,3 +64,2 @@ .appendText(code.type)

}
exports.CBar = CBar;
class CodeTypeEntity {

@@ -70,0 +66,0 @@ constructor(type, width) {

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicCPCLArg = void 0;
const frame_father_1 = require("@psdk/frame-father");
class BasicCPCLArg extends frame_father_1.EasyArg {
import { EasyArg } from "@psdk/frame-father";
export class BasicCPCLArg extends EasyArg {
append(arg) {

@@ -15,2 +12,1 @@ super.append(arg);

}
exports.BasicCPCLArg = BasicCPCLArg;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CBold = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CBold extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CBold extends BasicCPCLArg {
constructor(options) {

@@ -13,3 +10,3 @@ var _a;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendText(this.bold ? "1" : "0")

@@ -22,2 +19,1 @@ .clause();

}
exports.CBold = CBold;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CBox = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CBox extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CBox extends BasicCPCLArg {
constructor(options) {

@@ -23,3 +20,3 @@ var _a, _b, _c, _d, _e;

}
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.topLeftX)

@@ -36,2 +33,1 @@ .appendNumber(this.topLeftY)

}
exports.CBox = CBox;

@@ -1,18 +0,15 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CFeed = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const pagewidth_1 = require("./pagewidth");
const gap_1 = require("./gap");
const form_1 = require("./form");
const print_1 = require("./print");
const types_1 = require("../types");
class CFeed extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CPageWidth } from "./pagewidth";
import { CGap } from "./gap";
import { CForm } from "./form";
import { CPrint } from "./print";
import { CMode } from "../types";
export class CFeed extends BasicCPCLArg {
clause() {
super.append(new pagewidth_1.CPageWidth({ width: 576 }))
.append(new gap_1.CGap())
.append(new form_1.CForm())
.append(new print_1.CPrint({ mode: types_1.CMode.NORMAL }));
return frame_father_1.CPCLCommand.with(this.header()).clause();
super.append(new CPageWidth({ width: 576 }))
.append(new CGap())
.append(new CForm())
.append(new CPrint({ mode: CMode.NORMAL }));
return CPCLCommand.with(this.header()).clause();
}

@@ -23,2 +20,1 @@ header() {

}
exports.CFeed = CFeed;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CForm = void 0;
const frame_father_1 = require("@psdk/frame-father");
class CForm extends frame_father_1.OnlyTextHeaderArg {
import { OnlyTextHeaderArg } from "@psdk/frame-father";
export class CForm extends OnlyTextHeaderArg {
header() {

@@ -10,2 +7,1 @@ return 'FORM';

}
exports.CForm = CForm;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CGap = void 0;
const frame_father_1 = require("@psdk/frame-father");
class CGap extends frame_father_1.OnlyTextHeaderArg {
import { OnlyTextHeaderArg } from "@psdk/frame-father";
export class CGap extends OnlyTextHeaderArg {
header() {

@@ -10,2 +7,1 @@ return 'GAP-SENSE';

}
exports.CGap = CGap;

@@ -1,11 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CImage = void 0;
const basic_1 = require("./basic");
const frame_father_1 = require("@psdk/frame-father");
const frame_imageb_1 = require("@psdk/frame-imageb");
import { BasicCPCLArg } from "./basic";
import { Commander, Raw, CPCLCommand } from "@psdk/frame-father";
import { Pbita } from "@psdk/frame-imageb";
/**
* Image
*/
class CImage extends basic_1.BasicCPCLArg {
export class CImage extends BasicCPCLArg {
constructor(options) {

@@ -22,4 +19,3 @@ var _a, _b, _c, _d, _e;

clause() {
const processer = new frame_imageb_1.Pbita({
command: 'cpcl',
const processer = new Pbita({
threshold: this.threshold,

@@ -38,3 +34,3 @@ compress: this.compress,

const eWidth = Math.floor((width % 8 === 0) ? (width / 8) : (width / 8 + 1));
const command = frame_father_1.Commander.make().pushClause(frame_father_1.CPCLCommand.with(this.header())
const command = Commander.make().pushClause(CPCLCommand.with(this.header())
.appendNumber(eWidth)

@@ -50,3 +46,3 @@ .appendNumber(height)

.command();
return frame_father_1.Raw.binary(command.binary()).clause();
return Raw.binary(command.binary()).clause();
}

@@ -57,2 +53,1 @@ header() {

}
exports.CImage = CImage;

@@ -1,39 +0,23 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./bar"), exports);
__exportStar(require("./basic"), exports);
__exportStar(require("./bold"), exports);
__exportStar(require("./box"), exports);
__exportStar(require("./feed"), exports);
__exportStar(require("./form"), exports);
__exportStar(require("./gap"), exports);
__exportStar(require("./image"), exports);
__exportStar(require("./inverse"), exports);
__exportStar(require("./line"), exports);
__exportStar(require("./mag"), exports);
__exportStar(require("./page"), exports);
__exportStar(require("./pageheight"), exports);
__exportStar(require("./pagemode"), exports);
__exportStar(require("./pagesetup"), exports);
__exportStar(require("./pagewidth"), exports);
__exportStar(require("./print"), exports);
__exportStar(require("./qrcode"), exports);
__exportStar(require("./status"), exports);
__exportStar(require("./text"), exports);
__exportStar(require("./underline"), exports);
__exportStar(require("./watermark"), exports);
__exportStar(require("./sn"), exports);
export * from './bar';
export * from './basic';
export * from './bold';
export * from './box';
export * from './feed';
export * from './form';
export * from './gap';
export * from './image';
export * from './inverse';
export * from './line';
export * from './mag';
export * from './page';
export * from './pageheight';
export * from './pagemode';
export * from './pagesetup';
export * from './pagewidth';
export * from './print';
export * from './qrcode';
export * from './status';
export * from './text';
export * from './underline';
export * from './watermark';
export * from './sn';

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CInverse = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CInverse extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CInverse extends BasicCPCLArg {
constructor(options) {

@@ -16,3 +13,3 @@ var _a, _b, _c, _d;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.x)

@@ -29,2 +26,1 @@ .appendNumber(this.y)

}
exports.CInverse = CInverse;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CLine = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CLine extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CLine extends BasicCPCLArg {
constructor(options) {

@@ -18,3 +15,3 @@ var _a, _b, _c, _d, _e, _f;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.startX)

@@ -31,2 +28,1 @@ .appendNumber(this.startY)

}
exports.CLine = CLine;

@@ -1,12 +0,9 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CMag = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const types_1 = require("../types");
class CMag extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CFont } from "../types";
export class CMag extends BasicCPCLArg {
constructor(options) {
var _a;
super();
this.font = (_a = options === null || options === void 0 ? void 0 : options.font) !== null && _a !== void 0 ? _a : types_1.CFont.TSS16;
this.font = (_a = options === null || options === void 0 ? void 0 : options.font) !== null && _a !== void 0 ? _a : CFont.TSS16;
}

@@ -16,34 +13,31 @@ clause() {

switch (this.font) {
case types_1.CFont.TSS16:
case CFont.TSS16:
fontEntity = new FontEntity(1, 1, 55, 0, 16);
break;
case types_1.CFont.TSS20:
fontEntity = new FontEntity(1, 1, 6, 0, 20);
case CFont.TSS20:
fontEntity = new FontEntity(1, 1, 6, 1, 20);
break;
case types_1.CFont.TSS20_MAX1:
fontEntity = new FontEntity(1, 1, 6, 0, 40);
break;
case types_1.CFont.TSS24:
case CFont.TSS24:
fontEntity = new FontEntity(1, 1, 24, 0, 24);
break;
case types_1.CFont.TSS32:
case CFont.TSS32:
fontEntity = new FontEntity(1, 1, 4, 0, 32);
break;
case types_1.CFont.TSS24_MAX1:
case CFont.TSS24_MAX1:
fontEntity = new FontEntity(2, 2, 24, 0, 48);
break;
case types_1.CFont.TSS24_MAX2:
case CFont.TSS24_MAX2:
fontEntity = new FontEntity(3, 3, 24, 0, 72);
break;
case types_1.CFont.TSS28_MAX1:
case CFont.TSS28_MAX1:
fontEntity = new FontEntity(1, 1, 7, 3, 56);
break;
case types_1.CFont.TSS32_MAX1:
case CFont.TSS32_MAX1:
fontEntity = new FontEntity(2, 2, 4, 0, 64);
break;
case types_1.CFont.TSS32_MAX2:
case CFont.TSS32_MAX2:
fontEntity = new FontEntity(3, 3, 4, 0, 96);
break;
}
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(fontEntity.ex)

@@ -57,3 +51,2 @@ .appendNumber(fontEntity.ey)

}
exports.CMag = CMag;
class FontEntity {

@@ -60,0 +53,0 @@ constructor(ex, ey, family, size, height) {

@@ -1,9 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPage = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const pageheight_1 = require("./pageheight");
const pagewidth_1 = require("./pagewidth");
class CPage extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CPageHeight } from "./pageheight";
import { CPageWidth } from "./pagewidth";
export class CPage extends BasicCPCLArg {
constructor(options) {

@@ -17,5 +14,5 @@ var _a, _b, _c;

clause() {
super.prepend(new pageheight_1.CPageHeight({ height: this.height, copies: this.copies }));
super.append(new pagewidth_1.CPageWidth({ width: this.width }));
return frame_father_1.CPCLCommand.with(this.header())
super.prepend(new CPageHeight({ height: this.height, copies: this.copies }));
super.append(new CPageWidth({ width: this.width }));
return CPCLCommand.with(this.header())
.clause();

@@ -27,2 +24,1 @@ }

}
exports.CPage = CPage;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPageHeight = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CPageHeight extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CPageHeight extends BasicCPCLArg {
constructor(options) {

@@ -14,3 +11,3 @@ var _a, _b;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.height)

@@ -24,2 +21,1 @@ .appendNumber(this.copies)

}
exports.CPageHeight = CPageHeight;

@@ -1,19 +0,16 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPageMode = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const types_1 = require("../types");
const gap_1 = require("./gap");
const form_1 = require("./form");
class CPageMode extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CLocation } from "../types";
import { CGap } from "./gap";
import { CForm } from "./form";
export class CPageMode extends BasicCPCLArg {
constructor(options) {
var _a;
super();
this.location = (_a = options === null || options === void 0 ? void 0 : options.location) !== null && _a !== void 0 ? _a : types_1.CLocation.NO_LOCATION;
this.location = (_a = options === null || options === void 0 ? void 0 : options.location) !== null && _a !== void 0 ? _a : CLocation.NO_LOCATION;
}
clause() {
if (this.location > 0)
super.prepend(new gap_1.CGap()).prepend(new form_1.CForm());
return frame_father_1.CPCLCommand.with(this.header())
super.prepend(new CGap()).prepend(new CForm());
return CPCLCommand.with(this.header())
.clause();

@@ -25,2 +22,1 @@ }

}
exports.CPageMode = CPageMode;

@@ -1,9 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPageSetup = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const pageheight_1 = require("./pageheight");
const pagewidth_1 = require("./pagewidth");
class CPageSetup extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CPageHeight } from "./pageheight";
import { CPageWidth } from "./pagewidth";
export class CPageSetup extends BasicCPCLArg {
constructor(options) {

@@ -16,5 +13,5 @@ var _a, _b;

clause() {
super.prepend(new pageheight_1.CPageHeight({ height: this.pageHeight }));
super.append(new pagewidth_1.CPageWidth({ width: this.pageWidth }));
return frame_father_1.CPCLCommand.with(this.header()).clause();
super.prepend(new CPageHeight({ height: this.pageHeight }));
super.append(new CPageWidth({ width: this.pageWidth }));
return CPCLCommand.with(this.header()).clause();
}

@@ -25,2 +22,1 @@ header() {

}
exports.CPageSetup = CPageSetup;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPageWidth = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CPageWidth extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CPageWidth extends BasicCPCLArg {
constructor(options) {

@@ -13,3 +10,3 @@ var _a;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.width)

@@ -22,2 +19,1 @@ .clause();

}
exports.CPageWidth = CPageWidth;

@@ -1,16 +0,12 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPrint = void 0;
const frame_father_1 = require("@psdk/frame-father");
const types_1 = require("../types");
class CPrint extends frame_father_1.OnlyTextHeaderArg {
import { OnlyTextHeaderArg } from "@psdk/frame-father";
import { CMode } from "../types";
export class CPrint extends OnlyTextHeaderArg {
constructor(options) {
var _a;
super();
this.mode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : types_1.CMode.NORMAL;
this.mode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : CMode.NORMAL;
}
header() {
return this.mode == types_1.CMode.HORIZONTAL ? "POPRINT" : "PRINT";
return this.mode == CMode.HORIZONTAL ? "POPRINT" : "PRINT";
}
}
exports.CPrint = CPrint;

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CQRCode = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const types_1 = require("../types");
class CQRCode extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CCodeRotation, CCorrectLevel } from "../types";
export class CQRCode extends BasicCPCLArg {
constructor(options) {

@@ -14,9 +11,9 @@ var _a, _b, _c, _d, _e, _f, _g;

this.content = (_c = options.content) !== null && _c !== void 0 ? _c : '';
this.codeRotation = (_d = options.codeRotation) !== null && _d !== void 0 ? _d : types_1.CCodeRotation.ROTATION_0;
this.codeRotation = (_d = options.codeRotation) !== null && _d !== void 0 ? _d : CCodeRotation.ROTATION_0;
this.width = (_e = options.width) !== null && _e !== void 0 ? _e : 0;
this.level = (_f = options.level) !== null && _f !== void 0 ? _f : types_1.CCorrectLevel.H;
this.level = (_f = options.level) !== null && _f !== void 0 ? _f : CCorrectLevel.H;
this.charset = (_g = options.charset) !== null && _g !== void 0 ? _g : 'gbk';
}
clause() {
return frame_father_1.CPCLCommand.with(this.header(), this.charset)
return CPCLCommand.with(this.header(), this.charset)
.appendText("3" + "\n" + this.codeRotation)

@@ -36,2 +33,1 @@ .appendText("QR")

}
exports.CQRCode = CQRCode;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CSN = void 0;
const frame_father_1 = require("@psdk/frame-father");
class CSN extends frame_father_1.OnlyBinaryHeaderArg {
import { OnlyBinaryHeaderArg } from "@psdk/frame-father";
export class CSN extends OnlyBinaryHeaderArg {
constructor() {

@@ -16,2 +13,1 @@ super();

}
exports.CSN = CSN;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CStatus = void 0;
const frame_father_1 = require("@psdk/frame-father");
class CStatus extends frame_father_1.OnlyBinaryHeaderArg {
import { OnlyBinaryHeaderArg } from "@psdk/frame-father";
export class CStatus extends OnlyBinaryHeaderArg {
constructor() {

@@ -16,2 +13,1 @@ super();

}
exports.CStatus = CStatus;

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CText = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
const types_1 = require("../types");
class CText extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
import { CFont, CRotation } from "../types";
export class CText extends BasicCPCLArg {
constructor(options) {

@@ -14,4 +11,4 @@ var _a, _b, _c, _d, _e, _f;

this.content = (_c = options === null || options === void 0 ? void 0 : options.content) !== null && _c !== void 0 ? _c : '';
this.font = (_d = options === null || options === void 0 ? void 0 : options.font) !== null && _d !== void 0 ? _d : types_1.CFont.TSS16;
this.rotation = (_e = options === null || options === void 0 ? void 0 : options.rotation) !== null && _e !== void 0 ? _e : types_1.CRotation.ROTATION_0;
this.font = (_d = options === null || options === void 0 ? void 0 : options.font) !== null && _d !== void 0 ? _d : CFont.TSS16;
this.rotation = (_e = options === null || options === void 0 ? void 0 : options.rotation) !== null && _e !== void 0 ? _e : CRotation.ROTATION_0;
this.charset = (_f = options === null || options === void 0 ? void 0 : options.charset) !== null && _f !== void 0 ? _f : 'gbk';

@@ -22,34 +19,34 @@ }

switch (this.font) {
case types_1.CFont.TSS16:
case CFont.TSS16:
fontEntity = new FontEntity(1, 1, 55, 0, 16);
break;
case types_1.CFont.TSS20:
case CFont.TSS20:
fontEntity = new FontEntity(1, 1, 6, 0, 20);
break;
case types_1.CFont.TSS20_MAX1:
case CFont.TSS20_MAX1:
fontEntity = new FontEntity(1, 1, 6, 0, 40);
break;
case types_1.CFont.TSS24:
case CFont.TSS24:
fontEntity = new FontEntity(1, 1, 24, 0, 24);
break;
case types_1.CFont.TSS32:
case CFont.TSS32:
fontEntity = new FontEntity(1, 1, 4, 0, 32);
break;
case types_1.CFont.TSS24_MAX1:
case CFont.TSS24_MAX1:
fontEntity = new FontEntity(2, 2, 24, 0, 48);
break;
case types_1.CFont.TSS24_MAX2:
case CFont.TSS24_MAX2:
fontEntity = new FontEntity(3, 3, 24, 0, 72);
break;
case types_1.CFont.TSS28_MAX1:
case CFont.TSS28_MAX1:
fontEntity = new FontEntity(1, 1, 7, 3, 56);
break;
case types_1.CFont.TSS32_MAX1:
case CFont.TSS32_MAX1:
fontEntity = new FontEntity(2, 2, 4, 0, 64);
break;
case types_1.CFont.TSS32_MAX2:
case CFont.TSS32_MAX2:
fontEntity = new FontEntity(3, 3, 4, 0, 96);
break;
}
return frame_father_1.CPCLCommand.with(this.header(), this.charset)
return CPCLCommand.with(this.header(), this.charset)
.appendNumber(fontEntity.family)

@@ -66,3 +63,2 @@ .appendNumber(fontEntity.size)

}
exports.CText = CText;
class FontEntity {

@@ -69,0 +65,0 @@ constructor(ex, ey, family, size, height) {

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CUnderLine = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CUnderLine extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CUnderLine extends BasicCPCLArg {
constructor(options) {

@@ -13,3 +10,3 @@ var _a;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendText(this.underline ? "ON" : "OFF")

@@ -22,2 +19,1 @@ .clause();

}
exports.CUnderLine = CUnderLine;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CWaterMark = void 0;
const frame_father_1 = require("@psdk/frame-father");
const basic_1 = require("./basic");
class CWaterMark extends basic_1.BasicCPCLArg {
import { CPCLCommand } from "@psdk/frame-father";
import { BasicCPCLArg } from "./basic";
export class CWaterMark extends BasicCPCLArg {
constructor(options) {

@@ -13,3 +10,3 @@ var _a;

clause() {
return frame_father_1.CPCLCommand.with(this.header())
return CPCLCommand.with(this.header())
.appendNumber(this.value)

@@ -22,2 +19,1 @@ .clause();

}
exports.CWaterMark = CWaterMark;

@@ -1,12 +0,9 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicCPCL = void 0;
const frame_father_1 = require("@psdk/frame-father");
const args_1 = require("../args");
const types_1 = require("../types");
class BasicCPCL extends frame_father_1.PSDK {
import { Commander, PSDK } from '@psdk/frame-father';
import { CBold, CPrint, CUnderLine } from "../args";
import { CMode } from "../types";
export class BasicCPCL extends PSDK {
constructor(lifecycle) {
super();
this._lifecycle = lifecycle;
this._commander = frame_father_1.Commander.make();
this._commander = Commander.make();
}

@@ -36,3 +33,3 @@ connectedDevice() {

bold(bold) {
return super.push(new args_1.CBold({ bold: bold }));
return super.push(new CBold({ bold: bold }));
}

@@ -88,3 +85,3 @@ /**

print(arg) {
return super.push(arg !== null && arg !== void 0 ? arg : new args_1.CPrint({ mode: types_1.CMode.NORMAL }));
return super.push(arg !== null && arg !== void 0 ? arg : new CPrint({ mode: CMode.NORMAL }));
}

@@ -109,3 +106,3 @@ /**

underline(underline) {
return super.push(new args_1.CUnderLine({ underline: underline }));
return super.push(new CUnderLine({ underline: underline }));
}

@@ -132,2 +129,1 @@ /**

}
exports.BasicCPCL = BasicCPCL;

@@ -1,9 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPCL = void 0;
const generic_1 = require("./generic");
import { GenericCPCL } from "./generic";
/**
* CPCL entrypoint
*/
class CPCL {
export class CPCL {
/**

@@ -14,5 +11,4 @@ * Generic cpcl command

static generic(lifecycle) {
return new generic_1.GenericCPCL(lifecycle);
return new GenericCPCL(lifecycle);
}
}
exports.CPCL = CPCL;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericCPCL = void 0;
const basic_1 = require("./basic");
class GenericCPCL extends basic_1.BasicCPCL {
import { BasicCPCL } from "./basic";
export class GenericCPCL extends BasicCPCL {
constructor(lifecycle) {

@@ -10,2 +7,1 @@ super(lifecycle);

}
exports.GenericCPCL = GenericCPCL;

@@ -1,18 +0,2 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./generic"), exports);
__exportStar(require("./cpcl"), exports);
export * from './generic';
export * from './cpcl';

@@ -1,19 +0,3 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./impls"), exports);
__exportStar(require("./args"), exports);
__exportStar(require("./types"), exports);
export * from './impls';
export * from './args';
export * from './types';

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CCodeRotation = void 0;
var CCodeRotation;
export var CCodeRotation;
(function (CCodeRotation) {

@@ -14,2 +11,2 @@ /**

CCodeRotation["ROTATION_90"] = "VB";
})(CCodeRotation = exports.CCodeRotation || (exports.CCodeRotation = {}));
})(CCodeRotation || (CCodeRotation = {}));

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CCodeType = void 0;
/**
* CodeType
*/
var CCodeType;
export var CCodeType;
(function (CCodeType) {

@@ -45,2 +42,2 @@ /**

CCodeType[CCodeType["I2OF5"] = 8] = "I2OF5";
})(CCodeType = exports.CCodeType || (exports.CCodeType = {}));
})(CCodeType || (CCodeType = {}));

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CCorrectLevel = void 0;
var CCorrectLevel;
export var CCorrectLevel;
(function (CCorrectLevel) {

@@ -22,2 +19,2 @@ /**

CCorrectLevel["H"] = "H";
})(CCorrectLevel = exports.CCorrectLevel || (exports.CCorrectLevel = {}));
})(CCorrectLevel || (CCorrectLevel = {}));

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CFont = void 0;
/**
* font
*/
var CFont;
export var CFont;
(function (CFont) {

@@ -49,2 +46,2 @@ /**

CFont[CFont["TSS28_MAX1"] = 9] = "TSS28_MAX1";
})(CFont = exports.CFont || (exports.CFont = {}));
})(CFont || (CFont = {}));

@@ -1,23 +0,7 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./coderotation"), exports);
__exportStar(require("./codetype"), exports);
__exportStar(require("./correctlevel"), exports);
__exportStar(require("./font"), exports);
__exportStar(require("./location"), exports);
__exportStar(require("./mode"), exports);
__exportStar(require("./rotation"), exports);
export * from './coderotation';
export * from './codetype';
export * from './correctlevel';
export * from './font';
export * from './location';
export * from './mode';
export * from './rotation';

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CLocation = void 0;
var CLocation;
export var CLocation;
(function (CLocation) {

@@ -14,2 +11,2 @@ /**

CLocation[CLocation["SKIP"] = 1] = "SKIP";
})(CLocation = exports.CLocation || (exports.CLocation = {}));
})(CLocation || (CLocation = {}));

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CMode = void 0;
var CMode;
export var CMode;
(function (CMode) {

@@ -14,2 +11,2 @@ /**

CMode[CMode["HORIZONTAL"] = 1] = "HORIZONTAL";
})(CMode = exports.CMode || (exports.CMode = {}));
})(CMode || (CMode = {}));

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CRotation = void 0;
var CRotation;
export var CRotation;
(function (CRotation) {

@@ -22,2 +19,2 @@ /**

CRotation["ROTATION_270"] = "270";
})(CRotation = exports.CRotation || (exports.CRotation = {}));
})(CRotation || (CRotation = {}));
{
"name": "@psdk/cpcl",
"version": "0.2.67",
"version": "0.3.0",
"description": "psdk",

@@ -9,3 +9,3 @@ "main": "build/index.js",

"build": "tsc",
"package": "tsc && ncc build --source-map build/index.js -m -C -o dist && npx webpack",
"package": "tsc && ncc build --source-map build/index.js -m -C -o dist",
"test": "jest",

@@ -19,34 +19,15 @@ "docs": "npx typedoc --out dist/docs index.ts"

"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-decorators": "^7.17.12",
"@babel/plugin-proposal-export-namespace-from": "^7.17.12",
"@babel/plugin-proposal-function-sent": "^7.17.12",
"@babel/plugin-proposal-numeric-separator": "^7.16.7",
"@babel/plugin-proposal-object-rest-spread": "^7.18.0",
"@babel/plugin-proposal-throw-expressions": "^7.16.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-modules-commonjs": "^7.18.0",
"@babel/plugin-transform-object-assign": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.18.0",
"@babel/preset-env": "^7.18.0",
"@babel/preset-typescript": "^7.17.12",
"@babel/register": "^7.17.7",
"@babel/runtime-corejs3": "^7.18.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.35",
"@vercel/ncc": "^0.33.4",
"babel-loader": "^8.2.5",
"buffer": "^6.0.3",
"jest": "^28.1.0",
"string_decoder": "^1.3.0",
"ts-jest": "^28.0.2",
"typedoc": "^0.22.15",
"typescript": "^4.6.4",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
"@babel/core": "^7.24.5",
"@babel/preset-env": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@types/jest": "^29.5.12",
"@vercel/ncc": "^0.38.1",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
},
"dependencies": {
"@psdk/frame-father": "0.2.67",
"@psdk/frame-imageb": "0.2.67"
"@psdk/frame-father": "0.3.0",
"@psdk/frame-imageb": "0.3.0"
},

@@ -57,3 +38,3 @@ "files": [

],
"gitHead": "1b469612990a3efbf1a3fe4296ed13e8c8865988"
"gitHead": "9796259a6a24ae7e334340f6c28d5ae9b3e45401"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc