From 98363f326128cff97a69783309aa317c6af4032b Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Sat, 4 Nov 2017 23:09:33 +0900 Subject: [PATCH] add fancy-log types --- types/fancy-log/fancy-log-tests.ts | 26 ++++++++++++++++++++++++++ types/fancy-log/index.d.ts | 17 +++++++++++++++++ types/fancy-log/tsconfig.json | 23 +++++++++++++++++++++++ types/fancy-log/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/fancy-log/fancy-log-tests.ts create mode 100644 types/fancy-log/index.d.ts create mode 100644 types/fancy-log/tsconfig.json create mode 100644 types/fancy-log/tslint.json diff --git a/types/fancy-log/fancy-log-tests.ts b/types/fancy-log/fancy-log-tests.ts new file mode 100644 index 0000000000..d0b762eecc --- /dev/null +++ b/types/fancy-log/fancy-log-tests.ts @@ -0,0 +1,26 @@ +import log = require('./'); + +log(); +log(1); +log('foo'); +log('foo', 'bar'); + +log.dir(); +log.dir(1); +log.dir('foo'); +log.dir('foo', 'bar'); + +log.error(); +log.error(1); +log.error('foo'); +log.error('foo', 'bar'); + +log.info(); +log.info(1); +log.info('foo'); +log.info('foo', 'bar'); + +log.warn(); +log.warn(1); +log.warn('foo'); +log.warn('foo', 'bar'); diff --git a/types/fancy-log/index.d.ts b/types/fancy-log/index.d.ts new file mode 100644 index 0000000000..2fbdb3f0d2 --- /dev/null +++ b/types/fancy-log/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for fancy-log 1.3 +// Project: https://github.com/js-cli/fancy-log +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace FancyLog { + interface Logger { + (...args: any[]): Logger; + dir(...args: any[]): Logger; + error(...args: any[]): Logger; + info(...args: any[]): Logger; + warn(...args: any[]): Logger; + } +} + +declare var logger: FancyLog.Logger; +export = logger; diff --git a/types/fancy-log/tsconfig.json b/types/fancy-log/tsconfig.json new file mode 100644 index 0000000000..0ef3d95d9e --- /dev/null +++ b/types/fancy-log/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", + "fancy-log-tests.ts" + ] +} diff --git a/types/fancy-log/tslint.json b/types/fancy-log/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fancy-log/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }