Skip to content

Commit c737820

Browse files
committed
Minor TypeScript definition improvements
1 parent 82db101 commit c737820

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

index.d.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ declare namespace globby {
55
type ExpandDirectoriesOption =
66
| boolean
77
| ReadonlyArray<string>
8-
| {files: ReadonlyArray<string>; extensions: ReadonlyArray<string>};
8+
| {files: readonly string[]; extensions: readonly string[]};
99

1010
interface GlobbyOptions extends FastGlobOptions {
1111
/**
@@ -48,7 +48,7 @@ declare namespace globby {
4848

4949
interface GitignoreOptions {
5050
readonly cwd?: string;
51-
readonly ignore?: ReadonlyArray<string>;
51+
readonly ignore?: readonly string[];
5252
}
5353

5454
type FilterFunction = (path: string) => boolean;
@@ -58,7 +58,7 @@ interface Gitignore {
5858
/**
5959
`.gitignore` files matched by the ignore config are not used for the resulting filter function.
6060
61-
@returns A `Promise` for a filter function indicating whether a given path is ignored via a `.gitignore` file.
61+
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
6262
6363
@example
6464
```
@@ -82,7 +82,7 @@ declare const globby: {
8282
/**
8383
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
8484
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
85-
@returns A `Promise<Array>` of matching paths.
85+
@returns The matching paths.
8686
8787
@example
8888
```
@@ -97,17 +97,17 @@ declare const globby: {
9797
```
9898
*/
9999
(
100-
patterns: string | ReadonlyArray<string>,
100+
patterns: string | readonly string[],
101101
options?: globby.GlobbyOptions
102102
): Promise<string[]>;
103103

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

@@ -116,10 +116,10 @@ declare const globby: {
116116
117117
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
118118
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
119-
@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.
119+
@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.
120120
*/
121121
generateGlobTasks(
122-
patterns: string | ReadonlyArray<string>,
122+
patterns: string | readonly string[],
123123
options?: globby.GlobbyOptions
124124
): globby.GlobTask[];
125125

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"globby": "sindresorhus/globby#master",
7272
"matcha": "^0.7.0",
7373
"rimraf": "^2.6.3",
74-
"tsd": "^0.7.1",
74+
"tsd": "^0.7.3",
7575
"xo": "^0.24.0"
7676
},
7777
"xo": {

0 commit comments

Comments
 (0)