Migrate from JavaScript to TypeScript (#2)

* 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.

* Switch from pnpm to npm

* Remove unused EpochSeconds type
This commit is contained in:
Manuel Bahamóndez-Honores 2026-02-20 20:07:43 -03:00 committed by GitHub
parent f59b0f7ce4
commit bed46e52b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 713 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"
}
}