mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Adding TypeScript support for "datadog-winston" (#37983)
* Added typings for datadog-winston * Updated comments * Fixing comments which will also kick the Git checks * Apparently I can't have a PATCH in my version. I thought this was supposed to be the version of the JS package my types target * Ahh I see now, it is the version of the JS package, just with PATCH omitted * Updated library to use CommonJS style imports * Formatting * Fixing to not use a declare module * Fixing whitespace * Fixed typo * Adding options into a namespace so it can be referenced by consumer
This commit is contained in:
parent
5bd5b2884f
commit
e70729bb83
12
types/datadog-winston/datadog-winston-tests.ts
Normal file
12
types/datadog-winston/datadog-winston-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import DatadogWinston = require("datadog-winston");
|
||||
|
||||
const options: DatadogWinston.DatadogTransportOptions = {
|
||||
apiKey: '<key>',
|
||||
ddsource: 'node.js',
|
||||
ddtags: 'key:value',
|
||||
hostname: 'hostname',
|
||||
level: 'error',
|
||||
service: 'service',
|
||||
};
|
||||
|
||||
const logger = new DatadogWinston(options);
|
||||
25
types/datadog-winston/index.d.ts
vendored
Normal file
25
types/datadog-winston/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for datadog-winston 1.0
|
||||
// Project: https://github.com/itsfadnis/datadog-winston
|
||||
// Definitions by: Matt Hintzke <https://github.com/mhintzke13>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
import * as Transport from "winston-transport";
|
||||
|
||||
declare namespace DatadogWinston {
|
||||
interface DatadogTransportOptions extends Transport.TransportStreamOptions {
|
||||
apiKey: string;
|
||||
hostname?: string;
|
||||
service?: string;
|
||||
ddsource?: string;
|
||||
ddtags?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class DatadogWinston extends Transport {
|
||||
constructor(options: DatadogWinston.DatadogTransportOptions);
|
||||
|
||||
log?(info: any, next: () => void): void;
|
||||
}
|
||||
|
||||
export = DatadogWinston;
|
||||
6
types/datadog-winston/package.json
Normal file
6
types/datadog-winston/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"winston-transport": "^4.3.0"
|
||||
}
|
||||
}
|
||||
23
types/datadog-winston/tsconfig.json
Normal file
23
types/datadog-winston/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"datadog-winston-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/datadog-winston/tslint.json
Normal file
1
types/datadog-winston/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user