/** * 额外引入的工具统一由此处收口 */ /** * 遍历规则 * @param rules 规则内容 * @param callback 对规则进行检查结果写入 */ declare const loopRules: (rules: any[], callback: (checkItem: string, rule: any) => void) => void; /** * 字体处理,移除空格、引号和大小写,方便进行比较 * @param v 字体字符串 * @returns */ declare const formatFontFamily: (v: string) => string; /** * 获取节点内的纯文本内容 */ declare const getNodeText: (el: Element) => string; /** * 是否待翻译词条 */ declare const isDictionary: (text: any) => boolean; /** * 是否英文字符 */ declare const isEnglish: (text: any) => boolean; /** * 是否繁体字符 */ declare const isTraditional: (text: any) => boolean; /** * 元素节点或有效的文本节点 */ declare const isValidNode: (childNode: ChildNode) => boolean; /** * 配置 recordInfo 的上限 * @param value */ declare const configRecordInfo: (value: number) => void; /** * 记录设计规范检查的错误或告警信息 * @param rule * @param type * @param key * @param value * @param map * @param mapValue */ declare const recordInfo: ({ key, map, mapValue }: RecordInfo) => (type: 'error' | 'success' | 'warning' | 'help', rule: any, value: any) => void; declare const getRequestToken: (request: any) => { url: string; query: any; params: { action: any; }; }; /** * 获取可测试的颜色 * @param element 测试节点 * @param nodeType 节点类型 1是元素节点 3是文本节点 */ declare const getValidColor: (element: Element, nodeType: number) => { color: any; borderColor: any[]; backgroundColor: any; }; /** * 查找包含匹配正则的 class 的元素 * @param regex */ declare const findClassByRegex: (regex: RegExp) => any[]; /** * 计算PCP平均值 * @param data * @returns */ declare const PCPAverage: (originalData: number[]) => number; /** * 基于节点tag名称获取节点数量 * @param tagName * @param param1 * @returns */ declare const getNodeCount: (tagName: string, property?: any) => number; export { loopRules, formatFontFamily, getNodeText, isDictionary, isEnglish, isTraditional, isValidNode, configRecordInfo, recordInfo, getRequestToken, getValidColor, findClassByRegex, PCPAverage, getNodeCount, };