// Generated by dts-bundle v0.7.3 /** * Convenience function for type hinting * * @param fn */ export function define(fn: JSXElementFactory): JSXElementFactory; /** * Mounts a virtual DOM node onto the supplied element. */ export function mount(vNode: VNode, element: Element): void; declare global { namespace JSX { type GlobalHtmlAttributes = GlobalAttributes; type Element = VNode; interface ElementClass { props: TProps; } interface ElementAttributesProperty { props: TProps; } interface ElementChildrenAttribute { children: {}; } interface IntrinsicAttributes { key?: string | number; } interface IntrinsicElements { nothing: {}; a: AAttributes; abbr: GlobalHtmlAttributes; address: GlobalHtmlAttributes; area: AreaAttributes; article: GlobalHtmlAttributes; aside: GlobalHtmlAttributes; audio: AudioAttributes; b: GlobalHtmlAttributes; bdi: GlobalHtmlAttributes; bdo: GlobalHtmlAttributes; blockquote: GlobalHtmlAttributes; br: GlobalHtmlAttributes; button: ButtonAttributes; canvas: CanvasAttributes; caption: GlobalHtmlAttributes; cite: GlobalHtmlAttributes; code: GlobalHtmlAttributes; col: ColAttributes; colgroup: ColGroupAttributes; data: GlobalHtmlAttributes; datalist: GlobalHtmlAttributes; dd: GlobalHtmlAttributes; del: DelAttributes; details: DetailsAttributes; dfn: GlobalHtmlAttributes; div: GlobalHtmlAttributes; dl: GlobalHtmlAttributes; dt: GlobalHtmlAttributes; em: GlobalHtmlAttributes; embed: EmbedAttributes; fieldset: FieldsetAttributes; figcaption: GlobalHtmlAttributes; figure: GlobalHtmlAttributes; footer: GlobalHtmlAttributes; form: FormAttributes; h1: GlobalHtmlAttributes; h2: GlobalHtmlAttributes; h3: GlobalHtmlAttributes; h4: GlobalHtmlAttributes; h5: GlobalHtmlAttributes; h6: GlobalHtmlAttributes; header: GlobalHtmlAttributes; hr: GlobalHtmlAttributes; i: GlobalHtmlAttributes; iframe: IframeAttributes; img: ImgAttributes; input: InputAttributes; ins: InsAttributes; kbd: GlobalHtmlAttributes; label: LabelAttributes; legend: GlobalHtmlAttributes; li: LiAttributes; main: GlobalHtmlAttributes; map: MapAttributes; mark: GlobalHtmlAttributes; meter: MeterAttributes; nav: GlobalHtmlAttributes; object: ObjectAttributes; ol: GlobalHtmlAttributes; optgroup: OptgroupAttributes; option: OptionAttributes; output: GlobalHtmlAttributes; p: GlobalHtmlAttributes; param: ParamAttributes; picture: GlobalHtmlAttributes; pre: GlobalHtmlAttributes; progress: ProgressAttributes; q: QAttributes; rb: GlobalHtmlAttributes; rp: GlobalHtmlAttributes; rt: GlobalHtmlAttributes; rtc: GlobalHtmlAttributes; ruby: GlobalHtmlAttributes; s: GlobalHtmlAttributes; samp: GlobalHtmlAttributes; section: GlobalHtmlAttributes; select: SelectAttributes; small: GlobalHtmlAttributes; source: SourceAttributes; span: GlobalHtmlAttributes; strong: GlobalHtmlAttributes; sub: GlobalHtmlAttributes; summary: GlobalHtmlAttributes; sup: GlobalHtmlAttributes; table: GlobalHtmlAttributes; tbody: GlobalHtmlAttributes; td: TdAttributes; textarea: TextareaAttributes; tfoot: GlobalHtmlAttributes; th: ThAttributes; thead: GlobalHtmlAttributes; time: TimeAttributes; tr: GlobalHtmlAttributes; track: TrackAttributes; u: GlobalHtmlAttributes; ul: GlobalHtmlAttributes; var: GlobalHtmlAttributes; video: VideoAttributes; wbr: GlobalHtmlAttributes; altGlyph: SvgAttributes; altGlyphDef: SvgAttributes; altGlyphItem: SvgAttributes; animate: SvgAttributes; animateColor: SvgAttributes; animateMotion: SvgAttributes; animateTransform: SvgAttributes; circle: SvgAttributes; clipPath: SvgAttributes; 'color-profile': SvgAttributes; cursor: SvgAttributes; defs: SvgAttributes; desc: SvgAttributes; discard: SvgAttributes; ellipse: SvgAttributes; feBlend: SvgAttributes; feColorMatrix: SvgAttributes; feComponentTransfer: SvgAttributes; feComposite: SvgAttributes; feConvolveMatrix: SvgAttributes; feDiffuseLighting: SvgAttributes; feDisplacementMap: SvgAttributes; feDistantLight: SvgAttributes; feDropShadow: SvgAttributes; feFlood: SvgAttributes; feFuncA: SvgAttributes; feFuncB: SvgAttributes; feFuncG: SvgAttributes; feFuncR: SvgAttributes; feGaussianBlur: SvgAttributes; feImage: SvgAttributes; feMerge: SvgAttributes; feMergeNode: SvgAttributes; feMorphology: SvgAttributes; feOffset: SvgAttributes; fePointLight: SvgAttributes; feSpecularLighting: SvgAttributes; feSpotLight: SvgAttributes; feTile: SvgAttributes; feTurbulence: SvgAttributes; filter: SvgAttributes; font: SvgAttributes; 'font-face': SvgAttributes; 'font-face-format': SvgAttributes; 'font-face-name': SvgAttributes; 'font-face-src': SvgAttributes; 'font-face-uri': SvgAttributes; foreignObject: SvgAttributes; g: SvgAttributes; glyph: SvgAttributes; glyphRef: SvgAttributes; hatch: SvgAttributes; hatchpath: SvgAttributes; hkern: SvgAttributes; image: SvgAttributes; line: SvgAttributes; linearGradient: SvgAttributes; marker: SvgAttributes; mask: SvgAttributes; mesh: SvgAttributes; meshgradient: SvgAttributes; meshpatch: SvgAttributes; meshrow: SvgAttributes; metadata: SvgAttributes; 'missing-glyph': SvgAttributes; mpath: SvgAttributes; path: SvgAttributes; pattern: SvgAttributes; polygon: SvgAttributes; polyline: SvgAttributes; radialGradient: SvgAttributes; rect: SvgAttributes; script: SvgAttributes; set: SvgAttributes; solidcolor: SvgAttributes; stop: SvgAttributes; style: SvgAttributes; svg: SvgAttributes; switch: SvgAttributes; symbol: SvgAttributes; text: SvgAttributes; textPath: SvgAttributes; title: SvgAttributes; tref: SvgAttributes; tspan: SvgAttributes; unknown: SvgAttributes; use: SvgAttributes; view: SvgAttributes; vkern: SvgAttributes; } } } export type TextNode = string | number; export type Key = string | number; type MyraChild = VNode | TextNode; interface MyraNodeArray extends Array { } export type MyraNode = MyraChild | MyraNodeArray | boolean | null | undefined; export type UpdateState = TState | ((s: TState) => TState); export type Evolve = (update: UpdateState) => TState; export type ComponentFactory = (props: TProps) => MyraNode; export type JSXElementFactory = (props: TProps) => VNode; export type ErrorHandler = (error: any) => VNode; export interface Ref { current: T; } export type Effect = () => EffectCleanupCallback; export type EffectCleanupCallback = (() => void) | void; export interface ComponentProps { children?: MyraNode; key?: Key; } export const enum VNodeType { Nothing = 0, Text = 1, Element = 2, Fragment = 3, Component = 4, Memo = 5 } /** * Base interface for a virtual node. */ export interface VNodeBase { /** * A reference to a DOM node. */ domRef?: Node; } /** * A virtual node representing nothing. Will be rendered as a comment DOM * node. */ export interface NothingVNode extends VNodeBase { readonly _: VNodeType.Nothing; } /** * A virtual node that represents a text DOM node. */ export interface TextVNode extends VNodeBase { readonly _: VNodeType.Text; readonly text: string; } /** * A virtual node representing a DOM Element. */ export interface ElementVNode extends VNodeBase { readonly _: VNodeType.Element; readonly tagName: string; readonly props: GlobalAttributes & { children: VNode[]; }; domRef?: TElement; } export interface FragmentVNode extends VNodeBase { readonly _: VNodeType.Fragment; readonly props: { children: VNode[]; key?: Key; }; domRef?: HTMLElement; } export interface EffectWrapper { arg: any; cleanup?: EffectCleanupCallback; effect: Effect; invoke: boolean; sync: boolean; } /** * A virtual node representing a component. */ export interface ComponentVNode { readonly _: VNodeType.Component; readonly domRef?: Node; data?: any[]; /** A flag to indicate whether a new "renderComponent" call should be queued or not. */ debounceRender: boolean; effects?: Array; errorHandler?: ErrorHandler; link: { vNode: ComponentVNode; }; props: TProps; /** The most recent VNode tree of the component. */ rendition?: VNode; /** A stale component should not be rendered */ stale?: boolean; /** The function that generates a VNode tree for the component. */ view: ComponentFactory; } /** * Union type of the different types of virtual nodes. */ export type VNode = TextVNode | ElementVNode | FragmentVNode | ComponentVNode | NothingVNode; export interface GenericEvent extends Event { currentTarget: T; } export interface GenericClipboardEvent extends ClipboardEvent { currentTarget: T; } export interface GenericCompositionEvent extends CompositionEvent { currentTarget: T; } export interface GenericDragEvent extends DragEvent { currentTarget: T; } export interface GenericFocusEvent extends FocusEvent { currentTarget: T; } export interface GenericInputEvent extends InputEvent { currentTarget: T; } export interface GenericKeyboardEvent extends KeyboardEvent { currentTarget: T; } export interface GenericMouseEvent extends MouseEvent { currentTarget: T; } export interface GenericTouchEvent extends TouchEvent { currentTarget: T; } export interface GenericWheelEvent extends WheelEvent { currentTarget: T; } /** * A function used as callback for event triggers. */ export type EventListener = (event: TEvent) => void; export interface GlobalAttributes { children?: MyraNode; key?: Key; ref?: Ref; accesskey?: string; autocapitalize?: string; 'class'?: string; contenteditable?: boolean | '' | 'true' | 'false'; contextmenu?: string; dir?: 'ltr' | 'rtl' | 'auto'; draggable?: boolean | 'true' | 'false'; hidden?: boolean | 'true' | 'false'; id?: string; inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'; is?: string; itemid?: string; itemprop?: string; itemref?: string; itemscope?: boolean | 'true' | 'false'; itemtype?: string; lang?: string; part?: string; slot?: string; spellcheck?: boolean | 'default' | 'true' | 'false'; style?: string; tabindex?: number | string; title?: string; translate?: '' | 'yes' | 'no'; onauxclick?: EventListener>; onblur?: EventListener>; onclick?: EventListener>; oncontextmenu?: EventListener>; ondblclick?: EventListener>; onerror?: EventListener>; onfocus?: EventListener>; onfocusin?: EventListener>; onfocusout?: EventListener>; onfullscreenchange?: EventListener>; onfullscreenerror?: EventListener>; oninput?: EventListener>; onkeydown?: EventListener>; onkeypress?: EventListener>; onkeyup?: EventListener>; onmousedown?: EventListener>; onmouseenter?: EventListener>; onmouseleave?: EventListener>; onmousemove?: EventListener>; onmouseout?: EventListener>; onmouseover?: EventListener>; onmouseup?: EventListener>; onselect?: EventListener>; onwheel?: EventListener>; oncompositionend?: EventListener>; oncompositionstart?: EventListener>; oncompositionupdate?: EventListener>; oncopy?: EventListener>; oncut?: EventListener>; onpaste?: EventListener>; ondrag?: EventListener>; ondragend?: EventListener>; ondragenter?: EventListener>; ondragexit?: EventListener>; ondragleave?: EventListener>; ondragover?: EventListener>; ondragstart?: EventListener>; ondrop?: EventListener>; ontouchcancel?: EventListener>; ontouchend?: EventListener>; ontouchmove?: EventListener>; ontouchstart?: EventListener>; role?: string; 'aria-autocomplete'?: any; 'aria-checked'?: any; 'aria-disabled'?: any; 'aria-expanded'?: any; 'aria-haspopup'?: any; 'aria-hidden'?: any; 'aria-invalid'?: any; 'aria-label'?: any; 'aria-level'?: any; 'aria-multiline'?: any; 'aria-multiselectable'?: any; 'aria-orientation'?: any; 'aria-pressed'?: any; 'aria-readonly'?: any; 'aria-required'?: any; 'aria-selected'?: any; 'aria-sort'?: any; 'aria-valuemax'?: any; 'aria-valuemin'?: any; 'aria-valuenow'?: any; 'aria-valuetext'?: any; 'aria-live'?: any; 'aria-relevant'?: any; 'aria-atomic'?: any; 'aria-busy'?: any; 'aria-dropeffect'?: any; 'aria-dragged'?: any; 'aria-activedescendant'?: any; 'aria-controls'?: any; 'aria-describedby'?: any; 'aria-flowto'?: any; 'aria-labelledby'?: any; 'aria-owns'?: any; 'aria-posinset'?: any; 'aria-setsize'?: any; } export interface AAttributes extends GlobalAttributes { download?: string; href?: string; hreflang?: string; rel?: string; target?: string; type?: string; } export interface AreaAttributes extends GlobalAttributes { alt?: string; coords?: string; download?: string; href?: string; hreflang?: string; media?: string; rel?: string; shape?: string; target?: string; type?: string; } export interface AudioAttributes extends GlobalAttributes { autoplay?: boolean | 'true' | 'false'; buffered?: any; controls?: any; loop?: boolean | 'true' | 'false'; muted?: boolean | 'true' | 'false'; played?: any; preload?: '' | 'none' | 'metadata' | 'auto'; src?: string; volume?: number | string; } export interface ButtonAttributes extends GlobalAttributes { autofocus?: boolean | 'true' | 'false'; disabled?: boolean | 'true' | 'false'; form?: string; formaction?: string; formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; formmethod?: 'post' | 'get'; formnovalidate?: boolean | 'true' | 'false'; formtarget?: string; name?: string; type?: 'submit' | 'reset' | 'button'; value?: string | number; } export interface CanvasAttributes extends GlobalAttributes { height?: number | string; width?: number | string; } export interface ColAttributes extends GlobalAttributes { span?: number | string; } export interface ColGroupAttributes extends GlobalAttributes { span?: number | string; } export interface DelAttributes extends GlobalAttributes { cite?: string; datetime?: string; } export interface DetailsAttributes extends GlobalAttributes { open?: boolean | 'true' | 'false'; } export interface EmbedAttributes extends GlobalAttributes { height?: number | string; src?: string; type?: string; width?: number | string; } export interface FieldsetAttributes extends GlobalAttributes { disabled?: boolean | 'true' | 'false'; form?: string; name?: string; } export interface FormAttributes extends GlobalAttributes { accept?: string; 'accept-charset'?: string; action?: string; autocomplete?: 'on' | 'off'; enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; method?: 'post' | 'get'; name?: string; novalidate?: boolean | 'true' | 'false'; target?: string; onreset?: EventListener>; onsubmit?: EventListener>; onchange?: EventListener>; } export interface IframeAttributes extends GlobalAttributes { allow?: string; allowfullscreen?: boolean | 'true' | 'false'; allowpaymentrequest?: boolean | 'true' | 'false'; height?: number | string; loading?: 'eager' | 'lazy'; name?: string; referrerpolicy?: string; sandbox?: string; src?: string; srcdoc?: string; width?: number | string; } export interface ImgAttributes extends GlobalAttributes { alt?: string; crossorigin?: 'anonymous' | 'use-credentials'; height?: number | string; ismap?: boolean | 'true' | 'false'; longdesc?: string; sizes?: string; src: string; srcset?: string; width?: number | string; usemap?: string; } export interface InputAttributes extends Omit, 'oninput'> { type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'; accept?: string; autocomplete?: string; autofocus?: boolean | 'true' | 'false'; capture?: boolean | 'true' | 'false'; checked?: boolean | 'true' | 'false'; disabled?: boolean | 'true' | 'false'; form?: string; formaction?: string; formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; formmethod?: 'post' | 'get'; formnovalidate?: boolean | 'true' | 'false'; formtarget?: string; height?: number | string; list?: string; max?: number | string; maxlength?: number | string; min?: number | string; minlength?: number | string; multiple?: boolean | 'true' | 'false'; name?: string; pattern?: string; placeholder?: string; readonly?: boolean | 'true' | 'false'; required?: boolean | 'true' | 'false'; selectionDirection?: string; size?: number | string; spellcheck?: boolean | 'true' | 'false'; src?: string; step?: number | string; value?: string | number; width?: number | string; onchange?: EventListener>; oninput?: EventListener>; } export interface InsAttributes extends GlobalAttributes { cite?: string; datetime?: string; } export interface LabelAttributes extends GlobalAttributes { for?: string; form?: string; } export interface LiAttributes extends GlobalAttributes { value?: number | string; } export interface MapAttributes extends GlobalAttributes { name?: string; } export interface MeterAttributes extends GlobalAttributes { value?: number | string; min?: number | string; max?: number | string; low?: number | string; high?: number | string; optimum?: number | string; form?: string; } export interface ObjectAttributes extends GlobalAttributes { data?: string; height?: number | string; name?: string; type?: string; usemap?: string; width?: number | string; } export interface OptgroupAttributes extends GlobalAttributes { disabled?: boolean | 'true' | 'false'; label?: string; } export interface OptionAttributes extends GlobalAttributes { disabled?: boolean | 'true' | 'false'; label?: string; selected?: boolean | 'true' | 'false'; value?: string | number; } export interface ParamAttributes extends GlobalAttributes { name?: string; value?: string; } export interface ProgressAttributes extends GlobalAttributes { max?: number | string; value?: number | string; } export interface QAttributes extends GlobalAttributes { cite?: string; } export interface SelectAttributes extends GlobalAttributes { autofocus?: boolean | 'true' | 'false'; disabled?: boolean | 'true' | 'false'; form?: string; multiple?: boolean | 'true' | 'false'; name?: string; required?: boolean | 'true' | 'false'; size?: number | string; onchange?: EventListener>; } export interface SourceAttributes extends GlobalAttributes { src?: string; type?: string; } export interface TdAttributes extends GlobalAttributes { colspan?: number | string; headers?: string; rowspan?: number | string; } export interface TextareaAttributes extends Omit, 'oninput'> { autocomplete?: 'on' | 'off'; autofocus?: boolean | 'true' | 'false'; cols?: number | string; disabled?: boolean | 'true' | 'false'; form?: string; maxlength?: number | string; minlength?: number | string; name?: string; placeholder?: string; required?: boolean | 'true' | 'false'; rows?: number | string; selectionDirection?: string; selectionEnd?: number | string; selectionStart?: number | string; value?: string; wrap?: 'soft' | 'hard'; onchange?: EventListener>; oninput?: EventListener>; } export interface ThAttributes extends GlobalAttributes { colspan?: number | string; headers?: string; rowspan?: number | string; scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | 'auto'; } export interface TimeAttributes extends GlobalAttributes { datetime?: string; } export interface TrackAttributes extends GlobalAttributes { default?: boolean | 'true' | 'false'; kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'; label?: string; src?: string; srclang?: string; } export interface VideoAttributes extends GlobalAttributes { autoplay?: boolean | 'true' | 'false'; buffered?: any; controls?: boolean | 'true' | 'false'; crossorigin?: 'anonymous' | 'use-credentials'; height?: number | string; loop?: boolean | 'true' | 'false'; muted?: boolean | 'true' | 'false'; playsinline?: boolean; poster?: string; preload?: 'none' | 'metadata' | 'auto' | ''; src?: string; width?: number | string; } export interface SvgAttributes { [name: string]: any; } export {}; interface IProps { children?: MyraNode; key?: Key; } export function Fragment(props: IProps): FragmentVNode | NothingVNode; export {}; /** * Creates a JSX.Element/VNode from a JSX tag. */ export function h(tagNameOrComponent: string | ComponentFactory | undefined | null, props: TProps, ...children: Array): JSX.Element; type LazyStateInitialization = () => TState; /** * * @param initialState the initial state */ export function useState(initialState: TState | LazyStateInitialization): [TState, Evolve]; /** * * @param current an optional value */ export function useRef(current?: T): Ref; /** * * @param handler */ export function useErrorHandler(handler: ErrorHandler): void; /** * * @param effect * @param arg */ export function useLayoutEffect(effect: Effect, arg?: TArg): void; /** * * @param effect * @param arg */ export function useEffect(effect: Effect, arg?: TArg): void; /** * * @param fn * @param inputs */ export function useMemo(fn: (args: TArgs) => TMemoization, inputs: TArgs): TMemoization; export {}; type CompareFn = (newProps: TProps, oldProps: TProps) => boolean; /** * Memoizes a component view, preventing unnecessary renders. * * If no custom compare function is supplied, a shallow comparison of the props' * properties will decide whether the component will be rerendered or not. * * @param factory A component factory function * @param compare An optional props equality comparer function. If true is * returned the memoized view will be kept, otherwise the view * will be rerendered. */ export function memo(factory: ComponentFactory, compare?: CompareFn): JSXElementFactory; export {}; export as namespace myra