mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-09 17:11:10 +08:00
Merge pull request #19302 from nick121212/url-search-params
add defined for url-search-params
This commit is contained in:
19
types/url-search-params/index.d.ts
vendored
Normal file
19
types/url-search-params/index.d.ts
vendored
Normal 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;
|
||||
25
types/url-search-params/tsconfig.json
Normal file
25
types/url-search-params/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/url-search-params/tslint.json
Normal file
1
types/url-search-params/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
15
types/url-search-params/url-search-params-tests.ts
Normal file
15
types/url-search-params/url-search-params-tests.ts
Normal 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();
|
||||
Reference in New Issue
Block a user