monkberry icon indicating copy to clipboard operation
monkberry copied to clipboard

Typescript definitions?

Open ghost opened this issue 9 years ago • 6 comments

TypeScript Definition Manager

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

ghost avatar Jun 29 '16 19:06 ghost

Okay, will do it.

antonmedv avatar Jun 30 '16 04:06 antonmedv

What is the best way to add TSD for project?

antonmedv avatar Jul 01 '16 05:07 antonmedv

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

"typings": "./monkberry.d.ts"

alex-kinokon avatar Jul 01 '16 10:07 alex-kinokon

How to test TSD?

antonmedv avatar Jul 01 '16 10:07 antonmedv

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

gamebox avatar Jul 01 '16 14:07 gamebox

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.

mindplay-dk avatar Jan 09 '17 12:01 mindplay-dk