Merge pull request #22294 from alepee/add-form-urlencoded

add types for form-urlencoded
This commit is contained in:
Arthur Ozga
2017-12-19 17:19:54 -08:00
committed by GitHub
4 changed files with 46 additions and 0 deletions
@@ -0,0 +1,10 @@
import encode, { FormEncodedOptions } from "form-urlencoded";
const opts: FormEncodedOptions = {
sorted: true,
skipIndex: false,
ignorenull: true
};
encode([1, 2, 3]);
encode([1, 2, 3], opts);
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for form-urlencoded 2.0
// Project: https://github.com/iambumblehead/form-urlencoded#readme
// Definitions by: Antoine Lépée <https://github.com/alepee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface FormEncodedOptions {
sorted?: boolean;
skipIndex?: boolean;
ignorenull?: boolean;
}
export default function(data: any, opts?: FormEncodedOptions): string;
+23
View 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",
"form-urlencoded-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }