import * as React from 'react'; import ReactDOM from 'react-dom/client'; import { VElement as VElement$1 } from 'domeleon'; import { CSSProperties } from 'preact'; interface KnownHtmlAttributes { class?: string | (string | false | null | undefined)[] | undefined; style?: CSSProperties | undefined; acceptCharset?: string; autoComplete?: "on" | "off" | string; autoPlay?: boolean; bgColor?: string; colSpan?: string | number; crossOrigin?: "" | string | "anonymous" | "use-credentials"; dateTime?: string; dirName?: string; encType?: string | "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"; formAction?: string; formEncType?: string; formMethod?: string; formNoValidate?: string; formTarget?: string; hrefLang?: string; httpEquiv?: string; isMap?: boolean; maxLength?: string | number; minLength?: string | number; noValidate?: boolean; playsInline?: boolean; readOnly?: string; referrerPolicy?: string; rowSpan?: string | number; srcDoc?: string; srcLang?: string; srcSet?: string; useMap?: string; accept?: string; action?: string; align?: string | "left" | "top" | "right" | "bottom"; allow?: string; alt?: string; as?: "object" | "style" | "document" | string | "audio" | "embed" | "fetch" | "font" | "image" | "script" | "track" | "video" | "worker"; async?: boolean; background?: string; border?: string; capture?: string | "user" | "environment"; charset?: string; checked?: boolean; cite?: string; color?: string; cols?: string | number; content?: string | number; controls?: boolean; coords?: string; csp?: string; data?: string & Record; decoding?: string; default?: boolean; defer?: boolean; disabled?: boolean; download?: string; for?: string; form?: string; headers?: string; height?: string | number; high?: string | number; href?: string; integrity?: string; kind?: string | "subtitles" | "captions" | "chapters" | "metadata"; label?: string; language?: string; loading?: string | "lazy" | "eager"; list?: string; loop?: boolean; low?: string | number; max?: string | number; media?: string; method?: string; min?: string | number; multiple?: boolean; muted?: boolean; name?: string; open?: boolean; optimum?: string | number; pattern?: string; ping?: string; placeholder?: string; poster?: string; preload?: string; rel?: "preload" | "search" | string | "alternate" | "author" | "bookmark" | "canonical" | "dns-prefetch" | "external" | "expect" | "help" | "icon" | "license" | "manifest" | "me" | "modulepreload" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "pingback" | "preconnect" | "prefetch" | "prerender" | "prey" | "privacy-policy" | "stylesheet" | "tag" | "terms-of-service"; required?: boolean; reversed?: boolean; role?: string | string; rows?: string | number; sandbox?: string | "allow-downloads" | "allow-forms" | "allow-modals" | "allow-orientation-lock" | "allow-pointer-lock" | "allow-popups" | "allow-popups-to-escape-sandbox" | "allow-presentation" | "allow-same-origin" | "allow-scripts" | "allow-storage-access-by-user-activation" | "allow-top-navigation" | "allow-top-navigation-by-user-activation" | "allow-top-navigation-to-custom-protocols"; scope?: "row" | "rowgroup" | string | "col" | "colgroup"; selected?: boolean; shape?: string; size?: string | number; sizes?: string; span?: string | number; src?: string; start?: string | number; step?: string | number; summary?: string; target?: string | "_blank" | "_self" | "_parent" | "_top"; type?: string; value?: string | number; width?: string | number; wrap?: string | "hard" | "soft" | "off"; autoCapitalize?: "none" | string | "off" | "sentences" | "on" | "words" | "characters"; autoFocus?: boolean; contentEditable?: boolean; enterKeyHint?: string; exportParts?: string; inputMode?: "none" | "search" | string | "text" | "decimal" | "numeric" | "tel" | "email" | "url"; itemId?: string; itemProp?: string; itemRef?: string | string[]; itemScope?: string; itemType?: string; popOver?: string; spellCheck?: boolean; tabIndex?: string | number; virtualKeyboardPolicy?: string | "auto" | "manual"; writingSuggestions?: boolean; accesskey?: string; dir?: string | "auto" | "ltr" | "rtl"; draggable?: boolean; hidden?: boolean; id?: string; lang?: string; nonce?: string; part?: string; slot?: string; title?: string; translate?: string | "yes" | "no"; inert?: boolean; alpha?: boolean; colorSpace?: string; elemenTtiming?: string; fetchPriority?: string; imageSizes?: string; imageSrcset?: string; is?: string; popoverTarget?: string; popoverTargetAction?: string; credentialless?: boolean; browsingTopics?: boolean; onAbort?: (ev: UIEvent) => void; onActivate?: (ev: AnimationEvent) => void; onAnimationCancel?: (ev: AnimationEvent) => void; onAnimationEnd?: (ev: AnimationEvent) => void; onAnimationIteration?: (ev: AnimationEvent) => void; onAnimationStart?: (ev: AnimationEvent) => void; onAuxClick?: (ev: MouseEvent) => void; onBeforeInput?: (ev: InputEvent) => void; onBeforeToggle?: (ev: Event) => void; onBegin?: (ev: Event) => void; onBlur?: (ev: FocusEvent) => void; onCancel?: (ev: Event) => void; onCanPlay?: (ev: Event) => void; onCanPlayThrough?: (ev: Event) => void; onChange?: (ev: Event) => void; onClick?: (ev: MouseEvent) => void; onClose?: (ev: Event) => void; onContextLost?: (ev: Event) => void; onContextMenu?: (ev: MouseEvent) => void; onContextRestored?: (ev: Event) => void; onCopy?: (ev: ClipboardEvent) => void; onCueChange?: (ev: Event) => void; onCut?: (ev: ClipboardEvent) => void; onDblClick?: (ev: MouseEvent) => void; onDrag?: (ev: DragEvent) => void; onDragEnd?: (ev: DragEvent) => void; onDragEnter?: (ev: DragEvent) => void; onDragLeave?: (ev: DragEvent) => void; onDragOver?: (ev: DragEvent) => void; onDragStart?: (ev: DragEvent) => void; onDrop?: (ev: DragEvent) => void; onDurationChange?: (ev: Event) => void; onEmptied?: (ev: Event) => void; onEnded?: (ev: Event) => void; onError?: (event: Event | string) => void; onFocus?: (ev: FocusEvent) => void; onFocusIn?: (ev: FocusEvent) => void; onFocusOut?: (ev: FocusEvent) => void; onFormData?: (ev: FormDataEvent) => void; onGotPointerCapture?: (ev: PointerEvent) => void; onInput?: (ev: Event) => void; onInvalid?: (ev: Event) => void; onKeyDown?: (ev: KeyboardEvent) => void; onKeyPress?: (ev: KeyboardEvent) => void; onKeyUp?: (ev: KeyboardEvent) => void; onLoad?: (ev: Event) => void; onLoadedData?: (ev: Event) => void; onLoadedMetaData?: (ev: Event) => void; onLoadStart?: (ev: Event) => void; onLostPointerCapture?: (ev: PointerEvent) => void; onMouseDown?: (ev: MouseEvent) => void; onMouseEnter?: (ev: MouseEvent) => void; onMouseLeave?: (ev: MouseEvent) => void; onMouseMove?: (ev: MouseEvent) => void; onMouseOut?: (ev: MouseEvent) => void; onMouseOver?: (ev: MouseEvent) => void; onMouseUp?: (ev: MouseEvent) => void; onMouseWheel?: (event: Event) => void; onPaste?: (ev: ClipboardEvent) => void; onPause?: (ev: Event) => void; onPlay?: (ev: Event) => void; onPlaying?: (ev: Event) => void; onPointerCancel?: (ev: PointerEvent) => void; onPointerDown?: (ev: PointerEvent) => void; onPointerEnter?: (ev: PointerEvent) => void; onPointerLeave?: (ev: PointerEvent) => void; onPointerMove?: (ev: PointerEvent) => void; onPointerOut?: (ev: PointerEvent) => void; onPointerOver?: (ev: PointerEvent) => void; onPointerUp?: (ev: PointerEvent) => void; onProgress?: (ev: ProgressEvent) => void; onRateChange?: (ev: Event) => void; onRepeat?: (ev: Event) => void; onReset?: (ev: Event) => void; onResize?: (ev: UIEvent) => void; onScroll?: (ev: Event) => void; onScrollEnd?: (ev: Event) => void; onSecurityPolicyViolation?: (ev: SecurityPolicyViolationEvent) => void; onSeeked?: (ev: Event) => void; onSeeking?: (ev: Event) => void; onSelect?: (ev: Event) => void; onSelectionChange?: (ev: Event) => void; onSelectStart?: (ev: Event) => void; onShow?: (ev: Event) => void; onSlotChange?: (ev: Event) => void; onStalled?: (ev: Event) => void; onSubmit?: (ev: SubmitEvent) => void; onSuspend?: (ev: Event) => void; onTimeUpdate?: (ev: Event) => void; onToggle?: (ev: Event) => void; onTouchCancel?: (ev: TouchEvent) => void; onTouchEnd?: (ev: TouchEvent) => void; onTouchMove?: (ev: TouchEvent) => void; onTouchStart?: (ev: TouchEvent) => void; onTransitionCancel?: (ev: TransitionEvent) => void; onTransitionEnd?: (ev: TransitionEvent) => void; onTransitionRun?: (ev: TransitionEvent) => void; onTransitionStart?: (ev: TransitionEvent) => void; onUnload?: (ev: Event) => void; onVolumeChange?: (ev: Event) => void; onWaiting?: (ev: Event) => void; onWebkitAnimationEnd?: (ev: Event) => void; onWebkitAnimationIteration?: (ev: Event) => void; onWebkitAnimationStart?: (ev: Event) => void; onWebkitTransitionEnd?: (ev: Event) => void; onWheel?: (ev: WheelEvent) => void; ariaActiveDescendant?: string; ariaAtomic?: string | boolean; ariaAutoComplete?: "list" | "none" | string | "inline" | "both"; ariaBrailleLabel?: string; ariaBrailleRoleDescription?: string; ariaBusy?: boolean; ariaChecked?: boolean | string | "true" | "false" | "mixed"; ariaColCount?: number; ariaColIndex?: number; ariaColSpan?: number; ariaControls?: string; ariaCurrent?: boolean | "step" | string | "true" | "false" | "page" | "location" | "date" | "time"; ariaDescription?: string; ariaDescribedBy?: string; ariaDetails?: string; ariaDisabled?: boolean; ariaDropEffect?: "link" | "none" | string | "copy" | "execute" | "move" | "popup"; ariaErrorMessage?: string; ariaExpanded?: boolean; ariaFlowTo?: string; ariaGrabbed?: boolean; ariaHasPopup?: boolean | "dialog" | "grid" | "listbox" | "menu" | "tree" | string | "true" | "false"; ariaHidden?: boolean; ariaInvalid?: boolean | string | "true" | "false" | "grammar" | "spelling"; ariaKeyShortcuts?: string; ariaLabel?: string; ariaLabelledBy?: string; ariaLevel?: number; ariaLive?: string | "off" | "assertive" | "polite"; ariaModal?: boolean; ariaMultiLine?: boolean; ariaMultiSelectable?: boolean; ariaOrientation?: string | "horizontal" | "vertical"; ariaOwns?: string; ariaPlaceholder?: string; ariaPosInSet?: number; ariaPressed?: boolean | string | "true" | "false" | "mixed"; ariaReadOnly?: boolean; ariaRelevant?: string | "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"; ariaRequired?: boolean; ariaRoleDescription?: string; ariaRowCount?: number; ariaRowIndex?: number; ariaRowSpan?: number; ariaSelected?: boolean; ariaSetSize?: number; ariaSort?: "none" | string | "ascending" | "descending" | "other"; ariaValueMax?: number; ariaValueMin?: number; ariaValueNow?: number; ariaValueText?: string; } interface KnownSvgAttributes { accentHeight?: string | number; accumulate?: string | "none" | "sum"; additive?: string | "sum" | "replace"; alignmentBaseline?: "alphabetic" | "hanging" | "ideographic" | "mathematical" | "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "inherit" | string; allowReorder?: string | "no" | "yes"; alphabetic?: string | number; amplitude?: string | number; arabicForm?: string | "initial" | "medial" | "terminal" | "isolated"; ascent?: string | number; attributeName?: string; azimuth?: string | number; baseFrequency?: string | number; baselineShift?: string; baseProfile?: string | number; bbox?: string | number; begin?: string; bias?: string | number; by?: string | number; calcMode?: string | "discrete" | "linear" | "paced" | "spline"; capHeight?: string | number; className?: string; clip?: string; clipPath?: string; clipPathUnits?: string | number; clipRule?: string | number; colorInterpolation?: "auto" | "inherit" | string | "sRGB" | "linearRGB"; colorInterpolationFilters?: "auto" | "inherit" | string | "sRGB" | "linearRGB"; colorRendering?: string | number; cursor?: string; cx?: string | number; cy?: string | number; d?: string; decelerate?: string; descent?: string | number; diffuseConstant?: string | number; direction?: string | "ltr" | "rtl"; display?: string; divisor?: string | number; dominantBaseline?: string; dur?: string; dx?: string | number; dy?: string | number; edgeMode?: string | number; elevation?: string | number; end?: string; exponent?: string | number; fill?: string; fillOpacity?: string | number; fillRule?: "inherit" | string | "nonzero" | "evenodd"; filter?: string; filterRes?: string | number; filterUnits?: string | number; floodColor?: string; floodOpacity?: string | number; fontFamily?: string; fontSize?: string | number; fontSizeAdjust?: number | string | "none"; fontStretch?: number | string | "normal" | "semi-condensed" | "condensed" | "extra-condensed" | "ultra-condensed" | "semi-expanded" | "expanded" | "extra-expanded" | "ultra-expanded"; fontStyle?: string | "normal" | "italic" | "oblique"; fontVariant?: string | "none" | "normal"; fontWeight?: number | string | "normal" | "bold" | "bolder" | "lighter"; format?: string; fr?: string | number; from?: string | number; fx?: string | number; fy?: string | number; g1?: string; g2?: string; glyphName?: string; glyphOrientationHorizontal?: string | number; glyphOrientationVertical?: string | number; glyphRef?: string | number; gradientTransform?: string; gradientUnits?: string | "userSpaceOnUse" | "objectBoundingBox"; hanging?: string | number; horizAdvX?: string | number; horizOriginX?: string | number; horizOriginY?: string | number; ideographic?: string | number; imageRendering?: string; in?: string | "SourceGraphic" | "SourceAlpha" | "BackgroundImage" | "BackgroundAlpha" | "FillPaint" | "StrokePaint"; in2?: string | "SourceGraphic" | "SourceAlpha" | "BackgroundImage" | "BackgroundAlpha" | "FillPaint" | "StrokePaint"; intercept?: string | number; k?: string | number; k1?: string | number; k2?: string | number; k3?: string | number; k4?: string | number; kernelMatrix?: string | number; kernelUnitLength?: string | number; keyPoints?: string | number; keySplines?: string; keyTimes?: string; lengthAdjust?: string | number; letterSpacing?: string | number; lightingColor?: string; limitingConeAngle?: string | number; local?: string; markerEnd?: string | "none"; markerHeight?: string | number; markerMid?: string | "none"; markerStart?: string | "none"; markerUnits?: string | number; markerWidth?: string | number; mask?: string; maskContentUnits?: string | "userSpaceOnUse"; maskUnits?: string | number; mathematical?: string | number; method?: string | "align" | "stretch"; mode?: string; numOctaves?: string | number; offset?: string | number; opacity?: string | number; operator?: "in" | string | "lighter" | "over" | "out" | "atop" | "xor" | "arithmetic"; order?: string | number; orient?: number | "auto" | string | "auto-start-reverse"; orientation?: string | "h" | "v"; origin?: string; overflow?: "auto" | string | "visible" | "hidden" | "scroll"; overlinePosition?: string | number; overlineThickness?: string | number; paintOrder?: "fill" | "stroke" | string | "normal" | "markers"; path?: string; pathLength?: string | number; patternContentUnits?: string | "userSpaceOnUse" | "objectBoundingBox"; patternTransform?: string; patternUnits?: string | "userSpaceOnUse" | "objectBoundingBox"; pointerEvents?: "fill" | "stroke" | string | "none" | "bounding-box" | "visiblePainted" | "visibleFill" | "visibleStroke" | "visible" | "painted" | "all"; points?: string | number; pointsAtX?: string | number; pointsAtY?: string | number; pointsAtZ?: string | number; preserveAlpha?: boolean; preserveAspectRatio?: string | "none" | "xMinYMin" | "xMidYMin" | "xMaxYMin" | "xMinYMid" | "xMidYMid" | "xMaxYMid" | "xMinYMax" | "xMidYMax" | "xMaxYMax" | "meet" | "slice"; primitiveUnits?: string | "userSpaceOnUse" | "objectBoundingBox"; r?: string | number; radius?: string | number; refX?: number | string | "left" | "center" | "right"; refY?: number | string | "left" | "center" | "right"; repeatCount?: string | number; repeatDur?: string | number; requiredExtensions?: string; restart?: string | "always" | "whenNotActive" | "never"; result?: string; rotate?: number | "auto" | string | "auto-reverse"; rx?: string | number; ry?: string | number; scale?: string | number; seed?: string | number; shapeRendering?: "auto" | string | "optimizeSpeed" | "crispEdges" | "geometricPrecision"; side?: string | "left" | "right"; slope?: string | number; spacing?: "auto" | string | "exact"; specularConstant?: string | number; specularExponent?: string | number; speed?: string | number; spreadMethod?: string | "pad" | "reflect" | "repeat"; startOffset?: string | number; stdDeviation?: string | number; stemh?: string | number; stemv?: string | number; stitchTiles?: string | "noStitch" | "stitch"; stopColor?: string; stopOpacity?: string | number; stroke?: string; strokeDashArray?: string | number; strokeDashOffset?: string | number; strokeLineCap?: "inherit" | string | "butt" | "round" | "square"; strokeLineJoin?: "inherit" | string | "bevel" | "miter" | "miter-clip" | "round"; strokeMiterLimit?: string | number; strokeOpacity?: string | number; strokeWidth?: string | number; surfaceScale?: string | number; systemLanguage?: string; tableValues?: string | number; targetX?: string | number; targetY?: string | number; textAnchor?: "middle" | string | "start" | "end"; textDecoration?: string; textLength?: string | number; textRendering?: "auto" | string | "optimizeSpeed" | "geometricPrecision" | "optimizeLegibility"; to?: string | number; transform?: string; transformOrigin?: string; u1?: string; u2?: string; underlinePosition?: string | number; underlineThickness?: string | number; unicode?: string; unicodeBidi?: string | "normal" | "embed" | "bidi-override" | "isolate" | "isolate-override" | "plaintext"; unicodeRange?: string | number; unitsPerEm?: string | number; vAlphabetic?: string | number; values?: string | number; vectorEffect?: string | "none" | "non-scaling-stroke" | "non-scaling-size" | "non-rotation" | "fixed-position"; vertAdvY?: string | number; vertOriginX?: string | number; vertOriginY?: string | number; vHanging?: string | number; vIdeographic?: string | number; viewBox?: string; viewTarget?: string | number; visibility?: string | "visible" | "hidden" | "collapse"; vMathematical?: string | number; widths?: string | number; wordSpacing?: number | string | "normal"; writingMode?: string | "horizontal-tb" | "vertical-rl" | "vertical-lr"; x?: string | number; x1?: string | number; x2?: string | number; xChannelSelector?: string | "R" | "G" | "B" | "A"; xHeight?: string | number; xlinkActuate?: string; xlinkArcrole?: string; xlinkHref?: string; xlinkRole?: string; xlinkShow?: string; xlinkTitle?: string; xlinkType?: string; xmlBase?: string; xmlLang?: string; xmlns?: string; xmlnsXlink?: string; xmlSpace?: string; y?: string | number; y1?: string | number; y2?: string | number; yChannelSelector?: string | "R" | "G" | "B" | "A"; z?: string | number; zoomAndPan?: string | "disable" | "magnify"; } type PreactHookConfig = { hook: Function; options?: any; }; type PreactComponentConfig = { component: any; componentProps?: Record; }; type PreactWithConfig = PreactHookConfig | PreactComponentConfig; type OnUnmounted = () => void; interface VAttributes extends Partial { onMounted?: (element: Element) => OnUnmounted | void; key?: string | number; [dataAttribute: `data-${string}`]: string; withPreact?: PreactWithConfig; } type VNode = VElement | string | number; interface VElement { nodeName: string; attributes: VAttributes; children: VNode[]; key?: string | number; } type FrameworkAttrs = Record; type VElementTransformer = { transformElement: (tag: string, attrs: FrameworkAttrs, children: FrameworkNode[]) => FrameworkNode; transformHook: (hookConfig: any, tag: string, attrs: FrameworkAttrs, children: FrameworkNode[]) => FrameworkNode; tranformComponent: (componentConfig: any, tag: string, props: FrameworkAttrs, children: FrameworkNode[]) => FrameworkNode; transformOnMounted: (frameworkElement: FrameworkNode, onMounted: (el: Element) => OnUnmounted | void, originalProps: FrameworkAttrs) => FrameworkNode; transformAttributeName?: (domEventName: string, isSVG: boolean) => string; transformAttributes?: (tag: string, attrs: FrameworkAttrs) => FrameworkAttrs; }; declare abstract class Renderer { private readonly _transformer; abstract get rendererName(): string; abstract patch(vElement: VElement, element: Element): Element; constructor(transformer: VElementTransformer); protected renderVNode(node: VNode): FrameworkNode; } interface ReactRendererDeps { ReactLib: typeof React; ReactDOMClientLib: typeof ReactDOM; mountCallback?: (component: React.ReactNode, targetElement: Element) => void; } declare class ReactRenderer extends Renderer { private _dependencies; private _containerToReactRootMap; constructor(dependencies: ReactRendererDeps); get rendererName(): string; private defaultMountCallback; patch(vElement: VElement$1, element: Element): Element; unmount(containerElement: Element): void; } type ReactHookConfig = { hook: Function; options?: any; }; type ReactComponentConfig = { component: any; componentProps?: Record; childWrapper?: any; childWrapperProps?: Record; childProcessingMode?: 'map' | 'single' | 'passthrough'; childWrapperRefPropName?: string; }; type ReactWithConfig = ReactHookConfig | ReactComponentConfig; declare module '../../index.js' { interface VAttributes { withReact?: ReactWithConfig; } } export { ReactRenderer }; export type { ReactComponentConfig, ReactHookConfig, ReactWithConfig };