From 9d5535358fca3d705712f53da4fcd80f01600822 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Tue, 13 Mar 2018 19:59:23 +0545 Subject: [PATCH 1/9] Initial Commit for tlds types --- types/tlds/index.d.ts | 4 ++++ types/tlds/tlds-tests.ts | 4 ++++ types/tlds/tsconfig.json | 23 +++++++++++++++++++++++ types/tlds/tslint.json | 8 ++++++++ 4 files changed, 39 insertions(+) create mode 100644 types/tlds/index.d.ts create mode 100644 types/tlds/tlds-tests.ts create mode 100644 types/tlds/tsconfig.json create mode 100644 types/tlds/tslint.json diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts new file mode 100644 index 0000000000..615ce3f0eb --- /dev/null +++ b/types/tlds/index.d.ts @@ -0,0 +1,4 @@ +declare module "tlds" { + const c:Array; + export default c; +} diff --git a/types/tlds/tlds-tests.ts b/types/tlds/tlds-tests.ts new file mode 100644 index 0000000000..8ed622828d --- /dev/null +++ b/types/tlds/tlds-tests.ts @@ -0,0 +1,4 @@ +import * as tlds from 'tlds'; + +tlds; // all list of tlds +'[object Array]' == {}.toString.call(tlds); // tlds is an array \ No newline at end of file diff --git a/types/tlds/tsconfig.json b/types/tlds/tsconfig.json new file mode 100644 index 0000000000..fcb5c747c0 --- /dev/null +++ b/types/tlds/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tlds-tests.ts" + ] +} \ No newline at end of file diff --git a/types/tlds/tslint.json b/types/tlds/tslint.json new file mode 100644 index 0000000000..d335520e13 --- /dev/null +++ b/types/tlds/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false + } +} From 7847087c794c7e9b3ab7f65aad9432905770c87f Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Tue, 13 Mar 2018 20:47:19 +0545 Subject: [PATCH 2/9] Refactor type --- types/tlds/index.d.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index 615ce3f0eb..2d62ba5a27 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -1,4 +1 @@ -declare module "tlds" { - const c:Array; - export default c; -} +export declare const tlds: string[]; \ No newline at end of file From a1dd23a169bd7a6ff23b2bce356b944c8e9bb7b1 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Tue, 20 Mar 2018 20:47:08 +0545 Subject: [PATCH 3/9] Adding comments nad typescript version for passing Travis CI --- types/tlds/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index 2d62ba5a27..ccec15f9f8 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -1 +1,9 @@ +// Type definitions for tlds +// Project: https://github.com/stephenmathieson/node-tlds +// Definitions by: Ajay Gopal Shrestha +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +/* +Declaring const tlds and exporting it +*/ export declare const tlds: string[]; \ No newline at end of file From 8c83c926a268af5310e2da058514a6122989ee76 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Tue, 20 Mar 2018 20:58:54 +0545 Subject: [PATCH 4/9] Fixing Travis CI build error --- types/tlds/index.d.ts | 2 +- types/tlds/tlds-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index ccec15f9f8..14711a2d19 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for tlds +// Type definitions for tlds 1.199.0 // Project: https://github.com/stephenmathieson/node-tlds // Definitions by: Ajay Gopal Shrestha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/tlds/tlds-tests.ts b/types/tlds/tlds-tests.ts index 8ed622828d..5a0c452792 100644 --- a/types/tlds/tlds-tests.ts +++ b/types/tlds/tlds-tests.ts @@ -1,4 +1,4 @@ import * as tlds from 'tlds'; tlds; // all list of tlds -'[object Array]' == {}.toString.call(tlds); // tlds is an array \ No newline at end of file +'[object Array]' === {}.toString.call(tlds); // tlds is an array From 3467b281b3f7032ac596f464bfb69df95a000bd1 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Tue, 20 Mar 2018 21:07:45 +0545 Subject: [PATCH 5/9] Travis issue fixed --- types/tlds/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index 14711a2d19..4e567771d4 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for tlds 1.199.0 +// Type definitions for tlds 1.199 // Project: https://github.com/stephenmathieson/node-tlds // Definitions by: Ajay Gopal Shrestha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -/* +/* Declaring const tlds and exporting it */ -export declare const tlds: string[]; \ No newline at end of file +export const tlds: string[]; From e27b569929b4a7ba1dc4906275222d1ef26979bd Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Fri, 8 Jun 2018 10:16:42 +0545 Subject: [PATCH 6/9] Update tslint.json --- types/tlds/tslint.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/types/tlds/tslint.json b/types/tlds/tslint.json index d335520e13..f93cf8562a 100644 --- a/types/tlds/tslint.json +++ b/types/tlds/tslint.json @@ -1,8 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-empty-interface": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false - } + "extends": "dtslint/dt.json" } From db95351ce2c9a36aea1b6f9b12a2582bd94f6d23 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Fri, 8 Jun 2018 10:16:59 +0545 Subject: [PATCH 7/9] Update tsconfig.json --- types/tlds/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/tlds/tsconfig.json b/types/tlds/tsconfig.json index fcb5c747c0..4d7b86ad00 100644 --- a/types/tlds/tsconfig.json +++ b/types/tlds/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "tlds-tests.ts" ] -} \ No newline at end of file +} From e1366084111d035faa80f541e2f5a88ba771b1b1 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Wed, 20 Jun 2018 14:12:58 +0545 Subject: [PATCH 8/9] Update index.d.ts --- types/tlds/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index 4e567771d4..18743a2e3c 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -6,4 +6,5 @@ /* Declaring const tlds and exporting it */ -export const tlds: string[]; +declare const tlds: string[]; +export = tlds From 421f67199cb2aae2d735ed38779607f5d3433971 Mon Sep 17 00:00:00 2001 From: Ajay Shrestha Date: Wed, 20 Jun 2018 14:20:51 +0545 Subject: [PATCH 9/9] Update index.d.ts --- types/tlds/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts index 18743a2e3c..473fb16139 100644 --- a/types/tlds/index.d.ts +++ b/types/tlds/index.d.ts @@ -7,4 +7,4 @@ Declaring const tlds and exporting it */ declare const tlds: string[]; -export = tlds +export = tlds;