/** @jsxImportSource react */ import type { JSX as ReactJSX } from "react"; import { ChildNode, StyledContainerBase, StyledContainerConfig } from "../ui/Container"; import type { RenderProps } from "../ui/Instance"; import { Instance } from "../ui/Instance"; import { BooleanProp, NumberProp, Prop, StringProp, StructuredProp } from "../ui/Prop"; import type { RenderingContext } from "../ui/RenderingContext"; import type { TooltipInstance } from "./overlay/Tooltip"; import type { TooltipConfig, TooltipProp } from "./overlay/tooltip-ops"; import { TooltipParentInstance } from "./overlay/tooltip-ops"; export declare let urlAttributes: Record; type ReactIntrinsicElements = ReactJSX.IntrinsicElements; type IsEventHandler = K extends `on${string}` ? NonNullable extends Function ? true : false : false; type CxEventHandler = T extends (event: infer E) => any ? string | ((event: E, instance: Instance) => void) : T extends undefined ? undefined : string | T; type TransformHtmlElementProps = { [K in keyof T as K extends "style" | "className" | "class" ? never : K]: K extends "children" ? ChildNode | ChildNode[] : IsEventHandler extends true ? CxEventHandler : string extends T[K] ? Prop : NonNullable extends string ? Prop | string : Prop; }; /** Base HtmlElement configuration - core CxJS properties for extension by widgets */ export interface HtmlElementConfigBase extends StyledContainerConfig { id?: StringProp | NumberProp; /** HTML tag name */ tag?: string; /** Inner text contents. */ text?: StringProp | NumberProp; /** Inner html contents. */ innerHtml?: StringProp; /** Inner html contents. */ html?: StringProp; /** Tooltip configuration. */ tooltip?: StringProp | TooltipConfig; /** Additional attributes to be applied. */ attrs?: StructuredProp; /** Additional data attributes. */ data?: StructuredProp; autoFocus?: BooleanProp; onRef?: string | ((element: HTMLElement | null, instance: Instance) => void); } /** HtmlElement configuration with tag-specific attributes and events */ export type HtmlElementConfig = Omit & TransformHtmlElementProps & { tag?: Tag; }; export declare class HtmlElementInstance = HtmlElement> extends Instance implements TooltipParentInstance { events?: Record any>; tooltips: { [key: string]: TooltipInstance; }; } export declare class HtmlElement = HtmlElementInstance> extends StyledContainerBase { tag?: string; html?: string; innerText?: string; text?: string; innerHtml?: string; attrs?: Record; data?: Record; events?: Record unknown>; urlAttributes?: string[]; extraProps?: Record; tooltip?: TooltipProp; onRef?: string | ((element: HTMLElement | null, instance: Instance) => void); autoFocus?: boolean | string; [key: string]: unknown; constructor(config?: Config); declareData(...args: Record[]): void; isValidHtmlAttribute(attrName: string): string | false; init(): void; prepareData(context: RenderingContext, instance: InstanceType): void; attachProps(context: RenderingContext, instance: InstanceType, props: RenderProps): void; render(context: RenderingContext, instance: InstanceType, key: string): React.ReactNode; } export {}; //# sourceMappingURL=HtmlElement.d.ts.map