Skip to content

Commit

Permalink
Minor TypeScript definition improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 21, 2019
1 parent 82db101 commit c737820
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declare namespace globby {
type ExpandDirectoriesOption =
| boolean
| ReadonlyArray<string>
| {files: ReadonlyArray<string>; extensions: ReadonlyArray<string>};
| {files: readonly string[]; extensions: readonly string[]};

interface GlobbyOptions extends FastGlobOptions {
/**
Expand Down Expand Up @@ -48,7 +48,7 @@ declare namespace globby {

interface GitignoreOptions {
readonly cwd?: string;
readonly ignore?: ReadonlyArray<string>;
readonly ignore?: readonly string[];
}

type FilterFunction = (path: string) => boolean;
Expand All @@ -58,7 +58,7 @@ interface Gitignore {
/**
`.gitignore` files matched by the ignore config are not used for the resulting filter function.
@returns A `Promise` for a filter function indicating whether a given path is ignored via a `.gitignore` file.
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
@example
```
Expand All @@ -82,7 +82,7 @@ declare const globby: {
/**
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns A `Promise<Array>` of matching paths.
@returns The matching paths.
@example
```
Expand All @@ -97,17 +97,17 @@ declare const globby: {
```
*/
(
patterns: string | ReadonlyArray<string>,
patterns: string | readonly string[],
options?: globby.GlobbyOptions
): Promise<string[]>;

/**
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns An `Array` of matching paths.
@returns The matching paths.
*/
sync(
patterns: string | ReadonlyArray<string>,
patterns: string | readonly string[],
options?: globby.GlobbyOptions
): string[];

Expand All @@ -116,10 +116,10 @@ declare const globby: {
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns An `Array<Object>` in the format `{ pattern: string, options: Object }`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
@returns Object in the format `{ pattern: string, options: Object }`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
*/
generateGlobTasks(
patterns: string | ReadonlyArray<string>,
patterns: string | readonly string[],
options?: globby.GlobbyOptions
): globby.GlobTask[];

Expand All @@ -130,10 +130,10 @@ declare const globby: {
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param options - See the [`node-glob` options](https://github.com/isaacs/node-glob#globhasmagicpattern-options).
@returns A boolean of whether there are any special glob characters in the `patterns`.
@returns Whether there are any special glob characters in the `patterns`.
*/
hasMagic(
patterns: string | ReadonlyArray<string>,
patterns: string | readonly string[],
options?: NodeGlobOptions
): boolean;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"globby": "sindresorhus/globby#master",
"matcha": "^0.7.0",
"rimraf": "^2.6.3",
"tsd": "^0.7.1",
"tsd": "^0.7.3",
"xo": "^0.24.0"
},
"xo": {
Expand Down

0 comments on commit c737820

Please sign in to comment.