diff --git a/types/triple-beam/index.d.ts b/types/triple-beam/index.d.ts new file mode 100644 index 0000000000..3f6cdda734 --- /dev/null +++ b/types/triple-beam/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for triple-beam 1.3 +// Project: https://github.com/winstonjs/triple-beam +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace TripleBeam; + +export const LEVEL: string; +export const MESSAGE: string; +export const SPLAT: string; +export const configs: Configs; + +export interface Config { + readonly levels: {[k: string]: number}; + readonly colors: {[k: string]: string}; + } + +export interface Configs { + readonly cli: Config; + readonly npm: Config; + readonly syslog: Config; +} diff --git a/types/triple-beam/triple-beam-tests.ts b/types/triple-beam/triple-beam-tests.ts new file mode 100644 index 0000000000..de583abdde --- /dev/null +++ b/types/triple-beam/triple-beam-tests.ts @@ -0,0 +1,13 @@ +import tripleBeam = require('triple-beam'); + +const level: string = tripleBeam.LEVEL; +const message: string = tripleBeam.MESSAGE; +const splat: string = tripleBeam.SPLAT; +const configsObj: tripleBeam.Configs = tripleBeam.configs; + +const cli: tripleBeam.Config = configsObj.cli; +const npm: tripleBeam.Config = configsObj.npm; +const syslog: tripleBeam.Config = configsObj.syslog; + +const levels = cli.levels; +const colors = cli.colors; diff --git a/types/triple-beam/tsconfig.json b/types/triple-beam/tsconfig.json new file mode 100644 index 0000000000..9b58bd5007 --- /dev/null +++ b/types/triple-beam/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", + "triple-beam-tests.ts" + ] +} diff --git a/types/triple-beam/tslint.json b/types/triple-beam/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/triple-beam/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}