mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add GlobData interface
This commit is contained in:
@@ -5,6 +5,7 @@ var strArrResult: string[];
|
||||
var boolResult: boolean;
|
||||
var strMatchFuncResult: mm.MatchFunction<string>;
|
||||
var anyMatchFuncResult: mm.MatchFunction<any>;
|
||||
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');
|
||||
|
||||
Vendored
+8
-2
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user