blob: fab7d480ba14c1f52da6e8bde675d47347152613 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001interface Ignore {
2 /**
3 * Adds a rule rules to the current manager.
4 * @param {string | Ignore} pattern
5 * @returns IgnoreBase
6 */
7 add(pattern: string | Ignore): Ignore
8 /**
9 * Adds several rules to the current manager.
10 * @param {string[]} patterns
11 * @returns IgnoreBase
12 */
13 add(patterns: (string | Ignore)[]): Ignore
14
15 /**
16 * Filters the given array of pathnames, and returns the filtered array.
17 * NOTICE that each path here should be a relative path to the root of your repository.
18 * @param paths the array of paths to be filtered.
19 * @returns The filtered array of paths
20 */
21 filter(paths: string[]): string[]
22 /**
23 * Creates a filter function which could filter
24 * an array of paths with Array.prototype.filter.
25 */
26 createFilter(): (path: string) => boolean
27
28 /**
29 * Returns Boolean whether pathname should be ignored.
30 * @param {string} pathname a path to check
31 * @returns boolean
32 */
33 ignores(pathname: string): boolean
34}
35
36/**
37 * Creates new ignore manager.
38 */
39declare function ignore(): Ignore
40
41export default ignore