yui-image-editor 1.0.0 → 1.0.3
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.
- package/dist/types/components/ImageEditor/editor.types.d.ts +74 -0
- package/dist/types/components/ImageEditor/index.d.ts +117 -0
- package/dist/types/index.d.ts +85 -1
- package/dist/types/router/index.d.ts +2 -0
- package/dist/types/stores/counter.d.ts +13 -0
- package/dist/types/types/component.d.ts +53 -0
- package/dist/types/types/index.d.ts +130 -0
- package/dist/types/types/shims-svg.d.ts +24 -0
- package/dist/types/utils/specialMapTool.d.ts +33 -0
- package/dist/types/views/HomeView.d.ts +2 -0
- package/dist/types/views/MapPluginView.d.ts +2 -0
- package/dist/types/views/TestView.d.ts +2 -0
- package/dist/yui-image-editor.cjs.js +3 -0
- package/dist/yui-image-editor.css +1 -0
- package/dist/yui-image-editor.esm.js +6 -0
- package/dist/yui-image-editor.umd.js +3 -0
- package/package.json +6 -2
- package/.editorconfig +0 -8
- package/.gitattributes +0 -1
- package/.nrmrc +0 -1
- package/.oxlintrc.json +0 -10
- package/.prettierrc.json +0 -6
- package/.vscode/extensions.json +0 -11
- package/dist-app/assets/css/main-Dn6XCgL-.css +0 -1
- package/dist-app/assets/js/main-Bo-yvzk4.js +0 -3
- package/dist-app/index.html +0 -14
- package/e2e/tsconfig.json +0 -4
- package/e2e/vue.spec.ts +0 -8
- package/env.d.ts +0 -1
- package/eslint.config.ts +0 -38
- package/index.html +0 -13
- package/playwright.config.ts +0 -110
- package/public/favicon.ico +0 -0
- package/src/App.vue +0 -165
- package/src/assets/annotation/hjjd.svg +0 -33
- package/src/assets/annotation/kjjd.svg +0 -38
- package/src/assets/annotation/zbz.svg +0 -19
- package/src/assets/base.css +0 -86
- package/src/assets/logo.svg +0 -1
- package/src/assets/main.css +0 -28
- package/src/assets/variable.scss +0 -15
- package/src/components/ImageEditor/index.ts +0 -220
- package/src/components/ImageEditor/index.vue +0 -344
- package/src/components/icons/IconCommunity.vue +0 -7
- package/src/components/icons/IconDocumentation.vue +0 -7
- package/src/components/icons/IconEcosystem.vue +0 -7
- package/src/components/icons/IconSupport.vue +0 -7
- package/src/components/icons/IconTooling.vue +0 -19
- package/src/index.ts +0 -25
- package/src/main.ts +0 -11
- package/src/router/index.ts +0 -30
- package/src/stores/counter.ts +0 -12
- package/src/types/index.ts +0 -196
- package/src/utils/specialMapTool.ts +0 -358
- package/src/views/HomeView.vue +0 -12
- package/src/views/MapPluginView.vue +0 -16
- package/src/views/TestView.vue +0 -12
- package/tsconfig.app.json +0 -18
- package/tsconfig.json +0 -14
- package/tsconfig.node.json +0 -28
- package/tsconfig.vitest.json +0 -19
- package/vite.config.ts +0 -124
- package/vitest.config.ts +0 -27
- package/yui-image-editor-1.0.0.tgz +0 -0
- /package/{dist-app → dist}/favicon.ico +0 -0
- /package/{src → dist/types}/types/tui.d.ts +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { TuiImageEditor } from '../../types/index';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* 编辑器操作状态类型
|
|
5
|
+
*/
|
|
6
|
+
export interface EditorOperationStatus {
|
|
7
|
+
message: string;
|
|
8
|
+
type: 'success' | 'error' | 'info';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 编辑器响应式数据类型
|
|
12
|
+
*/
|
|
13
|
+
export interface EditorReactiveData {
|
|
14
|
+
canvasSize: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
mousePosition: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
elementCount: Ref<number>;
|
|
23
|
+
operationStatus: Ref<EditorOperationStatus | null>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 编辑器实例方法类型(供外部调用)
|
|
27
|
+
*/
|
|
28
|
+
export interface ImageEditorInstance {
|
|
29
|
+
/** 显示操作状态提示 */
|
|
30
|
+
showStatus: (message: string, type?: 'success' | 'error' | 'info') => void;
|
|
31
|
+
/** 更新画布尺寸 */
|
|
32
|
+
updateCanvasSize: () => void;
|
|
33
|
+
/** 添加标题 */
|
|
34
|
+
addTitle: () => Promise<void>;
|
|
35
|
+
/** 添加时间戳 */
|
|
36
|
+
addTimestamp: () => Promise<void>;
|
|
37
|
+
/** 添加附图标签 */
|
|
38
|
+
addFigureLabel: () => Promise<void>;
|
|
39
|
+
/** 添加对比拉框 */
|
|
40
|
+
addComparisonBox: () => Promise<void>;
|
|
41
|
+
/** 添加标定目标 */
|
|
42
|
+
addCalibrationTarget: () => Promise<void>;
|
|
43
|
+
/** 获取编辑器核心实例 */
|
|
44
|
+
getCoreEditor: () => TuiImageEditor | null;
|
|
45
|
+
/** 销毁编辑器 */
|
|
46
|
+
destroy: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 编辑器组件 Props 类型(若后续扩展Props用)
|
|
50
|
+
*/
|
|
51
|
+
export interface ImageEditorProps {
|
|
52
|
+
/** 初始图片URL */
|
|
53
|
+
initialImageUrl?: string;
|
|
54
|
+
/** 编辑器宽度 */
|
|
55
|
+
width?: string | number;
|
|
56
|
+
/** 编辑器高度 */
|
|
57
|
+
height?: string | number;
|
|
58
|
+
/** 是否开启A4默认尺寸 */
|
|
59
|
+
defaultA4Size?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 编辑器组件 Emits 类型
|
|
63
|
+
*/
|
|
64
|
+
export interface ImageEditorEmits {
|
|
65
|
+
/** 编辑器初始化完成事件 */
|
|
66
|
+
init: [editor: TuiImageEditor];
|
|
67
|
+
/** 操作状态变更事件 */
|
|
68
|
+
statusChange: [status: EditorOperationStatus | null];
|
|
69
|
+
/** 画布尺寸变更事件 */
|
|
70
|
+
canvasSizeChange: [size: {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
}];
|
|
74
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export declare const zhLocale: {
|
|
2
|
+
Crop: string;
|
|
3
|
+
Rotate: string;
|
|
4
|
+
Flip: string;
|
|
5
|
+
Draw: string;
|
|
6
|
+
Shape: string;
|
|
7
|
+
Icon: string;
|
|
8
|
+
Text: string;
|
|
9
|
+
Mask: string;
|
|
10
|
+
Filter: string;
|
|
11
|
+
Resize: string;
|
|
12
|
+
Undo: string;
|
|
13
|
+
Redo: string;
|
|
14
|
+
Delete: string;
|
|
15
|
+
Save: string;
|
|
16
|
+
Load: string;
|
|
17
|
+
Download: string;
|
|
18
|
+
Reset: string;
|
|
19
|
+
Cancel: string;
|
|
20
|
+
OK: string;
|
|
21
|
+
Apply: string;
|
|
22
|
+
Close: string;
|
|
23
|
+
Free: string;
|
|
24
|
+
Original: string;
|
|
25
|
+
Square: string;
|
|
26
|
+
'4:3': string;
|
|
27
|
+
'3:4': string;
|
|
28
|
+
'16:9': string;
|
|
29
|
+
'9:16': string;
|
|
30
|
+
Custom: string;
|
|
31
|
+
Width: string;
|
|
32
|
+
Height: string;
|
|
33
|
+
Ratio: string;
|
|
34
|
+
'Lock ratio': string;
|
|
35
|
+
'Unlock ratio': string;
|
|
36
|
+
'Rotate CW': string;
|
|
37
|
+
'Rotate CCW': string;
|
|
38
|
+
'Flip X': string;
|
|
39
|
+
'Flip Y': string;
|
|
40
|
+
Rectangle: string;
|
|
41
|
+
Circle: string;
|
|
42
|
+
Triangle: string;
|
|
43
|
+
Line: string;
|
|
44
|
+
Pen: string;
|
|
45
|
+
Eraser: string;
|
|
46
|
+
Color: string;
|
|
47
|
+
Opacity: string;
|
|
48
|
+
Fill: string;
|
|
49
|
+
Stroke: string;
|
|
50
|
+
Font: string;
|
|
51
|
+
Size: string;
|
|
52
|
+
Align: string;
|
|
53
|
+
Left: string;
|
|
54
|
+
Center: string;
|
|
55
|
+
Right: string;
|
|
56
|
+
Bold: string;
|
|
57
|
+
Italic: string;
|
|
58
|
+
Underline: string;
|
|
59
|
+
'Text color': string;
|
|
60
|
+
Grayscale: string;
|
|
61
|
+
Sepia: string;
|
|
62
|
+
Sepia2: string;
|
|
63
|
+
Invert: string;
|
|
64
|
+
Brightness: string;
|
|
65
|
+
Contrast: string;
|
|
66
|
+
Saturation: string;
|
|
67
|
+
Hue: string;
|
|
68
|
+
Blur: string;
|
|
69
|
+
Sharpen: string;
|
|
70
|
+
'Remove White': string;
|
|
71
|
+
Distance: string;
|
|
72
|
+
Pixelate: string;
|
|
73
|
+
'Color Filter': string;
|
|
74
|
+
Threshold: string;
|
|
75
|
+
Noise: string;
|
|
76
|
+
'Image Loaded': string;
|
|
77
|
+
'Save image as': string;
|
|
78
|
+
'Are you sure you want to reset?': string;
|
|
79
|
+
'Failed to load image': string;
|
|
80
|
+
'Please select an image': string;
|
|
81
|
+
'Image size is too large': string;
|
|
82
|
+
'Minimum size is': string;
|
|
83
|
+
'Maximum size is': string;
|
|
84
|
+
Zoom: string;
|
|
85
|
+
'Zoom In': string;
|
|
86
|
+
'Zoom Out': string;
|
|
87
|
+
Hand: string;
|
|
88
|
+
History: string;
|
|
89
|
+
'Delete All': string;
|
|
90
|
+
'Fit to canvas': string;
|
|
91
|
+
'Actual size': string;
|
|
92
|
+
'Custom size': string;
|
|
93
|
+
'Background color': string;
|
|
94
|
+
'File type': string;
|
|
95
|
+
JPEG: string;
|
|
96
|
+
PNG: string;
|
|
97
|
+
Quality: string;
|
|
98
|
+
Duplicate: string;
|
|
99
|
+
'Bring to front': string;
|
|
100
|
+
'Send to back': string;
|
|
101
|
+
'Blend mode': string;
|
|
102
|
+
Arrow: string;
|
|
103
|
+
'Arrow-2': string;
|
|
104
|
+
'Arrow-3': string;
|
|
105
|
+
'Star-1': string;
|
|
106
|
+
'Star-2': string;
|
|
107
|
+
Polygon: string;
|
|
108
|
+
Location: string;
|
|
109
|
+
Heart: string;
|
|
110
|
+
Bubble: string;
|
|
111
|
+
DeleteAll: string;
|
|
112
|
+
ZoomIn: string;
|
|
113
|
+
ZoomOut: string;
|
|
114
|
+
'Text size': string;
|
|
115
|
+
'Lock Aspect Ratio': string;
|
|
116
|
+
};
|
|
117
|
+
export declare const customTheme: {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
import { default as YuiImageEditor } from './components/ImageEditor/index';
|
|
2
|
+
import { YuiImageEditorProps } from './types/component';
|
|
3
|
+
import { App } from 'vue';
|
|
4
|
+
import type * as TuiEditorTypes from '@/types/index';
|
|
5
|
+
declare const ImageEditorComponent: {
|
|
6
|
+
new (): {
|
|
7
|
+
$props: YuiImageEditorProps;
|
|
8
|
+
} & typeof YuiImageEditor;
|
|
9
|
+
};
|
|
10
|
+
export { ImageEditorComponent as ImageEditor, YuiImageEditor };
|
|
11
|
+
export type { TuiEditorTypes, YuiImageEditorProps };
|
|
12
|
+
declare const _default: {
|
|
13
|
+
install: (app: App) => void;
|
|
14
|
+
YuiImageEditor: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
15
|
+
initialImageUrl: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
width: {
|
|
20
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
height: {
|
|
24
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
defaultA4Size: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
}>, {
|
|
32
|
+
showStatus: (message: string, type?: "success" | "error" | "info") => void;
|
|
33
|
+
updateCanvasSize: () => void;
|
|
34
|
+
addTitle: () => Promise<void>;
|
|
35
|
+
addTimestamp: () => Promise<void>;
|
|
36
|
+
addFigureLabel: () => Promise<void>;
|
|
37
|
+
addComparisonBox: () => Promise<void>;
|
|
38
|
+
addCalibrationTarget: () => Promise<void>;
|
|
39
|
+
getCoreEditor: () => TuiEditorTypes.TuiImageEditor | null;
|
|
40
|
+
destroy: () => void;
|
|
41
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
|
+
init: (editor: TuiEditorTypes.TuiImageEditor) => any;
|
|
43
|
+
statusChange: (status: import('./components/ImageEditor/editor.types').EditorOperationStatus | null) => any;
|
|
44
|
+
canvasSizeChange: (size: {
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
}) => any;
|
|
48
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
49
|
+
initialImageUrl: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
width: {
|
|
54
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
height: {
|
|
58
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
59
|
+
default: number;
|
|
60
|
+
};
|
|
61
|
+
defaultA4Size: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
}>> & Readonly<{
|
|
66
|
+
onInit?: ((editor: TuiEditorTypes.TuiImageEditor) => any) | undefined;
|
|
67
|
+
onStatusChange?: ((status: import('./components/ImageEditor/editor.types').EditorOperationStatus | null) => any) | undefined;
|
|
68
|
+
onCanvasSizeChange?: ((size: {
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
}) => any) | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
width: string | number;
|
|
74
|
+
height: string | number;
|
|
75
|
+
initialImageUrl: string;
|
|
76
|
+
defaultA4Size: boolean;
|
|
77
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
78
|
+
editorContainer: HTMLDivElement;
|
|
79
|
+
editorRef: HTMLDivElement;
|
|
80
|
+
}, HTMLDivElement>;
|
|
81
|
+
ImageEditor: new () => {
|
|
82
|
+
$props: YuiImageEditorProps;
|
|
83
|
+
} & typeof YuiImageEditor;
|
|
84
|
+
};
|
|
85
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const useCounterStore: import('pinia').StoreDefinition<"counter", Pick<{
|
|
2
|
+
count: import('vue').Ref<number, number>;
|
|
3
|
+
doubleCount: import('vue').ComputedRef<number>;
|
|
4
|
+
increment: () => void;
|
|
5
|
+
}, "count">, Pick<{
|
|
6
|
+
count: import('vue').Ref<number, number>;
|
|
7
|
+
doubleCount: import('vue').ComputedRef<number>;
|
|
8
|
+
increment: () => void;
|
|
9
|
+
}, "doubleCount">, Pick<{
|
|
10
|
+
count: import('vue').Ref<number, number>;
|
|
11
|
+
doubleCount: import('vue').ComputedRef<number>;
|
|
12
|
+
increment: () => void;
|
|
13
|
+
}, "increment">>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
export declare const YuiImageEditorProps: {
|
|
3
|
+
/** 图片源地址(必传) */
|
|
4
|
+
readonly src: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly required: true;
|
|
7
|
+
readonly description: "图片的URL地址";
|
|
8
|
+
};
|
|
9
|
+
/** 图片宽度(默认800px) */
|
|
10
|
+
readonly width: {
|
|
11
|
+
readonly type: NumberConstructor;
|
|
12
|
+
readonly default: 800;
|
|
13
|
+
readonly description: "图片编辑器宽度(px)";
|
|
14
|
+
};
|
|
15
|
+
/** 图片高度(默认600px) */
|
|
16
|
+
readonly height: {
|
|
17
|
+
readonly type: NumberConstructor;
|
|
18
|
+
readonly default: 600;
|
|
19
|
+
readonly description: "图片编辑器高度(px)";
|
|
20
|
+
};
|
|
21
|
+
/** 自定义样式 */
|
|
22
|
+
readonly customStyle: {
|
|
23
|
+
readonly type: PropType<CSSProperties>;
|
|
24
|
+
readonly default: () => {};
|
|
25
|
+
readonly description: "自定义组件样式";
|
|
26
|
+
};
|
|
27
|
+
/** 显示/隐藏元数据面板 */
|
|
28
|
+
readonly showMetadata: {
|
|
29
|
+
readonly type: BooleanConstructor;
|
|
30
|
+
readonly default: false;
|
|
31
|
+
readonly description: "是否显示图片元数据面板";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type YuiImageEditorProps = ExtractPropTypes<typeof YuiImageEditorProps>;
|
|
35
|
+
export type YuiImageEditorEmits = {
|
|
36
|
+
/** 图片加载完成事件 */
|
|
37
|
+
load: [imgInfo: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}];
|
|
41
|
+
/** 图片点击事件 */
|
|
42
|
+
click: [e: MouseEvent];
|
|
43
|
+
};
|
|
44
|
+
export type YuiImageEditorInstance = {
|
|
45
|
+
/** 重置图片编辑器 */
|
|
46
|
+
reset: () => void;
|
|
47
|
+
/** 获取当前图片信息 */
|
|
48
|
+
getImageInfo: () => {
|
|
49
|
+
src: string;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tui-image-editor 核心接口定义
|
|
3
|
+
* 根据实际使用的方法进行扩展
|
|
4
|
+
*/
|
|
5
|
+
export interface TuiImageEditor {
|
|
6
|
+
destroy(): void;
|
|
7
|
+
getCanvasSize(): {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
resizeCanvasDimension(dimensions: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
setCanvasBackgroundColor(color: string): void;
|
|
16
|
+
addText(text: string, options: TextOptions): Promise<ObjectProps>;
|
|
17
|
+
addShape(type: string, options: ShapeOptions): Promise<ObjectProps>;
|
|
18
|
+
addImageObject(url: string, options?: ImageObjectOptions): Promise<ObjectProps>;
|
|
19
|
+
resetZoom(): void;
|
|
20
|
+
resize(dimensions: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
ui: {
|
|
25
|
+
resizeEditor(): void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 对象属性接口
|
|
30
|
+
*/
|
|
31
|
+
export interface ObjectProps {
|
|
32
|
+
id: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 文字选项接口
|
|
37
|
+
*/
|
|
38
|
+
export interface TextOptions {
|
|
39
|
+
styles?: {
|
|
40
|
+
fill: string;
|
|
41
|
+
fontSize: number;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
fontWeight?: string;
|
|
44
|
+
textAlign?: string;
|
|
45
|
+
};
|
|
46
|
+
position: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
};
|
|
50
|
+
isSilent?: boolean;
|
|
51
|
+
left?: number;
|
|
52
|
+
top?: number;
|
|
53
|
+
fontSize?: number;
|
|
54
|
+
fontFamily?: string;
|
|
55
|
+
fill?: string;
|
|
56
|
+
stroke?: string;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 形状选项接口
|
|
62
|
+
*/
|
|
63
|
+
export interface ShapeOptions {
|
|
64
|
+
left: number;
|
|
65
|
+
top: number;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
fill: string;
|
|
69
|
+
stroke: string;
|
|
70
|
+
strokeWidth: number;
|
|
71
|
+
strokeDashArray?: [number, number];
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 图片对象选项接口
|
|
76
|
+
*/
|
|
77
|
+
export interface ImageObjectOptions {
|
|
78
|
+
left: number;
|
|
79
|
+
top: number;
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 编辑器配置接口
|
|
86
|
+
*/
|
|
87
|
+
export interface EditorConfig {
|
|
88
|
+
includeUI?: {
|
|
89
|
+
loadImage?: {
|
|
90
|
+
path: string;
|
|
91
|
+
name: string;
|
|
92
|
+
};
|
|
93
|
+
theme?: any;
|
|
94
|
+
initMenu?: string;
|
|
95
|
+
menuBarPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
96
|
+
menu?: string[];
|
|
97
|
+
locale?: any;
|
|
98
|
+
};
|
|
99
|
+
cssMaxWidth?: number;
|
|
100
|
+
cssMaxHeight?: number;
|
|
101
|
+
selectionStyle?: {
|
|
102
|
+
cornerSize?: number;
|
|
103
|
+
rotatingPointOffset?: number;
|
|
104
|
+
};
|
|
105
|
+
usageStatistics?: boolean;
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 坐标点接口
|
|
110
|
+
*/
|
|
111
|
+
export interface Point {
|
|
112
|
+
x: number;
|
|
113
|
+
y: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 尺寸接口
|
|
117
|
+
*/
|
|
118
|
+
export interface Size {
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 矩形区域接口
|
|
124
|
+
*/
|
|
125
|
+
export interface Rect {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/types/shims-svg.d.ts
|
|
2
|
+
declare module '*.svg' {
|
|
3
|
+
// 导出 SVG 的默认值(适配 Vue 项目的 SVG 导入)
|
|
4
|
+
const content: string;
|
|
5
|
+
export default content;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// 顺便把其他静态资源也声明了,避免后续爆红
|
|
9
|
+
declare module '*.png' {
|
|
10
|
+
const content: string;
|
|
11
|
+
export default content;
|
|
12
|
+
}
|
|
13
|
+
declare module '*.jpg' {
|
|
14
|
+
const content: string;
|
|
15
|
+
export default content;
|
|
16
|
+
}
|
|
17
|
+
declare module '*.jpeg' {
|
|
18
|
+
const content: string;
|
|
19
|
+
export default content;
|
|
20
|
+
}
|
|
21
|
+
declare module '*.gif' {
|
|
22
|
+
const content: string;
|
|
23
|
+
export default content;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ObjectProps, TuiImageEditor } from '../types';
|
|
2
|
+
export declare class SpecialMapTool {
|
|
3
|
+
private editor;
|
|
4
|
+
private colors;
|
|
5
|
+
private fonts;
|
|
6
|
+
private addedElements;
|
|
7
|
+
constructor(editorInstance: TuiImageEditor);
|
|
8
|
+
setA4Landscape(): Promise<{
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}>;
|
|
12
|
+
addTitle(text?: string): Promise<ObjectProps>;
|
|
13
|
+
addFigureLabel(text?: string): Promise<ObjectProps>;
|
|
14
|
+
addTimestamp(): Promise<ObjectProps>;
|
|
15
|
+
addYellowLabel(text: string, x: number, y: number): Promise<ObjectProps>;
|
|
16
|
+
addBlueLabel(text: string, x: number, y: number): Promise<ObjectProps>;
|
|
17
|
+
addComparisonBox(x: number, y: number, width: number, height: number, label?: string): Promise<ObjectProps>;
|
|
18
|
+
addCalibrationTarget(x: number, y: number, width: number, height: number): Promise<ObjectProps>;
|
|
19
|
+
addCompass(x: number, y: number, size?: number): Promise<ObjectProps>;
|
|
20
|
+
createFullSpecialMap(title?: string, figureLabel?: string): Promise<{
|
|
21
|
+
canvasSize: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
message: string;
|
|
26
|
+
}>;
|
|
27
|
+
getAllElements(): Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
type: string;
|
|
30
|
+
properties: any;
|
|
31
|
+
}>;
|
|
32
|
+
clearAllElements(): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|