From bcec761b1bb25b62c2b585305ded7cfe50010001 Mon Sep 17 00:00:00 2001 From: ikatyang Date: Thu, 24 Aug 2017 11:49:33 +0800 Subject: [PATCH] fix(globby): fix version and add some docs --- types/globby/index.d.ts | 30 +++++++++++++++++++++++++----- types/globby/tsconfig.json | 1 + 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/types/globby/index.d.ts b/types/globby/index.d.ts index d06091551c..531888f803 100644 --- a/types/globby/index.d.ts +++ b/types/globby/index.d.ts @@ -1,17 +1,37 @@ -// Type definitions for globby 0.6 +// Type definitions for globby 6.1 // Project: https://github.com/sindresorhus/globby#readme // Definitions by: Douglas Duteil +// Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 import { IOptions } from 'glob'; +/** + * Returns a `Promise` of matching paths. + */ declare function globby(patterns: string | string[], options?: IOptions): Promise; declare namespace globby { - function sync(patterns: string | string[], options?: IOptions): string[]; - function generateGlobTasks(patterns: string | string[], options?: IOptions): Array<{pattern: string, options: IOptions}>; - function hasMagic(patterns: string | string[], options?: IOptions): boolean; + /** + * Returns an `Array` of matching paths. + */ + function sync(patterns: string | string[], options?: IOptions): string[]; + /** + * Returns an `Array` in the format `{ pattern: string, opts: Object }`, + * which can be passed as arguments to [node-glob](https://github.com/isaacs/node-glob). + * This is useful for other globbing-related packages. + * + * Note that you should avoid running the same tasks multiple times as they contain a file system cache. + * Instead, run this method each time to ensure file system changes are taken into consideration. + */ + function generateGlobTasks(patterns: string | string[], options?: IOptions): Array<{pattern: string, options: IOptions}>; + /** + * Returns a `boolean` of whether there are any special glob characters in the patterns. + * + * Note that the options affect the results. If `noext: true` is set, then `+(a|b)` will not be considered a magic pattern. + * If the pattern has a brace expansion, like `a/{b/c,x/y}`, then that is considered magical, unless `nobrace: true` is set. + */ + function hasMagic(patterns: string | string[], options?: IOptions): boolean; } export = globby; diff --git a/types/globby/tsconfig.json b/types/globby/tsconfig.json index fd75c832f1..23fd250a6a 100644 --- a/types/globby/tsconfig.json +++ b/types/globby/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "target": "es6", "lib": [ "es6" ],