import { DataSchema, DataSourceDeps, Id, MApp, MComponent, MNode, MNodeInstance } from "@tmagic/schema"; import { MContainer, MNode as MNode$1, MPage, MPageFragment } from "@tmagic/core"; //#region temp/packages/editor/src/type.d.ts interface EditorNodeInfo { node: MNode$1 | null; parent: MContainer | null; page: MPage | MPageFragment | null; } //#endregion //#region temp/packages/utils/src/dom.d.ts declare const asyncLoadJs: (url: string, crossOrigin?: string, document?: Document) => any; declare const asyncLoadCss: (url: string, document?: Document) => any; declare const addClassName: (el: Element, doc: Document, className: string) => void; declare const removeClassName: (el: Element, ...className: string[]) => void; declare const removeClassNameByClassName: (doc: Document, className: string) => HTMLElement | null; declare const injectStyle: (doc: Document, style: string) => HTMLStyleElement; declare const createDiv: ({ className, cssText }: { className: string; cssText: string; }) => HTMLDivElement; declare const getDocument: () => Document; declare const calcValueByFontsize: (doc: Document | undefined, value: number) => number; declare const dslDomRelateConfig: { getIdFromEl: (el?: HTMLElement | SVGElement | null) => string | undefined; getElById: (doc?: Document, id?: string | number) => HTMLElement; setIdToEl: (el: HTMLElement | SVGElement, id: string | number) => void; }; declare const setDslDomRelateConfig: (name: K, value: T) => void; declare const getIdFromEl: () => (el?: HTMLElement | SVGElement | null) => string | undefined; declare const getElById: () => (doc?: Document, id?: string | number) => HTMLElement; declare const setIdToEl: () => (el: HTMLElement | SVGElement, id: string | number) => void; //#endregion //#region temp/packages/utils/src/const.d.ts declare const DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX = "ds-field::"; declare const DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX = "ds-field-changed"; declare const DATA_SOURCE_SET_DATA_METHOD_NAME = "setDataFromEvent"; //#endregion //#region temp/packages/utils/src/index.d.ts declare const getGlobalThis: () => any; declare const sleep: (ms: number) => Promise; declare const toLine: (name?: string) => string; declare const toHump: (name?: string) => string; declare const emptyFn: () => any; /** * 通过id获取组件在应用的子孙路径 * @param {number | string} id 组件id * @param {Array} data 要查找的根容器节点 * @return {Array} 组件在data中的子孙路径 */ declare const getNodePath: (id: Id, data?: MNode[]) => MNode[]; declare const getNodeInfo: (id: Id, root: Pick | null) => EditorNodeInfo; declare const filterXSS: (str: string) => string; declare const getUrlParam: (param: string, url?: string) => string; /** * 设置url中指定的参数 * * @param {string} * name [参数名] * @param {string} * value [参数值] * @param {string} * url [发生替换的url地址|默认为location.href] * @return {string} [返回处理后的url] */ declare const setUrlParam: (name: string, value: string, url?: string) => string; declare const getSearchObj: (search?: string) => Record; declare const delQueStr: (url: string, ref: string[] | string) => string; declare const isObject: (obj: any) => boolean; declare const isPop: (node: MComponent | null) => boolean; declare const isPage: (node?: MComponent | null) => boolean; declare const isPageFragment: (node?: MComponent | null) => boolean; declare const isNumber: (value: any) => boolean; declare const getHost: (targetUrl: string) => string | undefined; declare const isSameDomain: (targetUrl?: string, source?: string) => boolean; /** * 生成指定位数的GUID,无【-】格式 * @param digit 位数,默认值8 * @returns */ declare const guid: (digit?: number) => string; declare const getKeysArray: (keys: string | number) => string[]; declare const getValueByKeyPath: (keys?: number | string | string[], data?: Record) => any; declare const setValueByKeyPath: (keys: string | number, value: any, data?: Record) => any; declare const getNodes: (ids: Id[], data?: MNode[]) => MNode[]; declare const getDepKeys: (dataSourceDeps: DataSourceDeps | undefined, nodeId: Id) => Id[]; declare const getDepNodeIds: (dataSourceDeps?: DataSourceDeps) => string[]; /** * 将新节点更新到data或者parentId对应的节点的子节点中 * @param newNode 新节点 * @param data 需要修改的数据 * @param parentId 父节点 id */ declare const replaceChildNode: (newNode: MNode, data?: MNode[], parentId?: Id) => void; declare const DSL_NODE_KEY_COPY_PREFIX = "__tmagic__"; declare const IS_DSL_NODE_KEY = "__tmagic__dslNode"; declare const PAGE_FRAGMENT_CONTAINER_ID_KEY = "tmagic-page-fragment-container-id"; declare const compiledNode: (compile: (value: any) => any, node: MNode, dataSourceDeps?: DataSourceDeps, sourceId?: Id) => MNode; declare const compiledCond: (op: string, fieldValue: any, inputValue: any, range?: number[]) => boolean; declare const getDefaultValueFromFields: (fields: DataSchema[]) => Record; declare const getKeys: (obj: T) => Array; declare const calculatePercentage: (value: number, percentageStr: string) => number; declare const isPercentage: (value: number | string) => boolean; declare const convertToNumber: (value: number | string, parentValue?: number) => number; /** * 添加参数到URL * @param obj 参数对象 * @param global window对象 * @param needReload 是否需要刷新 */ declare const addParamToUrl: (obj: Record, global?: typeof globalThis, needReload?: boolean) => void; declare const dataSourceTemplateRegExp: RegExp; declare const isDslNode: (config: MNodeInstance) => boolean; interface NodeItem { items?: NodeItem[]; [key: string]: any; } declare const traverseNode: (node: T, cb: (node: T, parents: T[]) => void, parents?: T[], evalCbAfter?: boolean) => void; declare const isValueIncludeDataSource: (value: any) => boolean; declare const removeDataSourceFieldPrefix: (id?: string) => string; //#endregion export { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, DATA_SOURCE_SET_DATA_METHOD_NAME, DSL_NODE_KEY_COPY_PREFIX, IS_DSL_NODE_KEY, NodeItem, PAGE_FRAGMENT_CONTAINER_ID_KEY, addClassName, addParamToUrl, asyncLoadCss, asyncLoadJs, calcValueByFontsize, calculatePercentage, compiledCond, compiledNode, convertToNumber, createDiv, dataSourceTemplateRegExp, delQueStr, emptyFn, filterXSS, getDefaultValueFromFields, getDepKeys, getDepNodeIds, getDocument, getElById, getGlobalThis, getHost, getIdFromEl, getKeys, getKeysArray, getNodeInfo, getNodePath, getNodes, getSearchObj, getUrlParam, getValueByKeyPath, guid, injectStyle, isDslNode, isNumber, isObject, isPage, isPageFragment, isPercentage, isPop, isSameDomain, isValueIncludeDataSource, removeClassName, removeClassNameByClassName, removeDataSourceFieldPrefix, replaceChildNode, setDslDomRelateConfig, setIdToEl, setUrlParam, setValueByKeyPath, sleep, toHump, toLine, traverseNode };