getChildrenJSON.d.ts 536 B

123456789101112131415161718192021
  1. /**
  2. * @description 获取子元素的 JSON 格式数据
  3. * @author wangfupeng
  4. */
  5. import { DomElement } from '../utils/dom-core';
  6. declare type AttrType = {
  7. name: string;
  8. value: string;
  9. };
  10. export declare type NodeType = {
  11. tag: string;
  12. attrs: AttrType[];
  13. children: NodeListType;
  14. };
  15. export declare type NodeListType = Array<string | NodeType>;
  16. /**
  17. * 获取子元素的 JSON 格式数据
  18. * @param $elem DOM 节点
  19. */
  20. declare function getChildrenJSON($elem: DomElement): NodeListType;
  21. export default getChildrenJSON;