dmonad / lib0

Monorepo of isomorphic utility functions
MIT License
347 stars 62 forks source link

tree.findNode TypeScript definition error #37

Closed FindAPattern closed 2 years ago

FindAPattern commented 2 years ago

I'm getting the following type error when compiling a project that depends on lib0:

node_modules/lib0/tree.d.ts(54,22): error TS2315: Type 'N' is not generic.

This line seems to cause the error: https://github.com/dmonad/lib0/blob/73006dbdcbf9eda57d2fbfa10c431ee3b5470adc/tree.js#L297

The N class does not have a @template line in its doc comment.

(Also, thanks for the fantastic work you've done on Yjs and all of the supporting libraries.)

dmonad commented 2 years ago

Hi @FindAPattern I fixed the issue.

But please note that the tree implementation was created before I added typescript support (it's really old). I don't recommend using it in this state.

There is a comment at the top of the file that disables type checking. So there are probably more issues with the file.

I would be happy about a PR that adds typings to this module.