emmetio / nova-plugin

Emmet plugin for Panic’s Nova editor
MIT License
26 stars 11 forks source link

Use nova types from DefinitelyTyped #13

Closed apexskier closed 4 years ago

apexskier commented 4 years ago

Hey there!

I'm the author of Nova editor types on DefinitelyTyped (and the Nova TypeScript extension). As part of trying to make sure they're actually useful, I'm working through applying them to this project (since it also uses typescript), and I'd like to switch this project to using them directly. I've managed to find a few issues with my typings, and am updating them in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46703 (tests will fail until that's published).

You've taken some different approaches than I have, so I've got a few open questions that might help improve the community typings.

sergeche commented 4 years ago

How did you write/generate your types (types/nova/index.d.ts)? They're mostly similar to mine, but you've added comments, which are useful. If they aren't maintained by hand I'd like to include them.

I’ve copied them manually from Nova docs

I haven't found any sort of package that provides them without also pulling in the node typings, which I don't want since extensions don't run in a node runtime

That’s the reason why I’ve copied them manually from default TS libs. Nova execution host is neither DOM nor Node.js so the only solution I’ve found is to copy them from defaults and provide exact execution environment for Nova.

Should we figure out how to pull in fetch types into @types/nova-editor? (This will have similar issues to streams)

I don’t think so. Nova has its own execution environment and all common interfaces like fetch are implemented specifically for editor JS env so it’s better to keep them separately from default libs