adds typings for the 'triple-beam' package.

This commit is contained in:
Daniel Byrne 2018-08-28 09:44:52 -07:00
parent c9489b79d3
commit e6c19da9e7
4 changed files with 61 additions and 0 deletions

22
types/triple-beam/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
// Type definitions for triple-beam 1.3
// Project: https://github.com/winstonjs/triple-beam
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// 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;
}

View File

@ -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;

View 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",
"triple-beam-tests.ts"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}