import { ELang } from '../../constant/annotation'; import { IPolygonData } from '../../types/tool/polygon'; import { ETextType } from '../../constant/tool'; export declare const ATTRIBUTE_COLORS: string[]; export declare const REGEXP_NUMBER = "^[0-9]+$"; export declare const REGEXP_ENGLISH = "^[A-Za-z]+$"; export default class AttributeUtils { /** * 获取属性icon * @param attribute * @param attributeList */ static getAttributeIcon(attribute: string, attributeList: IInputList[], valid?: boolean): HTMLImageElement; /** * 获取正则校验的string * @param textCheckType * @param customFormat */ static checkString(textCheckType: number, customFormat: string): string; /** * * @param value 检测的值 * @param checkString RegExp string */ static checkTextAttibute(value: string | undefined, checkStrings: string): boolean; /** * 获取属性标注显示的数据 * @param attribute * @param attributeList * @returns {string} 标注属性 */ static getAttributeShowText(attribute: string | undefined, attributeList?: IInputList[]): string | undefined; /** * 获取属性标注的索引 * @param attribute * @param attributeList * @returns {number} 属性索引 */ static getAttributeIndex(attribute: string | undefined, attributeList: IInputList[]): number; /** * 获取属性标注的索引 * @param attribute * @param attributeList * @returns {string} 颜色hex值 */ static getAttributeColor(attribute: string | undefined, attributeList: IInputList[]): string; /** * 文本标注:自动获取下一个序号(取当前数据的最大值 + 1) * @param toolResultList 工具的结果集 * @param textCheckType */ static getTextAttribute(toolResultList: IRect[] | IPolygonData[] | IPoint[] | ILine[], textCheckType: number): string; /** * 更改数据的textAttribute * @param value * @param selectedID 工具中选中数据的ID * @param toolList 工具的结果集 */ static textChange(value: string | undefined, selectedID: string, toolList: any[]): any[]; /** * 获取错误提示的文案 * @param textCheckType */ static getErrorNotice(textCheckType: number, lang: ELang): string; static textAttributeValidate(textCheckType: number, customFormat: string, text: string): boolean | undefined; /** * 检查结果的文本标注数据是否可以通过 * @param textCheckType * @param customFormat * @param resultList 需要检查的结果集 */ static checkTextAttribute(textCheckType: ETextType, customFormat: string, resultList: any[], selectedID?: string): boolean; /** * 改变文本标注后 修改全部的LOG * @param toolLog LOG数据 * @param toolList 工具的数据集 */ static changeTextAttributeInLog(toolLog: any[][], toolList: any[]): any[][]; static getTextIconSvg(attribute: string | undefined, attributeList: IInputList[], attributeConfigurable: boolean | undefined, baseIcon: any): any; static generateIconAttribute({ fill, width, height, xmlns, xlink, }: { fill?: string; width?: number; height?: number; xmlns?: string; xlink?: string; }): string; /** * 根据keycode返回attribute, 没有匹配到时为undefined * @param keyCode * @param attributeList * @returns {undefined|string} 没有匹配到时为undefined */ static getAttributeByKeycode(keyCode: number, attributeList: IInputList[]): string | undefined; }