deno_karabiner icon indicating copy to clipboard operation
deno_karabiner copied to clipboard

No types from package...?

Open martaver opened this issue 3 years ago • 5 comments

Hey man, nice idea using typescript to manipulate karabiner!

I haven't really played with Deno so I'm not sure if I'm doing something wrong or if its a bug on your end:

When I import deno_karabiner like so:

import { KarabinerComplexModifications } from "https://deno.land/x/[email protected]/karabiner.ts";

Then KarabinerComplexModifications is type any.

Any idea what's going wrong?

martaver avatar Apr 08 '21 19:04 martaver

Actually I suspect this is a problem with the Webstorm Deno plugin...

martaver avatar Apr 08 '21 19:04 martaver

Hey man, nice idea using typescript to manipulate karabiner!

Thanks!

Then KarabinerComplexModifications is type any.

I was actually kinda able to reproduce this with VSCode and the Deno extension but it went away after upgrading Deno to 1.8.3. I was using 1.7.5 previously.

Now I get types as expected

image

esamattis avatar Apr 08 '21 21:04 esamattis

Hm... so like I said I'm not a deno expert, but the Deno tooling seems kind of sparse and inferior to the regular node/TS tooling.

I've forked your repo and switch out deno for node, so that I can just use the regular tooling instead. I could, however, set up an adapter for the file reads/writes and env read so that we could run the same code against both node and deno, change only the entry point.

Do you have any interest in this if I create a PR?

martaver avatar Apr 14 '21 07:04 martaver

Ya, the tooling is definitely a bit behind but I'm pretty confident that it will catch up as time goes on.

Do you have any interest in this if I create a PR?

To be honest one reason I used Deno was to see where it is and how it evolves in future. So not interested atm :)

But do post the link to your fork here so others can find it too! 👍

esamattis avatar Apr 15 '21 12:04 esamattis

Hm... the thing is I also have other updates to Types etc, which I auto-generated from karabiner documentation / rules. It would be ideal to be able to keep rolling improvements into the same repository. If you allowed the access to node/deno via an adapter interface, then we could keep the code together, and mutually benefit. And probably more people would contribute, too.

I don't see how that would prevent you from rolling with Deno.

martaver avatar Apr 16 '21 06:04 martaver