mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Adds type definitions for 'express-request-id' (#36411)
Adds type definitions and tests Adds tsconfig and tslint config
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import * as expressRequestId from 'express-request-id';
|
||||
|
||||
const options: expressRequestId.Options = {
|
||||
uuidVersion: 'v4',
|
||||
setHeader: false,
|
||||
headerName: 'X-Request-Id',
|
||||
attributeName: 'id',
|
||||
};
|
||||
|
||||
expressRequestId();
|
||||
expressRequestId({});
|
||||
expressRequestId(options);
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for express-request-id 1.4
|
||||
// Project: https://github.com/floatdrop/express-request-id
|
||||
// Definitions by: jgeth <https://github.com/jgeth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { RequestHandler } from 'express-serve-static-core';
|
||||
|
||||
declare namespace expressRequestId {
|
||||
interface Options {
|
||||
uuidVersion?: string;
|
||||
setHeader?: boolean;
|
||||
headerName?: string;
|
||||
attributeName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function expressRequestId(options?: expressRequestId.Options): RequestHandler;
|
||||
export = expressRequestId;
|
||||
@@ -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",
|
||||
"express-request-id-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user