UNPKG

36.7 kBTypeScriptView Raw
1/**
2 * This file gets copied to all distributions of stencil component collections.
3 * - no imports
4 */
5
6export interface ComponentWillLoad {
7 /**
8 * The component is about to load and it has not
9 * rendered yet.
10 *
11 * This is the best place to make any data updates
12 * before the first render.
13 *
14 * componentWillLoad will only be called once.
15 */
16 componentWillLoad: () => Promise<void> | void;
17}
18
19export interface ComponentDidLoad {
20 /**
21 * The component has loaded and has already rendered.
22 *
23 * Updating data in this method will cause the
24 * component to re-render.
25 *
26 * componentDidLoad will only be called once.
27 */
28 componentDidLoad: () => void;
29}
30
31export interface ComponentWillUpdate {
32 /**
33 * The component is about to update and re-render.
34 *
35 * Called multiple times throughout the life of
36 * the component as it updates.
37 *
38 * componentWillUpdate is not called on the first render.
39 */
40 componentWillUpdate: () => Promise<void> | void;
41}
42
43export interface ComponentDidUpdate {
44 /**
45 * The component has just re-rendered.
46 *
47 * Called multiple times throughout the life of
48 * the component as it updates.
49 *
50 * componentWillUpdate is not called on the
51 * first render.
52 */
53 componentDidUpdate: () => void;
54}
55
56export interface ComponentDidUnload {
57 /**
58 * The component did unload and the element
59 * will be destroyed.
60 */
61 componentDidUnload: () => void;
62}
63
64export interface ComponentInstance {
65 /**
66 * The component is about to load and it has not
67 * rendered yet.
68 *
69 * This is the best place to make any data updates
70 * before the first render.
71 *
72 * componentWillLoad will only be called once.
73 */
74 componentWillLoad?: () => Promise<void> | void;
75
76 /**
77 * The component has loaded and has already rendered.
78 *
79 * Updating data in this method will cause the
80 * component to re-render.
81 *
82 * componentDidLoad will only be called once.
83 */
84 componentDidLoad?: () => void;
85
86 /**
87 * The component is about to update and re-render.
88 *
89 * Called multiple times throughout the life of
90 * the component as it updates.
91 *
92 * componentWillUpdate is not called on the first render.
93 */
94 componentWillUpdate?: () => Promise<void> | void;
95
96 /**
97 * The component has just re-rendered.
98 *
99 * Called multiple times throughout the life of
100 * the component as it updates.
101 *
102 * componentWillUpdate is not called on the
103 * first render.
104 */
105 componentDidUpdate?: () => void;
106
107 /**
108 * The component did unload and the element
109 * will be destroyed.
110 */
111 componentDidUnload?: () => void;
112
113 render?: () => any;
114
115 /**
116 * Used to dynamically set host element attributes.
117 * Should be placed directly above render()
118 */
119 hostData?: () => {
120 class?: {[className: string]: boolean};
121 style?: any;
122 [attrName: string]: any;
123 };
124
125 [memberName: string]: any;
126}
127
128
129/**
130 * General types important to applications using stencil built components
131 */
132export interface EventEmitter<T= any> {
133 emit: (data?: T) => CustomEvent<T>;
134}
135
136export interface EventListenerEnable {
137 (instance: any, eventName: string, enabled: boolean, attachTo?: string|Element, passive?: boolean): void;
138}
139
140export interface QueueApi {
141 tick: (cb: RafCallback) => void;
142 read: (cb: RafCallback) => void;
143 write: (cb: RafCallback) => void;
144 clear?: () => void;
145 flush?: (cb?: () => void) => void;
146}
147
148export interface RafCallback {
149 (timeStamp: number): void;
150}
151
152/**
153 * This file gets copied to all distributions of stencil component collections.
154 * - no imports
155 */
156
157declare global {
158 interface HTMLStencilElement extends HTMLElement {
159 componentOnReady(): Promise<this>;
160 forceUpdate(): void;
161 }
162 interface StencilHTMLAttributes extends JSXElements.HTMLAttributes {}
163 interface StencilIntrinsicElements extends JSXElements.DefaultIntrinsicElements {}
164 interface StencilElementInterfaces {}
165 interface StencilGlobalHTMLAttributes {}
166}
167
168export namespace JSXElements {
169 export interface DefaultIntrinsicElements {
170 // Stencil elements
171 slot: JSXElements.SlotAttributes;
172
173 // HTML
174 a: JSXElements.AnchorHTMLAttributes<HTMLAnchorElement>;
175 abbr: JSXElements.HTMLAttributes;
176 address: JSXElements.HTMLAttributes;
177 area: JSXElements.AreaHTMLAttributes<HTMLAreaElement>;
178 article: JSXElements.HTMLAttributes;
179 aside: JSXElements.HTMLAttributes;
180 audio: JSXElements.AudioHTMLAttributes<HTMLAudioElement>;
181 b: JSXElements.HTMLAttributes;
182 base: JSXElements.BaseHTMLAttributes<HTMLBaseElement>;
183 bdi: JSXElements.HTMLAttributes;
184 bdo: JSXElements.HTMLAttributes;
185 big: JSXElements.HTMLAttributes;
186 blockquote: JSXElements.BlockquoteHTMLAttributes<HTMLQuoteElement>;
187 body: JSXElements.HTMLAttributes<HTMLBodyElement>;
188 br: JSXElements.HTMLAttributes<HTMLBRElement>;
189 button: JSXElements.ButtonHTMLAttributes<HTMLButtonElement>;
190 canvas: JSXElements.CanvasHTMLAttributes<HTMLCanvasElement>;
191 caption: JSXElements.HTMLAttributes<HTMLTableCaptionElement>;
192 cite: JSXElements.HTMLAttributes;
193 code: JSXElements.HTMLAttributes;
194 col: JSXElements.ColHTMLAttributes<HTMLTableColElement>;
195 colgroup: JSXElements.ColgroupHTMLAttributes<HTMLTableColElement>;
196 data: JSXElements.HTMLAttributes<HTMLDataElement>;
197 datalist: JSXElements.HTMLAttributes<HTMLDataListElement>;
198 dd: JSXElements.HTMLAttributes;
199 del: JSXElements.DelHTMLAttributes<HTMLModElement>;
200 details: JSXElements.DetailsHTMLAttributes<HTMLElement>;
201 dfn: JSXElements.HTMLAttributes;
202 dialog: JSXElements.DialogHTMLAttributes<HTMLDialogElement>;
203 div: JSXElements.HTMLAttributes<HTMLDivElement>;
204 dl: JSXElements.HTMLAttributes<HTMLDListElement>;
205 dt: JSXElements.HTMLAttributes;
206 em: JSXElements.HTMLAttributes;
207 embed: JSXElements.EmbedHTMLAttributes<HTMLEmbedElement>;
208 fieldset: JSXElements.FieldsetHTMLAttributes<HTMLFieldSetElement>;
209 figcaption: JSXElements.HTMLAttributes;
210 figure: JSXElements.HTMLAttributes;
211 footer: JSXElements.HTMLAttributes;
212 form: JSXElements.FormHTMLAttributes<HTMLFormElement>;
213 h1: JSXElements.HTMLAttributes<HTMLHeadingElement>;
214 h2: JSXElements.HTMLAttributes<HTMLHeadingElement>;
215 h3: JSXElements.HTMLAttributes<HTMLHeadingElement>;
216 h4: JSXElements.HTMLAttributes<HTMLHeadingElement>;
217 h5: JSXElements.HTMLAttributes<HTMLHeadingElement>;
218 h6: JSXElements.HTMLAttributes<HTMLHeadingElement>;
219 head: JSXElements.HTMLAttributes<HTMLHeadElement>;
220 header: JSXElements.HTMLAttributes;
221 hgroup: JSXElements.HTMLAttributes;
222 hr: JSXElements.HTMLAttributes<HTMLHRElement>;
223 html: JSXElements.HTMLAttributes<HTMLHtmlElement>;
224 i: JSXElements.HTMLAttributes;
225 iframe: JSXElements.IframeHTMLAttributes<HTMLIFrameElement>;
226 img: JSXElements.ImgHTMLAttributes<HTMLImageElement>;
227 input: JSXElements.InputHTMLAttributes<HTMLInputElement>;
228 ins: JSXElements.InsHTMLAttributes<HTMLModElement>;
229 kbd: JSXElements.HTMLAttributes;
230 keygen: JSXElements.KeygenHTMLAttributes<HTMLElement>;
231 label: JSXElements.LabelHTMLAttributes<HTMLLabelElement>;
232 legend: JSXElements.HTMLAttributes<HTMLLegendElement>;
233 li: JSXElements.LiHTMLAttributes<HTMLLIElement>;
234 link: JSXElements.LinkHTMLAttributes<HTMLLinkElement>;
235 main: JSXElements.HTMLAttributes;
236 map: JSXElements.MapHTMLAttributes<HTMLMapElement>;
237 mark: JSXElements.HTMLAttributes;
238 menu: JSXElements.MenuHTMLAttributes<HTMLMenuElement>;
239 menuitem: JSXElements.HTMLAttributes;
240 meta: JSXElements.MetaHTMLAttributes<HTMLMetaElement>;
241 meter: JSXElements.MeterHTMLAttributes<HTMLMeterElement>;
242 nav: JSXElements.HTMLAttributes;
243 noscript: JSXElements.HTMLAttributes;
244 object: JSXElements.ObjectHTMLAttributes<HTMLObjectElement>;
245 ol: JSXElements.OlHTMLAttributes<HTMLOListElement>;
246 optgroup: JSXElements.OptgroupHTMLAttributes<HTMLOptGroupElement>;
247 option: JSXElements.OptionHTMLAttributes<HTMLOptionElement>;
248 output: JSXElements.OutputHTMLAttributes<HTMLOutputElement>;
249 p: JSXElements.HTMLAttributes<HTMLParagraphElement>;
250 param: JSXElements.ParamHTMLAttributes<HTMLParamElement>;
251 picture: JSXElements.HTMLAttributes<HTMLPictureElement>;
252 pre: JSXElements.HTMLAttributes<HTMLPreElement>;
253 progress: JSXElements.ProgressHTMLAttributes<HTMLProgressElement>;
254 q: JSXElements.QuoteHTMLAttributes<HTMLQuoteElement>;
255 rp: JSXElements.HTMLAttributes;
256 rt: JSXElements.HTMLAttributes;
257 ruby: JSXElements.HTMLAttributes;
258 s: JSXElements.HTMLAttributes;
259 samp: JSXElements.HTMLAttributes;
260 script: JSXElements.ScriptHTMLAttributes<HTMLScriptElement>;
261 section: JSXElements.HTMLAttributes;
262 select: JSXElements.SelectHTMLAttributes<HTMLSelectElement>;
263 small: JSXElements.HTMLAttributes;
264 source: JSXElements.SourceHTMLAttributes<HTMLSourceElement>;
265 span: JSXElements.HTMLAttributes<HTMLSpanElement>;
266 strong: JSXElements.HTMLAttributes;
267 style: JSXElements.StyleHTMLAttributes<HTMLStyleElement>;
268 sub: JSXElements.HTMLAttributes;
269 summary: JSXElements.HTMLAttributes;
270 sup: JSXElements.HTMLAttributes;
271 table: JSXElements.TableHTMLAttributes<HTMLTableElement>;
272 tbody: JSXElements.HTMLAttributes<HTMLTableSectionElement>;
273 td: JSXElements.TdHTMLAttributes<HTMLTableDataCellElement>;
274 textarea: JSXElements.TextareaHTMLAttributes<HTMLTextAreaElement>;
275 tfoot: JSXElements.HTMLAttributes<HTMLTableSectionElement>;
276 th: JSXElements.ThHTMLAttributes<HTMLTableHeaderCellElement>;
277 thead: JSXElements.HTMLAttributes<HTMLTableSectionElement>;
278 time: JSXElements.TimeHTMLAttributes<HTMLTimeElement>;
279 title: JSXElements.HTMLAttributes<HTMLTitleElement>;
280 tr: JSXElements.HTMLAttributes<HTMLTableRowElement>;
281 track: JSXElements.TrackHTMLAttributes<HTMLTrackElement>;
282 u: JSXElements.HTMLAttributes;
283 ul: JSXElements.HTMLAttributes<HTMLUListElement>;
284 'var': JSXElements.HTMLAttributes;
285 video: JSXElements.VideoHTMLAttributes<HTMLVideoElement>;
286 wbr: JSXElements.HTMLAttributes;
287 }
288
289 export interface SlotAttributes {
290 name?: string;
291 slot?: string;
292 }
293
294 export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
295 download?: any;
296 href?: string;
297 hrefLang?: string;
298 hreflang?: string;
299 media?: string;
300 rel?: string;
301 target?: string;
302 }
303
304 export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
305
306 export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
307 alt?: string;
308 coords?: string;
309 download?: any;
310 href?: string;
311 hrefLang?: string;
312 hreflang?: string;
313 media?: string;
314 rel?: string;
315 shape?: string;
316 target?: string;
317 }
318
319 export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
320 href?: string;
321 target?: string;
322 }
323
324 export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
325 cite?: string;
326 }
327
328 export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
329 autoFocus?: boolean;
330 disabled?: boolean;
331 form?: string;
332 formAction?: string;
333 formaction?: string;
334 formEncType?: string;
335 formenctype?: string;
336 formMethod?: string;
337 formmethod?: string;
338 formNoValidate?: boolean;
339 formnovalidate?: boolean;
340 formTarget?: string;
341 formtarget?: string;
342 name?: string;
343 type?: string;
344 value?: string | string[] | number;
345 }
346
347 export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
348 height?: number | string;
349 width?: number | string;
350 }
351
352 export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
353 span?: number;
354 }
355
356 export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
357 span?: number;
358 }
359
360 export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
361 open?: boolean;
362 }
363
364 export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
365 cite?: string;
366 dateTime?: string;
367 datetime?: string;
368 }
369
370 export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
371 open?: boolean;
372 returnValue?: string;
373 }
374
375 export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
376 height?: number | string;
377 src?: string;
378 type?: string;
379 width?: number | string;
380 }
381
382 export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
383 disabled?: boolean;
384 form?: string;
385 name?: string;
386 }
387
388 export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
389 acceptCharset?: string;
390 acceptcharset?: string;
391 action?: string;
392 autoComplete?: string;
393 autocomplete?: string;
394 encType?: string;
395 enctype?: string;
396 method?: string;
397 name?: string;
398 noValidate?: boolean;
399 novalidate?: boolean | string;
400 target?: string;
401 }
402
403 export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
404 manifest?: string;
405 }
406
407 export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
408 allowFullScreen?: boolean;
409 allowfullScreen?: string | boolean;
410 allowTransparency?: boolean;
411 allowtransparency?: string | boolean;
412 frameBorder?: number | string;
413 frameborder?: number | string;
414 height?: number | string;
415 marginHeight?: number;
416 marginheight?: string | number;
417 marginWidth?: number;
418 marginwidth?: string | number;
419 name?: string;
420 sandbox?: string;
421 scrolling?: string;
422 seamless?: boolean;
423 src?: string;
424 srcDoc?: string;
425 srcdoc?: string;
426 width?: number | string;
427 }
428
429 export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
430 alt?: string;
431 decoding?: 'async' | 'auto' | 'sync';
432 height?: number | string;
433 sizes?: string;
434 src?: string;
435 srcSet?: string;
436 srcset?: string;
437 useMap?: string;
438 usemap?: string;
439 width?: number | string;
440 }
441
442 export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
443 cite?: string;
444 dateTime?: string;
445 datetime?: string;
446 }
447
448 export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
449 accept?: string;
450 alt?: string;
451 autoComplete?: string;
452 autocomplete?: string;
453 autoFocus?: boolean;
454 autofocus?: boolean | string;
455 capture?: string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
456 checked?: boolean;
457 crossOrigin?: string;
458 crossorigin?: string;
459 disabled?: boolean;
460 form?: string;
461 formAction?: string;
462 formaction?: string;
463 formEncType?: string;
464 formenctype?: string;
465 formMethod?: string;
466 formmethod?: string;
467 formNoValidate?: boolean;
468 formnovalidate?: boolean;
469 formTarget?: string;
470 formtarget?: string;
471 height?: number | string;
472 list?: string;
473 max?: number | string;
474 maxLength?: number;
475 maxlength?: number | string;
476 min?: number | string;
477 minLength?: number;
478 minlength?: number | string;
479 multiple?: boolean;
480 name?: string;
481 pattern?: string;
482 placeholder?: string;
483 readOnly?: boolean;
484 readonly?: boolean | string;
485 required?: boolean;
486 size?: number;
487 src?: string;
488 step?: number | string;
489 type?: string;
490 value?: string | string[] | number;
491 width?: number | string;
492 }
493
494 export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
495 autoFocus?: boolean;
496 autofocus?: boolean | string;
497 challenge?: string;
498 disabled?: boolean;
499 form?: string;
500 keyType?: string;
501 keytype?: string;
502 keyParams?: string;
503 keyparams?: string;
504 name?: string;
505 }
506
507 export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
508 form?: string;
509 htmlFor?: string;
510 htmlfor?: string;
511 }
512
513 export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
514 value?: string | string[] | number;
515 }
516
517 export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
518 href?: string;
519 hrefLang?: string;
520 hreflang?: string;
521 integrity?: string;
522 media?: string;
523 rel?: string;
524 sizes?: string;
525 type?: string;
526 }
527
528 export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
529 name?: string;
530 }
531
532 export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
533 type?: string;
534 }
535
536 export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
537 autoPlay?: boolean;
538 autoplay?: boolean | string;
539 controls?: boolean;
540 crossOrigin?: string;
541 crossorigin?: string;
542 loop?: boolean;
543 mediaGroup?: string;
544 mediagroup?: string;
545 muted?: boolean;
546 preload?: string;
547 src?: string;
548 }
549
550 export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
551 charSet?: string;
552 charset?: string;
553 content?: string;
554 httpEquiv?: string;
555 httpequiv?: string;
556 name?: string;
557 }
558
559 export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
560 form?: string;
561 high?: number;
562 low?: number;
563 max?: number | string;
564 min?: number | string;
565 optimum?: number;
566 value?: string | string[] | number;
567 }
568
569 export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
570 cite?: string;
571 }
572
573 export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
574 classID?: string;
575 classid?: string;
576 data?: string;
577 form?: string;
578 height?: number | string;
579 name?: string;
580 type?: string;
581 useMap?: string;
582 usemap?: string;
583 width?: number | string;
584 wmode?: string;
585 }
586
587 export interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
588 reversed?: boolean;
589 start?: number;
590 }
591
592 export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
593 disabled?: boolean;
594 label?: string;
595 }
596
597 export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
598 disabled?: boolean;
599 label?: string;
600 selected?: boolean;
601 value?: string | string[] | number;
602 }
603
604 export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
605 form?: string;
606 htmlFor?: string;
607 htmlfor?: string;
608 name?: string;
609 }
610
611 export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
612 name?: string;
613 value?: string | string[] | number;
614 }
615
616 export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
617 max?: number | string;
618 value?: string | string[] | number;
619 }
620
621 export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
622 async?: boolean;
623 charSet?: string;
624 charset?: string;
625 crossOrigin?: string;
626 crossorigin?: string;
627 defer?: boolean;
628 integrity?: string;
629 nonce?: string;
630 src?: string;
631 type?: string;
632 }
633
634 export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
635 autoFocus?: boolean;
636 disabled?: boolean;
637 form?: string;
638 multiple?: boolean;
639 name?: string;
640 required?: boolean;
641 size?: number;
642 }
643
644 export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
645 media?: string;
646 sizes?: string;
647 src?: string;
648 srcSet?: string;
649 type?: string;
650 }
651
652 export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
653 media?: string;
654 nonce?: string;
655 scoped?: boolean;
656 type?: string;
657 }
658
659 export interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
660 cellPadding?: number | string;
661 cellpadding?: number | string;
662 cellSpacing?: number | string;
663 cellspacing?: number | string;
664 summary?: string;
665 }
666
667 export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
668 autoFocus?: boolean;
669 autofocus?: boolean | string;
670 cols?: number;
671 disabled?: boolean;
672 form?: string;
673 maxLength?: number;
674 maxlength?: number | string;
675 minLength?: number;
676 minlength?: number | string;
677 name?: string;
678 placeholder?: string;
679 readOnly?: boolean;
680 readonly?: boolean | string;
681 required?: boolean;
682 rows?: number;
683 value?: string | string[] | number;
684 wrap?: string;
685 }
686
687 export interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
688 colSpan?: number;
689 headers?: string;
690 rowSpan?: number;
691 }
692
693 export interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
694 colSpan?: number;
695 headers?: string;
696 rowSpan?: number;
697 rowspan?: number | string;
698 scope?: string;
699 }
700
701 export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
702 dateTime?: string;
703 }
704
705 export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
706 default?: boolean;
707 kind?: string;
708 label?: string;
709 src?: string;
710 srcLang?: string;
711 srclang?: string;
712 }
713
714 export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
715 height?: number | string;
716 playsInline?: boolean;
717 playsinline?: boolean | string;
718 poster?: string;
719 width?: number | string;
720 }
721
722 export interface HTMLAttributes<T = HTMLElement> extends StencilGlobalHTMLAttributes, DOMAttributes {
723 // vdom specific
724 innerHTML?: string;
725 ref?: (elm?: T) => void;
726 key?: string | number;
727
728 // Standard HTML Attributes
729 accessKey?: string;
730 class?: string | { [className: string]: boolean };
731 contentEditable?: boolean | string;
732 contenteditable?: boolean | string;
733 contextMenu?: string;
734 contextmenu?: string;
735 dir?: string;
736 draggable?: boolean;
737 hidden?: boolean;
738 id?: string;
739 lang?: string;
740 slot?: string;
741 spellCheck?: boolean;
742 spellcheck?: boolean | string;
743 style?: { [key: string]: string };
744 tabIndex?: number;
745 tabindex?: number | string;
746 title?: string;
747
748 // Unknown
749 inputMode?: string;
750 inputmode?: string;
751 is?: string;
752 radioGroup?: string; // <command>, <menuitem>
753 radiogroup?: string;
754
755 // WAI-ARIA
756 role?: string;
757
758 // RDFa Attributes
759 about?: string;
760 datatype?: string;
761 inlist?: any;
762 prefix?: string;
763 property?: string;
764 resource?: string;
765 typeof?: string;
766 vocab?: string;
767
768 // Non-standard Attributes
769 autoCapitalize?: string;
770 autocapitalize?: string;
771 autoCorrect?: string;
772 autocorrect?: string;
773 autoSave?: string;
774 autosave?: string;
775 color?: string;
776 itemProp?: string;
777 itemprop?: string;
778 itemScope?: boolean;
779 itemscope?: boolean;
780 itemType?: string;
781 itemtype?: string;
782 itemID?: string;
783 itemid?: string;
784 itemRef?: string;
785 itemref?: string;
786 results?: number;
787 security?: string;
788 unselectable?: boolean;
789 }
790
791 export interface SVGAttributes extends StencilGlobalHTMLAttributes, DOMAttributes {
792 // Attributes which also defined in HTMLAttributes
793 // See comment in SVGDOMPropertyConfig.js
794 class?: string | { [className: string]: boolean };
795 color?: string;
796 height?: number | string;
797 id?: string;
798 lang?: string;
799 max?: number | string;
800 media?: string;
801 method?: string;
802 min?: number | string;
803 name?: string;
804 style?: { [key: string]: any; };
805 target?: string;
806 type?: string;
807 width?: number | string;
808
809 // Other HTML properties supported by SVG elements in browsers
810 role?: string;
811 tabIndex?: number;
812
813 // SVG Specific attributes
814 accentHeight?: number | string;
815 accumulate?: 'none' | 'sum';
816 additive?: 'replace' | 'sum';
817 alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' |
818 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit';
819 allowReorder?: 'no' | 'yes';
820 alphabetic?: number | string;
821 amplitude?: number | string;
822 arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated';
823 ascent?: number | string;
824 attributeName?: string;
825 attributeType?: string;
826 autoReverse?: number | string;
827 azimuth?: number | string;
828 baseFrequency?: number | string;
829 baselineShift?: number | string;
830 baseProfile?: number | string;
831 bbox?: number | string;
832 begin?: number | string;
833 bias?: number | string;
834 by?: number | string;
835 calcMode?: number | string;
836 capHeight?: number | string;
837 clip?: number | string;
838 clipPath?: string;
839 clipPathUnits?: number | string;
840 clipRule?: number | string;
841 colorInterpolation?: number | string;
842 colorInterpolationFilters?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit';
843 colorProfile?: number | string;
844 colorRendering?: number | string;
845 contentScriptType?: number | string;
846 contentStyleType?: number | string;
847 cursor?: number | string;
848 cx?: number | string;
849 cy?: number | string;
850 d?: string;
851 decelerate?: number | string;
852 descent?: number | string;
853 diffuseConstant?: number | string;
854 direction?: number | string;
855 display?: number | string;
856 divisor?: number | string;
857 dominantBaseline?: number | string;
858 dur?: number | string;
859 dx?: number | string;
860 dy?: number | string;
861 edgeMode?: number | string;
862 elevation?: number | string;
863 enableBackground?: number | string;
864 end?: number | string;
865 exponent?: number | string;
866 externalResourcesRequired?: number | string;
867 fill?: string;
868 fillOpacity?: number | string;
869 fillRule?: 'nonzero' | 'evenodd' | 'inherit';
870 filter?: string;
871 filterRes?: number | string;
872 filterUnits?: number | string;
873 floodColor?: number | string;
874 floodOpacity?: number | string;
875 focusable?: number | string;
876 fontFamily?: string;
877 fontSize?: number | string;
878 fontSizeAdjust?: number | string;
879 fontStretch?: number | string;
880 fontStyle?: number | string;
881 fontVariant?: number | string;
882 fontWeight?: number | string;
883 format?: number | string;
884 from?: number | string;
885 fx?: number | string;
886 fy?: number | string;
887 g1?: number | string;
888 g2?: number | string;
889 glyphName?: number | string;
890 glyphOrientationHorizontal?: number | string;
891 glyphOrientationVertical?: number | string;
892 glyphRef?: number | string;
893 gradientTransform?: string;
894 gradientUnits?: string;
895 hanging?: number | string;
896 horizAdvX?: number | string;
897 horizOriginX?: number | string;
898 ideographic?: number | string;
899 imageRendering?: number | string;
900 in2?: number | string;
901 in?: string;
902 intercept?: number | string;
903 k1?: number | string;
904 k2?: number | string;
905 k3?: number | string;
906 k4?: number | string;
907 k?: number | string;
908 kernelMatrix?: number | string;
909 kernelUnitLength?: number | string;
910 kerning?: number | string;
911 keyPoints?: number | string;
912 keySplines?: number | string;
913 keyTimes?: number | string;
914 lengthAdjust?: number | string;
915 letterSpacing?: number | string;
916 lightingColor?: number | string;
917 limitingConeAngle?: number | string;
918 local?: number | string;
919 markerEnd?: string;
920 markerHeight?: number | string;
921 markerMid?: string;
922 markerStart?: string;
923 markerUnits?: number | string;
924 markerWidth?: number | string;
925 mask?: string;
926 maskContentUnits?: number | string;
927 maskUnits?: number | string;
928 mathematical?: number | string;
929 mode?: number | string;
930 numOctaves?: number | string;
931 offset?: number | string;
932 opacity?: number | string;
933 operator?: number | string;
934 order?: number | string;
935 orient?: number | string;
936 orientation?: number | string;
937 origin?: number | string;
938 overflow?: number | string;
939 overlinePosition?: number | string;
940 overlineThickness?: number | string;
941 paintOrder?: number | string;
942 panose1?: number | string;
943 pathLength?: number | string;
944 patternContentUnits?: string;
945 patternTransform?: number | string;
946 patternUnits?: string;
947 pointerEvents?: number | string;
948 points?: string;
949 pointsAtX?: number | string;
950 pointsAtY?: number | string;
951 pointsAtZ?: number | string;
952 preserveAlpha?: number | string;
953 preserveAspectRatio?: string;
954 primitiveUnits?: number | string;
955 r?: number | string;
956 radius?: number | string;
957 refX?: number | string;
958 refY?: number | string;
959 renderingIntent?: number | string;
960 repeatCount?: number | string;
961 repeatDur?: number | string;
962 requiredExtensions?: number | string;
963 requiredFeatures?: number | string;
964 restart?: number | string;
965 result?: string;
966 rotate?: number | string;
967 rx?: number | string;
968 ry?: number | string;
969 scale?: number | string;
970 seed?: number | string;
971 shapeRendering?: number | string;
972 slope?: number | string;
973 spacing?: number | string;
974 specularConstant?: number | string;
975 specularExponent?: number | string;
976 speed?: number | string;
977 spreadMethod?: string;
978 startOffset?: number | string;
979 stdDeviation?: number | string;
980 stemh?: number | string;
981 stemv?: number | string;
982 stitchTiles?: number | string;
983 stopColor?: string;
984 stopOpacity?: number | string;
985 strikethroughPosition?: number | string;
986 strikethroughThickness?: number | string;
987 string?: number | string;
988 stroke?: string;
989 strokeDasharray?: string | number;
990 strokeDashoffset?: string | number;
991 strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
992 strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
993 strokeMiterlimit?: string;
994 strokeOpacity?: number | string;
995 strokeWidth?: number | string;
996 surfaceScale?: number | string;
997 systemLanguage?: number | string;
998 tableValues?: number | string;
999 targetX?: number | string;
1000 targetY?: number | string;
1001 textAnchor?: string;
1002 textDecoration?: number | string;
1003 textLength?: number | string;
1004 textRendering?: number | string;
1005 to?: number | string;
1006 transform?: string;
1007 u1?: number | string;
1008 u2?: number | string;
1009 underlinePosition?: number | string;
1010 underlineThickness?: number | string;
1011 unicode?: number | string;
1012 unicodeBidi?: number | string;
1013 unicodeRange?: number | string;
1014 unitsPerEm?: number | string;
1015 vAlphabetic?: number | string;
1016 values?: string;
1017 vectorEffect?: number | string;
1018 version?: string;
1019 vertAdvY?: number | string;
1020 vertOriginX?: number | string;
1021 vertOriginY?: number | string;
1022 vHanging?: number | string;
1023 vIdeographic?: number | string;
1024 viewBox?: string;
1025 viewTarget?: number | string;
1026 visibility?: number | string;
1027 vMathematical?: number | string;
1028 widths?: number | string;
1029 wordSpacing?: number | string;
1030 writingMode?: number | string;
1031 x1?: number | string;
1032 x2?: number | string;
1033 x?: number | string;
1034 xChannelSelector?: string;
1035 xHeight?: number | string;
1036 xlinkActuate?: string;
1037 xlinkArcrole?: string;
1038 xlinkHref?: string;
1039 xlinkRole?: string;
1040 xlinkShow?: string;
1041 xlinkTitle?: string;
1042 xlinkType?: string;
1043 xmlBase?: string;
1044 xmlLang?: string;
1045 xmlns?: string;
1046 xmlnsXlink?: string;
1047 xmlSpace?: string;
1048 y1?: number | string;
1049 y2?: number | string;
1050 y?: number | string;
1051 yChannelSelector?: string;
1052 z?: number | string;
1053 zoomAndPan?: string;
1054 }
1055
1056 export interface DOMAttributes {
1057 // Clipboard Events
1058 onCopy?: (event: ClipboardEvent) => void;
1059 onCopyCapture?: (event: ClipboardEvent) => void;
1060 onCut?: (event: ClipboardEvent) => void;
1061 onCutCapture?: (event: ClipboardEvent) => void;
1062 onPaste?: (event: ClipboardEvent) => void;
1063 onPasteCapture?: (event: ClipboardEvent) => void;
1064
1065 // Composition Events
1066 onCompositionEnd?: (event: CompositionEvent) => void;
1067 onCompositionEndCapture?: (event: CompositionEvent) => void;
1068 onCompositionStart?: (event: CompositionEvent) => void;
1069 onCompositionStartCapture?: (event: CompositionEvent) => void;
1070 onCompositionUpdate?: (event: CompositionEvent) => void;
1071 onCompositionUpdateCapture?: (event: CompositionEvent) => void;
1072
1073 // Focus Events
1074 onFocus?: (event: FocusEvent) => void;
1075 onFocusCapture?: (event: FocusEvent) => void;
1076 onBlur?: (event: FocusEvent) => void;
1077 onBlurCapture?: (event: FocusEvent) => void;
1078
1079 // Form Events
1080 onChange?: (event: Event) => void;
1081 onChangeCapture?: (event: Event) => void;
1082 onInput?: (event: Event) => void;
1083 onInputCapture?: (event: Event) => void;
1084 onReset?: (event: Event) => void;
1085 onResetCapture?: (event: Event) => void;
1086 onSubmit?: (event: Event) => void;
1087 onSubmitCapture?: (event: Event) => void;
1088 onInvalid?: (event: Event) => void;
1089 onInvalidCapture?: (event: Event) => void;
1090
1091 // Image Events
1092 onLoad?: (event: Event) => void;
1093 onLoadCapture?: (event: Event) => void;
1094 onError?: (event: Event) => void; // also a Media Event
1095 onErrorCapture?: (event: Event) => void; // also a Media Event
1096
1097 // Keyboard Events
1098 onKeyDown?: (event: KeyboardEvent) => void;
1099 onKeyDownCapture?: (event: KeyboardEvent) => void;
1100 onKeyPress?: (event: KeyboardEvent) => void;
1101 onKeyPressCapture?: (event: KeyboardEvent) => void;
1102 onKeyUp?: (event: KeyboardEvent) => void;
1103 onKeyUpCapture?: (event: KeyboardEvent) => void;
1104
1105 // MouseEvents
1106 onAuxClick?: (event: MouseEvent) => void;
1107 onClick?: (event: MouseEvent) => void;
1108 onClickCapture?: (event: MouseEvent) => void;
1109 onContextMenu?: (event: MouseEvent) => void;
1110 onContextMenuCapture?: (event: MouseEvent) => void;
1111 onDblClick?: (event: MouseEvent) => void;
1112 onDblClickCapture?: (event: MouseEvent) => void;
1113 onDrag?: (event: DragEvent) => void;
1114 onDragCapture?: (event: DragEvent) => void;
1115 onDragEnd?: (event: DragEvent) => void;
1116 onDragEndCapture?: (event: DragEvent) => void;
1117 onDragEnter?: (event: DragEvent) => void;
1118 onDragEnterCapture?: (event: DragEvent) => void;
1119 onDragExit?: (event: DragEvent) => void;
1120 onDragExitCapture?: (event: DragEvent) => void;
1121 onDragLeave?: (event: DragEvent) => void;
1122 onDragLeaveCapture?: (event: DragEvent) => void;
1123 onDragOver?: (event: DragEvent) => void;
1124 onDragOverCapture?: (event: DragEvent) => void;
1125 onDragStart?: (event: DragEvent) => void;
1126 onDragStartCapture?: (event: DragEvent) => void;
1127 onDrop?: (event: DragEvent) => void;
1128 onDropCapture?: (event: DragEvent) => void;
1129 onMouseDown?: (event: MouseEvent) => void;
1130 onMouseDownCapture?: (event: MouseEvent) => void;
1131 onMouseEnter?: (event: MouseEvent) => void;
1132 onMouseLeave?: (event: MouseEvent) => void;
1133 onMouseMove?: (event: MouseEvent) => void;
1134 onMouseMoveCapture?: (event: MouseEvent) => void;
1135 onMouseOut?: (event: MouseEvent) => void;
1136 onMouseOutCapture?: (event: MouseEvent) => void;
1137 onMouseOver?: (event: MouseEvent) => void;
1138 onMouseOverCapture?: (event: MouseEvent) => void;
1139 onMouseUp?: (event: MouseEvent) => void;
1140 onMouseUpCapture?: (event: MouseEvent) => void;
1141
1142 // Touch Events
1143 onTouchCancel?: (event: TouchEvent) => void;
1144 onTouchCancelCapture?: (event: TouchEvent) => void;
1145 onTouchEnd?: (event: TouchEvent) => void;
1146 onTouchEndCapture?: (event: TouchEvent) => void;
1147 onTouchMove?: (event: TouchEvent) => void;
1148 onTouchMoveCapture?: (event: TouchEvent) => void;
1149 onTouchStart?: (event: TouchEvent) => void;
1150 onTouchStartCapture?: (event: TouchEvent) => void;
1151
1152 // UI Events
1153 onScroll?: (event: UIEvent) => void;
1154 onScrollCapture?: (event: UIEvent) => void;
1155
1156 // Wheel Events
1157 onWheel?: (event: WheelEvent) => void;
1158 onWheelCapture?: (event: WheelEvent) => void;
1159
1160 // Animation Events
1161 onAnimationStart?: (event: AnimationEvent) => void;
1162 onAnimationStartCapture?: (event: AnimationEvent) => void;
1163 onAnimationEnd?: (event: AnimationEvent) => void;
1164 onAnimationEndCapture?: (event: AnimationEvent) => void;
1165 onAnimationIteration?: (event: AnimationEvent) => void;
1166 onAnimationIterationCapture?: (event: AnimationEvent) => void;
1167
1168 // Transition Events
1169 onTransitionEnd?: (event: TransitionEvent) => void;
1170 onTransitionEndCapture?: (event: TransitionEvent) => void;
1171 }
1172}
1173
1174export interface FunctionalUtilities {
1175 forEach: (children: FVNode[], cb: (vnode: ChildNode, index: number, array: FVNode[]) => void) => void;
1176 map: (children: FVNode[], cb: (vnode: ChildNode, index: number, array: FVNode[]) => ChildNode) => FVNode[];
1177}
1178
1179export interface FunctionalComponent<T = {}> {
1180 (props: T, children: FVNode[], utils: FunctionalUtilities): FVNode | FVNode[];
1181}
1182
1183export interface FVNode {
1184 // using v prefixes largely so closure has no issue property renaming
1185 vtag?: string | number | Function;
1186 vkey?: string | number;
1187 vtext?: string;
1188 vchildren?: FVNode[];
1189 vattrs?: any;
1190 vname?: string;
1191 ishost?: boolean;
1192 isSlotFallback?: boolean;
1193 isSlotReference?: boolean;
1194}
1195
1196export interface ChildNode {
1197 vtag?: string | number | Function;
1198 vkey?: string | number;
1199 vtext?: string;
1200 vchildren?: ChildNode[];
1201 vattrs?: any;
1202 vname?: string;
1203}