I have spent the best of the last three hours trying innovative ways to make my VSCode understand the typing definitions in this TypeScript program from my client deno cli app. Alas, I have failed.
My attempt consisted of trying to leverage deno compiler options to add types like this:
// @deno-types="https://raw.githubusercontent.com/firstdoit/cac/master/mod.d.ts"
export { cac } from 'https://raw.githubusercontent.com/firstdoit/cac/master/mod.js'
And then to generate said mod.d.ts from the types/* directory.
It's apparently impossible, because you inline EventEmitter (https://github.com/cacjs/cac/pull/66) but all "dts generation tools" I tried were unable to inline the events library.
I have spent the best of the last three hours trying innovative ways to make my VSCode understand the typing definitions in this TypeScript program from my client
deno
cli app. Alas, I have failed.My attempt consisted of trying to leverage deno compiler options to add types like this:
And then to generate said mod.d.ts from the
types/*
directory.It's apparently impossible, because you inline EventEmitter (https://github.com/cacjs/cac/pull/66) but all "dts generation tools" I tried were unable to inline the
events
library.Tools I tried to create a single dts: https://github.com/Swatinem/rollup-plugin-dts https://github.com/timocov/dts-bundle-generator
You can take a look at my commits if it helps: https://github.com/firstdoit/cac/commit/44e763c88ab4aa3f627b20f8548ad6305ed9031d https://github.com/firstdoit/cac/commit/4637d6bcfae0cc93fe981f6f7361adf48c11d6a6
I'm giving up on
cac
for now, since apparentlydeno
is really at a stage when it's best to only import.ts
, deno-native libs directly. :(