diff --git a/micromatch/micromatch.d.ts b/micromatch/micromatch.d.ts index e84b6c339..58aba394e 100644 --- a/micromatch/micromatch.d.ts +++ b/micromatch/micromatch.d.ts @@ -9,7 +9,8 @@ declare module 'micromatch' { import parseGlob = require('parse-glob'); namespace micromatch { - type Pattern = (string | RegExp | ((filePath: string) => boolean)); + type MatchFunction = ((value: T) => boolean); + type Pattern = (string | RegExp | MatchFunction); interface Options { /** @@ -126,7 +127,7 @@ declare module 'micromatch' { /** * Returns a function for matching. */ - (filePath: string, opts?: micromatch.Options): ((filePath: string) => boolean); + (filePath: string, opts?: micromatch.Options): micromatch.MatchFunction; }; /** @@ -139,12 +140,12 @@ declare module 'micromatch' { * Returns a function for matching using the supplied pattern. e.g. create your own "matcher". The advantage of * this method is that the pattern can be compiled outside of a loop. */ - matcher(pattern: micromatch.Pattern): ((filePath: string) => boolean); + matcher(pattern: micromatch.Pattern): micromatch.MatchFunction; /** * Returns a function that can be passed to Array#filter(). */ - filter(patterns: micromatch.Pattern | micromatch.Pattern[], opts?: micromatch.Options): ((filePath: string) => boolean); + filter(patterns: micromatch.Pattern | micromatch.Pattern[], opts?: micromatch.Options): micromatch.MatchFunction; /** * Returns true if a file path matches any of the given patterns.