diff --git a/types/tlds/index.d.ts b/types/tlds/index.d.ts new file mode 100644 index 0000000000..473fb16139 --- /dev/null +++ b/types/tlds/index.d.ts @@ -0,0 +1,10 @@ +// 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 +*/ +declare const tlds: string[]; +export = tlds; diff --git a/types/tlds/tlds-tests.ts b/types/tlds/tlds-tests.ts new file mode 100644 index 0000000000..5a0c452792 --- /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 diff --git a/types/tlds/tsconfig.json b/types/tlds/tsconfig.json new file mode 100644 index 0000000000..4d7b86ad00 --- /dev/null +++ b/types/tlds/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tlds-tests.ts" + ] +} diff --git a/types/tlds/tslint.json b/types/tlds/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/tlds/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}