2023-12-12 17:31:07 +08:00
|
|
|
import { RelationManage } from './GraphicRelation';
|
|
|
|
import { JlGraphic } from './JlGraphic';
|
|
|
|
export interface GraphicQueryStore {
|
|
|
|
/**
|
|
|
|
* 获取所有图形对象
|
|
|
|
*/
|
|
|
|
getAllGraphics(): JlGraphic[];
|
|
|
|
/**
|
|
|
|
* 根据id获取图形
|
|
|
|
*/
|
2023-12-14 13:11:42 +08:00
|
|
|
queryById<T extends JlGraphic>(id: number | string): T;
|
2023-12-12 17:31:07 +08:00
|
|
|
/**
|
|
|
|
* 根据id模糊查询图形
|
|
|
|
* @param id
|
|
|
|
*/
|
2023-12-14 13:11:42 +08:00
|
|
|
queryByIdAmbiguous(id: number | string): JlGraphic[];
|
2023-12-12 17:31:07 +08:00
|
|
|
/**
|
|
|
|
* 根据类型获取图形列表
|
|
|
|
*/
|
|
|
|
queryByType<T extends JlGraphic>(type: string): T[];
|
|
|
|
/**
|
|
|
|
* 根据code查询
|
|
|
|
* @param code
|
|
|
|
*/
|
|
|
|
queryByCode(code: string): JlGraphic[] | undefined;
|
|
|
|
/**
|
|
|
|
* 根据code模糊查询图形
|
|
|
|
* @param code
|
|
|
|
* @param type
|
|
|
|
*/
|
|
|
|
queryByCodeAmbiguous(code: string): JlGraphic[];
|
|
|
|
/**
|
|
|
|
* 根据id或code查询图形
|
|
|
|
* @param v
|
|
|
|
*/
|
2023-12-14 13:11:42 +08:00
|
|
|
queryByIdOrCode(v: string | number): JlGraphic[];
|
2023-12-12 17:31:07 +08:00
|
|
|
/**
|
|
|
|
* 根据id或code及类型查询图形
|
|
|
|
* @param v
|
|
|
|
* @param type
|
|
|
|
*/
|
2023-12-14 13:11:42 +08:00
|
|
|
queryByIdOrCodeAndType(v: string | number, type: string): JlGraphic[];
|
2023-12-12 17:31:07 +08:00
|
|
|
/**
|
|
|
|
* 根据code和类型获取图形
|
|
|
|
* @param code
|
|
|
|
* @param type
|
|
|
|
*/
|
|
|
|
queryByCodeAndType<T extends JlGraphic>(code: string, type: string): T | undefined;
|
|
|
|
/**
|
|
|
|
* 根据code和类型模糊查询图形
|
|
|
|
* @param code
|
|
|
|
* @param type
|
|
|
|
*/
|
|
|
|
queryByCodeAndTypeAmbiguous<T extends JlGraphic>(code: string, type: string): T[];
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 图形存储
|
|
|
|
*/
|
|
|
|
export declare class GraphicStore implements GraphicQueryStore {
|
2023-12-14 13:11:42 +08:00
|
|
|
store: Map<number, JlGraphic>;
|
2023-12-12 17:31:07 +08:00
|
|
|
relationManage: RelationManage;
|
|
|
|
constructor();
|
|
|
|
/**
|
|
|
|
* 获取所有图形对象
|
|
|
|
*/
|
|
|
|
getAllGraphics(): JlGraphic[];
|
2023-12-14 13:11:42 +08:00
|
|
|
queryById<T extends JlGraphic>(id: number | string): T;
|
|
|
|
queryByIdAmbiguous(id: number | string): JlGraphic[];
|
2023-12-12 17:31:07 +08:00
|
|
|
queryByType<T extends JlGraphic>(type: string): T[];
|
|
|
|
queryByCode(code: string): JlGraphic[] | undefined;
|
|
|
|
queryByCodeAmbiguous(code: string): JlGraphic[];
|
2023-12-14 13:11:42 +08:00
|
|
|
queryByIdOrCode(s: string | number): JlGraphic[];
|
|
|
|
queryByIdOrCodeAndType(s: string | number, type: string): JlGraphic[];
|
2023-12-12 17:31:07 +08:00
|
|
|
queryByCodeAndType<T extends JlGraphic>(code: string, type: string): T | undefined;
|
|
|
|
queryByCodeAndTypeAmbiguous<T extends JlGraphic>(code: string, type: string): T[];
|
|
|
|
/**
|
|
|
|
* 存储图形对象
|
|
|
|
* @param graphics 要存储的图形
|
|
|
|
*/
|
|
|
|
storeGraphics(graphic: JlGraphic): boolean;
|
|
|
|
/**
|
|
|
|
* 删除图形
|
|
|
|
* @param graph 要删除的图形
|
|
|
|
*/
|
|
|
|
deleteGraphics(graphic: JlGraphic): JlGraphic | undefined;
|
|
|
|
/**
|
|
|
|
* 清空
|
|
|
|
*/
|
|
|
|
clear(): void;
|
|
|
|
}
|