-
Notifications
You must be signed in to change notification settings - Fork 31
/
typings.d.ts
74 lines (61 loc) · 2.08 KB
/
typings.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { Compiler } from 'webpack';
export = HtmlWebpackTagsPlugin;
declare class HtmlWebpackTagsPlugin {
constructor(options?: HtmlWebpackTagsPlugin.Options);
apply(compiler: Compiler): void;
}
declare namespace HtmlWebpackTagsPlugin {
type AddHashFunction = (assetPath: string, hash: string) => string;
type AddPublicPathFunction = (assetPath: string, publicPath: string) => string;
type TypeString = 'css' | 'js';
type AttributesObject = { [attributeName: string]: string | boolean | number };
interface CommonOptions {
append?: boolean;
useHash?: boolean;
addHash?: AddHashFunction
hash?: boolean | string | AddHashFunction;
usePublicPath?: boolean;
addPublicPath?: AddPublicPathFunction
publicPath?: boolean | string | AddPublicPathFunction;
}
interface Options extends CommonOptions {
append?: boolean;
prependExternals?: boolean;
jsExtensions?: string | string[];
cssExtensions?: string | string[];
files?: string | string[];
tags?: string | MaybeLinkTagOptions | MaybeScriptTagOptions | Array<string | MaybeLinkTagOptions | MaybeScriptTagOptions>;
links?: string | LinkTagOptions | Array<string | LinkTagOptions>;
scripts?: string | ScriptTagOptions | Array<string | ScriptTagOptions>;
metas?: string | MetaTagOptions | Array<string | MetaTagOptions>;
}
interface ExternalObject {
packageName: string;
variableName: string;
}
interface BaseTagOptions extends CommonOptions {
glob?: string;
globPath?: string;
globFlatten?: boolean;
sourcePath?: string;
}
interface LinkTagOptions extends BaseTagOptions {
path: string;
attributes?: AttributesObject;
}
interface ScriptTagOptions extends BaseTagOptions {
path: string;
attributes?: AttributesObject;
external?: ExternalObject
}
interface MaybeLinkTagOptions extends LinkTagOptions {
type?: TypeString;
}
interface MaybeScriptTagOptions extends ScriptTagOptions {
type?: TypeString;
}
interface MetaTagOptions extends BaseTagOptions {
path?: string;
attributes: AttributesObject;
}
}