mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add typings for the existing connect-datadog package (#29439)
This commit is contained in:
parent
7f9b4c98a1
commit
8d3d0fab16
16
types/connect-datadog/connect-datadog-tests.ts
Normal file
16
types/connect-datadog/connect-datadog-tests.ts
Normal file
@ -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'),
|
||||
});
|
||||
24
types/connect-datadog/index.d.ts
vendored
Normal file
24
types/connect-datadog/index.d.ts
vendored
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
23
types/connect-datadog/tsconfig.json
Normal file
23
types/connect-datadog/tsconfig.json
Normal 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",
|
||||
"connect-datadog-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/connect-datadog/tslint.json
Normal file
1
types/connect-datadog/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user