import { HTMLProps, IndexKey, MathMLProps, SVGProps } from 'web-utility';
export type DataObject = Record;
export type PropsMap = Partial | keyof HTMLProps, string>>;
export type VNodeStyle = HTMLProps['style'] & {
[K in `--${string}`]?: string;
};
export declare class VNodeMeta {
key?: IndexKey;
ref?: (node?: Node) => any;
text?: string;
selector?: string;
namespace?: string;
tagName?: string;
is?: string;
props?: DataObject;
style?: VNodeStyle;
parent?: VNode;
children?: JsxChildren;
node?: Node;
}
export declare class VNode extends VNodeMeta {
children?: VNode[];
constructor({ children, ...meta }: VNodeMeta);
walkUp(): Generator;
namespaceOf(tagName: string): any;
createDOM(document?: Document): DocumentFragment | Element | Text;
toJSON(): VNodeMeta;
protected generateElementXML(): Generator;
generateXML(this: VNode): Generator;
static propsMap: PropsMap;
static attrsMap: Record>;
static isFragment({ key, node, children, ...rest }: VNode): boolean;
static fromDOM(node: Node): VNode;
}
export type JsxChild = VNode | string | number | boolean | null | undefined;
export type JsxChildren = JsxChild | Array;
export type JsxProps = DataObject & Pick & Omit, 'children'> & {
children?: JsxChildren;
};
export type SvgJsxProps = DataObject & Pick & Omit, 'children'> & {
children?: JsxChildren;
};
export type MathMlJsxProps = DataObject & Pick & Omit, 'children'> & {
children?: JsxChildren;
};
declare global {
/**
* @see {@link https://www.typescriptlang.org/docs/handbook/jsx.html}
*/
namespace JSX {
type Element = VNode;
type JSXElements = {
[tagName in keyof HTMLElementTagNameMap]: JsxProps;
} & {
[tagName in keyof SVGElementTagNameMap]: SvgJsxProps;
} & {
[tagName in keyof MathMLElementTagNameMap]: MathMlJsxProps;
};
interface IntrinsicElements extends JSXElements {
}
interface ElementAttributesProperty {
props: {};
}
interface ElementChildrenAttribute {
children: {};
}
}
}