Add typings for @newrelic/winston-enricher (#41134)

* Add typings for @newrelic/winston-enricher

* Fix typo

* fixes

* more

* :partyparrot:

* simplify dependencies
This commit is contained in:
Walter Rumsby
2019-12-26 16:19:18 -06:00
committed by Andrew Branch
parent 3c9d910f4d
commit d013dfe912
5 changed files with 59 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for @newrelic/winston-enricher 0.1
// Project: https://github.com/newrelic/newrelic-winston-logenricher-node
// Definitions by: wrumsby <https://github.com/wrumsby>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { Format } from 'logform';
declare function newrelicFormatter(): Format;
export = newrelicFormatter;
@@ -0,0 +1,13 @@
import newrelicFormatter = require('@newrelic/winston-enricher');
import winston = require('winston');
const logger = winston.createLogger({
level: 'info',
transports: new winston.transports.Console(),
format: winston.format.combine(
winston.format.label({label: 'test'}),
newrelicFormatter()
)
});
logger.debug('test');
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"winston": "^3.0.0"
}
}
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@newrelic/winston-enricher": [
"newrelic__winston-enricher"
]
}
},
"files": [
"index.d.ts",
"newrelic__winston-enricher-tests.ts"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }