From c68d7a109377d19d6a39d2bf6604ca96e2e7f2cd Mon Sep 17 00:00:00 2001 From: nick121212 Date: Thu, 24 Aug 2017 18:31:00 +0800 Subject: [PATCH 1/2] add defined for url-search-params --- .../.history/index.d_20170824113820.ts | 21 ++++++++++++++++ .../.history/index.d_20170824113824.ts | 19 ++++++++++++++ .../.history/index.d_20170824113950.ts | 19 ++++++++++++++ types/url-search-params/index.d.ts | 19 ++++++++++++++ types/url-search-params/tsconfig.json | 25 +++++++++++++++++++ types/url-search-params/tslint.json | 1 + .../url-search-params-tests.ts | 15 +++++++++++ 7 files changed, 119 insertions(+) create mode 100644 types/url-search-params/.history/index.d_20170824113820.ts create mode 100644 types/url-search-params/.history/index.d_20170824113824.ts create mode 100644 types/url-search-params/.history/index.d_20170824113950.ts create mode 100644 types/url-search-params/index.d.ts create mode 100644 types/url-search-params/tsconfig.json create mode 100644 types/url-search-params/tslint.json create mode 100644 types/url-search-params/url-search-params-tests.ts diff --git a/types/url-search-params/.history/index.d_20170824113820.ts b/types/url-search-params/.history/index.d_20170824113820.ts new file mode 100644 index 0000000000..a73f2ebe0d --- /dev/null +++ b/types/url-search-params/.history/index.d_20170824113820.ts @@ -0,0 +1,21 @@ +// 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; +} + +// declare const URLSearchParams: URLSearchParams; + +export = URLSearchParams; diff --git a/types/url-search-params/.history/index.d_20170824113824.ts b/types/url-search-params/.history/index.d_20170824113824.ts new file mode 100644 index 0000000000..144c7ba48b --- /dev/null +++ b/types/url-search-params/.history/index.d_20170824113824.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/.history/index.d_20170824113950.ts b/types/url-search-params/.history/index.d_20170824113950.ts new file mode 100644 index 0000000000..144c7ba48b --- /dev/null +++ b/types/url-search-params/.history/index.d_20170824113950.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/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(); From 7d78980f9ce372b3df6d091d4e6beb8a6f3c0a6b Mon Sep 17 00:00:00 2001 From: nick121212 Date: Thu, 24 Aug 2017 18:39:53 +0800 Subject: [PATCH 2/2] delete unused file --- .../.history/index.d_20170824113820.ts | 21 ------------------- .../.history/index.d_20170824113824.ts | 19 ----------------- .../.history/index.d_20170824113950.ts | 19 ----------------- 3 files changed, 59 deletions(-) delete mode 100644 types/url-search-params/.history/index.d_20170824113820.ts delete mode 100644 types/url-search-params/.history/index.d_20170824113824.ts delete mode 100644 types/url-search-params/.history/index.d_20170824113950.ts diff --git a/types/url-search-params/.history/index.d_20170824113820.ts b/types/url-search-params/.history/index.d_20170824113820.ts deleted file mode 100644 index a73f2ebe0d..0000000000 --- a/types/url-search-params/.history/index.d_20170824113820.ts +++ /dev/null @@ -1,21 +0,0 @@ -// 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; -} - -// declare const URLSearchParams: URLSearchParams; - -export = URLSearchParams; diff --git a/types/url-search-params/.history/index.d_20170824113824.ts b/types/url-search-params/.history/index.d_20170824113824.ts deleted file mode 100644 index 144c7ba48b..0000000000 --- a/types/url-search-params/.history/index.d_20170824113824.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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/.history/index.d_20170824113950.ts b/types/url-search-params/.history/index.d_20170824113950.ts deleted file mode 100644 index 144c7ba48b..0000000000 --- a/types/url-search-params/.history/index.d_20170824113950.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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;