UNPKG

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