mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-19 16:49:45 +08:00
Add ansi-regex package
This commit is contained in:
13
types/ansi-regex/ansi-regex-tests.ts
Normal file
13
types/ansi-regex/ansi-regex-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import ansiRegex = require("ansi-regex");
|
||||
|
||||
ansiRegex(); // $ExpectType RegExp
|
||||
|
||||
// From the ansi-regex README.md
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean
|
||||
// => true
|
||||
|
||||
ansiRegex().test('cake'); // $ExpectType boolean
|
||||
// => false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null
|
||||
// => ['\u001B[4m', '\u001B[0m']
|
||||
7
types/ansi-regex/index.d.ts
vendored
Normal file
7
types/ansi-regex/index.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Type definitions for ansi-regex 3.0
|
||||
// Project: https://github.com/chalk/ansi-regex#readme
|
||||
// Definitions by: Manish Vachharajani <https://github.com/mvachhar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function r(): RegExp;
|
||||
export = r;
|
||||
23
types/ansi-regex/tsconfig.json
Normal file
23
types/ansi-regex/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ansi-regex-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/ansi-regex/tslint.json
Normal file
1
types/ansi-regex/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user