1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export declare type ElementAttrNames = ('abbr' | 'accept' | 'accept-charset' | 'accesskey' | 'action' | 'allowfullscreen' | 'alt' | 'autocomplete' | 'autofocus' | 'autoplay' | 'autosave' | 'checked' | 'cite' | 'cols' | 'colspan' | 'contenteditable' | 'controls' | 'coords' | 'crossorigin' | 'data' | 'datetime' | 'default' | 'dir' | 'dirname' | 'disabled' | 'download' | 'draggable' | 'dropzone' | 'enctype' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'headers' | 'height' | 'hidden' | 'high' | 'href' | 'hreflang' | 'id' | 'inputmode' | 'integrity' | 'ismap' | 'kind' | 'label' | 'lang' | 'list' | 'loop' | 'low' | 'max' | 'maxlength' | 'media' | 'mediagroup' | 'method' | 'min' | 'minlength' | 'multiple' | 'muted' | 'name' | 'novalidate' | 'optimum' | 'pattern' | 'placeholder' | 'poster' | 'preload' | 'readonly' | 'rel' | 'required' | 'reversed' | 'rows' | 'rowspan' | 'sandbox' | 'scope' | 'selected' | 'shape' | 'size' | 'sizes' | 'span' | 'spellcheck' | 'src' | 'srcdoc' | 'srclang' | 'srcset' | 'start' | 'step' | 'tabindex' | 'target' | 'title' | 'type' | 'typemustmatch' | 'usemap' | 'value' | 'width' | 'wrap');
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare type CSSPropertyNames = ('alignContent' | 'alignItems' | 'alignSelf' | 'alignmentBaseline' | 'animation' | 'animationDelay' | 'animationDirection' | 'animationDuration' | 'animationFillMode' | 'animationIterationCount' | 'animationName' | 'animationPlayState' | 'animationTimingFunction' | 'backfaceVisibility' | 'background' | 'backgroundAttachment' | 'backgroundClip' | 'backgroundColor' | 'backgroundImage' | 'backgroundOrigin' | 'backgroundPosition' | 'backgroundPositionX' | 'backgroundPositionY' | 'backgroundRepeat' | 'backgroundSize' | 'baselineShift' | 'border' | 'borderBottom' | 'borderBottomColor' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStyle' | 'borderBottomWidth' | 'borderCollapse' | 'borderColor' | 'borderImage' | 'borderImageOutset' | 'borderImageRepeat' | 'borderImageSlice' | 'borderImageSource' | 'borderImageWidth' | 'borderLeft' | 'borderLeftColor' | 'borderLeftStyle' | 'borderLeftWidth' | 'borderRadius' | 'borderRight' | 'borderRightColor' | 'borderRightStyle' | 'borderRightWidth' | 'borderSpacing' | 'borderStyle' | 'borderTop' | 'borderTopColor' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStyle' | 'borderTopWidth' | 'borderWidth' | 'bottom' | 'boxShadow' | 'boxSizing' | 'breakAfter' | 'breakBefore' | 'breakInside' | 'captionSide' | 'clear' | 'clip' | 'clipPath' | 'clipRule' | 'color' | 'colorInterpolationFilters' | 'columnCount' | 'columnFill' | 'columnGap' | 'columnRule' | 'columnRuleColor' | 'columnRuleStyle' | 'columnRuleWidth' | 'columnSpan' | 'columnWidth' | 'columns' | 'content' | 'counterIncrement' | 'counterReset' | 'cssFloat' | 'cssText' | 'cursor' | 'direction' | 'display' | 'dominantBaseline' | 'emptyCells' | 'enableBackground' | 'fill' | 'fillOpacity' | 'fillRule' | 'filter' | 'flex' | 'flexBasis' | 'flexDirection' | 'flexFlow' | 'flexGrow' | 'flexShrink' | 'flexWrap' | 'floodColor' | 'floodOpacity' | 'font' | 'fontFamily' | 'fontFeatureSettings' | 'fontSize' | 'fontSizeAdjust' | 'fontStretch' | 'fontStyle' | 'fontVariant' | 'fontWeight' | 'glyphOrientationHorizontal' | 'glyphOrientationVertical' | 'height' | 'imeMode' | 'justifyContent' | 'kerning' | 'left' | 'letterSpacing' | 'lightingColor' | 'lineHeight' | 'listStyle' | 'listStyleImage' | 'listStylePosition' | 'listStyleType' | 'margin' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marker' | 'markerEnd' | 'markerMid' | 'markerStart' | 'mask' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'msContentZoomChaining' | 'msContentZoomLimit' | 'msContentZoomLimitMax' | 'msContentZoomLimitMin' | 'msContentZoomSnap' | 'msContentZoomSnapPoints' | 'msContentZoomSnapType' | 'msContentZooming' | 'msFlowFrom' | 'msFlowInto' | 'msFontFeatureSettings' | 'msGridColumn' | 'msGridColumnAlign' | 'msGridColumnSpan' | 'msGridColumns' | 'msGridRow' | 'msGridRowAlign' | 'msGridRowSpan' | 'msGridRows' | 'msHighContrastAdjust' | 'msHyphenateLimitChars' | 'msHyphenateLimitLines' | 'msHyphenateLimitZone' | 'msHyphens' | 'msImeAlign' | 'msOverflowStyle' | 'msScrollChaining' | 'msScrollLimit' | 'msScrollLimitXMax' | 'msScrollLimitXMin' | 'msScrollLimitYMax' | 'msScrollLimitYMin' | 'msScrollRails' | 'msScrollSnapPointsX' | 'msScrollSnapPointsY' | 'msScrollSnapType' | 'msScrollSnapX' | 'msScrollSnapY' | 'msScrollTranslation' | 'msTextCombineHorizontal' | 'msTextSizeAdjust' | 'msTouchAction' | 'msTouchSelect' | 'msUserSelect' | 'msWrapFlow' | 'msWrapMargin' | 'msWrapThrough' | 'opacity' | 'order' | 'orphans' | 'outline' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'overflow' | 'overflowX' | 'overflowY' | 'padding' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'pageBreakAfter' | 'pageBreakBefore' | 'pageBreakInside' | 'perspective' | 'perspectiveOrigin' | 'pointerEvents' | 'position' | 'quotes' | 'resize' | 'right' | 'rubyAlign' | 'rubyOverhang' | 'rubyPosition' | 'stopColor' | 'stopOpacity' | 'stroke' | 'strokeDasharray' | 'strokeDashoffset' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeMiterlimit' | 'strokeOpacity' | 'strokeWidth' | 'tableLayout' | 'textAlign' | 'textAlignLast' | 'textAnchor' | 'textDecoration' | 'textIndent' | 'textJustify' | 'textKashida' | 'textKashidaSpace' | 'textOverflow' | 'textShadow' | 'textTransform' | 'textUnderlinePosition' | 'top' | 'touchAction' | 'transform' | 'transformOrigin' | 'transformStyle' | 'transition' | 'transitionDelay' | 'transitionDuration' | 'transitionProperty' | 'transitionTimingFunction' | 'unicodeBidi' | 'verticalAlign' | 'visibility' | 'webkitAlignContent' | 'webkitAlignItems' | 'webkitAlignSelf' | 'webkitAnimation' | 'webkitAnimationDelay' | 'webkitAnimationDirection' | 'webkitAnimationDuration' | 'webkitAnimationFillMode' | 'webkitAnimationIterationCount' | 'webkitAnimationName' | 'webkitAnimationPlayState' | 'webkitAnimationTimingFunction' | 'webkitAppearance' | 'webkitBackfaceVisibility' | 'webkitBackgroundClip' | 'webkitBackgroundOrigin' | 'webkitBackgroundSize' | 'webkitBorderBottomLeftRadius' | 'webkitBorderBottomRightRadius' | 'webkitBorderImage' | 'webkitBorderRadius' | 'webkitBorderTopLeftRadius' | 'webkitBorderTopRightRadius' | 'webkitBoxAlign' | 'webkitBoxDirection' | 'webkitBoxFlex' | 'webkitBoxOrdinalGroup' | 'webkitBoxOrient' | 'webkitBoxPack' | 'webkitBoxSizing' | 'webkitColumnBreakAfter' | 'webkitColumnBreakBefore' | 'webkitColumnBreakInside' | 'webkitColumnCount' | 'webkitColumnGap' | 'webkitColumnRule' | 'webkitColumnRuleColor' | 'webkitColumnRuleStyle' | 'webkitColumnRuleWidth' | 'webkitColumnSpan' | 'webkitColumnWidth' | 'webkitColumns' | 'webkitFilter' | 'webkitFlex' | 'webkitFlexBasis' | 'webkitFlexDirection' | 'webkitFlexFlow' | 'webkitFlexGrow' | 'webkitFlexShrink' | 'webkitFlexWrap' | 'webkitJustifyContent' | 'webkitOrder' | 'webkitPerspective' | 'webkitPerspectiveOrigin' | 'webkitTapHighlightColor' | 'webkitTextFillColor' | 'webkitTextSizeAdjust' | 'webkitTransform' | 'webkitTransformOrigin' | 'webkitTransformStyle' | 'webkitTransition' | 'webkitTransitionDelay' | 'webkitTransitionDuration' | 'webkitTransitionProperty' | 'webkitTransitionTimingFunction' | 'webkitUserModify' | 'webkitUserSelect' | 'webkitWritingMode' | 'whiteSpace' | 'widows' | 'width' | 'wordBreak' | 'wordSpacing' | 'wordWrap' | 'writingMode' | 'zIndex' | 'zoom');
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare type ElementEventMap = {
|
39 | onabort: UIEvent;
|
40 | onauxclick: MouseEvent;
|
41 | onblur: FocusEvent;
|
42 | oncanplay: Event;
|
43 | oncanplaythrough: Event;
|
44 | onchange: Event;
|
45 | onclick: MouseEvent;
|
46 | oncontextmenu: PointerEvent;
|
47 | oncopy: ClipboardEvent;
|
48 | oncuechange: Event;
|
49 | oncut: ClipboardEvent;
|
50 | ondblclick: MouseEvent;
|
51 | ondrag: DragEvent;
|
52 | ondragend: DragEvent;
|
53 | ondragenter: DragEvent;
|
54 | ondragexit: DragEvent;
|
55 | ondragleave: DragEvent;
|
56 | ondragover: DragEvent;
|
57 | ondragstart: DragEvent;
|
58 | ondrop: DragEvent;
|
59 | ondurationchange: Event;
|
60 | onemptied: Event;
|
61 | onended: MediaStreamErrorEvent;
|
62 | onerror: ErrorEvent;
|
63 | onfocus: FocusEvent;
|
64 | oninput: Event;
|
65 | oninvalid: Event;
|
66 | onkeydown: KeyboardEvent;
|
67 | onkeypress: KeyboardEvent;
|
68 | onkeyup: KeyboardEvent;
|
69 | onload: Event;
|
70 | onloadeddata: Event;
|
71 | onloadedmetadata: Event;
|
72 | onloadend: Event;
|
73 | onloadstart: Event;
|
74 | onmousedown: MouseEvent;
|
75 | onmouseenter: MouseEvent;
|
76 | onmouseleave: MouseEvent;
|
77 | onmousemove: MouseEvent;
|
78 | onmouseout: MouseEvent;
|
79 | onmouseover: MouseEvent;
|
80 | onmouseup: MouseEvent;
|
81 | onmousewheel: WheelEvent;
|
82 | onpaste: ClipboardEvent;
|
83 | onpause: Event;
|
84 | onplay: Event;
|
85 | onplaying: Event;
|
86 | onpointercancel: PointerEvent;
|
87 | onpointerdown: PointerEvent;
|
88 | onpointerenter: PointerEvent;
|
89 | onpointerleave: PointerEvent;
|
90 | onpointermove: PointerEvent;
|
91 | onpointerout: PointerEvent;
|
92 | onpointerover: PointerEvent;
|
93 | onpointerup: PointerEvent;
|
94 | onprogress: ProgressEvent;
|
95 | onratechange: Event;
|
96 | onreset: Event;
|
97 | onscroll: UIEvent;
|
98 | onseeked: Event;
|
99 | onseeking: Event;
|
100 | onselect: UIEvent;
|
101 | onselectstart: Event;
|
102 | onstalled: Event;
|
103 | onsubmit: Event;
|
104 | onsuspend: Event;
|
105 | ontimeupdate: Event;
|
106 | onvolumechange: Event;
|
107 | onwaiting: Event;
|
108 | };
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | export declare type ElementDataset = {
|
119 | readonly [name: string]: string;
|
120 | };
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | export declare type ElementInlineStyle = {
|
128 | readonly [T in CSSPropertyNames]?: string;
|
129 | };
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | export declare type ElementBaseAttrs = {
|
142 | readonly [T in ElementAttrNames]?: string;
|
143 | };
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 | export declare type ElementEventAttrs = {
|
150 | readonly [T in keyof ElementEventMap]?: (this: HTMLElement, event: ElementEventMap[T]) => any;
|
151 | };
|
152 |
|
153 |
|
154 |
|
155 | export declare type ElementSpecialAttrs = {
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 | readonly key?: string;
|
169 | |
170 |
|
171 |
|
172 | readonly className?: string;
|
173 | |
174 |
|
175 |
|
176 | readonly htmlFor?: string;
|
177 | |
178 |
|
179 |
|
180 | readonly dataset?: ElementDataset;
|
181 | |
182 |
|
183 |
|
184 | readonly style?: ElementInlineStyle;
|
185 | };
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 | export declare type ElementAttrs = (ElementBaseAttrs & ElementEventAttrs & ElementSpecialAttrs);
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | export declare class VirtualText {
|
201 | |
202 |
|
203 |
|
204 | readonly content: string;
|
205 | |
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | readonly type: 'text';
|
212 | |
213 |
|
214 |
|
215 |
|
216 |
|
217 | constructor(content: string);
|
218 | }
|
219 | /**
|
220 | * A virtual node which represents an HTML element.
|
221 | *
|
222 | * #### Notes
|
223 | * User code will not typically create a `VirtualElement` node directly.
|
224 | * Instead, the `h()` function will be used to create an element tree.
|
225 | */
|
226 | export declare class VirtualElement {
|
227 | |
228 |
|
229 |
|
230 | readonly tag: string;
|
231 | |
232 |
|
233 |
|
234 | readonly attrs: ElementAttrs;
|
235 | |
236 |
|
237 |
|
238 | readonly children: ReadonlyArray<VirtualNode>;
|
239 | |
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 | readonly type: 'element';
|
246 | |
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | constructor(tag: string, attrs: ElementAttrs, children: ReadonlyArray<VirtualNode>);
|
256 | }
|
257 | /**
|
258 | * A type alias for a general virtual node.
|
259 | */
|
260 | export declare type VirtualNode = VirtualElement | VirtualText;
|
261 | /**
|
262 | * Create a new virtual element node.
|
263 | *
|
264 | * @param tag - The tag name for the element.
|
265 | *
|
266 | * @param attrs - The attributes for the element, if any.
|
267 | *
|
268 | * @param children - The children for the element, if any.
|
269 | *
|
270 | * @returns A new virtual element node for the given parameters.
|
271 | *
|
272 | * #### Notes
|
273 | * The children may be string literals, other virtual nodes, `null`, or
|
274 | * an array of those things. Strings are converted into text nodes, and
|
275 | * arrays are inlined as if the array contents were given as positional
|
276 | * arguments. This makes it simple to build up an array of children by
|
277 | * any desired means. `null` child values are simply ignored.
|
278 | *
|
279 | * A bound function for each HTML tag name is available as a static
|
280 | * function attached to the `h()` function. E.g. `h('div', ...)` is
|
281 | * equivalent to `h.div(...)`.
|
282 | */
|
283 | export declare function h(tag: string, ...children: h.Child[]): VirtualElement;
|
284 | export declare function h(tag: string, attrs: ElementAttrs, ...children: h.Child[]): VirtualElement;
|
285 | /**
|
286 | * The namespace for the `h` function statics.
|
287 | */
|
288 | export declare namespace h {
|
289 | |
290 |
|
291 |
|
292 | type Child = (string | VirtualNode | null) | Array<string | VirtualNode | null>;
|
293 | |
294 |
|
295 |
|
296 | interface IFactory {
|
297 | (...children: Child[]): VirtualElement;
|
298 | (attrs: ElementAttrs, ...children: Child[]): VirtualElement;
|
299 | }
|
300 | const a: IFactory;
|
301 | const abbr: IFactory;
|
302 | const address: IFactory;
|
303 | const area: IFactory;
|
304 | const article: IFactory;
|
305 | const aside: IFactory;
|
306 | const audio: IFactory;
|
307 | const b: IFactory;
|
308 | const bdi: IFactory;
|
309 | const bdo: IFactory;
|
310 | const blockquote: IFactory;
|
311 | const br: IFactory;
|
312 | const button: IFactory;
|
313 | const canvas: IFactory;
|
314 | const caption: IFactory;
|
315 | const cite: IFactory;
|
316 | const code: IFactory;
|
317 | const col: IFactory;
|
318 | const colgroup: IFactory;
|
319 | const data: IFactory;
|
320 | const datalist: IFactory;
|
321 | const dd: IFactory;
|
322 | const del: IFactory;
|
323 | const dfn: IFactory;
|
324 | const div: IFactory;
|
325 | const dl: IFactory;
|
326 | const dt: IFactory;
|
327 | const em: IFactory;
|
328 | const embed: IFactory;
|
329 | const fieldset: IFactory;
|
330 | const figcaption: IFactory;
|
331 | const figure: IFactory;
|
332 | const footer: IFactory;
|
333 | const form: IFactory;
|
334 | const h1: IFactory;
|
335 | const h2: IFactory;
|
336 | const h3: IFactory;
|
337 | const h4: IFactory;
|
338 | const h5: IFactory;
|
339 | const h6: IFactory;
|
340 | const header: IFactory;
|
341 | const hr: IFactory;
|
342 | const i: IFactory;
|
343 | const iframe: IFactory;
|
344 | const img: IFactory;
|
345 | const input: IFactory;
|
346 | const ins: IFactory;
|
347 | const kbd: IFactory;
|
348 | const label: IFactory;
|
349 | const legend: IFactory;
|
350 | const li: IFactory;
|
351 | const main: IFactory;
|
352 | const map: IFactory;
|
353 | const mark: IFactory;
|
354 | const meter: IFactory;
|
355 | const nav: IFactory;
|
356 | const noscript: IFactory;
|
357 | const object: IFactory;
|
358 | const ol: IFactory;
|
359 | const optgroup: IFactory;
|
360 | const option: IFactory;
|
361 | const output: IFactory;
|
362 | const p: IFactory;
|
363 | const param: IFactory;
|
364 | const pre: IFactory;
|
365 | const progress: IFactory;
|
366 | const q: IFactory;
|
367 | const rp: IFactory;
|
368 | const rt: IFactory;
|
369 | const ruby: IFactory;
|
370 | const s: IFactory;
|
371 | const samp: IFactory;
|
372 | const section: IFactory;
|
373 | const select: IFactory;
|
374 | const small: IFactory;
|
375 | const source: IFactory;
|
376 | const span: IFactory;
|
377 | const strong: IFactory;
|
378 | const sub: IFactory;
|
379 | const summary: IFactory;
|
380 | const sup: IFactory;
|
381 | const table: IFactory;
|
382 | const tbody: IFactory;
|
383 | const td: IFactory;
|
384 | const textarea: IFactory;
|
385 | const tfoot: IFactory;
|
386 | const th: IFactory;
|
387 | const thead: IFactory;
|
388 | const time: IFactory;
|
389 | const title: IFactory;
|
390 | const tr: IFactory;
|
391 | const track: IFactory;
|
392 | const u: IFactory;
|
393 | const ul: IFactory;
|
394 | const var_: IFactory;
|
395 | const video: IFactory;
|
396 | const wbr: IFactory;
|
397 | }
|
398 |
|
399 |
|
400 |
|
401 | export declare namespace VirtualDOM {
|
402 | |
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 | function realize(node: VirtualElement): HTMLElement;
|
416 | |
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | function render(content: VirtualNode | ReadonlyArray<VirtualNode> | null, host: HTMLElement): void;
|
433 | }
|