import type { VM } from './vm'; import type { RendererAPI } from './renderer'; export type Key = string | number; export declare const enum VNodeType { Text = 0, Comment = 1, Element = 2, CustomElement = 3, Static = 4, Fragment = 5, ScopedSlotFragment = 6 } export declare const enum VStaticPartType { Text = 0, Element = 1 } export type VNode = VText | VComment | VElement | VCustomElement | VStatic | VFragment | VScopedSlotFragment; export type VNodes = ReadonlyArray; /** * Mutable version of {@link VNodes}. It should only be used inside functions to build an array; * it should never be used as a parameter or return type. */ export type MutableVNodes = Array; export interface BaseVParent { children: VNodes; } export interface BaseVNode { type: VNodeType; elm: Node | undefined; sel: string; key: Key | undefined; owner: VM; } export interface VScopedSlotFragment extends BaseVNode { factory: (value: any, key: any) => VFragment; type: VNodeType.ScopedSlotFragment; slotName: unknown; sel: '__scoped_slot_fragment__'; } export interface VStaticPart { readonly type: VStaticPartType; readonly partId: number; readonly data: VStaticPartData | null; readonly text: string | null; elm: Element | Text | undefined; } export interface VStaticPartElement extends VStaticPart { readonly type: VStaticPartType.Element; readonly data: VStaticPartData; elm: Element | undefined; } export interface VStaticPartText extends VStaticPart { readonly type: VStaticPartType.Text; readonly text: string; elm: Text | undefined; } export type VStaticPartData = Pick; export interface VStatic extends BaseVNode { readonly type: VNodeType.Static; readonly sel: '__static__'; readonly key: Key; readonly fragment: Element; readonly parts: VStaticPart[] | undefined; elm: Element | undefined; slotAssignment: string | undefined; } export interface VFragment extends BaseVNode, BaseVParent { sel: '__fragment__'; type: VNodeType.Fragment; stable: 0 | 1; leading: VText | VComment; trailing: VText | VComment; } export interface VText extends BaseVNode { type: VNodeType.Text; sel: '__text__'; text: string; key: undefined; } export interface VComment extends BaseVNode { type: VNodeType.Comment; sel: '__comment__'; text: string; key: undefined; } export interface VBaseElement extends BaseVNode, BaseVParent { sel: string; data: VElementData; elm: Element | undefined; key: Key; slotAssignment: string | undefined; } export interface VElement extends VBaseElement { type: VNodeType.Element; } export interface VCustomElement extends VBaseElement { type: VNodeType.CustomElement; mode: 'closed' | 'open'; ctor: any; aChildren: VNodes | undefined; vm: VM | undefined; } export interface VNodeData { readonly props?: Readonly>; readonly attrs?: Readonly>; readonly className?: string; readonly style?: string; readonly classMap?: Readonly>; readonly styleDecls?: ReadonlyArray<[string, string, boolean]>; readonly context?: Readonly>>>; readonly on?: Readonly any>>; readonly dynamicOn?: Readonly any>>; readonly dynamicOnRaw?: Readonly any>>; readonly svg?: boolean; readonly renderer?: RendererAPI; } export interface VElementData extends VNodeData { readonly key: Key; readonly external?: boolean; readonly ref?: string; readonly slotData?: any; readonly slotAssignment?: string; readonly context?: { lwc?: { dom?: 'manual'; }; }; } export declare function isVBaseElement(vnode: VNode): vnode is VElement | VCustomElement; export declare function isSameVnode(vnode1: VNode, vnode2: VNode): boolean; export declare function isVCustomElement(vnode: VNode | VBaseElement): vnode is VCustomElement; export declare function isVFragment(vnode: VNode): vnode is VFragment; export declare function isVScopedSlotFragment(vnode: VNode): vnode is VScopedSlotFragment; export declare function isVStatic(vnode: VNode): vnode is VStatic; export declare function isVStaticPartElement(vnode: VStaticPart): vnode is VStaticPartElement; export declare function isVStaticPartText(vnode: VStaticPart): vnode is VStaticPartText; //# sourceMappingURL=vnodes.d.ts.map