Skip to content

Commit

Permalink
Merge pull request #269 from FormidableLabs/feature/229-ts-defs
Browse files Browse the repository at this point in the history
Add TypeScript definitions.
  • Loading branch information
parkerziegler authored Jan 29, 2019
2 parents b74a583 + 408481f commit ed6f65e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist-*
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
!README.md
!package.json
!index.js
!index.d.ts
24 changes: 24 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Type definitions for webpack-dashboard 2.x.x
// Project: https://github.com/FormidableLabs/webpack-dashboard
// Definitions by: Parker Ziegler <https://github.com/parkerziegler>
// TypeScript Version: 3.2

declare module 'webpack-dashboard/plugin' {
interface IMessage {
type: string;
value: string | number | { [key: string]: any }
error?: boolean;
}

interface IDashboardOptions {
port?: number;
host?: string;
handler?: (dataArray: IMessage[]) => void;
}

class DashboardPlugin {
constructor(options?: IDashboardOptions);
}

export = DashboardPlugin;
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
"engines": {
"node": ">=6.0.0"
},
"types": "index.d.ts",
"scripts": {
"test": "mocha 'test/**/*.spec.js'",
"test-cov": "nyc mocha 'test/**/*.spec.js'",
"lint": "eslint .",
"check": "npm run lint && npm run test",
"check-ci": "npm run lint && npm run test-cov",
"check": "npm run lint && npm run test && npm run check-ts",
"check-ci": "npm run lint && npm run test-cov && npm run check-ts",
"check-ts": "tsc index.d.ts --noEmit",
"dev": "cross-env EXAMPLE=duplicates-esm node bin/webpack-dashboard.js -- webpack-cli --config examples/config/webpack.config.js --watch"
},
"repository": {
Expand Down Expand Up @@ -58,6 +60,7 @@
"nyc": "^11.8.0",
"sinon": "^5.0.7",
"sinon-chai": "^3.0.0",
"typescript": "^3.2.4",
"webpack": "^4.8.3",
"webpack-cli": "^2.1.3",
"webpack-stats-plugin": "^0.2.1"
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6163,6 +6163,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d"
integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==

uglify-es@^3.3.4:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
Expand Down

0 comments on commit ed6f65e

Please sign in to comment.