hubgit / react-prosemirror

A React component for ProseMirror
https://ow1qi.csb.app/
MIT License
248 stars 51 forks source link

Typescript support? #8

Closed mattcopas closed 3 years ago

mattcopas commented 6 years ago

Hi,

I'd like to try using your lib using Typescript, but there's no type declaration file (index.d.ts), or a corresponding @types library on NPM.

Do you have any plan/would you add type declarations?

Cheers

hcharley commented 5 years ago

This seems like it may be difficult to accomplish, because it would be asking the maintainer of the @types package or the maintainer of this project to keep up with how the prose mirror API changes, right?

strogonoff commented 5 years ago

(FWIW it’s possible to provide typings using a .d.ts file inside the project itself.)

I’ll try to add some dummy opt-out declarations inside my current project to silence TS, but definitely hoping both this and the config-default packages are typed properly at some point by a knowledgeable person. I’ll be sure to create a PR when my typing skills are at suitable level, but I’m far from there yet.

hcharley commented 5 years ago

@strogonoff I'd love to see TypeScript definitions for this project personally. Do keep us posted if you make any progress, please!

hubgit commented 5 years ago

I have a plan to rewrite the whole project in TypeScript, if I can find time.

hubgit commented 4 years ago

I've started writing v2 in TypeScript - it's a different approach that will hopefully prove to be more extensible.

hubgit commented 3 years ago

v2 is now released, rewritten in TypeScript.

The way the React components work is a bit different, but you should be able to use the same schema, plugins, etc.