You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Adapted from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/65afafadd93759348909de1cdad5df5789c94326/types/js-yaml/index.d.ts
// 1. fixed compatibility with TypeScript 2 (which we're still
// using at the time of writing) by replacing `unknown` with `any`
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).
The text was updated successfully, but these errors were encountered:
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 useunknown
. Theunknown
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, seepackage.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. replaceunknown
byany
) 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 thejs-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).The text was updated successfully, but these errors were encountered: