@labelbee/lb-annotation 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +143 -0
  2. package/dist/index.js +76 -0
  3. package/dist/types/constant/annotation.d.ts +63 -0
  4. package/dist/types/constant/annotationTask.d.ts +16 -0
  5. package/dist/types/constant/defaultConfig.d.ts +259 -0
  6. package/dist/types/constant/keyCode.d.ts +32 -0
  7. package/dist/types/constant/style.d.ts +43 -0
  8. package/dist/types/constant/tool.d.ts +161 -0
  9. package/dist/types/core/index.d.ts +74 -0
  10. package/dist/types/core/toolOperation/LineToolOperation.d.ts +419 -0
  11. package/dist/types/core/toolOperation/TextToolOperation.d.ts +41 -0
  12. package/dist/types/core/toolOperation/ViewOperation.d.ts +55 -0
  13. package/dist/types/core/toolOperation/basicToolOperation.d.ts +188 -0
  14. package/dist/types/core/toolOperation/checkOperation.d.ts +37 -0
  15. package/dist/types/core/toolOperation/eventListener.d.ts +33 -0
  16. package/dist/types/core/toolOperation/measureOperation.d.ts +8 -0
  17. package/dist/types/core/toolOperation/pointOperation.d.ts +85 -0
  18. package/dist/types/core/toolOperation/polygonOperation.d.ts +134 -0
  19. package/dist/types/core/toolOperation/rectOperation.d.ts +141 -0
  20. package/dist/types/core/toolOperation/tagOperation.d.ts +44 -0
  21. package/dist/types/core/toolOperation/textAttributeClass.d.ts +56 -0
  22. package/dist/types/index.d.ts +26 -0
  23. package/dist/types/locales/constants.d.ts +15 -0
  24. package/dist/types/locales/en_US/message.d.ts +2 -0
  25. package/dist/types/locales/index.d.ts +4 -0
  26. package/dist/types/locales/zh_CN/message.d.ts +2 -0
  27. package/dist/types/utils/ActionsHistory.d.ts +32 -0
  28. package/dist/types/utils/EventBus.d.ts +40 -0
  29. package/dist/types/utils/ImgUtils.d.ts +3 -0
  30. package/dist/types/utils/MathUtils.d.ts +43 -0
  31. package/dist/types/utils/tool/AttributeUtils.d.ts +87 -0
  32. package/dist/types/utils/tool/AxisUtils.d.ts +189 -0
  33. package/dist/types/utils/tool/CanvasUtils.d.ts +40 -0
  34. package/dist/types/utils/tool/CommonToolUtils.d.ts +118 -0
  35. package/dist/types/utils/tool/DblClickEventListener.d.ts +47 -0
  36. package/dist/types/utils/tool/DrawUtils.d.ts +117 -0
  37. package/dist/types/utils/tool/ImgPosUtils.d.ts +34 -0
  38. package/dist/types/utils/tool/LineToolUtils.d.ts +105 -0
  39. package/dist/types/utils/tool/MarkerUtils.d.ts +9 -0
  40. package/dist/types/utils/tool/PolygonUtils.d.ts +60 -0
  41. package/dist/types/utils/tool/RectUtils.d.ts +69 -0
  42. package/dist/types/utils/tool/RenderDomUtils.d.ts +3 -0
  43. package/dist/types/utils/tool/StyleUtils.d.ts +9 -0
  44. package/dist/types/utils/tool/TagUtils.d.ts +54 -0
  45. package/dist/types/utils/tool/UnitUtils.d.ts +4 -0
  46. package/dist/types/utils/tool/ZoomUtils.d.ts +16 -0
  47. package/dist/types/utils/tool/polygonTool.d.ts +32 -0
  48. package/dist/types/utils/uuid.d.ts +1 -0
  49. package/es/index.js +76 -0
  50. package/package.json +96 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 查看模式 - 严格配置要求
