mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add typings for the existing connect-datadog package (#29439)
This commit is contained in:
committed by
Wesley Wigham
parent
7f9b4c98a1
commit
8d3d0fab16
@@ -0,0 +1,16 @@
|
||||
import connectDD = require('connect-datadog');
|
||||
import dogstatsd = require('node-dogstatsd');
|
||||
|
||||
// works with no options
|
||||
const middleware = connectDD({});
|
||||
|
||||
// works with all options
|
||||
const middleware2 = connectDD({
|
||||
stat: 'foo',
|
||||
path: true,
|
||||
method: true,
|
||||
protocol: true,
|
||||
response_code: true,
|
||||
tags: ['abc', 'def'],
|
||||
dogstatsd: new dogstatsd.StatsD('localhost'),
|
||||
});
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for connect-datadog 0.0
|
||||
// Project: https://github.com/AppPress/node-connect-datadog
|
||||
// Definitions by: Moshe Good <https://github.com/moshegood>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import express = require('express');
|
||||
import dogstatsd = require('node-dogstatsd');
|
||||
|
||||
export = Factory;
|
||||
|
||||
declare function Factory(options?: Factory.Options): express.RequestHandler;
|
||||
|
||||
declare namespace Factory {
|
||||
interface Options {
|
||||
stat?: string;
|
||||
tags?: string[];
|
||||
path?: boolean;
|
||||
method?: boolean;
|
||||
protocol?: boolean;
|
||||
response_code?: boolean;
|
||||
dogstatsd?: dogstatsd.StatsD;
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"connect-datadog-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user