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
However, with checked JS, as far as I can tell there's no way to achieve this. The following loosely demonstrates what I'm after.
/** * @typedef {import { MyType } from "types-package"} {MyType} * @param {MyType} bar */functionfoo(bar){}
Note that:
types-package is a .d.ts only package, no runtime code.
The specific use case I am working with is a module that implements an interface on the exported functions. Consider a VSCode extension, which exports an activate function, it is currently not possible to type the context parameter to that function if the extension is written in JS.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.5.3
Code
In TypeScript, it is trivial to import a type from a package:
However, with checked JS, as far as I can tell there's no way to achieve this. The following loosely demonstrates what I'm after.
Note that:
types-package
is a.d.ts
only package, no runtime code.activate
function, it is currently not possible to type thecontext
parameter to that function if the extension is written in JS.The text was updated successfully, but these errors were encountered: