From e7c97142be9ca8e8af1a014a367a44430ade7ee6 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Apr 2018 15:30:16 -0700 Subject: [PATCH] Add 'travis-fold' (#25305) --- types/travis-fold/index.d.ts | 11 +++++++++++ types/travis-fold/travis-fold-tests.ts | 12 ++++++++++++ types/travis-fold/tsconfig.json | 23 +++++++++++++++++++++++ types/travis-fold/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/travis-fold/index.d.ts create mode 100644 types/travis-fold/travis-fold-tests.ts create mode 100644 types/travis-fold/tsconfig.json create mode 100644 types/travis-fold/tslint.json diff --git a/types/travis-fold/index.d.ts b/types/travis-fold/index.d.ts new file mode 100644 index 0000000000..710024ab97 --- /dev/null +++ b/types/travis-fold/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for travis-fold 0.1 +// Project: https://github.com/macbre/travis-fold +// Definitions by: Andy Hanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function start(group: string): string; +export function end(group: string): string; +export function wrap(group: string, content: string): string; +export function pushStart(ret: string[], group: string): void; +export function pushEnd(ret: string[], group: string): void; +export function isTravis(): boolean; diff --git a/types/travis-fold/travis-fold-tests.ts b/types/travis-fold/travis-fold-tests.ts new file mode 100644 index 0000000000..a9d499c3fc --- /dev/null +++ b/types/travis-fold/travis-fold-tests.ts @@ -0,0 +1,12 @@ +import { end, isTravis, pushEnd, pushStart, start } from "travis-fold"; + +const out: string[] = []; +pushStart(out, 'fold'); +pushEnd(out, 'fold'); + +out.join('\n').trim(); // $ExpectType string + +if (isTravis()) { + start("s"); // $ExpectType string + end("e"); // $ExpectType string +} diff --git a/types/travis-fold/tsconfig.json b/types/travis-fold/tsconfig.json new file mode 100644 index 0000000000..9d50a3f5ac --- /dev/null +++ b/types/travis-fold/tsconfig.json @@ -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", + "travis-fold-tests.ts" + ] +} \ No newline at end of file diff --git a/types/travis-fold/tslint.json b/types/travis-fold/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/travis-fold/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }