-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
170 lines (153 loc) · 3.61 KB
/
index.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import * as HTMLMinifier from 'html-minifier';
import type { Plugin } from 'rollup';
interface HTMLOptions {
attributes?: {
/**
* Link Attribute inject into <head>
*
* @example
* <link rel="stylesheet" href="/style.css">
*
* @default null
*/
link?: object;
/**
* HTML Tag Attributes
*
* @example
* <html lang="en">
*
* @default { lang: 'end'}
*/
html?: object;
};
/**
* Minify the generated HTML file.
* If set to false, will use default htmlmin options,
* otherwise pass the htmlmin options
*
* @default true
*/
minify?: boolean | HTMLMinifier.Options;
/**
* File name to generate
*
* @default 'index.html'
*/
fileName?: string;
/**
* List of addition stylesheets to be applied
*/
styles?: {
/**
* The href URL of the stylesheet
*/
fileName: string;
/**
* Should the styles be placed before or after
*
* @default 'before'
*/
place?: 'before' | 'after';
}[];
/**
* SVG Sprite
*
*/
sprite?: {
/**
* Input Directory where `.svg` files are contained
*
* @default null
*/
input?: string;
/**
* Options passed to SVG Store
*
* @see https://github.com/svgstore/svgstore#svgstore-options
*/
options?: {
/**
* Remove `style` attributes from SVG definitions,
* or a list of attributes to remove.
*
* @default false
*/
cleanDefs?: boolean | string[];
/**
* Remove `style` attributes from SVG objects,
* or a list of attributes to remove.
*
* @default false
*/
cleanSymbols?: boolean | string[];
/**
* Outputs sprite as a string of XML.
*
* @default true
*/
inline?: boolean;
/**
* A map of attributes to set on the root `<svg>` element.
* If you set an attribute's value to null, you remove that attribute.
*
* @default false
*/
svgAttrs?: boolean | object;
/**
* A map of attributes to set on each <symbol> element.
* If you set an attribute's value to null, you remove that attribute.
*
* @default false
*/
symbolAttrs?: boolean | object;
/**
* Attributes to have svgstore attempt to copy to the newly
* created `<symbol>` tag from it's source `<svg>` tag.
* The viewBox, aria-labelledby, and role attributes are always copied.
*
* @default boolean
*/
copyAttrs?: boolean | string[];
/**
* Rename defs content ids to make them inherit files' names
* so that it would help to avoid defs with same ids in the output file.
*
* @default false
*/
renameDefs?: boolean;
};
};
/**
* List of single depth HTML element node to append to `<body>`.
* You can only add single tags as its an object value.
*/
nodes?: {
/**
* Property value should be the tag name, example: `div` or `main`
*/
[tagName: string]: { [attributeName: string]: string };
};
innerHTML?: string;
/**
* List of `<link>` to be appended to `<head>` element
*/
links?: object[];
/**
* List of Meta Tags to be appended to `<head>` element
*/
meta?: object[];
/**
* Public path to be preprended to src urls
*/
publicPath?: string;
/**
* Page Title
*/
title?: string;
}
/**
* Rollup plugin to take a list of globs, copy, transform, rename or repath
* and optionally watch for changes, syncing those over.
*/
export default function html(options: HTMLOptions): Plugin;