AriaMinaei / pretty-error

See node.js errors with less clutter
MIT License
1.52k stars 49 forks source link

* new: Issue #31 - Missing Typescript Definition #34

Closed nCore closed 8 years ago

nCore commented 8 years ago

Added Typescript Definition.

AriaMinaei commented 8 years ago

Thanks for the good work! Since I don't use TS atm, I can't really test this. But if you think this PR is good enough to merge, I'll do it ;)

So, let me know.

nCore commented 8 years ago

That's the question for @radarsu ;)

radarsu commented 8 years ago

The definition is great! Thanks!

AriaMinaei commented 8 years ago

Merged and published. Thanks for the good work :)

testerez commented 8 years ago

@nCore @radarsu: How are we supposed to use the definition in a typescript project? (I'm using typescript@2)

radarsu commented 8 years ago

After you install pretty-error you have to import it like this: import PrettyError = require("pretty-error");

If typescript compiler will underline "pretty-error" and say it has no definition (or something alike), then you should add to package.json of pretty-error module: "typings": "index.d.ts", After that typescript compiler should be able to find definition. I am using atom editor and typescript 2.1.0 though.

testerez commented 8 years ago

In fact, I'm using ts@2.0.3 (current stable release) and the reference in package.json seams to be required. I just made a PR https://github.com/AriaMinaei/pretty-error/pull/36