From d3684b19f4d96a0266f258e43136f3b933a7ce5a Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Fri, 8 Mar 2019 12:42:02 +0530 Subject: [PATCH] feat: add type definitions for get-res --- types/get-res/get-res-tests.ts | 3 +++ types/get-res/index.d.ts | 14 ++++++++++++++ types/get-res/tsconfig.json | 23 +++++++++++++++++++++++ types/get-res/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/get-res/get-res-tests.ts create mode 100644 types/get-res/index.d.ts create mode 100644 types/get-res/tsconfig.json create mode 100644 types/get-res/tslint.json diff --git a/types/get-res/get-res-tests.ts b/types/get-res/get-res-tests.ts new file mode 100644 index 0000000000..d767a6d054 --- /dev/null +++ b/types/get-res/get-res-tests.ts @@ -0,0 +1,3 @@ +import getRes = require('get-res'); + +getRes(); // $ExpectType Promise diff --git a/types/get-res/index.d.ts b/types/get-res/index.d.ts new file mode 100644 index 0000000000..36fb22d94c --- /dev/null +++ b/types/get-res/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for get-res 3.0 +// Project: https://github.com/kevva/get-res#readme +// Definitions by: Satya Rohith +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = getRes; + +/** + * Get ten most popular screen resolutions + * + * @returns An array with the details of ten most popular screen resolutions + */ +declare function getRes(): Promise; diff --git a/types/get-res/tsconfig.json b/types/get-res/tsconfig.json new file mode 100644 index 0000000000..aad9127e1b --- /dev/null +++ b/types/get-res/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", + "get-res-tests.ts" + ] +} diff --git a/types/get-res/tslint.json b/types/get-res/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-res/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }