import { Nullable } from '../utils/types'; import { EventHandler } from './eventhandler'; export declare class Thing extends EventHandler { uuid: string; id: string | number; name: string; isThing: true; parent: Nullable; children: Thing[]; tag: string; userData: any; userProps: any; descriptors: IDescriptor[]; private _level; protected _needsUpdate: boolean; constructor(opts?: any); set needsUpdate(v: boolean); get needsUpdate(): boolean; /** * 获取当前对象的类型 */ get className(): string; clone(): Thing; copy(): Thing; get level(): number; /** * 设置层级 主动更新子节点level */ set level(v: number); add(...things: Thing[] | T[]): this; remove(...things: Thing[]): this; /** * @description : 遍历所有对象 * @param {(obj:any)=>void} cb 回掉方法 * @return {*} * @example : */ foreach(cb: (arg0: any) => void): void; /** * 遍历一级子节点 * @param cb */ foreachChildren(cb: (arg0: any) => void): void; getObjectByProperty(name: string, value: any): T | Thing | undefined; /** * @description : 通过id获得对象 * @param {string} id * @return {*} * @example : */ getObjectById(id: string): Thing; /** * @description : 通过name获得对象 * @param {string} name * @return {*} * @example : */ getObjectByName(name: any): Thing; /** * 生成属性的set/get方法 * @param {string} name * @param {function} setFunc * @param {boolean} skipEqualsCheck */ defineProperty(name: string | number | symbol, setFunc: any, skipEqualsCheck?: boolean): void; buildAccessor(descriptor: IDescriptor, bindObject?: T): void; buildAccessors(schema: IDescriptor[], bindObject?: T): void; } export interface IDescriptor { name: string; attr?: string; type?: string | any; label?: string; assignment?: string; description?: string; defaultValue?: any; array?: any[]; count?: number; template?: IDescriptor; optionItems?: any; }