Problem
The package ships no type declarations — no types field in package.json and no .d.ts files. Consumers running tsc with checkJs (or plain TypeScript) get TS7016: Could not find a declaration file for module 'hooktml', and every import is implicitly any. This silently defeats type-checking for exactly the API surface where it helps most: signal() value types, hook deps arrays, and component signatures.
Downstream apps currently have to hand-maintain a local declare module "hooktml" shadow of the public API and re-diff it against the README on every version bump.
Proposal
The source is already thoroughly JSDoc-annotated, so declarations can be generated rather than written:
- Emit declarations from the existing JSDoc:
- Point
package.json at them:
- Add the emit step to the release/build script so the declarations can never drift from the source JSDoc.
Notes
- A few internal spots may need JSDoc tightening before the emit is clean (e.g.
index.js uses a bare @type {Object} where a @typedef with a current property is needed).
- Generic-heavy signatures (
signal, computed) are worth eyeballing in the emitted output — JSDoc @template usually emits fine, but these are the highest-value types in the API.
- Zero runtime impact; browser/CDN consumers are unaffected.
Problem
The package ships no type declarations — no
typesfield inpackage.jsonand no.d.tsfiles. Consumers runningtscwithcheckJs(or plain TypeScript) getTS7016: Could not find a declaration file for module 'hooktml', and every import is implicitlyany. This silently defeats type-checking for exactly the API surface where it helps most:signal()value types, hook deps arrays, and component signatures.Downstream apps currently have to hand-maintain a local
declare module "hooktml"shadow of the public API and re-diff it against the README on every version bump.Proposal
The source is already thoroughly JSDoc-annotated, so declarations can be generated rather than written:
package.jsonat them:{ "types": "./dist/types/index.d.ts", "exports": { ".": { "types": "./dist/types/index.d.ts", "browser": "./index.browser.js", "node": "./index.js", "default": "./index.js" } } }Notes
index.jsuses a bare@type {Object}where a@typedefwith acurrentproperty is needed).signal,computed) are worth eyeballing in the emitted output — JSDoc@templateusually emits fine, but these are the highest-value types in the API.