[qs-middleware] Add initial types

This commit is contained in:
Dave Cardwell
2019-01-25 20:38:27 -05:00
parent 89592f7ec3
commit 0b1cc5b516
4 changed files with 54 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for qs-middleware 1.0
// Project: https://github.com/springernature/qs-middleware
// Definitions by: Dave Cardwell <https://github.com/davecardwell>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import express = require("express");
import qs = require("qs");
declare function qsMiddleware(
options?: qs.IParseOptions
): express.RequestHandler;
export = qsMiddleware;
@@ -0,0 +1,23 @@
import express = require("express");
import query = require("qs-middleware");
const app = express();
app.use(query());
app.use(query({}));
app.use(
query({
delimiter: "string",
depth: 123,
decoder: str => str.toLowerCase(),
arrayLimit: 123,
parseArrays: true,
allowDots: true,
plainObjects: true,
allowPrototypes: true,
parameterLimit: 123,
strictNullHandling: true,
ignoreQueryPrefix: true
})
);
app.use(query({ delimiter: /regexp/ }));
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "qs-middleware-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }