import { IPolygonPoint } from '../../types/tool/polygon'; import { ESortDirection } from '../../constant/annotation'; type point = { id: string; x: number; y: number; }; export default class CommonToolUtils { /** * 找到指定步骤的数据 * @param step 获取的步骤 * @param stepList 步骤列表 * @returns 步骤配置 */ static getStepInfo(step: number, stepList: IStepInfo[]): IStepInfo; /** * 获取当前步骤的步骤配置信息,用于当前标注配置的获取 * 注意: 需要与 getStepInfo 区分,因为 getStepInfo 拿取的是直接的步骤信息 * @export * @param {number} currentStep * @param {IStepInfo[]} stepList * @returns {*} */ static getCurrentStepInfo(currentStep: number, stepList: IStepInfo[]): any; /** * 获取当前步骤的步骤的步骤配置 */ static getCurrentStepToolAndConfig(currentStep: number, stepList: IStepInfo[]): false | { tool: any; config: any; name: string; step: number; type: number; dataSourceStep: number; tips: string; simpleDocument: string; progress: number; fileCount: number; }; static jsonParser: (content: any, defaultValue?: any) => any; /** * 获取结果中最大的order * * @export * @param {any[]} result * @returns {number} */ static getMaxOrder(result: any[]): number; /** * 表单控件控件判断 返回 Boolean * hotkey is effective only whene filter return true * @param event * @returns {boolean} */ static hotkeyFilter(event: any): boolean; /** * 判断是否移动按钮 * @param keyCode */ static isMoveKey(keyCode: number): boolean; static getNextSelectedRectID(rectList: point[], sort?: ESortDirection, selectedID?: string): point; static getNextSelectedRectIDByEvent(pointList: point[], event: KeyboardEvent, selectedID?: string): point; /** * 计算当前状态下需要展示的结果集合 * @param T 当前图片的结果框 * @param sourceID 当前状态依赖的框体,若依赖原图则返回 '0' * @param attributeLockList 当前展示的属性 * @param selectedIDs 是否含有选中逻辑 * @returns */ static getRenderResultList(resultList: any[], sourceID: string, attributeLockList?: string[], selectedIDs?: string[], highlightVisible?: boolean): [T[], T[]]; /** * 获取当前依赖情况下的 sourceID 提取 */ static getSourceID(basicResult?: any): any; /** * 获取当前点集的所有线条 * @param pointList * @returns */ static findAllLine(pointList: IPolygonPoint[] | point[], isClose?: boolean): { point1: IPolygonPoint | point; point2: IPolygonPoint | point; pointIndex: number; }[]; /** * 转换当前依赖 sourceID * @param sourceID * @returns */ static translateSourceID(sourceID: string | number | undefined): string | number; /** * 兼容判断 sourceID 为 空字符串、不存在、数字的情况 * @param sourceA * @param sourceB * @returns */ static isDifferSourceID(sourceIDA: string | number, sourceIDB: string | number): boolean; /** * 兼容判断是否为相同类型的 sourceID * @param sourceIDA * @param sourceIDB * @returns */ static isSameSourceID(sourceIDA: string | number | undefined, sourceIDB: string | number | undefined): boolean; /** * 获取下一个列表标记的值和位置 * @param resultList * @param markerList * @param markerIndex * @returns */ static getNextMarker(resultList: Array, markerList?: IInputList[], markerIndex?: number): { label: string; index: number; } | undefined; /** * 获取当前值在列表标注的位置 * @param label * @param markerList * @returns */ static getCurrentMarkerIndex(label: string, markerList?: IInputList[]): number; } export {};