import { type Rec } from "@agyemanjp/standard"; import type { StdEltProps, Component, Children } from "../common"; /** General UI element type */ export type UIElement

= ProperElement

| ValueElement; export type ProperElement

= ComponentElement

| IntrinsicElement

; /** UI element that is a simple value */ export type ValueElement = string | undefined; /** UI element that is intrinsic to the engine */ export type IntrinsicElement

= UIElementBase

& { type: string; }; /** UI element that specifies a component invocation * A component element can produce another UI element, recursively, * until an intrinsic/value element is obtained, at which point we can generate DOM from it */ export type ComponentElement

= UIElementBase

& { type: Component

; }; export type UIElementBase

= { props: P; children?: Children; }; /** JSX is transformed into calls of this function */ export declare function createElement

(type: string, props: P, ...children: UIElement[]): IntrinsicElement

; export declare function createElement

(type: Component

, props: P, ...children: UIElement[]): ComponentElement

; /** Gets children of input element as a flat elements array */ export declare function getChildren(elt: UIElement): UIElement>[]; /** Converts input children into a flat array of elements */ export declare function normalizeChildren(children?: Children): UIElement>[]; export declare const isValueElt: (elt: UIElement) => elt is ValueElement; export declare const isProperElt:

(elt?: UIElement

) => elt is (IntrinsicElement

| ComponentElement

); export declare const isIntrinsicElt:

(elt: UIElement

) => elt is IntrinsicElement

; export declare const isComponentElt:

(elt: UIElement

) => elt is ComponentElement

; export declare const isFragmentElt: (elt: UIElement) => boolean;