Skip to content

Commit

Permalink
fix: add TS declarations (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianoMagrini committed Jul 14, 2020
1 parent 0177e45 commit c3c22f8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
36 changes: 36 additions & 0 deletions index.d.ts
@@ -0,0 +1,36 @@
declare module 'extract-css-chunks-webpack-plugin' {
import { ChunkData, Loader, Plugin } from 'webpack';

class ExtractCssChunksPlugin extends Plugin {
static loader: Loader;

constructor(options?: ExtractCssChunksPlugin.PluginOptions);
}

namespace ExtractCssChunksPlugin {
interface PluginOptions {
/**
* The filename of the entry chunk.
*/
filename?: string;
/**
* The filename of non-entry chunks.
*/
chunkFilename?: string;
/**
* Generates a file name (or template) based on chunk data.
*/
moduleFilename?: (chunk: ChunkData) => string;
/**
* Remove warnings about conflicting order.
*/
ignoreOrder?: boolean;
/**
* Inserts `<link>` at the given position (https://github.com/faceyspacey/extract-css-chunks-webpack-pluginn#insert).
*/
insert?: string | Function;
}
}

export = ExtractCssChunksPlugin;
}
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -31,6 +31,7 @@
"extract-css-chunks-webpack-plugin"
],
"main": "dist/cjs.js",
"types": "index.d.ts",
"engines": {
"node": ">= 6.9.0"
},
Expand Down Expand Up @@ -59,7 +60,8 @@
"travis": "npm run ci:coverage"
},
"files": [
"dist"
"dist",
"index.d.ts"
],
"peerDependencies": {
"webpack": "^4.4.0 || ^5.0.0"
Expand Down

0 comments on commit c3c22f8

Please sign in to comment.