, "style" | "class">;
/**
* A function that returns a template.
*
* @param props A set of properties with children.
* @param hooks Hooks methods.
* @returns A template.
*/
export type FunctionComponent = (props: P & KeyedProperties & TreeProperties, hooks: {
useState: (initialValue: T) => [T, (value: T) => void];
useMemo: (factory: () => T, deps?: unknown[]) => T;
useEffect: (effect: Effect, deps?: unknown[]) => void;
useId: (suffix?: string) => string;
useRenderContext: () => Context;
}) => Template;
/**
* Get render properties for a functional component.
*/
type VFunctionRenderProperties = Parameters[0] & KeyedProperties & TreeProperties;
/**
* The interface of a functional component.
*/
export type VFunction = {
type: T;
key: unknown;
namespace: string;
properties: VFunctionRenderProperties;
children: Template[];
[V_SYM]: true;
};
/**
* Get render properties for an element instance.
*/
type VElementRenderProperties = Members & RenderAttributes & KeyedProperties & TreeProperties & EventProperties & ElementProperties;
/**
* The interface of an HTML node used as JSX tag.
*/
export type VElement = {
type: T;
key: unknown;
namespace: string;
properties: VElementRenderProperties;
children: Template[];
[V_SYM]: true;
};
/**
* Get render properties for a slot tag.
*/
type VSlotRenderProperties = RenderAttributes<"slot"> & KeyedProperties & TreeProperties & EventProperties;
/**
* The interface of slot element.
*/
export type VSlot = {
type: "slot";
key: unknown;
properties: VSlotRenderProperties;
children: Template[];
[V_SYM]: true;
};
/**
* Get base render properties for a tag.
*/
type VTagBaseRenderProperties = RenderAttributes & KeyedProperties & TreeProperties & EventProperties & ElementProperties;
/**
* Get full render properties for a tag.
*/
type VTagRenderProperties = (T extends keyof JSXInternal.CustomElements ? Members : EmptyObject) & VTagBaseRenderProperties;
/**
* The interface of a generic JSX tag.
*/
export type VTag = {
type: T;
key: unknown;
namespace: string;
properties: VTagRenderProperties;
children: Template[];
[V_SYM]: true;
};
/**
* A literal value.
*/
export type VLiteral = {
type: string;
};
/**
* A virtual DOM object properties.
*/
type VObjectProperties = T extends typeof Fragment ? null : T extends FunctionComponent ? VFunctionRenderProperties : T extends HTMLElement ? VElementRenderProperties : T extends "slot" ? VSlotRenderProperties : T extends string ? VTagRenderProperties : never;
/**
* A distinct virtual object type.
*/
type DistinctVObject = T extends FunctionComponent ? VFunction : T extends HTMLElement ? VElement : T extends "slot" ? VSlot : T extends string ? VTag : never;
/**
* Generic virtual dom object.
*/
export type VObject = VFunction | VElement | VSlot | VTag;
/**
* A generic template. Can be a single atomic item or a list of items.
*/
export type Template = any;
/**
* Check if the current virtual node is a fragment.
* @param target The node to check.
* @returns True if the target is a virtual DOM object.
*/
export declare const isVObject: (target: Template) => target is VObject;
/**
* Check if the current virtual node is a functional component.
* @param target The node to check.
* @returns True if the target is a functional component.
*/
export declare const isVFunction: (target: VObject) => target is VFunction;
/**
* Check if the current virtual node is an HTML node instance.
* @param target The node to check.
* @returns True if the target is an HTML node instance.
*/
export declare const isVNode: (target: VObject) => target is VElement;
/**
* Check if the current virtual node is a slot element.
* @param target The node to check.
* @returns True if the target is a slot element.
*/
export declare const isVSlot: (target: VObject) => target is VSlot;
/**
* Check if the current virtual node is a generic tag to render.
* @param target The node to check.
* @returns True if the target is a generic tag to render.
*/
export declare const isVTag: (target: VObject) => target is VTag;
/**
* Function factory to use as JSX pragma.
*
* @param type The tag name, the constructor or the instance of the node.
* @param properties The set of properties of the Node.
* @param children The children of the Node.
* @returns The virtual DOM object.
*/
declare function h(type: T, properties?: VObjectProperties | null, ...children: Template[]): DistinctVObject;
/**
* Function factory to use as JSX pragma.
*
* @param type The tag name, the constructor or the instance of the node.
* @param properties The set of properties of the Node.
* @param key The Node key reference.
* @returns The virtual DOM object.
*/
declare function jsx(type: T, properties?: VObjectProperties | null, key?: unknown): DistinctVObject;
declare const jsxs: typeof jsx;
declare const jsxDEV: typeof jsx;
export { h, jsx, jsxs, jsxDEV };
/**
* Compile a template string into virtual DOM template.
* @param string The string to compile.
* @param values Values to interpolate.
* @returns The virtual DOM template.
*/
export declare const html: (strings: TemplateStringsArray, ...values: Template[]) => ReturnType | ReturnType[];
/**
* Compile a string into virtual DOM template.
* @param string The string to compile.
* @returns The virtual DOM template.
*/
export declare const compile: (string: string) => Template;
/**
* The internal JSX namespace.
*/
export declare namespace JSXInternal {
interface CustomElements {}
type Element = Template;
interface ElementClass extends HTMLElement {}
type IntrinsicAttributes = KeyedProperties & EventProperties & TreeProperties & ElementProperties;
type AutonomousElements = { [K in keyof CustomElements as CustomElements[K] extends {
extends: string;
} ? never : K] : Members };
type CustomizedElements = { [K in keyof HTMLTagNameMap] : Values<{ [P in keyof CustomElements as CustomElements[P] extends {
extends: K;
} ? P : never] : Members & {
is: P;
} }> };
type BuiltinElements = { [K in keyof HTMLTagNameMap] : Partial, never>> & {
is?: string | null | undefined;
} };
type IntrinsicElements = {
[key: string]: VElementRenderProperties & {
[key: PropertyKey]: unknown;
};
} & { [K in keyof AutonomousElements] : AutonomousElements[K] & VTagBaseRenderProperties } & { [K in keyof CustomizedElements] : (BuiltinElements[K] | CustomizedElements[K]) & VTagBaseRenderProperties } & { [K in keyof SVGTagNameMap] : VTagRenderProperties };
}