@leafer-in/editor 1.0.0-beta.15

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.
@@ -0,0 +1,68 @@
1
+ import { IUI, IPolygon, IEventListenerId, IGroupInputData, IResizeType, IAround, IDragEvent, IBoundsData, IPointData } from '@leafer-ui/interface';
2
+ import { IEditor, IEditorConfig, IEditorTool, IDirection8, IEditorResizeEvent, IEditorRotateEvent } from '@leafer-in/interface';
3
+ import { Group, DragEvent, RotateEvent, Event } from '@leafer-ui/core';
4
+
5
+ declare class Editor extends Group implements IEditor {
6
+ config: IEditorConfig;
7
+ resizePoints: IUI[];
8
+ rotatePoints: IUI[];
9
+ resizeLines: IUI[];
10
+ targetRect: IUI;
11
+ rect: IPolygon;
12
+ circle: IUI;
13
+ tool: IEditorTool;
14
+ private _target;
15
+ get target(): IUI;
16
+ set target(value: IUI);
17
+ enterPoint: IUI;
18
+ protected __eventIds: IEventListenerId[];
19
+ protected __targetEventIds: IEventListenerId[];
20
+ constructor(userConfig?: IEditorConfig, data?: IGroupInputData);
21
+ protected init(): void;
22
+ protected onTarget(): void;
23
+ getTool(value: IUI): IEditorTool;
24
+ update(): void;
25
+ protected onDrag(e: DragEvent): void;
26
+ protected onMove(e: DragEvent): void;
27
+ protected onRotate(e: DragEvent | RotateEvent): void;
28
+ onResize(e: DragEvent): void;
29
+ updateMoveCursor(): void;
30
+ protected __listenEvents(): void;
31
+ protected __removeListenEvents(): void;
32
+ protected __listenPointEvents(point: IUI, type: 'rotate' | 'resize', direction: IDirection8): void;
33
+ protected __listenTargetEvents(): void;
34
+ protected __removeTargetEvents(): void;
35
+ destroy(): void;
36
+ }
37
+
38
+ declare class EditorResizeEvent extends Event implements IEditorResizeEvent {
39
+ static RESIZE: string;
40
+ readonly target: IUI;
41
+ readonly editor: IEditor;
42
+ readonly resizeType: IResizeType;
43
+ readonly lockRatio: boolean;
44
+ readonly around: IAround;
45
+ readonly dragEvent: IDragEvent;
46
+ readonly direction: IDirection8;
47
+ readonly bounds: IBoundsData;
48
+ readonly old: IBoundsData;
49
+ readonly origin: IPointData;
50
+ readonly scaleX: number;
51
+ readonly scaleY: number;
52
+ constructor(type: string, data?: IEditorResizeEvent);
53
+ }
54
+
55
+ declare class EditorRotateEvent extends Event implements IEditorRotateEvent {
56
+ static ROTATE: string;
57
+ readonly target: IUI;
58
+ readonly editor: IEditor;
59
+ readonly origin: IPointData;
60
+ readonly rotation: number;
61
+ constructor(type: string, data?: IEditorRotateEvent);
62
+ }
63
+
64
+ declare const LineTool: IEditorTool;
65
+
66
+ declare const RectTool: IEditorTool;
67
+
68
+ export { Editor, EditorResizeEvent, EditorRotateEvent, LineTool, RectTool };