From 7cda84786520fd0673c934fde1aa722083e05f7b Mon Sep 17 00:00:00 2001 From: Glen Date: Sat, 23 Jan 2016 16:09:05 +0200 Subject: [PATCH] Add GlobData interface --- micromatch/micromatch-tests.ts | 5 +++-- micromatch/micromatch.d.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/micromatch/micromatch-tests.ts b/micromatch/micromatch-tests.ts index 75f9407ee..c0d47a80d 100644 --- a/micromatch/micromatch-tests.ts +++ b/micromatch/micromatch-tests.ts @@ -5,6 +5,7 @@ var strArrResult: string[]; var boolResult: boolean; var strMatchFuncResult: mm.MatchFunction; var anyMatchFuncResult: mm.MatchFunction; +var globDataResult: mm.GlobData; var regExpResult: RegExp; // Usage. @@ -45,8 +46,8 @@ boolResult = mm.any('abc', 'a*'); boolResult = mm.any('abc', 'a*', {dot: true}); // "expand" method. -mm.expand('*.js'); -mm.expand('*.js', {dot: true}); +globDataResult = mm.expand('*.js'); +globDataResult = mm.expand('*.js', {dot: true}); // "makeRe" method. regExpResult = mm.makeRe('*.js'); diff --git a/micromatch/micromatch.d.ts b/micromatch/micromatch.d.ts index 58aba394e..cea7098ec 100644 --- a/micromatch/micromatch.d.ts +++ b/micromatch/micromatch.d.ts @@ -62,7 +62,7 @@ declare module 'micromatch' { } interface Glob { - options: {}; // TODO: Expand? + options: micromatch.Options; pattern: string; history: {msg: any, pattern: string}[]; tokens: parseGlob.Result; @@ -114,6 +114,12 @@ declare module 'micromatch' { */ unescape(pattern: string): string; } + + interface GlobData { + pattern: string; + tokens: parseGlob.Result; + options: micromatch.Options; + } } interface Micromatch { @@ -155,7 +161,7 @@ declare module 'micromatch' { /** * Returns an object with a regex-compatible string and tokens. */ - expand(pattern: string, opts?: micromatch.Options): micromatch.Glob | {pattern: string, tokens: parseGlob.Result, options: {} /* TODO: Expand? */}; + expand(pattern: string, opts?: micromatch.Options): micromatch.Glob | micromatch.GlobData; /** * Create a regular expression for matching file paths based on the given pattern.