antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

Typescript definitions? #5

Open ghost opened 8 years ago

ghost commented 8 years ago

TypeScript Definition Manager

Would be very helpful if we got Typescript Definition files for the api (not the templating/handlebars).

antonmedv commented 8 years ago

Okay, will do it.

antonmedv commented 8 years ago

What is the best way to add TSD for project?

alex-kinokon commented 8 years ago

@elfet I think you can specify your typing definitions in package.json with the line

"typings": "./monkberry.d.ts"
antonmedv commented 8 years ago

How to test TSD?

gamebox commented 8 years ago

This package seems to be purpose built for this: https://www.npmjs.com/package/typescript-definition-tester

mindplay-dk commented 7 years ago

You might also consider porting to TypeScript - in my experience, that's usually the better approach, because it guarantees correct typedefs and removes the burden of maintaining them by hand.

In addition, it hardens your codebase against errors and makes the code self-documenting for other contributors.

You're already using ES6, so basically you would just be adding type-annotations for compile-time safety - it won't affect the footprint of the generated code at all.

Inferno is another project that uses this approach.