js-tspl
Version:
ts generate TSPL command, TSPL打印指令生成
37 lines (26 loc) • 633 B
Markdown
from 'js-tspl';
const tspl = new TSPL();
tspl.addText('Print test!');
const cmd = toBytes(tspl.toPrint());
```
```typescript
import TSPL, { toBytes } from 'js-tspl';
const cmd = toBytes(
new TSPL()
.addText('Print test!')
.addLine()
// toPrint 和 toBytes 会结束调用
.toBytes();
);
```
```typescript
import TSPL, { toBytes, encodeGBK } from 'js-tspl';
const tspl = new TSPL();
tspl.addText('Print test!');
const cmd = toBytes(encodeGBK(tspl.toPrint()));
```
```typescript
import TSPL, { toBytes }