1
0
Fork 0

Fix new typescript

This commit is contained in:
Pabloader 2026-05-24 08:32:15 +00:00
parent 135fb6efd1
commit 65660cc639
4 changed files with 12 additions and 7 deletions

View File

@ -21,12 +21,12 @@
"@types/bun": "^1.3.14",
"@types/html-minifier": "4.0.5",
"@types/inquirer": "9.0.7",
"@types/web-bluetooth": "0.0.21",
"@types/web-bluetooth": "^0.0.21",
"browser-detect": "0.2.28",
"eruda": "3.2.3",
"html-minifier": "4.0.0",
"jimp": "1.6.1",
"typescript": "^6.0.3",
"typescript": "6.0.3",
"uglify-js": "3.19.3",
},
},

View File

@ -59,7 +59,7 @@ export const NOTIFY_CHARACTERISTIC = "0000ae02-0000-1000-8000-00805f9b34fb";
export const PRINTER_WIDTH = 384;
const MTU = PRINTER_WIDTH / 8;
function formatMessage(command: Command, data: number[] | Uint8Array): Uint8Array {
function formatMessage(command: Command, data: number[] | Uint8Array) {
const len = data.length;
const message = new Uint8Array(len + 8);
@ -76,11 +76,11 @@ function formatMessage(command: Command, data: number[] | Uint8Array): Uint8Arra
return message;
}
function formatInt8(command: Command, data: number): Uint8Array {
function formatInt8(command: Command, data: number) {
return formatMessage(command, [data & 0xFF]);
}
function formatInt16(command: Command, data: number): Uint8Array {
function formatInt16(command: Command, data: number) {
const udata = new Uint8Array(2);
udata[0] = data & 0xFF;
udata[1] = (data >> 8) & 0xFF;

4
src/types.d.ts vendored
View File

@ -14,6 +14,10 @@ declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}
declare module '*.css' {
export default undefined;
}
declare module "*.png" {
const image: HTMLImageElement;
export default image;

View File

@ -27,7 +27,8 @@
"noPropertyAccessFromIndexSignature": false,
"paths": {
"@common/*": ["./src/common/*"]
}
},
"types": ["bun", "web-bluetooth"]
},
"include": ["./**/*.ts", "./**/*.tsx", "./**/*.js", "./**/*.jsx"],
"exclude": ["./dist/**/*"]