Skip to content

Commit

Permalink
Merge pull request #12 from dogmatico/ts-definition
Browse files Browse the repository at this point in the history
Add Typescript definitions
  • Loading branch information
markis committed Jul 26, 2017
2 parents 7c1ae44 + 0bf3423 commit 0f532d2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Type definitions for webpack-chunk-hash 0.4.0
// Project: https://github.com/alexindigo/webpack-chunk-hash
// Definitions by: Cristian Lorenzo <https://github.com/dogmatico>

import { Plugin } from "webpack";

declare class WebpackChunkHash extends Plugin {
constructor(options?: WebpackChunkHash.WebpackChunkHashPluginOptions);
}

export = WebpackChunkHash;

declare namespace WebpackChunkHash {
interface WebpackChunkHashPluginOptions {
/**
* A callback to add more content to the resulting hash
*/
additionalHashContent?: (chunk: any) => string;
/**
* Which algorithm to use. Defaults to 'md5'.
* See https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm
*/
algorithm?: string;
/**
* Which digest to use. Defaults to 'hex'.
* See https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding
*/
digest?: "hex" | "latin1" | "base64";
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
],
"author": "Alex Indigo <iam@alexindigo.com>",
"license": "MIT",
"dependencies": {},
"dependencies": {
"@types/webpack": "^3.0.5"
},
"devDependencies": {
"argparse": "^1.0.4",
"jasmine-node": "^1.14.5",
Expand Down

0 comments on commit 0f532d2

Please sign in to comment.