davidchambers / string-format

JavaScript string formatting inspired by Python’s `str.format()`
Do What The F*ck You Want To Public License
334 stars 36 forks source link

Include type definition for TypeScript usage #23

Open jimsleon opened 7 years ago

jimsleon commented 7 years ago

TypeScript becomes popular these days, so it will be great if type definition is included in the npm page so that it could be used in TypeScript projects.

davidchambers commented 7 years ago

I'll happily accept a pull request for this, @jimsleon. :)

saikirangit commented 7 years ago

We just created a file string-format.d.ts under src

declare module 'string-format' { const format: any; export = format; }

and used it as

import * as format from 'string-format';