1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export function define<TProps>(fn: JSXElementFactory<TProps & ComponentProps>): JSXElementFactory<TProps & ComponentProps>;
|
9 |
|
10 |
|
11 |
|
12 | export function mount(vNode: VNode, element: Element): void;
|
13 |
|
14 | declare global {
|
15 | namespace JSX {
|
16 | type GlobalHtmlAttributes<TElement extends HTMLElement> = GlobalAttributes<TElement>;
|
17 | type Element = VNode;
|
18 | interface ElementClass<TProps> {
|
19 | props: TProps;
|
20 | }
|
21 | interface ElementAttributesProperty<TProps> {
|
22 | props: TProps;
|
23 | }
|
24 | interface ElementChildrenAttribute {
|
25 | children: {};
|
26 | }
|
27 | interface IntrinsicAttributes {
|
28 | key?: string | number;
|
29 | }
|
30 | interface IntrinsicElements {
|
31 | nothing: {};
|
32 | a: AAttributes;
|
33 | abbr: GlobalHtmlAttributes<HTMLElement>;
|
34 | address: GlobalHtmlAttributes<HTMLElement>;
|
35 | area: AreaAttributes;
|
36 | article: GlobalHtmlAttributes<HTMLElement>;
|
37 | aside: GlobalHtmlAttributes<HTMLElement>;
|
38 | audio: AudioAttributes;
|
39 | b: GlobalHtmlAttributes<HTMLElement>;
|
40 | bdi: GlobalHtmlAttributes<HTMLElement>;
|
41 | bdo: GlobalHtmlAttributes<HTMLElement>;
|
42 | blockquote: GlobalHtmlAttributes<HTMLElement>;
|
43 | br: GlobalHtmlAttributes<HTMLBRElement>;
|
44 | button: ButtonAttributes;
|
45 | canvas: CanvasAttributes;
|
46 | caption: GlobalHtmlAttributes<HTMLTableCaptionElement>;
|
47 | cite: GlobalHtmlAttributes<HTMLElement>;
|
48 | code: GlobalHtmlAttributes<HTMLElement>;
|
49 | col: ColAttributes;
|
50 | colgroup: ColGroupAttributes;
|
51 | data: GlobalHtmlAttributes<HTMLElement>;
|
52 | datalist: GlobalHtmlAttributes<HTMLDataListElement>;
|
53 | dd: GlobalHtmlAttributes<HTMLElement>;
|
54 | del: DelAttributes;
|
55 | details: DetailsAttributes;
|
56 | dfn: GlobalHtmlAttributes<HTMLElement>;
|
57 | div: GlobalHtmlAttributes<HTMLDivElement>;
|
58 | dl: GlobalHtmlAttributes<HTMLDListElement>;
|
59 | dt: GlobalHtmlAttributes<HTMLElement>;
|
60 | em: GlobalHtmlAttributes<HTMLElement>;
|
61 | embed: EmbedAttributes;
|
62 | fieldset: FieldsetAttributes;
|
63 | figcaption: GlobalHtmlAttributes<HTMLElement>;
|
64 | figure: GlobalHtmlAttributes<HTMLElement>;
|
65 | footer: GlobalHtmlAttributes<HTMLElement>;
|
66 | form: FormAttributes;
|
67 | h1: GlobalHtmlAttributes<HTMLHeadingElement>;
|
68 | h2: GlobalHtmlAttributes<HTMLHeadingElement>;
|
69 | h3: GlobalHtmlAttributes<HTMLHeadingElement>;
|
70 | h4: GlobalHtmlAttributes<HTMLHeadingElement>;
|
71 | h5: GlobalHtmlAttributes<HTMLHeadingElement>;
|
72 | h6: GlobalHtmlAttributes<HTMLHeadingElement>;
|
73 | header: GlobalHtmlAttributes<HTMLElement>;
|
74 | hr: GlobalHtmlAttributes<HTMLHRElement>;
|
75 | i: GlobalHtmlAttributes<HTMLElement>;
|
76 | iframe: IframeAttributes;
|
77 | img: ImgAttributes;
|
78 | input: InputAttributes;
|
79 | ins: InsAttributes;
|
80 | kbd: GlobalHtmlAttributes<HTMLElement>;
|
81 | label: LabelAttributes;
|
82 | legend: GlobalHtmlAttributes<HTMLLegendElement>;
|
83 | li: LiAttributes;
|
84 | main: GlobalHtmlAttributes<HTMLElement>;
|
85 | map: MapAttributes;
|
86 | mark: GlobalHtmlAttributes<HTMLElement>;
|
87 | meter: MeterAttributes;
|
88 | nav: GlobalHtmlAttributes<HTMLElement>;
|
89 | object: ObjectAttributes;
|
90 | ol: GlobalHtmlAttributes<HTMLOListElement>;
|
91 | optgroup: OptgroupAttributes;
|
92 | option: OptionAttributes;
|
93 | output: GlobalHtmlAttributes<HTMLElement>;
|
94 | p: GlobalHtmlAttributes<HTMLParagraphElement>;
|
95 | param: ParamAttributes;
|
96 | picture: GlobalHtmlAttributes<HTMLPictureElement>;
|
97 | pre: GlobalHtmlAttributes<HTMLPreElement>;
|
98 | progress: ProgressAttributes;
|
99 | q: QAttributes;
|
100 | rb: GlobalHtmlAttributes<HTMLElement>;
|
101 | rp: GlobalHtmlAttributes<HTMLElement>;
|
102 | rt: GlobalHtmlAttributes<HTMLElement>;
|
103 | rtc: GlobalHtmlAttributes<HTMLElement>;
|
104 | ruby: GlobalHtmlAttributes<HTMLElement>;
|
105 | s: GlobalHtmlAttributes<HTMLElement>;
|
106 | samp: GlobalHtmlAttributes<HTMLElement>;
|
107 | section: GlobalHtmlAttributes<HTMLElement>;
|
108 | select: SelectAttributes;
|
109 | small: GlobalHtmlAttributes<HTMLElement>;
|
110 | source: SourceAttributes;
|
111 | span: GlobalHtmlAttributes<HTMLElement>;
|
112 | strong: GlobalHtmlAttributes<HTMLElement>;
|
113 | sub: GlobalHtmlAttributes<HTMLElement>;
|
114 | summary: GlobalHtmlAttributes<HTMLElement>;
|
115 | sup: GlobalHtmlAttributes<HTMLElement>;
|
116 | table: GlobalHtmlAttributes<HTMLTableElement>;
|
117 | tbody: GlobalHtmlAttributes<HTMLTableSectionElement>;
|
118 | td: TdAttributes;
|
119 | textarea: TextareaAttributes;
|
120 | tfoot: GlobalHtmlAttributes<HTMLTableSectionElement>;
|
121 | th: ThAttributes;
|
122 | thead: GlobalHtmlAttributes<HTMLTableSectionElement>;
|
123 | time: TimeAttributes;
|
124 | tr: GlobalHtmlAttributes<HTMLTableRowElement>;
|
125 | track: TrackAttributes;
|
126 | u: GlobalHtmlAttributes<HTMLElement>;
|
127 | ul: GlobalHtmlAttributes<HTMLUListElement>;
|
128 | var: GlobalHtmlAttributes<HTMLElement>;
|
129 | video: VideoAttributes;
|
130 | wbr: GlobalHtmlAttributes<HTMLElement>;
|
131 | altGlyph: SvgAttributes;
|
132 | altGlyphDef: SvgAttributes;
|
133 | altGlyphItem: SvgAttributes;
|
134 | animate: SvgAttributes;
|
135 | animateColor: SvgAttributes;
|
136 | animateMotion: SvgAttributes;
|
137 | animateTransform: SvgAttributes;
|
138 | circle: SvgAttributes;
|
139 | clipPath: SvgAttributes;
|
140 | 'color-profile': SvgAttributes;
|
141 | cursor: SvgAttributes;
|
142 | defs: SvgAttributes;
|
143 | desc: SvgAttributes;
|
144 | discard: SvgAttributes;
|
145 | ellipse: SvgAttributes;
|
146 | feBlend: SvgAttributes;
|
147 | feColorMatrix: SvgAttributes;
|
148 | feComponentTransfer: SvgAttributes;
|
149 | feComposite: SvgAttributes;
|
150 | feConvolveMatrix: SvgAttributes;
|
151 | feDiffuseLighting: SvgAttributes;
|
152 | feDisplacementMap: SvgAttributes;
|
153 | feDistantLight: SvgAttributes;
|
154 | feDropShadow: SvgAttributes;
|
155 | feFlood: SvgAttributes;
|
156 | feFuncA: SvgAttributes;
|
157 | feFuncB: SvgAttributes;
|
158 | feFuncG: SvgAttributes;
|
159 | feFuncR: SvgAttributes;
|
160 | feGaussianBlur: SvgAttributes;
|
161 | feImage: SvgAttributes;
|
162 | feMerge: SvgAttributes;
|
163 | feMergeNode: SvgAttributes;
|
164 | feMorphology: SvgAttributes;
|
165 | feOffset: SvgAttributes;
|
166 | fePointLight: SvgAttributes;
|
167 | feSpecularLighting: SvgAttributes;
|
168 | feSpotLight: SvgAttributes;
|
169 | feTile: SvgAttributes;
|
170 | feTurbulence: SvgAttributes;
|
171 | filter: SvgAttributes;
|
172 | font: SvgAttributes;
|
173 | 'font-face': SvgAttributes;
|
174 | 'font-face-format': SvgAttributes;
|
175 | 'font-face-name': SvgAttributes;
|
176 | 'font-face-src': SvgAttributes;
|
177 | 'font-face-uri': SvgAttributes;
|
178 | foreignObject: SvgAttributes;
|
179 | g: SvgAttributes;
|
180 | glyph: SvgAttributes;
|
181 | glyphRef: SvgAttributes;
|
182 | hatch: SvgAttributes;
|
183 | hatchpath: SvgAttributes;
|
184 | hkern: SvgAttributes;
|
185 | image: SvgAttributes;
|
186 | line: SvgAttributes;
|
187 | linearGradient: SvgAttributes;
|
188 | marker: SvgAttributes;
|
189 | mask: SvgAttributes;
|
190 | mesh: SvgAttributes;
|
191 | meshgradient: SvgAttributes;
|
192 | meshpatch: SvgAttributes;
|
193 | meshrow: SvgAttributes;
|
194 | metadata: SvgAttributes;
|
195 | 'missing-glyph': SvgAttributes;
|
196 | mpath: SvgAttributes;
|
197 | path: SvgAttributes;
|
198 | pattern: SvgAttributes;
|
199 | polygon: SvgAttributes;
|
200 | polyline: SvgAttributes;
|
201 | radialGradient: SvgAttributes;
|
202 | rect: SvgAttributes;
|
203 | script: SvgAttributes;
|
204 | set: SvgAttributes;
|
205 | solidcolor: SvgAttributes;
|
206 | stop: SvgAttributes;
|
207 | style: SvgAttributes;
|
208 | svg: SvgAttributes;
|
209 | switch: SvgAttributes;
|
210 | symbol: SvgAttributes;
|
211 | text: SvgAttributes;
|
212 | textPath: SvgAttributes;
|
213 | title: SvgAttributes;
|
214 | tref: SvgAttributes;
|
215 | tspan: SvgAttributes;
|
216 | unknown: SvgAttributes;
|
217 | use: SvgAttributes;
|
218 | view: SvgAttributes;
|
219 | vkern: SvgAttributes;
|
220 | }
|
221 | }
|
222 | }
|
223 | export type TextNode = string | number;
|
224 | export type Key = string | number;
|
225 | type MyraChild = VNode | TextNode;
|
226 | interface MyraNodeArray extends Array<MyraNode> {
|
227 | }
|
228 | export type MyraNode = MyraChild | MyraNodeArray | boolean | null | undefined;
|
229 | export type UpdateState<TState> = TState | ((s: Readonly<TState>) => TState);
|
230 | export type Evolve<TState> = (update: UpdateState<TState>) => TState;
|
231 | export type ComponentFactory<TProps> = (props: TProps) => MyraNode;
|
232 | export type JSXElementFactory<TProps> = (props: TProps) => VNode;
|
233 | export type ErrorHandler = (error: any) => VNode;
|
234 | export interface Ref<T> {
|
235 | current: T;
|
236 | }
|
237 | export type Effect = () => EffectCleanupCallback;
|
238 | export type EffectCleanupCallback = (() => void) | void;
|
239 | export interface ComponentProps extends Record<string, any> {
|
240 | children?: MyraNode;
|
241 | key?: Key;
|
242 | }
|
243 | export const enum VNodeType {
|
244 | Nothing = 0,
|
245 | Text = 1,
|
246 | Element = 2,
|
247 | Fragment = 3,
|
248 | Component = 4,
|
249 | Memo = 5
|
250 | }
|
251 | /**
|
252 | * Base interface for a virtual node.
|
253 | */
|
254 | export interface VNodeBase {
|
255 | /**
|
256 | * A reference to a DOM node.
|
257 | */
|
258 | domRef?: Node;
|
259 | }
|
260 | /**
|
261 | * A virtual node representing nothing. Will be rendered as a comment DOM
|
262 | * node.
|
263 | */
|
264 | export interface NothingVNode extends VNodeBase {
|
265 | readonly _: VNodeType.Nothing;
|
266 | }
|
267 | /**
|
268 | * A virtual node that represents a text DOM node.
|
269 | */
|
270 | export interface TextVNode extends VNodeBase {
|
271 | readonly _: VNodeType.Text;
|
272 | readonly value: string;
|
273 | }
|
274 | /**
|
275 | * A virtual node representing a DOM Element.
|
276 | */
|
277 | export interface ElementVNode<TElement extends Element> extends VNodeBase {
|
278 | readonly _: VNodeType.Element;
|
279 | readonly tagName: string;
|
280 | readonly props: GlobalAttributes<TElement> & {
|
281 | children: VNode[];
|
282 | };
|
283 | domRef?: TElement;
|
284 | }
|
285 | export interface FragmentVNode extends VNodeBase {
|
286 | readonly _: VNodeType.Fragment;
|
287 | readonly props: {
|
288 | children: VNode[];
|
289 | key?: Key;
|
290 | };
|
291 | domRef?: HTMLElement;
|
292 | }
|
293 | export interface EffectWrapper {
|
294 | arg: any;
|
295 | cleanup?: EffectCleanupCallback;
|
296 | effect: Effect;
|
297 | invoke: boolean;
|
298 | sync: boolean;
|
299 | }
|
300 | /**
|
301 | * A virtual node representing a component.
|
302 | */
|
303 | export interface ComponentVNode<TProps> extends VNodeBase {
|
304 | readonly _: VNodeType.Component;
|
305 | data?: any[];
|
306 | /** A flag to indicate whether a new "renderComponent" call should be queued or not. */
|
307 | debounceRender: boolean;
|
308 | effects?: Array<EffectWrapper>;
|
309 | errorHandler?: ErrorHandler;
|
310 | link: {
|
311 | vNode: ComponentVNode<TProps>;
|
312 | };
|
313 | props: TProps;
|
314 | /** The most recent VNode tree of the component. */
|
315 | rendition?: VNode;
|
316 | /** The function that generates a VNode tree for the component. */
|
317 | view: ComponentFactory<TProps>;
|
318 | }
|
319 | export interface MemoVNode<TProps> extends VNodeBase {
|
320 | readonly _: VNodeType.Memo;
|
321 | readonly compare: (newProps: TProps, oldProps: TProps) => boolean;
|
322 | readonly view: ComponentFactory<TProps>;
|
323 | }
|
324 |
|
325 |
|
326 |
|
327 | export type VNode = TextVNode | ElementVNode<any> | FragmentVNode | ComponentVNode<any> | NothingVNode | MemoVNode<any>;
|
328 | export interface GenericEvent<T extends EventTarget> extends Event {
|
329 | currentTarget: T;
|
330 | }
|
331 | export interface GenericClipboardEvent<T extends EventTarget> extends ClipboardEvent {
|
332 | currentTarget: T;
|
333 | }
|
334 | export interface GenericCompositionEvent<T extends EventTarget> extends CompositionEvent {
|
335 | currentTarget: T;
|
336 | }
|
337 | export interface GenericDragEvent<T extends EventTarget> extends DragEvent {
|
338 | currentTarget: T;
|
339 | }
|
340 | export interface GenericFocusEvent<T extends EventTarget> extends FocusEvent {
|
341 | currentTarget: T;
|
342 | }
|
343 | export interface GenericInputEvent<T extends EventTarget> extends InputEvent {
|
344 | currentTarget: T;
|
345 | }
|
346 | export interface GenericKeyboardEvent<T extends EventTarget> extends KeyboardEvent {
|
347 | currentTarget: T;
|
348 | }
|
349 | export interface GenericMouseEvent<T extends EventTarget> extends MouseEvent {
|
350 | currentTarget: T;
|
351 | }
|
352 | export interface GenericTouchEvent<T extends EventTarget> extends TouchEvent {
|
353 | currentTarget: T;
|
354 | }
|
355 | export interface GenericWheelEvent<T extends EventTarget> extends WheelEvent {
|
356 | currentTarget: T;
|
357 | }
|
358 |
|
359 |
|
360 |
|
361 | export type EventListener<TEvent extends Event> = (event: TEvent) => void;
|
362 | export interface GlobalAttributes<TElement extends Element> {
|
363 | children?: MyraNode;
|
364 | key?: Key;
|
365 | ref?: Ref<TElement>;
|
366 | accesskey?: string;
|
367 | autocapitalize?: string;
|
368 | 'class'?: string;
|
369 | contenteditable?: boolean | '' | 'true' | 'false';
|
370 | contextmenu?: string;
|
371 | dir?: 'ltr' | 'rtl' | 'auto';
|
372 | draggable?: boolean | 'true' | 'false';
|
373 | hidden?: boolean | 'true' | 'false';
|
374 | id?: string;
|
375 | inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
376 | is?: string;
|
377 | itemid?: string;
|
378 | itemprop?: string;
|
379 | itemref?: string;
|
380 | itemscope?: boolean | 'true' | 'false';
|
381 | itemtype?: string;
|
382 | lang?: string;
|
383 | part?: string;
|
384 | slot?: string;
|
385 | spellcheck?: boolean | 'default' | 'true' | 'false';
|
386 | style?: string;
|
387 | tabindex?: number | string;
|
388 | title?: string;
|
389 | translate?: '' | 'yes' | 'no';
|
390 | onauxclick?: EventListener<GenericMouseEvent<TElement>>;
|
391 | onblur?: EventListener<GenericEvent<TElement>>;
|
392 | onclick?: EventListener<GenericMouseEvent<TElement>>;
|
393 | oncontextmenu?: EventListener<GenericEvent<TElement>>;
|
394 | ondblclick?: EventListener<GenericMouseEvent<TElement>>;
|
395 | onerror?: EventListener<GenericEvent<TElement>>;
|
396 | onfocus?: EventListener<GenericFocusEvent<TElement>>;
|
397 | onfocusin?: EventListener<GenericFocusEvent<TElement>>;
|
398 | onfocusout?: EventListener<GenericFocusEvent<TElement>>;
|
399 | onfullscreenchange?: EventListener<GenericEvent<TElement>>;
|
400 | onfullscreenerror?: EventListener<GenericEvent<TElement>>;
|
401 | oninput?: EventListener<GenericInputEvent<HTMLInputElement>>;
|
402 | onkeydown?: EventListener<GenericKeyboardEvent<TElement>>;
|
403 | onkeypress?: EventListener<GenericKeyboardEvent<TElement>>;
|
404 | onkeyup?: EventListener<GenericKeyboardEvent<TElement>>;
|
405 | onmousedown?: EventListener<GenericMouseEvent<TElement>>;
|
406 | onmouseenter?: EventListener<GenericMouseEvent<TElement>>;
|
407 | onmouseleave?: EventListener<GenericMouseEvent<TElement>>;
|
408 | onmousemove?: EventListener<GenericMouseEvent<TElement>>;
|
409 | onmouseout?: EventListener<GenericMouseEvent<TElement>>;
|
410 | onmouseover?: EventListener<GenericMouseEvent<TElement>>;
|
411 | onmouseup?: EventListener<GenericMouseEvent<TElement>>;
|
412 | onselect?: EventListener<GenericEvent<TElement>>;
|
413 | onwheel?: EventListener<GenericWheelEvent<TElement>>;
|
414 | oncompositionend?: EventListener<GenericCompositionEvent<TElement>>;
|
415 | oncompositionstart?: EventListener<GenericCompositionEvent<TElement>>;
|
416 | oncompositionupdate?: EventListener<GenericCompositionEvent<TElement>>;
|
417 | oncopy?: EventListener<GenericClipboardEvent<TElement>>;
|
418 | oncut?: EventListener<GenericClipboardEvent<TElement>>;
|
419 | onpaste?: EventListener<GenericClipboardEvent<TElement>>;
|
420 | ondrag?: EventListener<GenericDragEvent<TElement>>;
|
421 | ondragend?: EventListener<GenericDragEvent<TElement>>;
|
422 | ondragenter?: EventListener<GenericDragEvent<TElement>>;
|
423 | ondragexit?: EventListener<GenericDragEvent<TElement>>;
|
424 | ondragleave?: EventListener<GenericDragEvent<TElement>>;
|
425 | ondragover?: EventListener<GenericDragEvent<TElement>>;
|
426 | ondragstart?: EventListener<GenericDragEvent<TElement>>;
|
427 | ondrop?: EventListener<GenericDragEvent<TElement>>;
|
428 | ontouchcancel?: EventListener<GenericTouchEvent<TElement>>;
|
429 | ontouchend?: EventListener<GenericTouchEvent<TElement>>;
|
430 | ontouchmove?: EventListener<GenericTouchEvent<TElement>>;
|
431 | ontouchstart?: EventListener<GenericTouchEvent<TElement>>;
|
432 | role?: string;
|
433 | 'aria-autocomplete'?: any;
|
434 | 'aria-checked'?: any;
|
435 | 'aria-disabled'?: any;
|
436 | 'aria-expanded'?: any;
|
437 | 'aria-haspopup'?: any;
|
438 | 'aria-hidden'?: any;
|
439 | 'aria-invalid'?: any;
|
440 | 'aria-label'?: any;
|
441 | 'aria-level'?: any;
|
442 | 'aria-multiline'?: any;
|
443 | 'aria-multiselectable'?: any;
|
444 | 'aria-orientation'?: any;
|
445 | 'aria-pressed'?: any;
|
446 | 'aria-readonly'?: any;
|
447 | 'aria-required'?: any;
|
448 | 'aria-selected'?: any;
|
449 | 'aria-sort'?: any;
|
450 | 'aria-valuemax'?: any;
|
451 | 'aria-valuemin'?: any;
|
452 | 'aria-valuenow'?: any;
|
453 | 'aria-valuetext'?: any;
|
454 | 'aria-live'?: any;
|
455 | 'aria-relevant'?: any;
|
456 | 'aria-atomic'?: any;
|
457 | 'aria-busy'?: any;
|
458 | 'aria-dropeffect'?: any;
|
459 | 'aria-dragged'?: any;
|
460 | 'aria-activedescendant'?: any;
|
461 | 'aria-controls'?: any;
|
462 | 'aria-describedby'?: any;
|
463 | 'aria-flowto'?: any;
|
464 | 'aria-labelledby'?: any;
|
465 | 'aria-owns'?: any;
|
466 | 'aria-posinset'?: any;
|
467 | 'aria-setsize'?: any;
|
468 | }
|
469 | export interface AAttributes extends GlobalAttributes<HTMLAnchorElement> {
|
470 | download?: string;
|
471 | href?: string;
|
472 | hreflang?: string;
|
473 | rel?: string;
|
474 | target?: string;
|
475 | type?: string;
|
476 | }
|
477 | export interface AreaAttributes extends GlobalAttributes<HTMLAreaElement> {
|
478 | alt?: string;
|
479 | coords?: string;
|
480 | download?: string;
|
481 | href?: string;
|
482 | hreflang?: string;
|
483 | media?: string;
|
484 | rel?: string;
|
485 | shape?: string;
|
486 | target?: string;
|
487 | type?: string;
|
488 | }
|
489 | export interface AudioAttributes extends GlobalAttributes<HTMLAudioElement> {
|
490 | autoplay?: boolean | 'true' | 'false';
|
491 | buffered?: any;
|
492 | controls?: any;
|
493 | loop?: boolean | 'true' | 'false';
|
494 | muted?: boolean | 'true' | 'false';
|
495 | played?: any;
|
496 | preload?: '' | 'none' | 'metadata' | 'auto';
|
497 | src?: string;
|
498 | volume?: number | string;
|
499 | }
|
500 | export interface ButtonAttributes extends GlobalAttributes<HTMLButtonElement> {
|
501 | autofocus?: boolean | 'true' | 'false';
|
502 | disabled?: boolean | 'true' | 'false';
|
503 | form?: string;
|
504 | formaction?: string;
|
505 | formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
506 | formmethod?: 'post' | 'get';
|
507 | formnovalidate?: boolean | 'true' | 'false';
|
508 | formtarget?: string;
|
509 | name?: string;
|
510 | type?: 'submit' | 'reset' | 'button';
|
511 | value?: string | number;
|
512 | }
|
513 | export interface CanvasAttributes extends GlobalAttributes<HTMLCanvasElement> {
|
514 | height?: number | string;
|
515 | width?: number | string;
|
516 | }
|
517 | export interface ColAttributes extends GlobalAttributes<HTMLTableColElement> {
|
518 | span?: number | string;
|
519 | }
|
520 | export interface ColGroupAttributes extends GlobalAttributes<HTMLTableColElement> {
|
521 | span?: number | string;
|
522 | }
|
523 | export interface DelAttributes extends GlobalAttributes<HTMLElement> {
|
524 | cite?: string;
|
525 | datetime?: string;
|
526 | }
|
527 | export interface DetailsAttributes extends GlobalAttributes<HTMLElement> {
|
528 | open?: boolean | 'true' | 'false';
|
529 | }
|
530 | export interface EmbedAttributes extends GlobalAttributes<HTMLEmbedElement> {
|
531 | height?: number | string;
|
532 | src?: string;
|
533 | type?: string;
|
534 | width?: number | string;
|
535 | }
|
536 | export interface FieldsetAttributes extends GlobalAttributes<HTMLFieldSetElement> {
|
537 | disabled?: boolean | 'true' | 'false';
|
538 | form?: string;
|
539 | name?: string;
|
540 | }
|
541 | export interface FormAttributes extends GlobalAttributes<HTMLFormElement> {
|
542 | accept?: string;
|
543 | 'accept-charset'?: string;
|
544 | action?: string;
|
545 | autocomplete?: 'on' | 'off';
|
546 | enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
547 | method?: 'post' | 'get';
|
548 | name?: string;
|
549 | novalidate?: boolean | 'true' | 'false';
|
550 | target?: string;
|
551 | onreset?: EventListener<GenericEvent<HTMLFormElement>>;
|
552 | onsubmit?: EventListener<GenericEvent<HTMLFormElement>>;
|
553 | onchange?: EventListener<GenericEvent<HTMLFormElement>>;
|
554 | }
|
555 | export interface IframeAttributes extends GlobalAttributes<HTMLIFrameElement> {
|
556 | allow?: string;
|
557 | allowfullscreen?: boolean | 'true' | 'false';
|
558 | allowpaymentrequest?: boolean | 'true' | 'false';
|
559 | height?: number | string;
|
560 | loading?: 'eager' | 'lazy';
|
561 | name?: string;
|
562 | referrerpolicy?: string;
|
563 | sandbox?: string;
|
564 | src?: string;
|
565 | srcdoc?: string;
|
566 | width?: number | string;
|
567 | }
|
568 | export interface ImgAttributes extends GlobalAttributes<HTMLImageElement> {
|
569 | alt?: string;
|
570 | crossorigin?: 'anonymous' | 'use-credentials';
|
571 | height?: number | string;
|
572 | ismap?: boolean | 'true' | 'false';
|
573 | longdesc?: string;
|
574 | sizes?: string;
|
575 | src: string;
|
576 | srcset?: string;
|
577 | width?: number | string;
|
578 | usemap?: string;
|
579 | }
|
580 | export interface InputAttributes extends Omit<GlobalAttributes<HTMLInputElement>, 'oninput'> {
|
581 | type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
582 | accept?: string;
|
583 | autocomplete?: string;
|
584 | autofocus?: boolean | 'true' | 'false';
|
585 | capture?: boolean | 'true' | 'false';
|
586 | checked?: boolean | 'true' | 'false';
|
587 | disabled?: boolean | 'true' | 'false';
|
588 | form?: string;
|
589 | formaction?: string;
|
590 | formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
591 | formmethod?: 'post' | 'get';
|
592 | formnovalidate?: boolean | 'true' | 'false';
|
593 | formtarget?: string;
|
594 | height?: number | string;
|
595 | list?: string;
|
596 | max?: number | string;
|
597 | maxlength?: number | string;
|
598 | min?: number | string;
|
599 | minlength?: number | string;
|
600 | multiple?: boolean | 'true' | 'false';
|
601 | name?: string;
|
602 | pattern?: string;
|
603 | placeholder?: string;
|
604 | readonly?: boolean | 'true' | 'false';
|
605 | required?: boolean | 'true' | 'false';
|
606 | selectionDirection?: string;
|
607 | size?: number | string;
|
608 | spellcheck?: boolean | 'true' | 'false';
|
609 | src?: string;
|
610 | step?: number | string;
|
611 | value?: string | number;
|
612 | width?: number | string;
|
613 | onchange?: EventListener<GenericEvent<HTMLInputElement>>;
|
614 | oninput?: EventListener<GenericEvent<HTMLInputElement>>;
|
615 | }
|
616 | export interface InsAttributes extends GlobalAttributes<HTMLElement> {
|
617 | cite?: string;
|
618 | datetime?: string;
|
619 | }
|
620 | export interface LabelAttributes extends GlobalAttributes<HTMLLabelElement> {
|
621 | for?: string;
|
622 | form?: string;
|
623 | }
|
624 | export interface LiAttributes extends GlobalAttributes<HTMLLIElement> {
|
625 | value?: number | string;
|
626 | }
|
627 | export interface MapAttributes extends GlobalAttributes<HTMLMapElement> {
|
628 | name?: string;
|
629 | }
|
630 | export interface MeterAttributes extends GlobalAttributes<HTMLMeterElement> {
|
631 | value?: number | string;
|
632 | min?: number | string;
|
633 | max?: number | string;
|
634 | low?: number | string;
|
635 | high?: number | string;
|
636 | optimum?: number | string;
|
637 | form?: string;
|
638 | }
|
639 | export interface ObjectAttributes extends GlobalAttributes<HTMLObjectElement> {
|
640 | data?: string;
|
641 | height?: number | string;
|
642 | name?: string;
|
643 | type?: string;
|
644 | usemap?: string;
|
645 | width?: number | string;
|
646 | }
|
647 | export interface OptgroupAttributes extends GlobalAttributes<HTMLOptGroupElement> {
|
648 | disabled?: boolean | 'true' | 'false';
|
649 | label?: string;
|
650 | }
|
651 | export interface OptionAttributes extends GlobalAttributes<HTMLOptionElement> {
|
652 | disabled?: boolean | 'true' | 'false';
|
653 | label?: string;
|
654 | selected?: boolean | 'true' | 'false';
|
655 | value?: string | number;
|
656 | }
|
657 | export interface ParamAttributes extends GlobalAttributes<HTMLParamElement> {
|
658 | name?: string;
|
659 | value?: string;
|
660 | }
|
661 | export interface ProgressAttributes extends GlobalAttributes<HTMLProgressElement> {
|
662 | max?: number | string;
|
663 | value?: number | string;
|
664 | }
|
665 | export interface QAttributes extends GlobalAttributes<HTMLQuoteElement> {
|
666 | cite?: string;
|
667 | }
|
668 | export interface SelectAttributes extends GlobalAttributes<HTMLSelectElement> {
|
669 | autofocus?: boolean | 'true' | 'false';
|
670 | disabled?: boolean | 'true' | 'false';
|
671 | form?: string;
|
672 | multiple?: boolean | 'true' | 'false';
|
673 | name?: string;
|
674 | required?: boolean | 'true' | 'false';
|
675 | size?: number | string;
|
676 | onchange?: EventListener<GenericEvent<HTMLSelectElement>>;
|
677 | }
|
678 | export interface SourceAttributes extends GlobalAttributes<HTMLSourceElement> {
|
679 | src?: string;
|
680 | type?: string;
|
681 | }
|
682 | export interface TdAttributes extends GlobalAttributes<HTMLTableCellElement> {
|
683 | colspan?: number | string;
|
684 | headers?: string;
|
685 | rowspan?: number | string;
|
686 | }
|
687 | export interface TextareaAttributes extends Omit<GlobalAttributes<HTMLTextAreaElement>, 'oninput'> {
|
688 | autocomplete?: 'on' | 'off';
|
689 | autofocus?: boolean | 'true' | 'false';
|
690 | cols?: number | string;
|
691 | disabled?: boolean | 'true' | 'false';
|
692 | form?: string;
|
693 | maxlength?: number | string;
|
694 | minlength?: number | string;
|
695 | name?: string;
|
696 | placeholder?: string;
|
697 | required?: boolean | 'true' | 'false';
|
698 | rows?: number | string;
|
699 | selectionDirection?: string;
|
700 | selectionEnd?: number | string;
|
701 | selectionStart?: number | string;
|
702 | value?: string;
|
703 | wrap?: 'soft' | 'hard';
|
704 | onchange?: EventListener<GenericEvent<HTMLTextAreaElement>>;
|
705 | oninput?: EventListener<GenericEvent<HTMLTextAreaElement>>;
|
706 | }
|
707 | export interface ThAttributes extends GlobalAttributes<HTMLTableHeaderCellElement> {
|
708 | colspan?: number | string;
|
709 | headers?: string;
|
710 | rowspan?: number | string;
|
711 | scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | 'auto';
|
712 | }
|
713 | export interface TimeAttributes extends GlobalAttributes<HTMLElement> {
|
714 | datetime?: string;
|
715 | }
|
716 | export interface TrackAttributes extends GlobalAttributes<HTMLTrackElement> {
|
717 | default?: boolean | 'true' | 'false';
|
718 | kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
|
719 | label?: string;
|
720 | src?: string;
|
721 | srclang?: string;
|
722 | }
|
723 | export interface VideoAttributes extends GlobalAttributes<HTMLVideoElement> {
|
724 | autoplay?: boolean | 'true' | 'false';
|
725 | buffered?: any;
|
726 | controls?: boolean | 'true' | 'false';
|
727 | crossorigin?: 'anonymous' | 'use-credentials';
|
728 | height?: number | string;
|
729 | loop?: boolean | 'true' | 'false';
|
730 | muted?: boolean | 'true' | 'false';
|
731 | playsinline?: boolean;
|
732 | poster?: string;
|
733 | preload?: 'none' | 'metadata' | 'auto' | '';
|
734 | src?: string;
|
735 | width?: number | string;
|
736 | }
|
737 | export interface SvgAttributes {
|
738 | [name: string]: any;
|
739 | }
|
740 | export {};
|
741 |
|
742 | interface IProps {
|
743 | children?: VNode[];
|
744 | key?: Key;
|
745 | }
|
746 | export function Fragment(props: IProps): FragmentVNode;
|
747 | export {};
|
748 |
|
749 |
|
750 |
|
751 |
|
752 | export function h<TProps>(tagNameOrComponent: string | ComponentFactory<object> | undefined | null, props: TProps, ...children: Array<MyraNode>): JSX.Element;
|
753 |
|
754 | type LazyStateInitialization<TState> = () => TState;
|
755 |
|
756 |
|
757 |
|
758 |
|
759 | export function useState<TState>(initialState: TState | LazyStateInitialization<TState>): [TState, Evolve<TState>];
|
760 |
|
761 |
|
762 |
|
763 |
|
764 | export function useRef<T>(current?: T): Ref<T>;
|
765 |
|
766 |
|
767 |
|
768 |
|
769 | export function useErrorHandler(handler: ErrorHandler): void;
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 | export function useLayoutEffect<TArg extends unknown[]>(effect: Effect, arg?: TArg): void;
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 | export function useEffect<TArg extends unknown[]>(effect: Effect, arg?: TArg): void;
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 | export function useMemo<TMemoization, TArgs>(fn: (args: TArgs) => TMemoization, inputs: TArgs): TMemoization;
|
788 | export {};
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 | export function memo<TProps>(factory: ComponentFactory<TProps & ComponentProps>, compare?: (newProps: TProps, oldProps: TProps) => boolean): JSXElementFactory<TProps & ComponentProps>;
|
802 |
|
803 | export as namespace myra |
\ | No newline at end of file |