@realsee/dnalogel 2.0.0-alpha.33-beta → 2.0.0-alpha.33
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/ModelChassisCompassPlugin/index.js +5 -3
- package/dist/PanoSpatialTagPlugin/index.js +13 -11
- package/dist/floorplan/ModelFloorplanPlugin/index.js +7 -6
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +7 -6
- package/dist/index.es.js +25 -20
- package/dist/index.js +25 -20
- package/dist/index.umd.js +25 -20
- package/dist/shared-utils/uuid.d.ts +0 -1
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
- package/docs/modules.html +20 -20
- package/libs/ModelChassisCompassPlugin/Plugin.js +5 -3
- package/libs/PanoSpatialTagPlugin/Components/tag.js +9 -9
- package/libs/PanoSpatialTagPlugin/Plugin.js +4 -2
- package/libs/floorplan/Components/Compass.js +7 -6
- package/libs/shared-utils/uuid.d.ts +0 -1
- package/libs/shared-utils/uuid.js +0 -1
- package/package.json +2 -4
- package/components/index.js +0 -1450
- package/dist/components/PaintBrush/Controller.d.ts +0 -43
- package/dist/components/PaintBrush/Subscribe.d.ts +0 -76
- package/dist/components/PaintBrush/index.d.ts +0 -27
- package/dist/components/PaintBrush/style.d.ts +0 -2
- package/dist/components/PaintBrush/tween.d.ts +0 -62
- package/dist/components/PaintBrush/typings.d.ts +0 -58
- package/dist/components/PaintBrush/utils.d.ts +0 -26
- package/dist/components/index.d.ts +0 -2
- package/libs/components/PaintBrush/Controller.d.ts +0 -43
- package/libs/components/PaintBrush/Controller.js +0 -575
- package/libs/components/PaintBrush/Subscribe.d.ts +0 -76
- package/libs/components/PaintBrush/Subscribe.js +0 -121
- package/libs/components/PaintBrush/index.d.ts +0 -27
- package/libs/components/PaintBrush/index.js +0 -57
- package/libs/components/PaintBrush/style.d.ts +0 -2
- package/libs/components/PaintBrush/style.js +0 -102
- package/libs/components/PaintBrush/tween.d.ts +0 -62
- package/libs/components/PaintBrush/tween.js +0 -15
- package/libs/components/PaintBrush/typings.d.ts +0 -58
- package/libs/components/PaintBrush/typings.js +0 -6
- package/libs/components/PaintBrush/utils.d.ts +0 -26
- package/libs/components/PaintBrush/utils.js +0 -51
- package/libs/components/index.d.ts +0 -2
- package/libs/components/index.js +0 -3
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { noop } from './utils';
|
|
2
|
-
import { PaintBrushAction, PaintBrushConfigs, PaintBrushEventMap, PaintBrushState } from './typings';
|
|
3
|
-
import { Subscribe } from './Subscribe';
|
|
4
|
-
export declare class Controller extends Subscribe<PaintBrushEventMap> {
|
|
5
|
-
configs: PaintBrushConfigs;
|
|
6
|
-
private clientWidth;
|
|
7
|
-
private clientHeight;
|
|
8
|
-
private ready;
|
|
9
|
-
private uuid;
|
|
10
|
-
private tween?;
|
|
11
|
-
private tweening;
|
|
12
|
-
private container;
|
|
13
|
-
private canvas;
|
|
14
|
-
private data;
|
|
15
|
-
private tempLine;
|
|
16
|
-
get color(): string;
|
|
17
|
-
get state(): Record<string, PaintBrushState[]>;
|
|
18
|
-
get dpr(): number;
|
|
19
|
-
constructor(configs: PaintBrushConfigs);
|
|
20
|
-
ifInsertToDOM(): HTMLDivElement;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param className 初始化画板
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
initCanvas(className: string): HTMLCanvasElement;
|
|
27
|
-
/**
|
|
28
|
-
* 初始化操作面板
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
initCtrl(): HTMLDivElement;
|
|
32
|
-
openBrush(): void;
|
|
33
|
-
closeBrush(): void;
|
|
34
|
-
updateCurrentColor(color: string): void;
|
|
35
|
-
openBrushHandle(): void;
|
|
36
|
-
emitStateChange(action: PaintBrushAction, userAction?: boolean): void;
|
|
37
|
-
action(action: PaintBrushAction): void;
|
|
38
|
-
handleDrawLine(_uuid: string, data: PaintBrushState, { withUndo }: {
|
|
39
|
-
withUndo?: boolean;
|
|
40
|
-
}, callback?: typeof noop): void;
|
|
41
|
-
handleUndo(uuid: string): void;
|
|
42
|
-
destroyBrush(): void;
|
|
43
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export declare type EventMap = {
|
|
2
|
-
[name: string]: (...args: any[]) => void | boolean;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* 监听者模式
|
|
6
|
-
* @template T 预设的监听回调类型
|
|
7
|
-
* @example
|
|
8
|
-
* ```
|
|
9
|
-
* new Subscribe<{
|
|
10
|
-
* "foo": [arg1: number, arg2: string],
|
|
11
|
-
* "bar": [arg: boolean],
|
|
12
|
-
* }>()
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
declare class Subscribe<T extends EventMap> {
|
|
16
|
-
/**
|
|
17
|
-
* 判断是否注册了事件
|
|
18
|
-
* @param name 事件类型
|
|
19
|
-
*/
|
|
20
|
-
hasListener(name: keyof T): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 注册事件
|
|
23
|
-
* @param name 事件类型
|
|
24
|
-
* @param callback 事件回调函数
|
|
25
|
-
* @param once 是否只执行一次
|
|
26
|
-
* @returns 解除事件
|
|
27
|
-
* @template K 预设的监听事件名称
|
|
28
|
-
* @template C 回调函数函数上下文
|
|
29
|
-
*/
|
|
30
|
-
on<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
|
|
31
|
-
/**
|
|
32
|
-
* 注册事件(是否只执行一次)
|
|
33
|
-
* @param name 事件类型
|
|
34
|
-
* @param callback 事件回调函数
|
|
35
|
-
* @returns 解除事件
|
|
36
|
-
* @template K 预设的监听事件名称
|
|
37
|
-
* @template C 回调函数函数上下文
|
|
38
|
-
*/
|
|
39
|
-
once<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
|
|
40
|
-
/**
|
|
41
|
-
* 解除事件
|
|
42
|
-
*
|
|
43
|
-
* 如果 name 不传的话解除对应所有事件
|
|
44
|
-
* 如果 name, callback 不传的话解除所有name的所有事件
|
|
45
|
-
* @param name 事件类型
|
|
46
|
-
* @param callback 事件回调函数
|
|
47
|
-
* @template K 预设的监听事件名称
|
|
48
|
-
*/
|
|
49
|
-
off<K extends keyof T>(name?: K, callback?: (...args: Parameters<T[K]>) => ReturnType<T[K]>): void;
|
|
50
|
-
/**
|
|
51
|
-
* 触发事件
|
|
52
|
-
* @param name 事件类型
|
|
53
|
-
* @param data 触发事件的数据
|
|
54
|
-
* @returns canceled 是否被触发取消
|
|
55
|
-
* @template K 预设的监听事件名称
|
|
56
|
-
*/
|
|
57
|
-
emit<K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
|
|
58
|
-
}
|
|
59
|
-
export declare namespace SubscribeMixinType {
|
|
60
|
-
interface hasListener<T extends EventMap> {
|
|
61
|
-
(name: keyof T): boolean;
|
|
62
|
-
}
|
|
63
|
-
interface on<T extends EventMap> {
|
|
64
|
-
<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
|
|
65
|
-
}
|
|
66
|
-
interface once<T extends EventMap> {
|
|
67
|
-
<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
|
|
68
|
-
}
|
|
69
|
-
interface off<T extends EventMap> {
|
|
70
|
-
<K extends keyof T>(names?: K | K[], callback?: (...args: any[]) => any): void;
|
|
71
|
-
}
|
|
72
|
-
interface emit<T extends EventMap> {
|
|
73
|
-
<K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export { Subscribe };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { PaintBrushAction, PaintBrushConfigs, PaintBrushEventMap, PaintBrushState } from './typings';
|
|
2
|
-
export declare class PaintBrush {
|
|
3
|
-
private controller;
|
|
4
|
-
constructor(configs?: Partial<PaintBrushConfigs>);
|
|
5
|
-
on<K extends keyof PaintBrushEventMap>(name: K, callback: (...args: Parameters<PaintBrushEventMap[K]>) => ReturnType<PaintBrushEventMap[K]>): void;
|
|
6
|
-
off<K extends keyof PaintBrushEventMap>(name: K, callback: (...args: Parameters<PaintBrushEventMap[K]>) => ReturnType<PaintBrushEventMap[K]>): void;
|
|
7
|
-
once<K extends keyof PaintBrushEventMap>(name: K, callback: (...args: Parameters<PaintBrushEventMap[K]>) => ReturnType<PaintBrushEventMap[K]>): void;
|
|
8
|
-
/**
|
|
9
|
-
* 显示画笔。
|
|
10
|
-
*/
|
|
11
|
-
show(): void;
|
|
12
|
-
action(action: PaintBrushAction): void;
|
|
13
|
-
/**
|
|
14
|
-
* 获取画笔状态。
|
|
15
|
-
*/
|
|
16
|
-
get state(): Record<string, PaintBrushState[]>;
|
|
17
|
-
get configs(): PaintBrushConfigs;
|
|
18
|
-
/**
|
|
19
|
-
* 销毁。
|
|
20
|
-
*
|
|
21
|
-
* @deprecated
|
|
22
|
-
*
|
|
23
|
-
* @description 画笔应该维护一个 **全局单例**,重复利用。
|
|
24
|
-
*/
|
|
25
|
-
dispose(): void;
|
|
26
|
-
setCurrentColor(color: string): void;
|
|
27
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const PaintBrushStyle = "\n<style type=\"text/css\">\n\n#_gl_paintBrush {\nposition: fixed;\ntop: 0;\nbottom: 0;\nleft: 0;\nright: 0;\ntransform: translateZ(0);\nz-index: 1997;\npointer-events: none;\nopacity: 0;\ntransition: all 500ms;\n}\n\n#_gl_paintBrush.brushing {\n opacity: 1;\n}\n\n#_gl_paintBrush ._paintBrush-canvas {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n}\n\n#_gl_paintBrush ._paintBrush-canvas--sync {\n pointer-events: none;\n z-index: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n}\n\n#_gl_paintBrush ._paintBrush-canvas {\n pointer-events: none;\n z-index: 1;\n}\n\n#_gl_paintBrush.brushing ._paintBrush-canvas {\n pointer-events: auto;\n}\n\n#_gl_paintBrush ._paintBrush-ctrl {\n width: 140px;\n height: 52px;\n position: absolute;\n bottom: 28px;\n right: 50%;\n transform: translateX(50%);\n font-size: 10px;\n color: white;\n z-index: 2;\n}\n\n#_gl_paintBrush.brushing ._paintBrush-ctrl {\n pointer-events: auto;\n}\n\n#_gl_paintBrush ._paintBrush-ctrl ._paintBrush-ctrlinner {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 100%;\n border-radius: 26px;\n padding: 8px 16px;\n box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);\n background-image: linear-gradient(180deg, hsl(0deg 0% 0% / 57%), hsl(0deg 0% 0% / 70%) 117%);\n}\n\n._paintBrush-ctrlitem {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 38px;\n height: 38px;\n cursor: pointer;\n}\n\n._paintBrush-ctrlitem--undo >.brush-icon{\n background-image: url(\"//vrlab-static.ljcdn.com/release/web/revoke.ab7694ef.svg\");\n background-size: 100%;\n width: 22px;\n height: 22px;\n}\n\n._paintBrush-ctrlitem--close >.brush-icon {\n background-image: url(\"//vrlab-static.ljcdn.com/release/web/exit_paintbrush.02bc1341.svg\");\n background-size: 100%;\n width: 22px;\n height: 22px;\n}\n\n</style>\n";
|
|
2
|
-
export default PaintBrushStyle;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Tween } from '@tweenjs/tween.js';
|
|
2
|
-
export declare const Easing: {
|
|
3
|
-
Linear: {
|
|
4
|
-
None: (amount: number) => number;
|
|
5
|
-
};
|
|
6
|
-
Quadratic: {
|
|
7
|
-
In: (amount: number) => number;
|
|
8
|
-
Out: (amount: number) => number;
|
|
9
|
-
InOut: (amount: number) => number;
|
|
10
|
-
};
|
|
11
|
-
Cubic: {
|
|
12
|
-
In: (amount: number) => number;
|
|
13
|
-
Out: (amount: number) => number;
|
|
14
|
-
InOut: (amount: number) => number;
|
|
15
|
-
};
|
|
16
|
-
Quartic: {
|
|
17
|
-
In: (amount: number) => number;
|
|
18
|
-
Out: (amount: number) => number;
|
|
19
|
-
InOut: (amount: number) => number;
|
|
20
|
-
};
|
|
21
|
-
Quintic: {
|
|
22
|
-
In: (amount: number) => number;
|
|
23
|
-
Out: (amount: number) => number;
|
|
24
|
-
InOut: (amount: number) => number;
|
|
25
|
-
};
|
|
26
|
-
Sinusoidal: {
|
|
27
|
-
In: (amount: number) => number;
|
|
28
|
-
Out: (amount: number) => number;
|
|
29
|
-
InOut: (amount: number) => number;
|
|
30
|
-
};
|
|
31
|
-
Exponential: {
|
|
32
|
-
In: (amount: number) => number;
|
|
33
|
-
Out: (amount: number) => number;
|
|
34
|
-
InOut: (amount: number) => number;
|
|
35
|
-
};
|
|
36
|
-
Circular: {
|
|
37
|
-
In: (amount: number) => number;
|
|
38
|
-
Out: (amount: number) => number;
|
|
39
|
-
InOut: (amount: number) => number;
|
|
40
|
-
};
|
|
41
|
-
Elastic: {
|
|
42
|
-
In: (amount: number) => number;
|
|
43
|
-
Out: (amount: number) => number;
|
|
44
|
-
InOut: (amount: number) => number;
|
|
45
|
-
};
|
|
46
|
-
Back: {
|
|
47
|
-
In: (amount: number) => number;
|
|
48
|
-
Out: (amount: number) => number;
|
|
49
|
-
InOut: (amount: number) => number;
|
|
50
|
-
};
|
|
51
|
-
Bounce: {
|
|
52
|
-
In: (amount: number) => number;
|
|
53
|
-
Out: (amount: number) => number;
|
|
54
|
-
InOut: (amount: number) => number;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export interface TweenRes extends Tween<any> {
|
|
58
|
-
onDestroy: (fn: () => void) => any;
|
|
59
|
-
destroy: () => any;
|
|
60
|
-
}
|
|
61
|
-
export default function tween(from: any, to: any, duration: number, easing?: (amount: number) => number): TweenRes;
|
|
62
|
-
export declare function tweenProgress(duration: number, easing: (amount: number) => number): TweenRes;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export interface PaintBrushConfigs {
|
|
2
|
-
container?: HTMLDivElement;
|
|
3
|
-
currentColor: string;
|
|
4
|
-
DPR?: number;
|
|
5
|
-
onClickClose?: () => void;
|
|
6
|
-
onClickUndo?: () => void;
|
|
7
|
-
onUndoText?: string;
|
|
8
|
-
onExitText?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare type PaintBrushEventMap = {
|
|
11
|
-
readyChange: (ready: boolean) => void;
|
|
12
|
-
stateChange: (state: PaintBrushAction, userAction: boolean) => void;
|
|
13
|
-
};
|
|
14
|
-
export interface PaintBrushState {
|
|
15
|
-
move: {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
};
|
|
19
|
-
line: {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
}[];
|
|
23
|
-
color: string;
|
|
24
|
-
uuid: string;
|
|
25
|
-
duration: number;
|
|
26
|
-
}
|
|
27
|
-
export declare enum PaintBrushTypeEnum {
|
|
28
|
-
Drawline = "Drawline",
|
|
29
|
-
Undo = "Undo",
|
|
30
|
-
Exit = "Exit"
|
|
31
|
-
}
|
|
32
|
-
export interface PaintBrushAction {
|
|
33
|
-
uuid: string;
|
|
34
|
-
/**
|
|
35
|
-
* 类型枚举
|
|
36
|
-
*/
|
|
37
|
-
type: PaintBrushTypeEnum;
|
|
38
|
-
/**
|
|
39
|
-
* 颜色色值
|
|
40
|
-
*/
|
|
41
|
-
color: string;
|
|
42
|
-
/**
|
|
43
|
-
* 是否就绪
|
|
44
|
-
*/
|
|
45
|
-
ready: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* 状态值
|
|
48
|
-
*/
|
|
49
|
-
state?: PaintBrushState;
|
|
50
|
-
/**
|
|
51
|
-
* 时间戳:当作 uuid 使用
|
|
52
|
-
*/
|
|
53
|
-
timestamp?: number;
|
|
54
|
-
/**
|
|
55
|
-
* 是否是结尾数据
|
|
56
|
-
*/
|
|
57
|
-
end?: boolean;
|
|
58
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare function noop(): void;
|
|
2
|
-
export interface Coords {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function queue(promiseCallback?: () => Promise<void>): void;
|
|
7
|
-
export declare function transformCoords(coords: Coords, cw: number, ch: number): {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function unTransformCoords(coords: Coords, cw: number, ch: number): {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
};
|
|
15
|
-
export declare function getQuadraticCurvePoint(points: Coords[]): {
|
|
16
|
-
control?: undefined;
|
|
17
|
-
end?: undefined;
|
|
18
|
-
} | {
|
|
19
|
-
control: Coords;
|
|
20
|
-
end: {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare function execInterval(i: number, time: number, callback?: typeof noop): void;
|
|
26
|
-
export declare function nextFrame(fn: FrameRequestCallback, delay?: number): void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { noop } from './utils';
|
|
2
|
-
import { PaintBrushAction, PaintBrushConfigs, PaintBrushEventMap, PaintBrushState } from './typings';
|
|
3
|
-
import { Subscribe } from './Subscribe';
|
|
4
|
-
export declare class Controller extends Subscribe<PaintBrushEventMap> {
|
|
5
|
-
configs: PaintBrushConfigs;
|
|
6
|
-
private clientWidth;
|
|
7
|
-
private clientHeight;
|
|
8
|
-
private ready;
|
|
9
|
-
private uuid;
|
|
10
|
-
private tween?;
|
|
11
|
-
private tweening;
|
|
12
|
-
private container;
|
|
13
|
-
private canvas;
|
|
14
|
-
private data;
|
|
15
|
-
private tempLine;
|
|
16
|
-
get color(): string;
|
|
17
|
-
get state(): Record<string, PaintBrushState[]>;
|
|
18
|
-
get dpr(): number;
|
|
19
|
-
constructor(configs: PaintBrushConfigs);
|
|
20
|
-
ifInsertToDOM(): HTMLDivElement;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param className 初始化画板
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
initCanvas(className: string): HTMLCanvasElement;
|
|
27
|
-
/**
|
|
28
|
-
* 初始化操作面板
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
initCtrl(): HTMLDivElement;
|
|
32
|
-
openBrush(): void;
|
|
33
|
-
closeBrush(): void;
|
|
34
|
-
updateCurrentColor(color: string): void;
|
|
35
|
-
openBrushHandle(): void;
|
|
36
|
-
emitStateChange(action: PaintBrushAction, userAction?: boolean): void;
|
|
37
|
-
action(action: PaintBrushAction): void;
|
|
38
|
-
handleDrawLine(_uuid: string, data: PaintBrushState, { withUndo }: {
|
|
39
|
-
withUndo?: boolean;
|
|
40
|
-
}, callback?: typeof noop): void;
|
|
41
|
-
handleUndo(uuid: string): void;
|
|
42
|
-
destroyBrush(): void;
|
|
43
|
-
}
|