@htmlplus/element 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundlers.d.ts +5 -5
- package/dist/bundlers.js +4 -4
- package/dist/client.d.ts +51 -26
- package/dist/client.js +710 -633
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +2 -1
- package/dist/jsx-runtime.d.ts +183 -183
- package/dist/transformer.d.ts +45 -40
- package/dist/transformer.js +394 -278
- package/package.json +96 -92
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare const KEY = "htmlplus";
|
|
2
2
|
declare const PACKAGE_NAME = "@htmlplus/element";
|
|
3
3
|
declare const API_CONNECTED: unique symbol;
|
|
4
|
+
declare const API_DEFAULTS: unique symbol;
|
|
4
5
|
declare const API_HOST: unique symbol;
|
|
5
6
|
declare const API_REQUEST: unique symbol;
|
|
6
7
|
declare const API_RENDER_COMPLETED: unique symbol;
|
|
@@ -45,4 +46,4 @@ declare const UTILS_STYLES_IMPORTED = "styles";
|
|
|
45
46
|
declare const UTILS_STYLES_LOCAL = "UTILS_STYLES";
|
|
46
47
|
declare const UTILS_PATH = "@htmlplus/element/internal.js";
|
|
47
48
|
|
|
48
|
-
export { API_CONNECTED, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED, UTILS_ATTRIBUTES_IMPORTED, UTILS_ATTRIBUTES_LOCAL, UTILS_HTML_IMPORTED, UTILS_HTML_LOCAL, UTILS_PATH, UTILS_STYLES_IMPORTED, UTILS_STYLES_LOCAL };
|
|
49
|
+
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED, UTILS_ATTRIBUTES_IMPORTED, UTILS_ATTRIBUTES_LOCAL, UTILS_HTML_IMPORTED, UTILS_HTML_LOCAL, UTILS_PATH, UTILS_STYLES_IMPORTED, UTILS_STYLES_LOCAL };
|
package/dist/constants.js
CHANGED
|
@@ -2,6 +2,7 @@ const KEY = 'htmlplus';
|
|
|
2
2
|
const PACKAGE_NAME = '@htmlplus/element';
|
|
3
3
|
// APIs
|
|
4
4
|
const API_CONNECTED = Symbol();
|
|
5
|
+
const API_DEFAULTS = Symbol();
|
|
5
6
|
const API_HOST = Symbol();
|
|
6
7
|
const API_REQUEST = Symbol();
|
|
7
8
|
const API_RENDER_COMPLETED = Symbol();
|
|
@@ -56,4 +57,4 @@ const UTILS_STYLES_IMPORTED = 'styles';
|
|
|
56
57
|
const UTILS_STYLES_LOCAL = 'UTILS_STYLES';
|
|
57
58
|
const UTILS_PATH = '@htmlplus/element/internal.js';
|
|
58
59
|
|
|
59
|
-
export { API_CONNECTED, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED, UTILS_ATTRIBUTES_IMPORTED, UTILS_ATTRIBUTES_LOCAL, UTILS_HTML_IMPORTED, UTILS_HTML_LOCAL, UTILS_PATH, UTILS_STYLES_IMPORTED, UTILS_STYLES_LOCAL };
|
|
60
|
+
export { API_CONNECTED, API_DEFAULTS, API_HOST, API_RENDER_COMPLETED, API_REQUEST, API_STACKS, API_STYLE, COMMENT_AUTO_ADDED, DECORATOR_CSS_VARIABLE, DECORATOR_ELEMENT, DECORATOR_EVENT, DECORATOR_METHOD, DECORATOR_PROPERTY, DECORATOR_PROPERTY_TYPE, DECORATOR_STATE, ELEMENT_HOST_NAME, KEY, LIFECYCLE_ADOPTED, LIFECYCLE_CONNECTED, LIFECYCLE_CONSTRUCTED, LIFECYCLE_DISCONNECTED, LIFECYCLE_READY, LIFECYCLE_UPDATE, LIFECYCLE_UPDATED, METHOD_RENDER, PACKAGE_NAME, STATIC_STYLE, STATIC_TAG, STYLE_IMPORTED, TYPE_ARRAY, TYPE_BIGINT, TYPE_BOOLEAN, TYPE_DATE, TYPE_ENUM, TYPE_FUNCTION, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TYPE_UNDEFINED, UTILS_ATTRIBUTES_IMPORTED, UTILS_ATTRIBUTES_LOCAL, UTILS_HTML_IMPORTED, UTILS_HTML_LOCAL, UTILS_PATH, UTILS_STYLES_IMPORTED, UTILS_STYLES_LOCAL };
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,193 +1,193 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
|
|
3
3
|
type WithPart<K extends keyof React.JSX.IntrinsicElements> = React.JSX.IntrinsicElements[K] & {
|
|
4
|
-
|
|
4
|
+
part?: string;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
declare namespace JSX {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
host: WithPart<'div'> & { [key: string]: unknown };
|
|
10
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
|
-
|
|
11
|
+
a: WithPart<'a'>;
|
|
12
|
+
abbr: WithPart<'abbr'>;
|
|
13
|
+
address: WithPart<'address'>;
|
|
14
|
+
area: WithPart<'area'>;
|
|
15
|
+
article: WithPart<'article'>;
|
|
16
|
+
aside: WithPart<'aside'>;
|
|
17
|
+
audio: WithPart<'audio'>;
|
|
18
|
+
b: WithPart<'b'>;
|
|
19
|
+
base: WithPart<'base'>;
|
|
20
|
+
bdi: WithPart<'bdi'>;
|
|
21
|
+
bdo: WithPart<'bdo'>;
|
|
22
|
+
big: WithPart<'big'>;
|
|
23
|
+
blockquote: WithPart<'blockquote'>;
|
|
24
|
+
body: WithPart<'body'>;
|
|
25
|
+
br: WithPart<'br'>;
|
|
26
|
+
button: WithPart<'button'>;
|
|
27
|
+
canvas: WithPart<'canvas'>;
|
|
28
|
+
caption: WithPart<'caption'>;
|
|
29
|
+
center: WithPart<'center'>;
|
|
30
|
+
cite: WithPart<'cite'>;
|
|
31
|
+
code: WithPart<'code'>;
|
|
32
|
+
col: WithPart<'col'>;
|
|
33
|
+
colgroup: WithPart<'colgroup'>;
|
|
34
|
+
data: WithPart<'data'>;
|
|
35
|
+
datalist: WithPart<'datalist'>;
|
|
36
|
+
dd: WithPart<'dd'>;
|
|
37
|
+
del: WithPart<'del'>;
|
|
38
|
+
details: WithPart<'details'>;
|
|
39
|
+
dfn: WithPart<'dfn'>;
|
|
40
|
+
dialog: WithPart<'dialog'>;
|
|
41
|
+
div: WithPart<'div'>;
|
|
42
|
+
dl: WithPart<'dl'>;
|
|
43
|
+
dt: WithPart<'dt'>;
|
|
44
|
+
em: WithPart<'em'>;
|
|
45
|
+
embed: WithPart<'embed'>;
|
|
46
|
+
fieldset: WithPart<'fieldset'>;
|
|
47
|
+
figcaption: WithPart<'figcaption'>;
|
|
48
|
+
figure: WithPart<'figure'>;
|
|
49
|
+
footer: WithPart<'footer'>;
|
|
50
|
+
form: WithPart<'form'>;
|
|
51
|
+
h1: WithPart<'h1'>;
|
|
52
|
+
h2: WithPart<'h2'>;
|
|
53
|
+
h3: WithPart<'h3'>;
|
|
54
|
+
h4: WithPart<'h4'>;
|
|
55
|
+
h5: WithPart<'h5'>;
|
|
56
|
+
h6: WithPart<'h6'>;
|
|
57
|
+
head: WithPart<'head'>;
|
|
58
|
+
header: WithPart<'header'>;
|
|
59
|
+
hgroup: WithPart<'hgroup'>;
|
|
60
|
+
hr: WithPart<'hr'>;
|
|
61
|
+
html: WithPart<'html'>;
|
|
62
|
+
i: WithPart<'i'>;
|
|
63
|
+
iframe: WithPart<'iframe'>;
|
|
64
|
+
img: WithPart<'img'>;
|
|
65
|
+
input: WithPart<'input'>;
|
|
66
|
+
ins: WithPart<'ins'>;
|
|
67
|
+
kbd: WithPart<'kbd'>;
|
|
68
|
+
keygen: WithPart<'keygen'>;
|
|
69
|
+
label: WithPart<'label'>;
|
|
70
|
+
legend: WithPart<'legend'>;
|
|
71
|
+
li: WithPart<'li'>;
|
|
72
|
+
link: WithPart<'link'>;
|
|
73
|
+
main: WithPart<'main'>;
|
|
74
|
+
map: WithPart<'map'>;
|
|
75
|
+
mark: WithPart<'mark'>;
|
|
76
|
+
menu: WithPart<'menu'>;
|
|
77
|
+
menuitem: WithPart<'menuitem'>;
|
|
78
|
+
meta: WithPart<'meta'>;
|
|
79
|
+
meter: WithPart<'meter'>;
|
|
80
|
+
nav: WithPart<'nav'>;
|
|
81
|
+
noindex: WithPart<'noindex'>;
|
|
82
|
+
noscript: WithPart<'noscript'>;
|
|
83
|
+
object: WithPart<'object'>;
|
|
84
|
+
ol: WithPart<'ol'>;
|
|
85
|
+
optgroup: WithPart<'optgroup'>;
|
|
86
|
+
option: WithPart<'option'>;
|
|
87
|
+
output: WithPart<'output'>;
|
|
88
|
+
p: WithPart<'p'>;
|
|
89
|
+
param: WithPart<'param'>;
|
|
90
|
+
picture: WithPart<'picture'>;
|
|
91
|
+
pre: WithPart<'pre'>;
|
|
92
|
+
progress: WithPart<'progress'>;
|
|
93
|
+
q: WithPart<'q'>;
|
|
94
|
+
rp: WithPart<'rp'>;
|
|
95
|
+
rt: WithPart<'rt'>;
|
|
96
|
+
ruby: WithPart<'ruby'>;
|
|
97
|
+
s: WithPart<'s'>;
|
|
98
|
+
samp: WithPart<'samp'>;
|
|
99
|
+
search: WithPart<'search'>;
|
|
100
|
+
slot: WithPart<'slot'> & { onSlotChange?: (event: Event) => void };
|
|
101
|
+
script: WithPart<'script'>;
|
|
102
|
+
section: WithPart<'section'>;
|
|
103
|
+
select: WithPart<'select'>;
|
|
104
|
+
small: WithPart<'small'>;
|
|
105
|
+
source: WithPart<'source'>;
|
|
106
|
+
span: WithPart<'span'>;
|
|
107
|
+
strong: WithPart<'strong'>;
|
|
108
|
+
style: WithPart<'style'>;
|
|
109
|
+
sub: WithPart<'sub'>;
|
|
110
|
+
summary: WithPart<'summary'>;
|
|
111
|
+
sup: WithPart<'sup'>;
|
|
112
|
+
table: WithPart<'table'>;
|
|
113
|
+
template: WithPart<'template'>;
|
|
114
|
+
tbody: WithPart<'tbody'>;
|
|
115
|
+
td: WithPart<'td'>;
|
|
116
|
+
textarea: WithPart<'textarea'>;
|
|
117
|
+
tfoot: WithPart<'tfoot'>;
|
|
118
|
+
th: WithPart<'th'>;
|
|
119
|
+
thead: WithPart<'thead'>;
|
|
120
|
+
time: WithPart<'time'>;
|
|
121
|
+
title: WithPart<'title'>;
|
|
122
|
+
tr: WithPart<'tr'>;
|
|
123
|
+
track: WithPart<'track'>;
|
|
124
|
+
u: WithPart<'u'>;
|
|
125
|
+
ul: WithPart<'ul'>;
|
|
126
|
+
var: WithPart<'var'>;
|
|
127
|
+
video: WithPart<'video'>;
|
|
128
|
+
wbr: WithPart<'wbr'>;
|
|
129
|
+
webview: WithPart<'webview'>;
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
// SVG
|
|
132
|
+
svg: WithPart<'svg'>;
|
|
133
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
134
|
+
animate: WithPart<'animate'>;
|
|
135
|
+
animateMotion: WithPart<'animateMotion'>;
|
|
136
|
+
animateTransform: WithPart<'animateTransform'>;
|
|
137
|
+
circle: WithPart<'circle'>;
|
|
138
|
+
clipPath: WithPart<'clipPath'>;
|
|
139
|
+
defs: WithPart<'defs'>;
|
|
140
|
+
desc: WithPart<'desc'>;
|
|
141
|
+
ellipse: WithPart<'ellipse'>;
|
|
142
|
+
feBlend: WithPart<'feBlend'>;
|
|
143
|
+
feColorMatrix: WithPart<'feColorMatrix'>;
|
|
144
|
+
feComponentTransfer: WithPart<'feComponentTransfer'>;
|
|
145
|
+
feComposite: WithPart<'feComposite'>;
|
|
146
|
+
feConvolveMatrix: WithPart<'feConvolveMatrix'>;
|
|
147
|
+
feDiffuseLighting: WithPart<'feDiffuseLighting'>;
|
|
148
|
+
feDisplacementMap: WithPart<'feDisplacementMap'>;
|
|
149
|
+
feDistantLight: WithPart<'feDistantLight'>;
|
|
150
|
+
feDropShadow: WithPart<'feDropShadow'>;
|
|
151
|
+
feFlood: WithPart<'feFlood'>;
|
|
152
|
+
feFuncA: WithPart<'feFuncA'>;
|
|
153
|
+
feFuncB: WithPart<'feFuncB'>;
|
|
154
|
+
feFuncG: WithPart<'feFuncG'>;
|
|
155
|
+
feFuncR: WithPart<'feFuncR'>;
|
|
156
|
+
feGaussianBlur: WithPart<'feGaussianBlur'>;
|
|
157
|
+
feImage: WithPart<'feImage'>;
|
|
158
|
+
feMerge: WithPart<'feMerge'>;
|
|
159
|
+
feMergeNode: WithPart<'feMergeNode'>;
|
|
160
|
+
feMorphology: WithPart<'feMorphology'>;
|
|
161
|
+
feOffset: WithPart<'feOffset'>;
|
|
162
|
+
fePointLight: WithPart<'fePointLight'>;
|
|
163
|
+
feSpecularLighting: WithPart<'feSpecularLighting'>;
|
|
164
|
+
feSpotLight: WithPart<'feSpotLight'>;
|
|
165
|
+
feTile: WithPart<'feTile'>;
|
|
166
|
+
feTurbulence: WithPart<'feTurbulence'>;
|
|
167
|
+
filter: WithPart<'filter'>;
|
|
168
|
+
foreignObject: WithPart<'foreignObject'>;
|
|
169
|
+
g: WithPart<'g'>;
|
|
170
|
+
image: WithPart<'image'>;
|
|
171
|
+
line: WithPart<'line'>;
|
|
172
|
+
linearGradient: WithPart<'linearGradient'>;
|
|
173
|
+
marker: WithPart<'marker'>;
|
|
174
|
+
mask: WithPart<'mask'>;
|
|
175
|
+
metadata: WithPart<'metadata'>;
|
|
176
|
+
mpath: WithPart<'mpath'>;
|
|
177
|
+
path: WithPart<'path'>;
|
|
178
|
+
pattern: WithPart<'pattern'>;
|
|
179
|
+
polygon: WithPart<'polygon'>;
|
|
180
|
+
polyline: WithPart<'polyline'>;
|
|
181
|
+
radialGradient: WithPart<'radialGradient'>;
|
|
182
|
+
rect: WithPart<'rect'>;
|
|
183
|
+
set: WithPart<'set'>;
|
|
184
|
+
stop: WithPart<'stop'>;
|
|
185
|
+
switch: WithPart<'switch'>;
|
|
186
|
+
symbol: WithPart<'symbol'>;
|
|
187
|
+
text: WithPart<'text'>;
|
|
188
|
+
textPath: WithPart<'textPath'>;
|
|
189
|
+
tspan: WithPart<'tspan'>;
|
|
190
|
+
use: WithPart<'use'>;
|
|
191
|
+
view: WithPart<'view'>;
|
|
192
|
+
}
|
|
193
193
|
}
|
package/dist/transformer.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from '@babel/types';
|
|
2
2
|
import { ParserOptions } from '@babel/parser';
|
|
3
3
|
|
|
4
|
-
type Return<T> = void | T | Promise<void | T>;
|
|
4
|
+
type Return<T> = void | T | Promise<void> | Promise<T>;
|
|
5
5
|
interface TransformerPluginContext {
|
|
6
6
|
skipped?: boolean;
|
|
7
7
|
script?: string;
|
|
8
8
|
assetsDestination?: string;
|
|
9
9
|
assetsSource?: string;
|
|
10
|
-
class?: ClassDeclaration;
|
|
11
|
-
classEvents?:
|
|
12
|
-
classMembers?: ClassBody['body'];
|
|
13
|
-
classMethods?:
|
|
10
|
+
class?: t.ClassDeclaration;
|
|
11
|
+
classEvents?: t.ClassProperty[];
|
|
12
|
+
classMembers?: t.ClassBody['body'];
|
|
13
|
+
classMethods?: t.ClassMethod[];
|
|
14
14
|
className?: string;
|
|
15
|
-
classProperties?:
|
|
16
|
-
classStates?:
|
|
15
|
+
classProperties?: t.ClassProperty[];
|
|
16
|
+
classStates?: t.ClassProperty[];
|
|
17
17
|
directoryName?: string;
|
|
18
18
|
directoryPath?: string;
|
|
19
19
|
elementKey?: string;
|
|
20
20
|
elementInterfaceName?: string;
|
|
21
21
|
elementTagName?: string;
|
|
22
|
-
fileAST?: File;
|
|
22
|
+
fileAST?: t.File;
|
|
23
23
|
fileContent?: string;
|
|
24
24
|
fileExtension?: string;
|
|
25
25
|
fileName?: string;
|
|
26
26
|
filePath?: string;
|
|
27
27
|
metadata?: {
|
|
28
|
-
[key: string]:
|
|
28
|
+
[key: string]: unknown;
|
|
29
29
|
};
|
|
30
30
|
readmeContent?: string;
|
|
31
31
|
readmeExtension?: string;
|
|
@@ -40,95 +40,100 @@ interface TransformerPluginContext {
|
|
|
40
40
|
interface TransformerPluginGlobal {
|
|
41
41
|
contexts: Array<TransformerPluginContext>;
|
|
42
42
|
metadata?: {
|
|
43
|
-
[key: string]:
|
|
43
|
+
[key: string]: unknown;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
interface TransformerPlugin {
|
|
47
47
|
name: string;
|
|
48
|
-
options?:
|
|
48
|
+
options?: unknown;
|
|
49
49
|
start?: (global: TransformerPluginGlobal) => Return<TransformerPluginGlobal>;
|
|
50
50
|
run?: (context: TransformerPluginContext, global: TransformerPluginGlobal) => Return<TransformerPluginContext>;
|
|
51
51
|
finish?: (global: TransformerPluginGlobal) => Return<TransformerPluginGlobal>;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
run: (filePath: string) => Promise<TransformerPluginContext>;
|
|
58
|
-
finish: () => Promise<void>;
|
|
53
|
+
type InvertOptional<T> = {
|
|
54
|
+
[K in keyof T as undefined extends T[K] ? K : never]-?: T[K];
|
|
55
|
+
} & {
|
|
56
|
+
[K in keyof T as undefined extends T[K] ? never : K]?: T[K];
|
|
59
57
|
};
|
|
60
58
|
|
|
61
|
-
declare const ASSETS_OPTIONS:
|
|
59
|
+
declare const ASSETS_OPTIONS: InvertOptional<AssetsOptions>;
|
|
62
60
|
interface AssetsOptions {
|
|
63
61
|
destination?: (context: TransformerPluginContext) => string;
|
|
64
62
|
source?: (context: TransformerPluginContext) => string;
|
|
65
63
|
json?: (context: TransformerPluginContext) => string;
|
|
66
64
|
}
|
|
67
|
-
declare const assets: (
|
|
65
|
+
declare const assets: (userOptions?: AssetsOptions) => TransformerPlugin;
|
|
68
66
|
|
|
69
|
-
declare const COPY_OPTIONS:
|
|
67
|
+
declare const COPY_OPTIONS: InvertOptional<CopyOptions>;
|
|
70
68
|
interface CopyOptions {
|
|
71
69
|
at?: 'start' | 'run' | 'finish';
|
|
72
70
|
destination: string;
|
|
73
71
|
source: string;
|
|
74
72
|
transformer?: (content: string) => string;
|
|
75
73
|
}
|
|
76
|
-
declare const copy: (
|
|
74
|
+
declare const copy: (userOptions: CopyOptions) => TransformerPlugin;
|
|
77
75
|
|
|
78
|
-
declare const CUSTOM_ELEMENT_OPTIONS:
|
|
76
|
+
declare const CUSTOM_ELEMENT_OPTIONS: InvertOptional<CustomElementOptions>;
|
|
79
77
|
interface CustomElementOptions {
|
|
80
78
|
prefix?: string;
|
|
81
79
|
typings?: boolean;
|
|
82
80
|
}
|
|
83
|
-
declare const customElement: (
|
|
81
|
+
declare const customElement: (userOptions?: CustomElementOptions) => TransformerPlugin;
|
|
84
82
|
|
|
85
|
-
declare const DOCUMENT_OPTIONS:
|
|
83
|
+
declare const DOCUMENT_OPTIONS: InvertOptional<DocumentOptions>;
|
|
86
84
|
interface DocumentOptions {
|
|
87
|
-
destination
|
|
88
|
-
transformer?: (context: TransformerPluginContext, element:
|
|
85
|
+
destination?: string;
|
|
86
|
+
transformer?: (context: TransformerPluginContext, element: unknown) => unknown;
|
|
89
87
|
}
|
|
90
|
-
declare const document: (
|
|
88
|
+
declare const document: (userOptions?: DocumentOptions) => TransformerPlugin;
|
|
91
89
|
|
|
92
90
|
declare const extract: () => TransformerPlugin;
|
|
93
91
|
|
|
94
|
-
declare const PARSE_OPTIONS:
|
|
92
|
+
declare const PARSE_OPTIONS: ParseOptions;
|
|
95
93
|
interface ParseOptions extends ParserOptions {
|
|
96
94
|
}
|
|
97
|
-
declare const parse: (
|
|
95
|
+
declare const parse: (userOptions?: ParseOptions) => TransformerPlugin;
|
|
98
96
|
|
|
99
97
|
declare const read: () => TransformerPlugin;
|
|
100
98
|
|
|
101
|
-
declare const README_OPTIONS:
|
|
99
|
+
declare const README_OPTIONS: InvertOptional<ReadmeOptions>;
|
|
102
100
|
interface ReadmeOptions {
|
|
103
101
|
source?: (context: TransformerPluginContext) => string;
|
|
104
102
|
}
|
|
105
|
-
declare const readme: (
|
|
103
|
+
declare const readme: (userOptions?: ReadmeOptions) => TransformerPlugin;
|
|
106
104
|
|
|
107
|
-
declare const STYLE_OPTIONS:
|
|
105
|
+
declare const STYLE_OPTIONS: InvertOptional<StyleOptions>;
|
|
108
106
|
interface StyleOptions {
|
|
109
107
|
source?: (context: TransformerPluginContext) => string | string[];
|
|
110
108
|
}
|
|
111
|
-
declare const style: (
|
|
109
|
+
declare const style: (userOptions?: StyleOptions) => TransformerPlugin;
|
|
112
110
|
|
|
113
111
|
declare const validate: () => TransformerPlugin;
|
|
114
112
|
|
|
115
|
-
declare const VISUAL_STUDIO_CODE_OPTIONS:
|
|
113
|
+
declare const VISUAL_STUDIO_CODE_OPTIONS: InvertOptional<VisualStudioCodeOptions>;
|
|
116
114
|
interface VisualStudioCodeOptions {
|
|
117
115
|
destination?: string;
|
|
118
116
|
reference?: (context: TransformerPluginContext) => string;
|
|
119
117
|
transformer?: (context: TransformerPluginContext, element: any) => any;
|
|
120
118
|
}
|
|
121
|
-
declare const visualStudioCode: (
|
|
119
|
+
declare const visualStudioCode: (userOptions?: VisualStudioCodeOptions) => TransformerPlugin;
|
|
122
120
|
|
|
123
|
-
declare const WEB_TYPES_OPTIONS:
|
|
121
|
+
declare const WEB_TYPES_OPTIONS: InvertOptional<WebTypesOptions>;
|
|
124
122
|
interface WebTypesOptions {
|
|
125
123
|
destination?: string;
|
|
126
124
|
packageName?: string;
|
|
127
125
|
packageVersion?: string;
|
|
128
126
|
reference?: (context: TransformerPluginContext) => string;
|
|
129
|
-
transformer?: (context: TransformerPluginContext, element:
|
|
127
|
+
transformer?: (context: TransformerPluginContext, element: unknown) => unknown;
|
|
130
128
|
}
|
|
131
|
-
declare const webTypes: (
|
|
129
|
+
declare const webTypes: (userOptions?: WebTypesOptions) => TransformerPlugin;
|
|
130
|
+
|
|
131
|
+
declare const transformer: (...plugins: TransformerPlugin[]) => {
|
|
132
|
+
global: TransformerPluginGlobal;
|
|
133
|
+
start: () => Promise<void>;
|
|
134
|
+
run: (filePath: string) => Promise<TransformerPluginContext>;
|
|
135
|
+
finish: () => Promise<void>;
|
|
136
|
+
};
|
|
132
137
|
|
|
133
138
|
export { ASSETS_OPTIONS, COPY_OPTIONS, CUSTOM_ELEMENT_OPTIONS, DOCUMENT_OPTIONS, PARSE_OPTIONS, README_OPTIONS, STYLE_OPTIONS, VISUAL_STUDIO_CODE_OPTIONS, WEB_TYPES_OPTIONS, assets, copy, customElement, document, extract, parse, read, readme, style, transformer, validate, visualStudioCode, webTypes };
|
|
134
|
-
export type { AssetsOptions, CopyOptions, CustomElementOptions, DocumentOptions, ParseOptions, ReadmeOptions, StyleOptions, TransformerPlugin, TransformerPluginContext, TransformerPluginGlobal, VisualStudioCodeOptions, WebTypesOptions };
|
|
139
|
+
export type { AssetsOptions, CopyOptions, CustomElementOptions, DocumentOptions, InvertOptional, ParseOptions, ReadmeOptions, StyleOptions, TransformerPlugin, TransformerPluginContext, TransformerPluginGlobal, VisualStudioCodeOptions, WebTypesOptions };
|