3
+ */
4
+ import { EToolName } from '../../constant/tool';
5
+ import { IPolygonData } from '../../types/tool/polygon';
6
+ import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
7
+ interface ICheckResult {
8
+ result: Array<IPolygonData | IRect | ITagResult>;
9
+ toolName: EToolName;
10
+ config: string[];
11
+ }
12
+ interface ICheckOperationProps extends IBasicToolOperationProps {
13
+ resultList: ICheckResult[];
14
+ }
15
+ declare class CheckOperation extends BasicToolOperation {
16
+ resultList: ICheckResult[];
17
+ hoverID: string[];
18
+ fillID: string[];
19
+ private mouseHoverID?;
20
+ constructor(props: ICheckOperationProps);
21
+ onMouseDown(e: MouseEvent): true | undefined;
22
+ updateRotate(): void;
23
+ onMouseMove(e: MouseEvent): void;
24
+ getHoverRectID: (e: MouseEvent) => string;
25
+ setResult(result: ICheckResult[]): void;
26
+ drawPolygon(polygonList: IPolygonData[], config: any): void;
27
+ drawRect(rectList: IRect[], config: any): void;
28
+ drawTag(tagList: ITagResult[], config: any): void;
29
+ setHoverID(hoverID: string[]): void;
30
+ setFillID(fillID: string[]): void;
31
+ render(): void;
32
+ /**
33
+ * 同步操作中的基础信息
34
+ */
35
+ exportData(): {}[];
36
+ }
37
+ export default CheckOperation;
@@ -0,0 +1,33 @@
1
+ export default class EventListener {
2
+ private _events;
3
+ constructor();
4
+ /**
5
+ * 事件绑定。(注:相同的事件下的相同方法不支持多次绑定)
6
+ * @param eventName 事件名字
7
+ * @param callback 事件回调
8
+ */
9
+ on(eventName: string, callback: (params?: any) => void): void;
10
+ /**
11
+ * 单独的事件绑定,一个事件仅支持绑定一个函数
12
+ * @param eventName
13
+ * @param callback
14
+ */
15
+ singleOn(eventName: string, callback: (params?: any) => void): void;
16
+ /**
17
+ * 事件广播
18
+ * @param eventName 事件名字
19
+ * @param callback 事件回调
20
+ */
21
+ emit(eventName: string, ...args: any[]): void;
22
+ /**
23
+ * 事件解绑,对某一事件进行事件解绑
24
+ * @param eventName 需要解绑的事件名字
25
+ * @param callback 需要解绑的方法
26
+ */
27
+ unbind(eventName: string, callback: (params?: any) => void): void;
28
+ /**
29
+ * 解绑事件
30
+ * @param eventName
31
+ */
32
+ unbindAll(eventName: string): void;
33
+ }
@@ -0,0 +1,8 @@
1
+ import { RectOperation, IRectOperationProps } from './rectOperation';
2
+ interface IMeasureOpeartion extends IRectOperationProps {
3
+ }
4
+ declare class MeasureOperation extends RectOperation {
5
+ constructor(props: IMeasureOpeartion);
6
+ setSelectedIdAfterAddingDrawingRect(): void;
7
+ }
8
+ export default MeasureOperation;
@@ -0,0 +1,85 @@
1
+ import { IPolygonData } from '../../types/tool/polygon';
2
+ import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
3
+ export interface IPointOperationProps extends IBasicToolOperationProps {
4
+ style: any;
5
+ }
6
+ declare class PointOperation extends BasicToolOperation {
7
+ config: IPointToolConfig;
8
+ pointList: IPointUnit[];
9
+ hoverID?: string;
10
+ selectedID?: string;
11
+ private _textAttributInstance?;
12
+ constructor(props: IPointOperationProps);
13
+ get dataList(): IPointUnit[];
14
+ setResult(pointList: IPointUnit[]): void;
15
+ /**
16
+ * 设置当前的结果集
17
+ * @param rectList
18
+ * @param isUpload
19
+ */
20
+ setPointList(pointList: IPointUnit[], isUpload?: boolean): void;
21
+ setConfig(config: string, isClear?: boolean): void;
22
+ clearResult(): void;
23
+ setDefaultAttribute(defaultAttribute?: string): void;
24
+ /**
25
+ * 外层 sidabr 调用
26
+ * @param v
27
+ * @returns
28
+ */
29
+ textChange: (v: string) => void;
30
+ get selectedText(): string | undefined;
31
+ setStyle(toolStyle: any): void;
32
+ setSelectedID(newID?: string): void;
33
+ /**
34
+ * 获取当前配置下的 icon svg
35
+ * @param attribute
36
+ */
37
+ getTextIconSvg(attribute?: string): any;
38
+ /**
39
+ * 清除所有的中间状态
40
+ */
41
+ clearActiveStatus(): void;
42
+ setBasicResult(basicResult: any): void;
43
+ onMouseDown(e: MouseEvent): true | undefined;
44
+ onMouseMove(e: MouseEvent): undefined;
45
+ onMouseUp(e: MouseEvent): true | undefined;
46
+ onDragMove(e: MouseEvent): void;
47
+ onKeyDown(e: KeyboardEvent): void;
48
+ createPoint(e: MouseEvent): void;
49
+ isInPoint(pos: ICoordinate, point: ICoordinate): boolean;
50
+ getHoverId(): string | undefined;
51
+ rightMouseUp(): void;
52
+ onTabKeyDown(e: KeyboardEvent): void;
53
+ /**
54
+ * 当前依赖状态下本页的所有的点
55
+ *
56
+ * @readonly
57
+ * @memberof RectOperation
58
+ */
59
+ get currentPageResult(): IPolygonData[];
60
+ /**
61
+ * 导出结果
62
+ */
63
+ exportData(): any[];
64
+ deletePoint(): void;
65
+ /** 撤销 和 重做 */
66
+ undoAndRedo(name: 'undo' | 'redo'): void;
67
+ /** 撤销 */
68
+ undo(): void;
69
+ /** 重做 */
70
+ redo(): void;
71
+ getCurrentSelectedData(): {
72
+ width: number;
73
+ textAttribute: string;
74
+ color: any;
75
+ } | undefined;
76
+ /** 更新文本输入,并且进行关闭 */
77
+ updateSelectedTextAttribute(newTextAttribute?: string): void;
78
+ renderTextAttribute(): void;
79
+ /**
80
+ * 绘制标点
81
+ */
82
+ renderPoint(): void;
83
+ render(): void;
84
+ }
85
+ export default PointOperation;
@@ -0,0 +1,134 @@
1
+ import { IPolygonConfig, IPolygonData, IPolygonPoint } from '../../types/tool/polygon';
2
+ import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
3
+ interface IPolygonOperationProps extends IBasicToolOperationProps {
4
+ }
5
+ declare class PolygonOperation extends BasicToolOperation {
6
+ config: IPolygonConfig;
7
+ drawingPointList: IPolygonPoint[];
8
+ polygonList: IPolygonData[];
9
+ hoverID?: string;
10
+ hoverPointIndex: number;
11
+ hoverEdgeIndex: number;
12
+ selectedID?: string;
13
+ editPolygonID?: string;
14
+ private dragInfo?;
15
+ private drawingHistory;
16
+ private isCtrl;
17
+ private isAlt;
18
+ private _textAttributInstance?;
19
+ constructor(props: IPolygonOperationProps);
20
+ eventBinding(): void;
21
+ eventUnbinding(): void;
22
+ destroy(): void;
23
+ get selectedPolygon(): IPolygonData | undefined;
24
+ get polygonListUnderZoom(): {
25
+ pointList: ({
26
+ x: number;
27
+ y: number;
28
+ specialPoint?: boolean | undefined;
29
+ specialEdge?: boolean | undefined;
30
+ } | {
31
+ x: number;
32
+ y: number;
33
+ })[];
34
+ sourceID: string;
35
+ id: string;
36
+ valid: boolean;
37
+ order: number;
38
+ textAttribute: string;
39
+ attribute: string;
40
+ }[];
41
+ get selectedText(): string | undefined;
42
+ isAllowDouble: (e: MouseEvent) => boolean;
43
+ get dataList(): IPolygonData[];
44
+ /**
45
+ * 当前页面展示的框体
46
+ */
47
+ get currentShowList(): IPolygonData[];
48
+ /**
49
+ * 当前依赖状态下本页的所有框
50
+ *
51
+ * @readonly
52
+ * @memberof RectOperation
53
+ */
54
+ get currentPageResult(): IPolygonData[];
55
+ setResult(polygonList: IPolygonData[]): void;
56
+ /**
57
+ * 外层 sidabr 调用
58
+ * @param v
59
+ * @returns
60
+ */
61
+ textChange: (v: string) => void;
62
+ /**
63
+ * 设定指定多边形的信息
64
+ * @param id
65
+ * @param newPolygonData
66
+ * @returns
67
+ */
68
+ setPolygonDataByID(newPolygonData: Partial<IPolygonData>, id?: string): IPolygonData[];
69
+ addPointInDrawing(e: MouseEvent): void;
70
+ clearResult(): void;
71
+ /**
72
+ * 清除多边形拖拽的中间状态
73
+ */
74
+ clearPolygonDrag(): void;
75
+ /**
76
+ * 清楚所有的中间状态
77
+ */
78
+ clearActiveStatus(): void;
79
+ setPolygonList(polygonList: IPolygonData[]): void;
80
+ setSelectedID(newID?: string): void;
81
+ setDefaultAttribute(defaultAttribute?: string): void;
82
+ setStyle(toolStyle: any): void;
83
+ setPolygonValidAndRender(id: string): void;
84
+ /**
85
+ * 初始化的添加的数据
86
+ * @returns
87
+ */
88
+ addDrawingPointToPolygonList(): void;
89
+ setSelectedIdAfterAddingDrawing(newID: string): void;
90
+ /**
91
+ * 获取当前 hover 多边形的 ID
92
+ * @param e
93
+ * @returns
94
+ */
95
+ getHoverID(e: MouseEvent): string;
96
+ getHoverEdgeIndex(e: MouseEvent): number;
97
+ getHoverPointIndex(e: MouseEvent): number;
98
+ deletePolygon(id?: string): void;
99
+ deletePolygonPoint(index: number): void;
100
+ spaceKeydown(): void;
101
+ onTabKeyDown(e: KeyboardEvent): void;
102
+ onKeyDown(e: KeyboardEvent): void;
103
+ onKeyUp(e: KeyboardEvent): void;
104
+ rightMouseUp(): void;
105
+ onLeftDblClick(e: MouseEvent): void;
106
+ onRightDblClick(e: MouseEvent): void;
107
+ onMouseDown(e: MouseEvent): true | undefined;
108
+ onDragMove(e: MouseEvent): void;
109
+ onMouseMove(e: MouseEvent): void;
110
+ leftMouseUp(e: MouseEvent): void;
111
+ onMouseUp(e: MouseEvent): undefined;
112
+ dragMouseUp(): void;
113
+ exportData(): any[];
114
+ /**
115
+ * 获取当前配置下的 icon svg
116
+ * @param attribute
117
+ */
118
+ getTextIconSvg(attribute?: string): any;
119
+ getCurrentSelectedData(): {
120
+ width: number;
121
+ textAttribute: string;
122
+ color: any;
123
+ } | undefined;
124
+ /** 更新文本输入,并且进行关闭 */
125
+ updateSelectedTextAttribute(newTextAttribute?: string): void;
126
+ renderTextAttribute(): void;
127
+ renderPolygon(): void;
128
+ render(): void;
129
+ /** 撤销 */
130
+ undo(): void;
131
+ /** 重做 */
132
+ redo(): void;
133
+ }
134
+ export default PolygonOperation;
@@ -0,0 +1,141 @@
1
+ import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
2
+ interface IRectOperationProps extends IBasicToolOperationProps {
3
+ drawOutSideTarget: boolean;
4
+ style: any;
5
+ }
6
+ declare class RectOperation extends BasicToolOperation {
7
+ drawingRect?: IRect;
8
+ firstClickCoord?: ICoordinate;
9
+ firstCurrentPos?: ICoordinate;
10
+ rectList: IRect[];
11
+ drawOutSideTarget: boolean;
12
+ hoverRectID?: string;
13
+ hoverRectPointIndex: number;
14
+ hoverRectEdgeIndex: number;
15
+ selectedRectID?: string;
16
+ isFlow: boolean;
17
+ config: IRectConfig;
18
+ markerIndex: number;
19
+ private _textAttributInstance?;
20
+ private dragInfo?;
21
+ constructor(props: IRectOperationProps);
22
+ setResult(rectList: IRect[]): void;
23
+ destroy(): void;
24
+ setConfig(config: string, isClear?: boolean): void;
25
+ /**
26
+ * 设置当前的结果集
27
+ * @param rectList
28
+ * @param isUpload
29
+ */
30
+ setRectList(rectList: IRect[], isUpload?: boolean): void;
31
+ get selectedRect(): IRect | undefined;
32
+ get selectedID(): string | undefined;
33
+ get selectedText(): string | undefined;
34
+ get dataList(): IRect[];
35
+ /**
36
+ * 当前页面展示的框体
37
+ */
38
+ get currentShowList(): IRect[];
39
+ /**
40
+ * 当前依赖状态下本页的所有框
41
+ *
42
+ * @readonly
43
+ * @memberof RectOperation
44
+ */
45
+ get currentPageResult(): IRect[];
46
+ /**
47
+ * 是否含有列表标注
48
+ */
49
+ get hasMarkerConfig(): boolean | undefined;
50
+ setSelectedID(newID?: string): void;
51
+ setSelectedRectID(newID?: string): void;
52
+ setStyle(toolStyle: any): void;
53
+ /**
54
+ * 向外部提供标记的更改
55
+ * @param markerIndex
56
+ */
57
+ setMarkerIndex: (markerIndex: number) => void;
58
+ /**
59
+ * 更改当前列表标注位置,并且设置为选中
60
+ * @param markerIndex
61
+ * @returns
62
+ */
63
+ setMarkerIndexAndSelect: (markerIndex: number) => void;
64
+ /** 更新文本输入,并且进行关闭 */
65
+ updateSelectedRectTextAttribute(newTextAttribute?: string): void;
66
+ getHoverRectID: (e: MouseEvent) => string;
67
+ /**
68
+ * 获取当前的选中部分的hoverIndex
69
+ * ../../../param e
70
+ */
71
+ getHoverRectPointIndex(e: MouseEvent): number;
72
+ getHoverRectEdgeIndex(e: MouseEvent): number;
73
+ /**
74
+ * 获取当前配置下的 icon svg
75
+ * @param attribute
76
+ */
77
+ getTextIconSvg(attribute?: string): any;
78
+ onMouseDown(e: MouseEvent): undefined;
79
+ onDragMove(coordinate: ICoordinate): void;
80
+ onMouseMove(e: MouseEvent): undefined;
81
+ setAttributeLockList(attributeLockList: string[]): void;
82
+ setBasicResult(basicResult: any): void;
83
+ setRectValidAndRender(id: string): void;
84
+ createNewDrawingRect(e: MouseEvent, basicSourceID: string): void;
85
+ /**
86
+ * 将绘制中的框体添加进 rectList 中
87
+ * @returns
88
+ */
89
+ addDrawingRectToRectList(): void;
90
+ setSelectedIdAfterAddingDrawingRect(): void;
91
+ getDrawingRectWithRectList(): IRect[];
92
+ /**
93
+ * mouseup 下的鼠标右键
94
+ * @param e
95
+ */
96
+ rightMouseUp(e: MouseEvent): void;
97
+ shiftRightMouseUp(e: MouseEvent): void;
98
+ onMouseUp(e: MouseEvent): true | undefined;
99
+ onRightDblClick(e: MouseEvent): void;
100
+ onKeyDown(e: KeyboardEvent): true | undefined;
101
+ onKeyUp(e: KeyboardEvent): void;
102
+ onWheel(e: MouseEvent): void;
103
+ textChange: (v: string) => void;
104
+ getCurrentSelectedData(): {
105
+ width: number;
106
+ textAttribute: string;
107
+ color: any;
108
+ } | undefined;
109
+ renderTextAttribute(): void;
110
+ renderSelectedRect(rect?: IRect): void;
111
+ /**
112
+ * 绘制当前框的
113
+ * @param rect 当前矩形框
114
+ * @param zoom 是否进行缩放
115
+ * @param isZoom 矩形框是否为缩放后的比例
116
+ */
117
+ renderDrawingRect(rect: IRect, zoom?: number, isZoom?: boolean): void;
118
+ /**
119
+ * 渲染矩形框体
120
+ */
121
+ renderRect(): void;
122
+ render(): void;
123
+ setDefaultAttribute(defaultAttribute?: string): void;
124
+ setValid(valid: boolean): void;
125
+ /**
126
+ * 清楚所有的中间状态
127
+ */
128
+ clearActiveStatus(): void;
129
+ clearResult(sendMessage?: boolean): void;
130
+ deleteRect(rectID?: string): void;
131
+ /**
132
+ * 导出结果
133
+ */
134
+ exportData(): any[];
135
+ /** 撤销 */
136
+ undo(): void;
137
+ /** 重做 */
138
+ redo(): void;
139
+ }
140
+ export { RectOperation, IRectOperationProps };
141
+ export default RectOperation;
@@ -0,0 +1,44 @@
1
+ import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
2
+ interface ITagOperationProps extends IBasicToolOperationProps {
3
+ config: string;
4
+ }
5
+ declare class TagOperation extends BasicToolOperation {
6
+ config: ITagConfig;
7
+ tagResult: ITagResult[];
8
+ labelSelectedList: number[];
9
+ constructor(props: ITagOperationProps);
10
+ destroy(): void;
11
+ /**
12
+ * 获取初始值结果列表
13
+ */
14
+ getInitResultList: (dataSourceStep: number, basicResultList: any[]) => {
15
+ id: string;
16
+ sourceID: any;
17
+ result: any;
18
+ }[];
19
+ setResult(tagResult: any[]): void;
20
+ /**
21
+ * 当前依赖状态下的结果集合
22
+ * 主要是跟其他工具同步,正常情况为 1
23
+ *
24
+ * @readonly
25
+ * @memberof RectOperation
26
+ */
27
+ get currentPageResult(): ITagResult[];
28
+ /**
29
+ * 当前页面的标注结果
30
+ */
31
+ get currentTagResult(): ITagResult;
32
+ get sourceID(): any;
33
+ onKeyDown(e: KeyboardEvent): void;
34
+ setLabel: (i: number, j: number) => void;
35
+ clearResult: (sendMessage?: boolean, value?: string | undefined) => void;
36
+ /**
37
+ * 清除当前渲染的标签
38
+ */
39
+ clearTag(): void;
40
+ renderTag(): void;
41
+ render(): void;
42
+ exportData(): any[];
43
+ }
44
+ export default TagOperation;
@@ -0,0 +1,56 @@
1
+ interface ITextareaData {
2
+ width?: number;
3
+ textAttribute: string;
4
+ color: string;
5
+ }
6
+ interface IBaseInfo {
7
+ getCurrentSelectedData: () => ITextareaData | undefined;
8
+ updateSelectedTextAttribute: (newTextAttribute: string) => void;
9
+ }
10
+ interface ITextAttributeProps {
11
+ container: HTMLElement;
12
+ width?: number;
13
+ icon: HTMLImageElement;
14
+ color: string;
15
+ }
16
+ export default class TextAttributeClass {
17
+ private container;
18
+ private _textareaDOM?;
19
+ private _textAttributeDOM?;
20
+ private _textDOM?;
21
+ private _iconDOM?;
22
+ private getCurrentSelectedData;
23
+ private updateSelectedTextAttribute;
24
+ constructor(props: ITextAttributeProps & IBaseInfo);
25
+ get isExit(): boolean;
26
+ get isExitTextareaDOM(): boolean;
27
+ updateIcon(icon: any): void;
28
+ appendToContainer(): void;
29
+ initTextAttributeDOM(): HTMLDivElement;
30
+ initTextDOM(width: number, lineHeight: number): HTMLSpanElement;
31
+ initIconDOM(icon: any): HTMLDivElement;
32
+ initTextareaDOM(width: number, color: string): HTMLTextAreaElement;
33
+ removeTextDOM(): void;
34
+ removeIconDOM(): void;
35
+ removeTextareaDOM(): void;
36
+ submitTextarea(): void;
37
+ textKeyDown: (e: KeyboardEvent) => void;
38
+ clearTextAttribute(): void;
39
+ private renderTextarea;
40
+ /**
41
+ * 更新当前文本定位、内容
42
+ * @param textAttribute
43
+ * @param position
44
+ */
45
+ update(textAttribute: string, position: {
46
+ left: number;
47
+ top: number;
48
+ color: string;
49
+ width?: number;
50
+ }): void;
51
+ /**
52
+ * 用于外层切换选中框调用
53
+ */
54
+ changeSelected(): void;
55
+ }
56
+ export {};
@@ -0,0 +1,26 @@
1
+ import { RectOperation } from './core/toolOperation/rectOperation';
2
+ import TagOperation from './core/toolOperation/tagOperation';
3
+ import PointOperation from './core/toolOperation/pointOperation';
4
+ import LineToolOperation from './core/toolOperation/LineToolOperation';
5
+ import TextToolOperation from './core/toolOperation/TextToolOperation';
6
+ import PolygonOperation from './core/toolOperation/polygonOperation';
7
+ import MeasureOperation from './core/toolOperation/measureOperation';
8
+ import { BasicToolOperation } from './core/toolOperation/basicToolOperation';
9
+ import ViewOperation from './core/toolOperation/ViewOperation';
10
+ import * as cAnnotation from './constant/annotation';
11
+ import * as cAnnotationTask from './constant/annotationTask';
12
+ import * as cKeyCode from './constant/keyCode';
13
+ import * as cStyle from './constant/style';
14
+ import * as cTool from './constant/tool';
15
+ import TagUtils from './utils/tool/TagUtils';
16
+ import uuid from './utils/uuid';
17
+ import CommonToolUtils from './utils/tool/CommonToolUtils';
18
+ import MarkerUtils from './utils/tool/MarkerUtils';
19
+ import RectUtils from './utils/tool/RectUtils';
20
+ import AxisUtils from './utils/tool/AxisUtils';
21
+ import DrawUtils from './utils/tool/DrawUtils';
22
+ import ImgUtils from './utils/ImgUtils';
23
+ import DblClickEventListener from './utils/tool/DblClickEventListener';
24
+ import AnnotationEngine from './core';
25
+ declare const toolUtils: typeof CommonToolUtils;
26
+ export { RectOperation, TagOperation, PointOperation, LineToolOperation, PolygonOperation, TextToolOperation, BasicToolOperation, MeasureOperation, ViewOperation, cAnnotation, cAnnotationTask, cKeyCode, cStyle, cTool, toolUtils, uuid, DblClickEventListener, CommonToolUtils, MarkerUtils, RectUtils, AxisUtils, TagUtils, DrawUtils, ImgUtils, AnnotationEngine, };
@@ -0,0 +1,15 @@
1
+ export declare enum EMessage {
2
+ NoRotateNotice = "noRotateNotice",
3
+ RectErrorSizeNotice = "rectErrorSizeNotice",
4
+ TextCheckNumberErrorNotice = "textCheckNumberErrorNotice",
5
+ TextCheckEnglishErrorNotice = "textCheckEnglishErrorNotice",
6
+ TextCheckCustomErrorNotice = "textCheckCustomErrorNotice",
7
+ UpperLimitErrorNotice = "UpperLimitErrorNotice",
8
+ LowerLimitErrorNotice = "LowerLimitErrorNotice",
9
+ InvalidImage = "InvalidImage",
10
+ DisableDelete = "DisableDelete",
11
+ ClearPartialData = "ClearPartialData",
12
+ MarkerFinish = "MarkerFinish",
13
+ LowerLimitPoint = "LowerLimitPoint",
14
+ NoRotateInDependence = "noRotateInDependence"
15
+ }
@@ -0,0 +1,2 @@
1
+ declare const message: Record<string, string>;
2
+ export default message;
@@ -0,0 +1,4 @@
1
+ declare class Locale {
2
+ static getMessagesByLocale: (key: string, locale: string) => string;
3
+ }
4
+ export default Locale;
@@ -0,0 +1,2 @@
1
+ declare const message: Record<string, string>;
2
+ export default message;
@@ -0,0 +1,32 @@
1
+ export default class ActionsHistory {
2
+ record: any[];
3
+ recordIndex: number;
4
+ callback?: () => void;
5
+ minRecordIndex: number;
6
+ /** 历史改变后触发的更新 */
7
+ historyChanged?: (undoEnabled: boolean, redoEnabled: boolean) => void;
8
+ constructor(historyChanged?: (undoEnabled: boolean, redoEnabled: boolean) => void);
9
+ get undoEnabled(): boolean;
10
+ get redoEnabled(): boolean;
11
+ emitHistoryChanged: () => void;
12
+ pushHistory(action: any): void;
13
+ updateHistory(newRecord: any): void;
14
+ /**
15
+ * 应用属性到所有记录
16
+ * @param key
17
+ * @param value
18
+ */
19
+ applyAttribute(id: string | undefined, key: string, value: any): void;
20
+ /** 撤销 */
21
+ undo(): any;
22
+ /** 重做 */
23
+ redo(): any;
24
+ init(): void;
25
+ empty(): void;
26
+ /**
27
+ * 设置已经保存的数据
28
+ * @param minIndex
29
+ * @param isExitData 用于空数组下的赋值
30
+ */
31
+ initRecord(data: any[], isExitData?: boolean): void;
32
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * EventBus 事件传递,用于组件间的事件监听/传递
3
+ */
4
+ declare class EventBus {
5
+ private _events;
6
+ constructor();
7
+ /**
8
+ * 事件绑定。(注:相同的事件下的相同方法不支持多次绑定)
9
+ * @param eventName 事件名字
10
+ * @param callback 事件回调
11
+ */
12
+ on(eventName: string, callback: () => void): void;
13
+ /**
14
+ * 单独的事件绑定,一个事件仅支持绑定一个函数
15
+ *
16
+ * @param {string} eventName
17
+ * @param {() => void} callback
18
+ * @memberof EventBus
19
+ */
20
+ singleOn(eventName: string, callback: () => void): void;
21
+ /**
22
+ * 事件广播
23
+ * @param eventName 事件名字
24
+ * @param callback 事件回调
25
+ */
26
+ emit(eventName: string): void;
27
+ /**
28
+ * 事件解绑,对某一事件进行事件解绑
29
+ * @param eventName 需要解绑的事件名字
30
+ * @param callback 需要解绑的方法
31
+ */
32
+ unbind(eventName: string, callback: () => void): void;
33
+ /**
34
+ * 解绑事件
35
+ * @param eventName
36
+ */
37
+ unbindAll(eventName: string): void;
38
+ }
39
+ declare const _default: EventBus;
40
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default class ImgUtils {
2
+ static load(src: string): Promise<HTMLImageElement>;
3
+ }