mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Update types for ansi-regex 4.0 (#31568)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
f680ffc4f0
commit
90df1ee381
@@ -9,5 +9,8 @@ ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean
|
||||
ansiRegex().test('cake'); // $ExpectType boolean
|
||||
// => false
|
||||
|
||||
ansiRegex({onlyFirst: true}).test('cake'); // $ExpectType boolean
|
||||
// => false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null
|
||||
// => ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
15
types/ansi-regex/index.d.ts
vendored
15
types/ansi-regex/index.d.ts
vendored
@@ -1,7 +1,16 @@
|
||||
// Type definitions for ansi-regex 3.0
|
||||
// Type definitions for ansi-regex 4.0
|
||||
// Project: https://github.com/chalk/ansi-regex#readme
|
||||
// Definitions by: Manish Vachharajani <https://github.com/mvachhar>
|
||||
// Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function r(): RegExp;
|
||||
export = r;
|
||||
declare namespace ansiRegex {
|
||||
interface Options {
|
||||
/** Match only the first ANSI escape. */
|
||||
onlyFirst?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
|
||||
|
||||
export = ansiRegex;
|
||||
|
||||
Reference in New Issue
Block a user