diff --git a/types/url-search-params/index.d.ts b/types/url-search-params/index.d.ts new file mode 100644 index 0000000000..144c7ba48b --- /dev/null +++ b/types/url-search-params/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for url-search-params 0.10 +// Project: https://github.com/WebReflection/url-search-params +// Definitions by: Nick +// 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; + get(name: string): string; + getAll(): string[]; + has(name: string): boolean; + keys(): Iterator; + set(name: string, value: any): void; + values(pointer: string): Iterator; +} + +export = URLSearchParams; diff --git a/types/url-search-params/tsconfig.json b/types/url-search-params/tsconfig.json new file mode 100644 index 0000000000..1484d6d7cf --- /dev/null +++ b/types/url-search-params/tsconfig.json @@ -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" + ] +} diff --git a/types/url-search-params/tslint.json b/types/url-search-params/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/url-search-params/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/url-search-params/url-search-params-tests.ts b/types/url-search-params/url-search-params-tests.ts new file mode 100644 index 0000000000..1f2c7a0644 --- /dev/null +++ b/types/url-search-params/url-search-params-tests.ts @@ -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();