AlefAlefAlef / ivrita

Ivrita is an open-source set of typographic tools for gender equality in Hebrew
https://alefalefalef.co.il/ivrita
GNU Affero General Public License v3.0
41 stars 4 forks source link

Type Definitions (TypeScript) #5

Open guytepper opened 3 years ago

guytepper commented 3 years ago

Hi @kinging123 & @avrahamcornfeld :) First off, big thanks for this magical library. It's a pleasure to use.

I am using TypeScript for my project, and importing Ivrita and using it's methods emits warnings since there are no types here.

Could you maybe consider adding types if you have some free time available?

kinging123 commented 3 years ago

Hi Guy!

Glad to hear, please let us know where you're using it so we can showcase your projects on our website :)

Do you need a strict .d.ts file, or is adding JSDoc to the exported functions enough? I know that some TypeScript engines and IDEs support JSDoc, and it'll be much easier for us to produce and maintain.

Also, feel free to add the definitions yourself, we will be happy to assist and correct along the way and would appreciate the headstart.

guytepper commented 3 years ago

Seems like it's possible to generate d.ts file from JSDoc (The .d.ts file is needed to avoid the warnings).

It's being used in https://github.com/act-1/native, a mobile app which is still in development. I'll let you know once it becomes publicly available :)

kinging123 commented 3 years ago

Hi, sorry for the delay in response. Your tip was awesome - I have now added type definitions for all the exported features (and more) of Ivrita! 🥳

It's all in the type-definitions branch, and once we feel it's stable enough (since some changes in the actual code had to be made) we will push it to the main branch.

I would love to hear your feedback about this, so let me know if I've done something incorrectly or inconveniently.

Please take a look at the custom switch feature, which I think will be useful to you. :)