From 64e9992f39986b1daec8d54dcb9b90d3e6b4dd19 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Tue, 20 Apr 2021 11:40:14 +0200 Subject: [PATCH] fix(types): allow for readonly arrays Allow for `readonly` arrays in the type definitions. --- index.d.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index 66657af..73dea9d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,17 +7,11 @@ 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. @@ -25,7 +19,8 @@ export interface Ignore { * @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.