From 9c7693a30befcfb9e3fdfd26eeb1810a7f39e200 Mon Sep 17 00:00:00 2001 From: Anders Westy Larsen Date: Tue, 4 Dec 2018 10:15:30 +0100 Subject: [PATCH] New: Added types to npm package --- .npmignore | 11 +++++++++++ package.json | 3 ++- src/request-helper.ts | 1 + src/trustpilot-api.ts | 2 ++ tsconfig.json | 3 ++- 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..b43d5bc --- /dev/null +++ b/.npmignore @@ -0,0 +1,11 @@ +spec +src +.commitlintrc +.editorconfig +.eslintrc +.gitignore +.nvmrc +.releaserc +.travis.yml +tsconfig.* +tslint.json \ No newline at end of file diff --git a/package.json b/package.json index a7de1e2..d94d210 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,11 @@ "review" ], "main": "./dist/trustpilot-api.js", + "types": "./dist/trustpilot-api.d.ts", "scripts": { "tsc": "tsc -p tsconfig.build.json", "test": "mocha --compilers ts:ts-node/register ./spec/*.spec.ts", - "lint": "tslint -c tslint.json --fix -e node_modules/** **/*.ts", + "lint": "tslint -c tslint.json --fix -e node_modules/** -e **/*.d.ts **/*.ts", "build": "npm run tsc && npm run test && npm run lint", "start": "node dist/client.js" }, diff --git a/src/request-helper.ts b/src/request-helper.ts index 327f3c1..2f83722 100644 --- a/src/request-helper.ts +++ b/src/request-helper.ts @@ -1,3 +1,4 @@ +import { RequestAPI, UriOptions, UrlOptions } from 'request'; import * as rp from 'request-promise-native'; import { AccessProvider } from './access-provider'; diff --git a/src/trustpilot-api.ts b/src/trustpilot-api.ts index 1a7d5b0..926325c 100644 --- a/src/trustpilot-api.ts +++ b/src/trustpilot-api.ts @@ -1,3 +1,5 @@ +import { RequestAPI, UriOptions, UrlOptions } from 'request'; +import { RequestPromise, RequestPromiseOptions } from 'request-promise-native'; import { AccessProvider } from './access-provider'; import { ITrustpilotApiConfig } from './models'; import { RequestHelper } from './request-helper'; diff --git a/tsconfig.json b/tsconfig.json index eeeae72..4271aba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,8 @@ "removeComments": true, "sourceMap": true, "skipLibCheck": true, - "inlineSources": true + "inlineSources": true, + "declaration": true, }, "exclude": [ "node_modules"