import type { ComponentSchema } from '@mo-fang/types';
import type { ComputedResolvedValue } from '../types';
import type { ElementTree, TrackedComponentSchema } from './element-tree';
import type { Store } from './store';
/**
 * 元素循环配置
 */
export interface ElementLoop {
    enable: boolean;
    items?: unknown[] | unknown;
    item?: string;
    index?: string;
}
/**
 * 元素上下文
 */
export interface ElementContext {
    loop?: ElementLoop;
    [key: string]: unknown;
}
/**
 * 渲染树
 */
export interface RenderTree {
    uuid: string;
    name: string;
    slotMap?: Record<string, RenderTree[]>;
    children?: RenderTree[];
}
/**
 * 元素对应的组件
 */
export type ElementComponent = Record<string, unknown>;
/**
 * 元素对应的 Props
 */
export type ElementProps = Record<string, any>;
export declare class Element {
    /**
     * 状态容器
     */
    store: Store;
    /**
     * 标识
     */
    uuid: string;
    /**
     * 组件名
     */
    name: string;
    /**
     * 布局配置
     */
    layout: ComponentSchema['layout'];
    /**
     * 启用组件实例
     */
    useRef: ComponentSchema['useRef'];
    /**
     * 是否是循环元素
     */
    isLooped: boolean;
    /**
     * 组件 Props
     */
    props: ElementProps;
    /**
     * 组件实例
     */
    component?: ElementComponent | null;
    /**
     * 条件渲染
     */
    condition: ComputedResolvedValue<boolean>;
    /**
     * 子元素循环配置
     */
    loop?: ComputedResolvedValue<Record<string, ElementLoop>>;
    /**
     * slot
     */
    slot?: Record<string, Element[]>;
    /**
     * 子元素
     */
    children?: Element[];
    /**
     * 父元素
     */
    parent?: Element;
    /**
     * 作用域
     */
    scope?: Record<string, unknown>;
    constructor(store: Store, tree: ElementTree, componentSchema: TrackedComponentSchema, parent?: Element, loopParams?: {
        uuid: string;
        scope: Record<string, unknown>;
        isLooped: boolean;
    });
    /**
     * 上下文
     */
    get context(): ElementContext;
    /**
     * 渲染树
     */
    get renderTree(): RenderTree;
    /**
     * 生成条件和循环配置
     *
     * @param condition
     * @param children
     */
    generateConditionAndLoop: (condition: TrackedComponentSchema['condition'], children: TrackedComponentSchema['children']) => void;
    /**
     * 生成子树
     *
     * @param tree
     * @param children
     * @param loop
     */
    generateChildren: (tree: ElementTree, children: ComponentSchema[] | undefined, loop?: Record<string, ElementLoop>) => void;
    /**
     * 生成组件实例和组件 props，如有循环配置需要生成多个
     */
    generateComponentsAndProps: (store: Store, props?: ComponentSchema['props']) => void;
    /**
     * 销毁
     */
    clearStoreValue: () => void;
}
//# sourceMappingURL=element.d.ts.map