@@ -17,66 +17,65 @@ interface PatternParams {
17
17
mark ?: string
18
18
}
19
19
20
- export interface Ignore {
21
- /**
22
- * Adds one or several rules to the current manager.
23
- * @param {string[] } patterns
24
- * @returns IgnoreBase
25
- */
26
- add (
27
- patterns : string | Ignore | readonly ( string | Ignore ) [ ] | PatternParams
28
- ) : this
29
-
30
- /**
31
- * Filters the given array of pathnames, and returns the filtered array.
32
- * NOTICE that each path here should be a relative path to the root of your repository.
33
- * @param paths the array of paths to be filtered.
34
- * @returns The filtered array of paths
35
- */
36
- filter ( pathnames : readonly Pathname [ ] ) : Pathname [ ]
20
+ /**
21
+ * Creates new ignore manager.
22
+ */
23
+ declare function ignore ( options ?: ignore . Options ) : ignore . Ignore
24
+ declare namespace ignore {
25
+ interface Ignore {
26
+ /**
27
+ * Adds one or several rules to the current manager.
28
+ * @param {string[] } patterns
29
+ * @returns IgnoreBase
30
+ */
31
+ add (
32
+ patterns : string | Ignore | readonly ( string | Ignore ) [ ] | PatternParams
33
+ ) : this
37
34
38
- /**
39
- * Creates a filter function which could filter
40
- * an array of paths with Array.prototype.filter.
41
- */
42
- createFilter ( ) : ( pathname : Pathname ) => boolean
35
+ /**
36
+ * Filters the given array of pathnames, and returns the filtered array.
37
+ * NOTICE that each path here should be a relative path to the root of your repository.
38
+ * @param paths the array of paths to be filtered.
39
+ * @returns The filtered array of paths
40
+ */
41
+ filter ( pathnames : readonly Pathname [ ] ) : Pathname [ ]
43
42
44
- /**
45
- * Returns Boolean whether pathname should be ignored.
46
- * @param {string } pathname a path to check
47
- * @returns boolean
48
- */
49
- ignores ( pathname : Pathname ) : boolean
43
+ /**
44
+ * Creates a filter function which could filter
45
+ * an array of paths with Array.prototype.filter.
46
+ */
47
+ createFilter ( ) : ( pathname : Pathname ) => boolean
50
48
51
- /**
52
- * Returns whether pathname should be ignored or unignored
53
- * @param {string } pathname a path to check
54
- * @returns TestResult
55
- */
56
- test ( pathname : Pathname ) : TestResult
49
+ /**
50
+ * Returns Boolean whether pathname should be ignored.
51
+ * @param {string } pathname a path to check
52
+ * @returns boolean
53
+ */
54
+ ignores ( pathname : Pathname ) : boolean
57
55
58
- /**
59
- * Debugs ignore rules and returns the checking result, which is
60
- * equivalent to `git check-ignore -v`.
61
- * @returns TestResult
62
- */
63
- checkIgnore ( pathname : Pathname ) : TestResult
64
- }
56
+ /**
57
+ * Returns whether pathname should be ignored or unignored
58
+ * @param {string } pathname a path to check
59
+ * @returns TestResult
60
+ */
61
+ test ( pathname : Pathname ) : TestResult
65
62
66
- export interface Options {
67
- ignorecase ?: boolean
68
- // For compatibility
69
- ignoreCase ?: boolean
70
- allowRelativePaths ?: boolean
71
- }
63
+ /**
64
+ * Debugs ignore rules and returns the checking result, which is
65
+ * equivalent to `git check-ignore -v`.
66
+ * @returns TestResult
67
+ */
68
+ checkIgnore ( pathname : Pathname ) : TestResult
69
+ }
72
70
73
- /**
74
- * Creates new ignore manager.
75
- */
76
- declare function ignore ( options ?: Options ) : Ignore
77
- declare function isPathValid ( pathname : string ) : boolean
71
+ interface Options {
72
+ ignorecase ?: boolean
73
+ // For compatibility
74
+ ignoreCase ?: boolean
75
+ allowRelativePaths ?: boolean
76
+ }
78
77
79
- export default ignore
80
- export {
81
- isPathValid
78
+ function isPathValid ( pathname : string ) : boolean
82
79
}
80
+
81
+ export = ignore
0 commit comments