Replace hand-written .d.ts with JSDoc + tsc auto-generation

- Delete hand-written index.d.ts that drifted from source
- Add JSDoc type annotations to all source files
- Create src/types.js with shared typedefs (SelfInfo, Contact,
  ContactMessage, ChannelInfo, RepeaterStats, etc.)
- Add tsconfig.json for declaration generation
- Add build:types script and prepublishOnly hook
- Add GitHub Actions CI workflow for type checking
- Use Uint8Array everywhere (no Buffer references)
- Add semantic type aliases (EpochSeconds, Milliseconds, MilliVolts)
- Add typed event overloads on Connection (on/once/off)
- All 11 PR #15 review comments addressed
This commit is contained in:
Manuel Bahamóndez-Honores 2026-02-18 05:49:46 -03:00
parent de31939a28
commit 2d4cb35e51
23 changed files with 988 additions and 212 deletions

17
.github/workflows/typecheck.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: Type Check
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build:types