Skip to content

Commit 428ede4

Browse files
hh10kSimenB
authored andcommitted
Make index.d.ts work with noImplicitAny. Add some documentation while we're at it. (#22)
1 parent af563aa commit 428ede4

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

index.d.ts

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,44 @@
1-
// TODO: I don't know if it's possible to document default values...
1+
declare namespace AddAssetHtmlPlugin {
2+
interface Options {
3+
/**
4+
* The absolute path of the file you want to add to the compilation, and resulting HTML file.
5+
* Mandatory.
6+
*/
7+
filepath: string;
28

3-
interface PluginOptions {
4-
filepath: string;
5-
typeOfAsset?: string;
6-
includeSourcemap?: boolean;
7-
hash?: boolean;
8-
outputPath?: string;
9-
publicPath?: string;
10-
}
9+
/**
10+
* If true, will append a unique hash of the file to the filename. This is useful for cache busting.
11+
* Default false.
12+
*/
13+
hash?: boolean;
14+
15+
/**
16+
* If true, will add filepath + '.map' to the compilation as well.
17+
* Default true.
18+
*/
19+
includeSourcemap?: boolean;
20+
21+
/**
22+
* If set, will be used as the output directory of the file.
23+
*/
24+
outputPath?: string;
1125

12-
export class AddAssetHtmlPlugin {
13-
constructor(options: PluginOptions);
26+
/**
27+
* If set, will be used as the public path of the script or link tag.
28+
*/
29+
publicPath?: string;
1430

15-
apply(compiler): void;
31+
/**
32+
* Can be set to css to create a link-tag instead of a script-tag.
33+
* Default 'js'
34+
*/
35+
typeOfAsset?: string;
36+
}
1637
}
38+
39+
declare class AddAssetHtmlPlugin {
40+
constructor(options: AddAssetHtmlPlugin.Options);
41+
apply(compiler: any): void;
42+
}
43+
44+
export = AddAssetHtmlPlugin;

0 commit comments

Comments
 (0)