|
1 |
| -import { IOptions as GlobOptions } from 'glob'; |
2 |
| -import { Stats } from 'fs'; |
| 1 | +import { Stats } from "fs"; |
| 2 | + |
| 3 | +interface IMinimatchOptions { |
| 4 | + /** |
| 5 | + * Dump a ton of stuff to stderr. |
| 6 | + * |
| 7 | + * @default false |
| 8 | + */ |
| 9 | + debug?: boolean | undefined; |
| 10 | + |
| 11 | + /** |
| 12 | + * Do not expand `{a,b}` and `{1..3}` brace sets. |
| 13 | + * |
| 14 | + * @default false |
| 15 | + */ |
| 16 | + nobrace?: boolean | undefined; |
| 17 | + |
| 18 | + /** |
| 19 | + * Disable `**` matching against multiple folder names. |
| 20 | + * |
| 21 | + * @default false |
| 22 | + */ |
| 23 | + noglobstar?: boolean | undefined; |
| 24 | + |
| 25 | + /** |
| 26 | + * Allow patterns to match filenames starting with a period, |
| 27 | + * even if the pattern does not explicitly have a period in that spot. |
| 28 | + * |
| 29 | + * Note that by default, `'a/**' + '/b'` will **not** match `a/.d/b`, unless `dot` is set. |
| 30 | + * |
| 31 | + * @default false |
| 32 | + */ |
| 33 | + dot?: boolean | undefined; |
| 34 | + |
| 35 | + /** |
| 36 | + * Disable "extglob" style patterns like `+(a|b)`. |
| 37 | + * |
| 38 | + * @default false |
| 39 | + */ |
| 40 | + noext?: boolean | undefined; |
| 41 | + |
| 42 | + /** |
| 43 | + * Perform a case-insensitive match. |
| 44 | + * |
| 45 | + * @default false |
| 46 | + */ |
| 47 | + nocase?: boolean | undefined; |
| 48 | + |
| 49 | + /** |
| 50 | + * When a match is not found by `minimatch.match`, |
| 51 | + * return a list containing the pattern itself if this option is set. |
| 52 | + * Otherwise, an empty list is returned if there are no matches. |
| 53 | + * |
| 54 | + * @default false |
| 55 | + */ |
| 56 | + nonull?: boolean | undefined; |
| 57 | + |
| 58 | + /** |
| 59 | + * If set, then patterns without slashes will be matched |
| 60 | + * against the basename of the path if it contains slashes. For example, |
| 61 | + * `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
| 62 | + * |
| 63 | + * @default false |
| 64 | + */ |
| 65 | + matchBase?: boolean | undefined; |
| 66 | + |
| 67 | + /** |
| 68 | + * Suppress the behavior of treating `#` at the start of a pattern as a comment. |
| 69 | + * |
| 70 | + * @default false |
| 71 | + */ |
| 72 | + nocomment?: boolean | undefined; |
| 73 | + |
| 74 | + /** |
| 75 | + * Suppress the behavior of treating a leading `!` character as negation. |
| 76 | + * |
| 77 | + * @default false |
| 78 | + */ |
| 79 | + nonegate?: boolean | undefined; |
| 80 | + |
| 81 | + /** |
| 82 | + * Returns from negate expressions the same as if they were not negated. |
| 83 | + * (Ie, true on a hit, false on a miss.) |
| 84 | + * |
| 85 | + * @default false |
| 86 | + */ |
| 87 | + flipNegate?: boolean | undefined; |
| 88 | + |
| 89 | + /** |
| 90 | + * Compare a partial path to a pattern. As long as the parts of the path that |
| 91 | + * are present are not contradicted by the pattern, it will be treated as a |
| 92 | + * match. This is useful in applications where you're walking through a |
| 93 | + * folder structure, and don't yet have the full path, but want to ensure that |
| 94 | + * you do not walk down paths that can never be a match. |
| 95 | + * |
| 96 | + * @default false |
| 97 | + * |
| 98 | + * @example |
| 99 | + * import minimatch = require("minimatch"); |
| 100 | + * |
| 101 | + * minimatch('/a/b', '/a/*' + '/c/d', { partial: true }) // true, might be /a/b/c/d |
| 102 | + * minimatch('/a/b', '/**' + '/d', { partial: true }) // true, might be /a/b/.../d |
| 103 | + * minimatch('/x/y/z', '/a/**' + '/z', { partial: true }) // false, because x !== a |
| 104 | + */ |
| 105 | + partial?: boolean; |
| 106 | + |
| 107 | + /** |
| 108 | + * Use `\\` as a path separator _only_, and _never_ as an escape |
| 109 | + * character. If set, all `\\` characters are replaced with `/` in |
| 110 | + * the pattern. Note that this makes it **impossible** to match |
| 111 | + * against paths containing literal glob pattern characters, but |
| 112 | + * allows matching with patterns constructed using `path.join()` and |
| 113 | + * `path.resolve()` on Windows platforms, mimicking the (buggy!) |
| 114 | + * behavior of earlier versions on Windows. Please use with |
| 115 | + * caution, and be mindful of the caveat about Windows paths |
| 116 | + * |
| 117 | + * For legacy reasons, this is also set if |
| 118 | + * `options.allowWindowsEscape` is set to the exact value `false`. |
| 119 | + * |
| 120 | + * @default false |
| 121 | + */ |
| 122 | + windowsPathsNoEscape?: boolean; |
| 123 | +} |
| 124 | + |
| 125 | +import fs = require("fs"); |
| 126 | +interface IGlobOptions extends IMinimatchOptions { |
| 127 | + cwd?: string | undefined; |
| 128 | + root?: string | undefined; |
| 129 | + dot?: boolean | undefined; |
| 130 | + nomount?: boolean | undefined; |
| 131 | + mark?: boolean | undefined; |
| 132 | + nosort?: boolean | undefined; |
| 133 | + stat?: boolean | undefined; |
| 134 | + silent?: boolean | undefined; |
| 135 | + strict?: boolean | undefined; |
| 136 | + cache?: |
| 137 | + | { [path: string]: boolean | "DIR" | "FILE" | ReadonlyArray<string> } |
| 138 | + | undefined; |
| 139 | + statCache?: |
| 140 | + | { [path: string]: false | { isDirectory(): boolean } | undefined } |
| 141 | + | undefined; |
| 142 | + symlinks?: { [path: string]: boolean | undefined } | undefined; |
| 143 | + realpathCache?: { [path: string]: string } | undefined; |
| 144 | + sync?: boolean | undefined; |
| 145 | + nounique?: boolean | undefined; |
| 146 | + nonull?: boolean | undefined; |
| 147 | + debug?: boolean | undefined; |
| 148 | + nobrace?: boolean | undefined; |
| 149 | + noglobstar?: boolean | undefined; |
| 150 | + noext?: boolean | undefined; |
| 151 | + nocase?: boolean | undefined; |
| 152 | + matchBase?: any; |
| 153 | + nodir?: boolean | undefined; |
| 154 | + ignore?: string | ReadonlyArray<string> | undefined; |
| 155 | + follow?: boolean | undefined; |
| 156 | + realpath?: boolean | undefined; |
| 157 | + nonegate?: boolean | undefined; |
| 158 | + nocomment?: boolean | undefined; |
| 159 | + absolute?: boolean | undefined; |
| 160 | + allowWindowsEscape?: boolean | undefined; |
| 161 | + fs?: typeof fs; |
| 162 | +} |
3 | 163 |
|
4 | 164 | export type CreateOptions = {
|
5 | 165 | dot?: boolean;
|
6 |
| - globOptions?: GlobOptions; |
| 166 | + globOptions?: IGlobOptions; |
7 | 167 | ordering?: string;
|
8 | 168 | pattern?: string;
|
9 | 169 | transform?: (filePath: string) => NodeJS.ReadWriteStream | void;
|
|
0 commit comments