diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2ed48cd --- /dev/null +++ b/index.d.ts @@ -0,0 +1,6 @@ +export = Matcher; +declare function Matcher(input: string[], patterns: string[]) : string[]; + +declare namespace Matcher{ + export function isMatch(input: string, pattern: string) : boolean; +} diff --git a/readme.md b/readme.md index 6716eec..3d11405 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,15 @@ Useful when you want to accept loose string input and regexes/globs are too conv $ npm install --save matcher ``` +## Import + +```js +const matcher = require('matcher'); +``` + +```js +import * as matcher from "matcher" +``` ## Usage @@ -74,6 +83,9 @@ Case-insensitive. Use `*` to match zero or more characters. A pattern starting w $ npm run bench ``` +## Typescript + +Includes [TypeScript](http://typescriptlang.org) definitions inside this project ## Related