refactor: migrate entire codebase to TypeScript (NO any)
Complete TypeScript migration of all source and test files:
Server (moved to server/):
- server.js → server/index.ts with full Express/WS/SQLite types
- DocumentRow, VersionRow, WsControlMessage interfaces
- tsx for development and production execution
Core lib (src/lib/ — 8 modules):
- crypto.ts, provider.ts, version-history.ts, offline.ts
- share-dialog.ts, suggesting.ts, print-layout.ts, context-menu.ts
- Full interfaces for all data structures and event types
Sheets (src/sheets/ — 25 modules):
- types.ts shared interface file (CellStyle, CellData, CellRef, Token, etc.)
- formulas.ts with RangeArray, typed parser/evaluator
- recalc.ts with CellStore interface
- All feature modules fully typed (charts, filter, sort, CF, validation, etc.)
Docs (src/docs/ — 27 modules):
- types.ts + html2pdf.d.ts + vendor.d.ts for third-party libs
- TipTap extensions with proper generics
- All feature modules typed (search, markdown, outline, etc.)
Landing (3 modules):
- landing.ts, landing-utils.ts, landing-dragdrop.ts with DocumentMeta types
Tests (69 files):
- All .test.js → .test.ts with typed mocks and imports
Infrastructure:
- tsconfig.json (strict, noImplicitAny, noUncheckedIndexedAccess)
- vite.config.ts, package.json updated for tsx
- Zero any types across entire codebase
1800 tests passing, zero regressions.