Skip to content

Commit

Permalink
Merge pull request #70 from nicojs/patch-1
Browse files Browse the repository at this point in the history
fix(types): allow for readonly arrays
  • Loading branch information
kaelzhang committed Dec 19, 2021
2 parents aeb459d + 64e9992 commit 7785ba8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions index.d.ts
Expand Up @@ -7,25 +7,20 @@ interface TestResult {

export interface Ignore {
/**
* Adds a rule rules to the current manager.
* @param {string | Ignore} pattern
* @returns IgnoreBase
*/
add(pattern: string | Ignore): this
/**
* Adds several rules to the current manager.
* Adds one or several rules to the current manager.
* @param {string[]} patterns
* @returns IgnoreBase
*/
add(patterns: (string | Ignore)[]): this
add(patterns: string | Ignore | readonly (string | Ignore)[]): this

/**
* Filters the given array of pathnames, and returns the filtered array.
* NOTICE that each path here should be a relative path to the root of your repository.
* @param paths the array of paths to be filtered.
* @returns The filtered array of paths
*/
filter(pathnames: Pathname[]): Pathname[]
filter(pathnames: readonly Pathname[]): Pathname[]

/**
* Creates a filter function which could filter
* an array of paths with Array.prototype.filter.
Expand Down

0 comments on commit 7785ba8

Please sign in to comment.