Description
See #166 (comment) (cc @GreyCat)
When adding the js-yaml
dependency in #166, I couldn't use the TypeScript definitions available in the DefinitelyTyped repo directly, because they use unknown
. The unknown
type is a feature introduced in TypeScript 3.0 (see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#new-unknown-top-type), but we're currently using TypeScript 2, see package.json
:
kaitai_struct_webide/package.json
Line 33 in 80c94b1
So I had to copy the TS definitions to lib/ts-types/js-yaml.d.ts
and patch it (i.e. replace unknown
by any
) to make it compatible with TypeScript 2:
kaitai_struct_webide/lib/ts-types/js-yaml.d.ts
Lines 4 to 6 in 5de330d
I believe migrating from TypeScript 2 would allow us to drop our lib/ts-types
directory altogether and use the packages in the @types
namespace at npm instead. For example, for the js-yaml
library, this would be just a matter of adding @types/js-yaml
as a dependency (according to my tests, the TS compiler automatically resolves the installed @types/*
packages, so no more steps are needed).