The 4.x packages are authored in TypeScript: the published source maps point at .ts sources (e.g. @tko/bind's applyBindings.js.map has "sources": ["../src/applyBindings.ts"]), yet none of them ship type declarations.
There are no .d.ts files in any @tko/* package, the types/typings field is unset, and the exports map only lists JS:
"exports": { ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }
So import ko from '@tko/build.knockout' fails type-checking with "Could not find a declaration file for module '@tko/build.knockout'". The same applies to @tko/build.reference and the individual packages, and there's no @types/tko on DefinitelyTyped.
The workaround on the consumer side is to keep the old knockout package as a dev dependency purely for its bundled .d.ts and re-point it:
declare module '@tko/build.knockout' {
import ko from 'knockout';
export default ko;
}
That works because the runtime API is KO3-compatible, but it's a hack and doesn't cover the modular @tko/* packages.
Since the source is already TypeScript (#92 landed the conversion, #6 is the original tracking issue), this looks like mostly enabling declaration emit in the build and adding a types entry to each package's exports.
Checked on @tko/build.knockout@4.1.0 and @tko/build.reference@4.1.0.
The 4.x packages are authored in TypeScript: the published source maps point at
.tssources (e.g.@tko/bind'sapplyBindings.js.maphas"sources": ["../src/applyBindings.ts"]), yet none of them ship type declarations.There are no
.d.tsfiles in any@tko/*package, thetypes/typingsfield is unset, and theexportsmap only lists JS:So
import ko from '@tko/build.knockout'fails type-checking with "Could not find a declaration file for module '@tko/build.knockout'". The same applies to@tko/build.referenceand the individual packages, and there's no@types/tkoon DefinitelyTyped.The workaround on the consumer side is to keep the old
knockoutpackage as a dev dependency purely for its bundled.d.tsand re-point it:That works because the runtime API is KO3-compatible, but it's a hack and doesn't cover the modular
@tko/*packages.Since the source is already TypeScript (#92 landed the conversion, #6 is the original tracking issue), this looks like mostly enabling declaration emit in the build and adding a
typesentry to each package'sexports.Checked on
@tko/build.knockout@4.1.0and@tko/build.reference@4.1.0.