source: trip-planner-front/node_modules/ignore/index.d.ts@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[6a3a178]1type Pathname = string
2
3interface TestResult {
4 ignored: boolean
5 unignored: boolean
6}
7
8export interface Ignore {
9 /**
10 * Adds a rule rules to the current manager.
11 * @param {string | Ignore} pattern
12 * @returns IgnoreBase
13 */
14 add(pattern: string | Ignore): this
15 /**
16 * Adds several rules to the current manager.
17 * @param {string[]} patterns
18 * @returns IgnoreBase
19 */
20 add(patterns: (string | Ignore)[]): this
21
22 /**
23 * Filters the given array of pathnames, and returns the filtered array.
24 * NOTICE that each path here should be a relative path to the root of your repository.
25 * @param paths the array of paths to be filtered.
26 * @returns The filtered array of paths
27 */
28 filter(pathnames: Pathname[]): Pathname[]
29 /**
30 * Creates a filter function which could filter
31 * an array of paths with Array.prototype.filter.
32 */
33 createFilter(): (pathname: Pathname) => boolean
34
35 /**
36 * Returns Boolean whether pathname should be ignored.
37 * @param {string} pathname a path to check
38 * @returns boolean
39 */
40 ignores(pathname: Pathname): boolean
41
42 /**
43 * Returns whether pathname should be ignored or unignored
44 * @param {string} pathname a path to check
45 * @returns TestResult
46 */
47 test(pathname: Pathname): TestResult
48}
49
50interface Options {
51 ignorecase?: boolean
52}
53
54/**
55 * Creates new ignore manager.
56 */
57declare function ignore(options?: Options): Ignore
58
59declare namespace ignore {
60 export function isPathValid (pathname: string): boolean
61}
62
63export default ignore
Note: See TracBrowser for help on using the repository browser.