Migrate from JavaScript to TypeScript

Convert all 16 source files from .js to .ts with full type annotations.
Add types.ts with interfaces for all data structures. Export BufferReader
and BufferWriter from index. Use 'as const' for literal types on constants.
This commit is contained in:
Manuel Bahamóndez-Honores 2026-02-19 09:01:02 -03:00
parent f59b0f7ce4
commit 8487ce2421
22 changed files with 917 additions and 315 deletions

View file

@ -2,15 +2,22 @@
"name": "@liamcottle/meshcore.js",
"version": "1.11.0",
"description": "",
"main": "src/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc",
"prepublishOnly": "npm run build"
},
"files": ["dist"],
"author": "Liam Cottle <liam@liamcottle.com>",
"license": "MIT",
"dependencies": {
"@noble/curves": "^1.8.1",
"serialport": "^13.0.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.7.0"
}
}