UNPKG

2.39 kBTypeScriptView Raw
1// Type definitions for parse-glob 3.0.4
2// Project: https://github.com/jonschlinkert/parse-glob
3// Definitions by: glen-84 <https://github.com/glen-84>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6
7declare namespace parseGlob {
8 interface Result {
9 /**
10 * A copy of the original, unmodified glob pattern.
11 */
12 orig: string;
13 /**
14 * An object with boolean information about the glob.
15 */
16 is: {
17 /**
18 * True if the pattern actually is a glob pattern.
19 */
20 glob: boolean;
21 /**
22 * True if it's a negation pattern (!/foo.js).
23 */
24 negated: boolean;
25 /**
26 * True if it has extglobs (@(foo|bar)).
27 */
28 extglob: boolean;
29 /**
30 * True if it has braces ({1..2} or .{txt,md}).
31 */
32 braces: boolean;
33 /**
34 * True if it has POSIX brackets ([[:alpha:]]).
35 */
36 brackets: boolean;
37 /**
38 * True if the pattern has a globstar (double star, **).
39 */
40 globstar: boolean;
41 /**
42 * True if the pattern should match dotfiles.
43 */
44 dotfile: boolean;
45 /**
46 * True if the pattern should match dot-directories (like .git).
47 */
48 dotdir: boolean;
49 };
50 /**
51 * The glob pattern part of the string, if any.
52 */
53 glob: string;
54 /**
55 * The non-glob part of the string, if any.
56 */
57 base: string;
58 /**
59 * File path segments.
60 */
61 path: {
62 /**
63 * Directory.
64 */
65 dirname: string;
66 /**
67 * File name with extension.
68 */
69 basename: string;
70 /**
71 * File name without extension.
72 */
73 filename: string;
74 /**
75 * File extension with dot.
76 */
77 extname: string;
78 /**
79 * File extension without dot.
80 */
81 ext: string;
82 };
83 }
84}
85
86interface ParseGlob {
87 (glob: string): parseGlob.Result;
88}
89
90declare const parseGlob: ParseGlob;
91export = parseGlob;