From acbc157694b67499dd239e39a1089842ef0ad869 Mon Sep 17 00:00:00 2001 From: taoya7 <569781231@qq.com> Date: Mon, 11 Mar 2024 19:44:38 +0800 Subject: [PATCH] feat: Init --- src/index.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/index.ts b/src/index.ts index f4c8ea9..323d059 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,27 @@ export * from "./command"; + +import { + FONTMUL, + FONTTYPE, + LabelCommand, + ROTATION, + EEC, +} from "@/command/Label"; + +function main() { + let label = new LabelCommand(50, 30, 0); + label.addText( + 0, + 0, + FONTTYPE.FONT_1, + ROTATION.ROTATION_0, + FONTMUL.MUL_1, + FONTMUL.MUL_1, + "Hello World" + ); + label.addQRCode(0, 0, EEC.LEVEL_L, 5, ROTATION.ROTATION_0, "taoya.art"); + var command = label.getCommand(); + console.log(command); // 获取字节码 + console.log(label.getCommandStr(command)); +} +main();