Merge pull request #19302 from nick121212/url-search-params

add defined for url-search-params
This commit is contained in:
Bowden Kelly
2017-08-24 17:25:54 -07:00
committed by GitHub
4 changed files with 60 additions and 0 deletions

19
types/url-search-params/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for url-search-params 0.10
// Project: https://github.com/WebReflection/url-search-params
// Definitions by: Nick <https://github.com/nick121212>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class URLSearchParams {
constructor(init?: string | URLSearchParams | any);
append(name: string, value: any): void;
delete(name: string): void;
entries(pointer: string): Iterator<string>;
get(name: string): string;
getAll(): string[];
has(name: string): boolean;
keys(): Iterator<string>;
set(name: string, value: any): void;
values(pointer: string): Iterator<string>;
}
export = URLSearchParams;

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"es6"
],
"target": "es6",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"url-search-params-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -0,0 +1,15 @@
import URLSearchParams = require("url-search-params");
const params = new URLSearchParams();
params.append("a", "1");
params.delete("a");
params.get("a");
params.has("a");
params.getAll();
params.toString();