evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Create typings, or a workaround to import to typescript? #270

Open dessalines opened 8 years ago

dessalines commented 8 years ago

Does anyone have this working with typescript, or have typings with it? I'd love if this node package came with the .d.ts typings file.

timfish commented 7 years ago

If you're just using the toHTML method, you'll only need this:

declare module "markdown" {
  var markdown: {
    toHTML(markdown: string): string;
  }
}
zedfight commented 5 years ago

Same issue, use in TypeScript, it will tips: Try npm install @types/markdown if it exists or add a new declaration (.d.ts) file containing declare module 'markdown'; and there is no @types/markdown.