From 67e320cf412dccaf6cadce74002f71c0c62e407f Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 14 Aug 2017 19:06:38 +0200 Subject: [PATCH] [has-ansi] add typings (#18923) --- types/has-ansi/has-ansi-tests.ts | 5 +++++ types/has-ansi/index.d.ts | 8 ++++++++ types/has-ansi/tsconfig.json | 22 ++++++++++++++++++++++ types/has-ansi/tslint.json | 1 + 4 files changed, 36 insertions(+) create mode 100644 types/has-ansi/has-ansi-tests.ts create mode 100644 types/has-ansi/index.d.ts create mode 100644 types/has-ansi/tsconfig.json create mode 100644 types/has-ansi/tslint.json diff --git a/types/has-ansi/has-ansi-tests.ts b/types/has-ansi/has-ansi-tests.ts new file mode 100644 index 0000000000..59099876cb --- /dev/null +++ b/types/has-ansi/has-ansi-tests.ts @@ -0,0 +1,5 @@ +import hasAnsi = require('has-ansi'); + +// $ExpectType boolean +hasAnsi('\u001B[4mUnicorn\u001B[0m'); +hasAnsi('cake'); diff --git a/types/has-ansi/index.d.ts b/types/has-ansi/index.d.ts new file mode 100644 index 0000000000..55b2b9c28f --- /dev/null +++ b/types/has-ansi/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for has-ansi 3.0 +// Project: https://github.com/chalk/has-ansi#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hasAnsi; + +declare function hasAnsi(input: string): boolean; diff --git a/types/has-ansi/tsconfig.json b/types/has-ansi/tsconfig.json new file mode 100644 index 0000000000..e4d14969af --- /dev/null +++ b/types/has-ansi/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "has-ansi-tests.ts" + ] +} diff --git a/types/has-ansi/tslint.json b/types/has-ansi/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/has-ansi/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }