@yorab/react-paint 0.18.1 → 1.0.0-beta.1

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 (247) hide show
  1. package/README.md +266 -22
  2. package/dist/_chunks/canvas-CDYlr833.js +1 -0
  3. package/dist/_chunks/editor-BARYd5Od.js +1 -0
  4. package/dist/canvas/components/Canvas.d.ts +15 -3
  5. package/dist/canvas/components/EditTextBox.d.ts +4 -4
  6. package/dist/canvas/constants/app.d.ts +32 -17
  7. package/dist/canvas/constants/grid.d.ts +7 -0
  8. package/dist/canvas/constants/picture.d.ts +8 -0
  9. package/dist/canvas/constants/shapes.d.ts +2 -2
  10. package/dist/canvas/constants/tools.d.ts +12 -2
  11. package/dist/canvas/constants/zoom.d.ts +4 -2
  12. package/dist/canvas/context/PaintContext.d.ts +9 -0
  13. package/dist/canvas/hooks/useAnnotationsStyle.d.ts +5 -0
  14. package/dist/canvas/hooks/useAutoScroll.d.ts +4 -0
  15. package/dist/canvas/hooks/useCanvasRenderer.d.ts +17 -0
  16. package/dist/canvas/hooks/useDrawableCanvas.d.ts +8 -5
  17. package/dist/canvas/hooks/useDropPicture.d.ts +7 -0
  18. package/dist/canvas/hooks/useKeyboard.d.ts +6 -32
  19. package/dist/canvas/hooks/usePaintState.d.ts +9 -0
  20. package/dist/canvas/hooks/usePinchZoomAndMove.d.ts +3 -13
  21. package/dist/canvas/hooks/useReactPaint.d.ts +11 -163
  22. package/dist/canvas/hooks/useResizeObserver.d.ts +1 -0
  23. package/dist/canvas/hooks/useShapeEvents.d.ts +7 -0
  24. package/dist/canvas/hooks/useZoom.d.ts +4 -17
  25. package/dist/canvas/index.d.ts +24 -17
  26. package/dist/canvas/index.js +1 -1
  27. package/dist/canvas/store/createStore.d.ts +14 -0
  28. package/dist/canvas/store/eventEmitter.d.ts +11 -0
  29. package/dist/canvas/store/internal.d.ts +5 -0
  30. package/dist/canvas/store/paintStore.d.ts +898 -0
  31. package/dist/canvas/store/selectors.d.ts +855 -0
  32. package/dist/canvas/store/shapesReducer.d.ts +66 -0
  33. package/dist/canvas/store/types.d.ts +72 -0
  34. package/dist/canvas/types/Canvas.d.ts +19 -0
  35. package/dist/{src/common → canvas}/types/Mode.d.ts +8 -15
  36. package/dist/{common → canvas}/types/Settings.d.ts +6 -1
  37. package/dist/{common → canvas}/types/Shapes.d.ts +27 -21
  38. package/dist/canvas/types/editor.d.ts +388 -0
  39. package/dist/{common → canvas}/types/tools.d.ts +10 -6
  40. package/dist/{common → canvas}/utils/array.d.ts +2 -0
  41. package/dist/canvas/utils/canvas.d.ts +18 -2
  42. package/dist/canvas/utils/click.d.ts +17 -0
  43. package/dist/canvas/utils/data.d.ts +6 -5
  44. package/dist/canvas/utils/equality.d.ts +5 -0
  45. package/dist/canvas/utils/file.d.ts +36 -266
  46. package/dist/canvas/utils/grid.d.ts +1 -1
  47. package/dist/canvas/utils/intersect.d.ts +24 -14
  48. package/dist/canvas/utils/object.d.ts +11 -0
  49. package/dist/{src/common/utils/selection.d.ts → canvas/utils/selectedShapes.d.ts} +2 -2
  50. package/dist/canvas/utils/selection/anchors.d.ts +16 -0
  51. package/dist/canvas/utils/selection/groupSelection.d.ts +3 -3
  52. package/dist/canvas/utils/selection/lineSelection.d.ts +3 -10
  53. package/dist/canvas/utils/selection/rectSelection.d.ts +6 -11
  54. package/dist/canvas/utils/selection/selectionFrame.d.ts +2 -2
  55. package/dist/canvas/utils/selection.d.ts +7 -5
  56. package/dist/canvas/utils/shapeInput.d.ts +45 -0
  57. package/dist/canvas/utils/shapePatch.d.ts +10 -0
  58. package/dist/canvas/utils/shapes/brush.d.ts +6 -6
  59. package/dist/canvas/utils/shapes/circle.d.ts +5 -5
  60. package/dist/canvas/utils/shapes/curve.d.ts +4 -4
  61. package/dist/canvas/utils/shapes/ellipse.d.ts +5 -5
  62. package/dist/canvas/utils/shapes/group.d.ts +9 -3
  63. package/dist/canvas/utils/shapes/index.d.ts +31 -5
  64. package/dist/canvas/utils/shapes/line.d.ts +5 -5
  65. package/dist/canvas/utils/shapes/path.d.ts +16 -8
  66. package/dist/canvas/utils/shapes/picture.d.ts +7 -5
  67. package/dist/canvas/utils/shapes/polygon.d.ts +4 -4
  68. package/dist/canvas/utils/shapes/rectangle.d.ts +5 -5
  69. package/dist/canvas/utils/shapes/text.d.ts +12 -6
  70. package/dist/canvas/utils/shapes/triangle.d.ts +2 -2
  71. package/dist/canvas/utils/tools.d.ts +12 -3
  72. package/dist/canvas/utils/transform.d.ts +5 -4
  73. package/dist/canvas/utils/trigo.d.ts +17 -1
  74. package/dist/canvas/utils/util.d.ts +14 -0
  75. package/dist/canvas/utils/zoom.d.ts +29 -15
  76. package/dist/editor/components/common/Button.d.ts +0 -1
  77. package/dist/editor/components/common/FileInput.d.ts +0 -1
  78. package/dist/editor/components/common/Loading.d.ts +1 -2
  79. package/dist/editor/components/common/Menu.d.ts +3 -2
  80. package/dist/editor/components/common/Modal.d.ts +1 -2
  81. package/dist/editor/components/common/Panel.d.ts +1 -2
  82. package/dist/editor/components/common/Snackbar.d.ts +2 -3
  83. package/dist/editor/components/settings/ClosedPointsField.d.ts +1 -1
  84. package/dist/editor/components/settings/ColorField.d.ts +1 -2
  85. package/dist/editor/components/settings/DeleteButton.d.ts +3 -4
  86. package/dist/editor/components/settings/FontFamilyField.d.ts +1 -2
  87. package/dist/editor/components/settings/LayoutButton.d.ts +1 -2
  88. package/dist/editor/components/settings/Layouts.d.ts +4 -15
  89. package/dist/editor/components/settings/LineArrowField.d.ts +1 -2
  90. package/dist/editor/components/settings/LineTypeField.d.ts +2 -3
  91. package/dist/editor/components/settings/RangeField.d.ts +1 -2
  92. package/dist/editor/components/settings/SelectField.d.ts +1 -2
  93. package/dist/editor/components/settings/SettingsBar.d.ts +3 -18
  94. package/dist/editor/components/settings/ToggleField.d.ts +2 -1
  95. package/dist/editor/components/settings/ZoomButton.d.ts +1 -2
  96. package/dist/editor/components/settings/ZoomPanel.d.ts +4 -0
  97. package/dist/editor/components/toolbox/ActionButton.d.ts +9 -0
  98. package/dist/editor/components/toolbox/ContextMenu.d.ts +5 -24
  99. package/dist/editor/components/toolbox/ExportModal.d.ts +1 -2
  100. package/dist/editor/components/toolbox/LoadFileTool.d.ts +4 -4
  101. package/dist/editor/components/toolbox/MenuGroup.d.ts +1 -7
  102. package/dist/editor/components/toolbox/PictureUrlInput.d.ts +2 -2
  103. package/dist/editor/components/toolbox/Tool.d.ts +3 -3
  104. package/dist/editor/components/toolbox/Toolbar.d.ts +5 -16
  105. package/dist/editor/components/toolbox/ToolbarGroup.d.ts +2 -3
  106. package/dist/editor/constants/options.d.ts +11 -1
  107. package/dist/editor/constants/snackbar.d.ts +1 -1
  108. package/dist/editor/constants/style.d.ts +0 -9
  109. package/dist/editor/constants/tools.d.ts +12 -32
  110. package/dist/editor/editor.css +1 -0
  111. package/dist/editor/hooks/useDrag.d.ts +3 -3
  112. package/dist/editor/hooks/useMenu.d.ts +3 -2
  113. package/dist/editor/hooks/usePressOutside.d.ts +7 -0
  114. package/dist/editor/hooks/useSnackbar.d.ts +1 -1
  115. package/dist/editor/index.d.ts +12 -22
  116. package/dist/editor/index.js +1 -1
  117. package/dist/editor/types/tools.d.ts +7 -0
  118. package/dist/editor/utils/dom.d.ts +1 -0
  119. package/dist/editor/utils/style.d.ts +7 -1
  120. package/dist/editor/utils/toolbar.d.ts +1 -2
  121. package/dist/editor/utils/util.d.ts +5 -0
  122. package/dist/index.d.ts +2 -5
  123. package/dist/react-paint.css +1 -1
  124. package/dist/react-paint.js +1 -1
  125. package/dist/react-paint.umd.cjs +1 -1
  126. package/package.json +37 -26
  127. package/dist/_chunks/array-DuJem3vg.js +0 -1
  128. package/dist/_chunks/canvas-DF1RWuxW.js +0 -1
  129. package/dist/_chunks/editor-DuVskl0R.js +0 -1
  130. package/dist/canvas/context/CanvasContext.d.ts +0 -55
  131. package/dist/canvas/hooks/useComponent.d.ts +0 -12
  132. package/dist/canvas/hooks/useDoubleClick.d.ts +0 -5
  133. package/dist/canvas/hooks/useEventListener.d.ts +0 -2
  134. package/dist/canvas/hooks/useShapes.d.ts +0 -44
  135. package/dist/common/hooks/useDebounce.d.ts +0 -2
  136. package/dist/common/types/Canvas.d.ts +0 -8
  137. package/dist/common/types/Mode.d.ts +0 -64
  138. package/dist/common/types/react.d.ts +0 -6
  139. package/dist/common/utils/dom.d.ts +0 -1
  140. package/dist/common/utils/object.d.ts +0 -4
  141. package/dist/common/utils/selection.d.ts +0 -4
  142. package/dist/common/utils/util.d.ts +0 -3
  143. package/dist/editor/constants/grid.d.ts +0 -7
  144. package/dist/src/canvas/components/Canvas.d.ts +0 -4
  145. package/dist/src/canvas/components/EditTextBox.d.ts +0 -13
  146. package/dist/src/canvas/constants/app.d.ts +0 -37
  147. package/dist/src/canvas/constants/grid.d.ts +0 -1
  148. package/dist/src/canvas/constants/keyboard.d.ts +0 -27
  149. package/dist/src/canvas/constants/picture.d.ts +0 -1
  150. package/dist/src/canvas/constants/rendering.d.ts +0 -3
  151. package/dist/src/canvas/constants/shapes.d.ts +0 -10
  152. package/dist/src/canvas/constants/tools.d.ts +0 -4
  153. package/dist/src/canvas/constants/zoom.d.ts +0 -5
  154. package/dist/src/canvas/context/CanvasContext.d.ts +0 -55
  155. package/dist/src/canvas/hooks/useComponent.d.ts +0 -12
  156. package/dist/src/canvas/hooks/useDoubleClick.d.ts +0 -5
  157. package/dist/src/canvas/hooks/useDrawableCanvas.d.ts +0 -6
  158. package/dist/src/canvas/hooks/useEventListener.d.ts +0 -2
  159. package/dist/src/canvas/hooks/useKeyboard.d.ts +0 -33
  160. package/dist/src/canvas/hooks/usePinchZoomAndMove.d.ts +0 -17
  161. package/dist/src/canvas/hooks/useReactPaint.d.ts +0 -164
  162. package/dist/src/canvas/hooks/useResizeObserver.d.ts +0 -6
  163. package/dist/src/canvas/hooks/useShapes.d.ts +0 -44
  164. package/dist/src/canvas/hooks/useZoom.d.ts +0 -22
  165. package/dist/src/canvas/index.d.ts +0 -19
  166. package/dist/src/canvas/utils/canvas.d.ts +0 -15
  167. package/dist/src/canvas/utils/data.d.ts +0 -5
  168. package/dist/src/canvas/utils/file.d.ts +0 -274
  169. package/dist/src/canvas/utils/grid.d.ts +0 -2
  170. package/dist/src/canvas/utils/intersect.d.ts +0 -27
  171. package/dist/src/canvas/utils/selection/groupSelection.d.ts +0 -4
  172. package/dist/src/canvas/utils/selection/lineSelection.d.ts +0 -19
  173. package/dist/src/canvas/utils/selection/rectSelection.d.ts +0 -20
  174. package/dist/src/canvas/utils/selection/selectionFrame.d.ts +0 -3
  175. package/dist/src/canvas/utils/selection.d.ts +0 -12
  176. package/dist/src/canvas/utils/shapes/brush.d.ts +0 -21
  177. package/dist/src/canvas/utils/shapes/circle.d.ts +0 -18
  178. package/dist/src/canvas/utils/shapes/curve.d.ts +0 -17
  179. package/dist/src/canvas/utils/shapes/ellipse.d.ts +0 -18
  180. package/dist/src/canvas/utils/shapes/group.d.ts +0 -33
  181. package/dist/src/canvas/utils/shapes/index.d.ts +0 -35
  182. package/dist/src/canvas/utils/shapes/line.d.ts +0 -19
  183. package/dist/src/canvas/utils/shapes/path.d.ts +0 -29
  184. package/dist/src/canvas/utils/shapes/picture.d.ts +0 -13
  185. package/dist/src/canvas/utils/shapes/polygon.d.ts +0 -18
  186. package/dist/src/canvas/utils/shapes/rectangle.d.ts +0 -22
  187. package/dist/src/canvas/utils/shapes/text.d.ts +0 -27
  188. package/dist/src/canvas/utils/shapes/triangle.d.ts +0 -4
  189. package/dist/src/canvas/utils/transform.d.ts +0 -15
  190. package/dist/src/canvas/utils/trigo.d.ts +0 -19
  191. package/dist/src/canvas/utils/zoom.d.ts +0 -58
  192. package/dist/src/common/hooks/useDebounce.d.ts +0 -2
  193. package/dist/src/common/types/Canvas.d.ts +0 -8
  194. package/dist/src/common/types/Settings.d.ts +0 -24
  195. package/dist/src/common/types/Shapes.d.ts +0 -153
  196. package/dist/src/common/types/react.d.ts +0 -6
  197. package/dist/src/common/types/tools.d.ts +0 -164
  198. package/dist/src/common/types/utils.d.ts +0 -4
  199. package/dist/src/common/utils/array.d.ts +0 -2
  200. package/dist/src/common/utils/dom.d.ts +0 -1
  201. package/dist/src/common/utils/object.d.ts +0 -4
  202. package/dist/src/common/utils/util.d.ts +0 -3
  203. package/dist/src/editor/components/common/Button.d.ts +0 -16
  204. package/dist/src/editor/components/common/FileInput.d.ts +0 -13
  205. package/dist/src/editor/components/common/Loading.d.ts +0 -6
  206. package/dist/src/editor/components/common/Menu.d.ts +0 -10
  207. package/dist/src/editor/components/common/Modal.d.ts +0 -11
  208. package/dist/src/editor/components/common/Panel.d.ts +0 -15
  209. package/dist/src/editor/components/common/Snackbar.d.ts +0 -7
  210. package/dist/src/editor/components/settings/ClosedPointsField.d.ts +0 -10
  211. package/dist/src/editor/components/settings/ColorField.d.ts +0 -15
  212. package/dist/src/editor/components/settings/DeleteButton.d.ts +0 -8
  213. package/dist/src/editor/components/settings/FontFamilyField.d.ts +0 -12
  214. package/dist/src/editor/components/settings/LayoutButton.d.ts +0 -7
  215. package/dist/src/editor/components/settings/Layouts.d.ts +0 -19
  216. package/dist/src/editor/components/settings/LineArrowField.d.ts +0 -12
  217. package/dist/src/editor/components/settings/LineTypeField.d.ts +0 -16
  218. package/dist/src/editor/components/settings/RangeField.d.ts +0 -19
  219. package/dist/src/editor/components/settings/SelectField.d.ts +0 -18
  220. package/dist/src/editor/components/settings/SettingsBar.d.ts +0 -26
  221. package/dist/src/editor/components/settings/ToggleField.d.ts +0 -13
  222. package/dist/src/editor/components/settings/ZoomButton.d.ts +0 -8
  223. package/dist/src/editor/components/toolbox/ContextMenu.d.ts +0 -25
  224. package/dist/src/editor/components/toolbox/ExportModal.d.ts +0 -7
  225. package/dist/src/editor/components/toolbox/LoadFileTool.d.ts +0 -11
  226. package/dist/src/editor/components/toolbox/MenuGroup.d.ts +0 -27
  227. package/dist/src/editor/components/toolbox/PictureUrlInput.d.ts +0 -7
  228. package/dist/src/editor/components/toolbox/Tool.d.ts +0 -11
  229. package/dist/src/editor/components/toolbox/Toolbar.d.ts +0 -26
  230. package/dist/src/editor/components/toolbox/ToolbarGroup.d.ts +0 -14
  231. package/dist/src/editor/constants/grid.d.ts +0 -7
  232. package/dist/src/editor/constants/icons.d.ts +0 -43
  233. package/dist/src/editor/constants/loading.d.ts +0 -1
  234. package/dist/src/editor/constants/options.d.ts +0 -13
  235. package/dist/src/editor/constants/snackbar.d.ts +0 -7
  236. package/dist/src/editor/constants/style.d.ts +0 -14
  237. package/dist/src/editor/constants/tools.d.ts +0 -32
  238. package/dist/src/editor/hooks/useDrag.d.ts +0 -15
  239. package/dist/src/editor/hooks/useMenu.d.ts +0 -11
  240. package/dist/src/editor/hooks/useSnackbar.d.ts +0 -10
  241. package/dist/src/editor/index.d.ts +0 -25
  242. package/dist/src/editor/types/snackbar.d.ts +0 -7
  243. package/dist/src/editor/utils/style.d.ts +0 -2
  244. package/dist/src/editor/utils/toolbar.d.ts +0 -11
  245. package/dist/src/index.d.ts +0 -5
  246. /package/dist/{common → canvas}/types/utils.d.ts +0 -0
  247. /package/dist/{canvas → editor}/hooks/useDebounce.d.ts +0 -0
@@ -0,0 +1,898 @@
1
+ import { type UtilsSettings } from './../../canvas/constants/app.js';
2
+ import type { CanvasTransformation, InternalState, Modifiers, PanStart, SelectionFrameState, UseReactPaintProps } from './../../canvas/store/types.js';
3
+ import type { CanvasSize } from './../../canvas/types/Canvas.js';
4
+ import type { ChangeSource, EditorActions, ExportImageOptions, ShapesBounds } from './../../canvas/types/editor.js';
5
+ import type { HoverModeData, SelectionModeContextMenu, SelectionModeData } from './../../canvas/types/Mode.js';
6
+ import type { Point, SelectionType, ShapeEntity, ShapeInput, StateData, StyleShape } from './../../canvas/types/Shapes.js';
7
+ import type { ToolsType } from './../../canvas/types/tools.js';
8
+ import { type ViewBounds } from './../../canvas/utils/zoom.js';
9
+ type Listeners = {
10
+ [K in keyof HTMLElementEventMap]?: (e: HTMLElementEventMap[K]) => void;
11
+ };
12
+ /**
13
+ * Store of a react-paint instance: state of the canvas, of the selection and of the history,
14
+ * and the engine that updates it. It knows nothing about React.
15
+ */
16
+ export declare const createPaintStore: (props?: UseReactPaintProps) => {
17
+ getState: () => InternalState;
18
+ subscribe: (listener: () => void) => () => void;
19
+ watch: <S>(select: (state: InternalState) => S, onChange: (value: S, previous: S) => void, isEqual?: ((a: S, b: S) => boolean) | undefined) => () => void;
20
+ batch: <R>(fn: () => R) => R;
21
+ transaction: <R>(fn: () => R) => R;
22
+ selectors: {
23
+ selectFeatures: ({ config }: InternalState) => {
24
+ edition: boolean;
25
+ zoom: boolean;
26
+ };
27
+ selectIsInteractive: (state: InternalState) => boolean;
28
+ selectSettings: (state: InternalState) => UtilsSettings;
29
+ selectActiveTool: ({ tools }: InternalState) => ToolsType;
30
+ selectSelectedShapes: (selection: ({
31
+ id: string;
32
+ computed: {
33
+ borders: import("./../../canvas/types/Shapes.js").Rect;
34
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
35
+ center: Point;
36
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
37
+ };
38
+ path: Path2D;
39
+ } & {
40
+ id?: string;
41
+ rotation?: number;
42
+ toolId?: string;
43
+ visible?: boolean;
44
+ locked?: boolean;
45
+ style?: StyleShape | undefined;
46
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
47
+ } & import("./../../canvas/types/Shapes.js").Line & {
48
+ type: "line";
49
+ } & {
50
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
51
+ } & {
52
+ type: "line";
53
+ arrows?: import("./../../canvas/types/Shapes.js").TriangleEntity[];
54
+ }) | ({
55
+ id: string;
56
+ computed: {
57
+ borders: import("./../../canvas/types/Shapes.js").Rect;
58
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
59
+ center: Point;
60
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
61
+ };
62
+ path: Path2D;
63
+ } & {
64
+ id?: string;
65
+ rotation?: number;
66
+ toolId?: string;
67
+ visible?: boolean;
68
+ locked?: boolean;
69
+ style?: StyleShape | undefined;
70
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
71
+ } & import("./../../canvas/types/Shapes.js").Rect & {
72
+ src: string;
73
+ } & {
74
+ type: "picture";
75
+ img: HTMLImageElement;
76
+ flipX?: boolean;
77
+ flipY?: boolean;
78
+ ratio?: number;
79
+ } & {
80
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
81
+ } & {
82
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
83
+ }) | ({
84
+ id: string;
85
+ computed: {
86
+ borders: import("./../../canvas/types/Shapes.js").Rect;
87
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
88
+ center: Point;
89
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
90
+ };
91
+ path: Path2D;
92
+ } & {
93
+ id?: string;
94
+ rotation?: number;
95
+ toolId?: string;
96
+ visible?: boolean;
97
+ locked?: boolean;
98
+ style?: StyleShape | undefined;
99
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
100
+ } & import("./../../canvas/types/Shapes.js").Rect & {
101
+ value: string[];
102
+ fontSize: number;
103
+ } & {
104
+ type: "text";
105
+ flipX?: boolean;
106
+ flipY?: boolean;
107
+ ratio?: number;
108
+ } & {
109
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
110
+ } & {
111
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
112
+ }) | ({
113
+ id: string;
114
+ computed: {
115
+ borders: import("./../../canvas/types/Shapes.js").Rect;
116
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
117
+ center: Point;
118
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
119
+ };
120
+ path: Path2D;
121
+ } & {
122
+ id?: string;
123
+ rotation?: number;
124
+ toolId?: string;
125
+ visible?: boolean;
126
+ locked?: boolean;
127
+ style?: StyleShape | undefined;
128
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
129
+ } & import("./../../canvas/types/Shapes.js").Rect & {
130
+ type: "rect";
131
+ } & {
132
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
133
+ } & {
134
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
135
+ }) | ({
136
+ id: string;
137
+ computed: {
138
+ borders: import("./../../canvas/types/Shapes.js").Rect;
139
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
140
+ center: Point;
141
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
142
+ };
143
+ path: Path2D;
144
+ } & {
145
+ id?: string;
146
+ rotation?: number;
147
+ toolId?: string;
148
+ visible?: boolean;
149
+ locked?: boolean;
150
+ style?: StyleShape | undefined;
151
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
152
+ } & import("./../../canvas/types/Shapes.js").Rect & {
153
+ type: "square";
154
+ } & {
155
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
156
+ } & {
157
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
158
+ }) | ({
159
+ id: string;
160
+ computed: {
161
+ borders: import("./../../canvas/types/Shapes.js").Rect;
162
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
163
+ center: Point;
164
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
165
+ };
166
+ path: Path2D;
167
+ } & {
168
+ id?: string;
169
+ rotation?: number;
170
+ toolId?: string;
171
+ visible?: boolean;
172
+ locked?: boolean;
173
+ style?: StyleShape | undefined;
174
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
175
+ } & import("./../../canvas/types/Shapes.js").Circle & {
176
+ type: "circle";
177
+ } & {
178
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
179
+ } & {
180
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
181
+ }) | ({
182
+ id: string;
183
+ computed: {
184
+ borders: import("./../../canvas/types/Shapes.js").Rect;
185
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
186
+ center: Point;
187
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
188
+ };
189
+ path: Path2D;
190
+ } & {
191
+ id?: string;
192
+ rotation?: number;
193
+ toolId?: string;
194
+ visible?: boolean;
195
+ locked?: boolean;
196
+ style?: StyleShape | undefined;
197
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
198
+ } & import("./../../canvas/types/Shapes.js").Ellipse & {
199
+ type: "ellipse";
200
+ } & {
201
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
202
+ } & {
203
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
204
+ }) | ({
205
+ id: string;
206
+ computed: {
207
+ borders: import("./../../canvas/types/Shapes.js").Rect;
208
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
209
+ center: Point;
210
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
211
+ };
212
+ path: Path2D;
213
+ } & {
214
+ id?: string;
215
+ rotation?: number;
216
+ toolId?: string;
217
+ visible?: boolean;
218
+ locked?: boolean;
219
+ style?: StyleShape | undefined;
220
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
221
+ } & import("./../../canvas/types/Shapes.js").Polygon & {
222
+ type: "polygon";
223
+ } & {
224
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
225
+ } & {
226
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
227
+ }) | ({
228
+ id: string;
229
+ computed: {
230
+ borders: import("./../../canvas/types/Shapes.js").Rect;
231
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
232
+ center: Point;
233
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
234
+ };
235
+ path: Path2D;
236
+ } & {
237
+ id?: string;
238
+ rotation?: number;
239
+ toolId?: string;
240
+ visible?: boolean;
241
+ locked?: boolean;
242
+ style?: StyleShape | undefined;
243
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
244
+ } & import("./../../canvas/types/Shapes.js").Curve & {
245
+ type: "curve";
246
+ } & {
247
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
248
+ } & {
249
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
250
+ }) | ({
251
+ id: string;
252
+ computed: {
253
+ borders: import("./../../canvas/types/Shapes.js").Rect;
254
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
255
+ center: Point;
256
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
257
+ };
258
+ path: Path2D;
259
+ } & {
260
+ id?: string;
261
+ rotation?: number;
262
+ toolId?: string;
263
+ visible?: boolean;
264
+ locked?: boolean;
265
+ style?: StyleShape | undefined;
266
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
267
+ } & import("./../../canvas/types/Shapes.js").Brush & {
268
+ type: "brush";
269
+ scaleX?: number;
270
+ scaleY?: number;
271
+ } & {
272
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
273
+ } & {
274
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
275
+ }) | ({
276
+ id: string;
277
+ computed: {
278
+ borders: import("./../../canvas/types/Shapes.js").Rect;
279
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
280
+ center: Point;
281
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
282
+ };
283
+ path: Path2D;
284
+ } & {
285
+ id?: string;
286
+ rotation?: number;
287
+ toolId?: string;
288
+ visible?: boolean;
289
+ locked?: boolean;
290
+ style?: StyleShape | undefined;
291
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
292
+ } & import("./../../canvas/types/Shapes.js").Rect & {
293
+ type: "group";
294
+ shapes: ShapeEntity[];
295
+ } & {
296
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
297
+ } & {
298
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
299
+ }) | undefined) => (({
300
+ id: string;
301
+ computed: {
302
+ borders: import("./../../canvas/types/Shapes.js").Rect;
303
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
304
+ center: Point;
305
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
306
+ };
307
+ path: Path2D;
308
+ } & {
309
+ id?: string;
310
+ rotation?: number;
311
+ toolId?: string;
312
+ visible?: boolean;
313
+ locked?: boolean;
314
+ style?: StyleShape | undefined;
315
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
316
+ } & import("./../../canvas/types/Shapes.js").Line & {
317
+ type: "line";
318
+ } & {
319
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
320
+ } & {
321
+ type: "line";
322
+ arrows?: import("./../../canvas/types/Shapes.js").TriangleEntity[];
323
+ }) | ({
324
+ id: string;
325
+ computed: {
326
+ borders: import("./../../canvas/types/Shapes.js").Rect;
327
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
328
+ center: Point;
329
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
330
+ };
331
+ path: Path2D;
332
+ } & {
333
+ id?: string;
334
+ rotation?: number;
335
+ toolId?: string;
336
+ visible?: boolean;
337
+ locked?: boolean;
338
+ style?: StyleShape | undefined;
339
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
340
+ } & import("./../../canvas/types/Shapes.js").Rect & {
341
+ src: string;
342
+ } & {
343
+ type: "picture";
344
+ img: HTMLImageElement;
345
+ flipX?: boolean;
346
+ flipY?: boolean;
347
+ ratio?: number;
348
+ } & {
349
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
350
+ } & {
351
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
352
+ }) | ({
353
+ id: string;
354
+ computed: {
355
+ borders: import("./../../canvas/types/Shapes.js").Rect;
356
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
357
+ center: Point;
358
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
359
+ };
360
+ path: Path2D;
361
+ } & {
362
+ id?: string;
363
+ rotation?: number;
364
+ toolId?: string;
365
+ visible?: boolean;
366
+ locked?: boolean;
367
+ style?: StyleShape | undefined;
368
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
369
+ } & import("./../../canvas/types/Shapes.js").Rect & {
370
+ value: string[];
371
+ fontSize: number;
372
+ } & {
373
+ type: "text";
374
+ flipX?: boolean;
375
+ flipY?: boolean;
376
+ ratio?: number;
377
+ } & {
378
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
379
+ } & {
380
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
381
+ }) | ({
382
+ id: string;
383
+ computed: {
384
+ borders: import("./../../canvas/types/Shapes.js").Rect;
385
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
386
+ center: Point;
387
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
388
+ };
389
+ path: Path2D;
390
+ } & {
391
+ id?: string;
392
+ rotation?: number;
393
+ toolId?: string;
394
+ visible?: boolean;
395
+ locked?: boolean;
396
+ style?: StyleShape | undefined;
397
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
398
+ } & import("./../../canvas/types/Shapes.js").Rect & {
399
+ type: "rect";
400
+ } & {
401
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
402
+ } & {
403
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
404
+ }) | ({
405
+ id: string;
406
+ computed: {
407
+ borders: import("./../../canvas/types/Shapes.js").Rect;
408
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
409
+ center: Point;
410
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
411
+ };
412
+ path: Path2D;
413
+ } & {
414
+ id?: string;
415
+ rotation?: number;
416
+ toolId?: string;
417
+ visible?: boolean;
418
+ locked?: boolean;
419
+ style?: StyleShape | undefined;
420
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
421
+ } & import("./../../canvas/types/Shapes.js").Rect & {
422
+ type: "square";
423
+ } & {
424
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
425
+ } & {
426
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
427
+ }) | ({
428
+ id: string;
429
+ computed: {
430
+ borders: import("./../../canvas/types/Shapes.js").Rect;
431
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
432
+ center: Point;
433
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
434
+ };
435
+ path: Path2D;
436
+ } & {
437
+ id?: string;
438
+ rotation?: number;
439
+ toolId?: string;
440
+ visible?: boolean;
441
+ locked?: boolean;
442
+ style?: StyleShape | undefined;
443
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
444
+ } & import("./../../canvas/types/Shapes.js").Circle & {
445
+ type: "circle";
446
+ } & {
447
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
448
+ } & {
449
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
450
+ }) | ({
451
+ id: string;
452
+ computed: {
453
+ borders: import("./../../canvas/types/Shapes.js").Rect;
454
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
455
+ center: Point;
456
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
457
+ };
458
+ path: Path2D;
459
+ } & {
460
+ id?: string;
461
+ rotation?: number;
462
+ toolId?: string;
463
+ visible?: boolean;
464
+ locked?: boolean;
465
+ style?: StyleShape | undefined;
466
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
467
+ } & import("./../../canvas/types/Shapes.js").Ellipse & {
468
+ type: "ellipse";
469
+ } & {
470
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
471
+ } & {
472
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
473
+ }) | ({
474
+ id: string;
475
+ computed: {
476
+ borders: import("./../../canvas/types/Shapes.js").Rect;
477
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
478
+ center: Point;
479
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
480
+ };
481
+ path: Path2D;
482
+ } & {
483
+ id?: string;
484
+ rotation?: number;
485
+ toolId?: string;
486
+ visible?: boolean;
487
+ locked?: boolean;
488
+ style?: StyleShape | undefined;
489
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
490
+ } & import("./../../canvas/types/Shapes.js").Polygon & {
491
+ type: "polygon";
492
+ } & {
493
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
494
+ } & {
495
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
496
+ }) | ({
497
+ id: string;
498
+ computed: {
499
+ borders: import("./../../canvas/types/Shapes.js").Rect;
500
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
501
+ center: Point;
502
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
503
+ };
504
+ path: Path2D;
505
+ } & {
506
+ id?: string;
507
+ rotation?: number;
508
+ toolId?: string;
509
+ visible?: boolean;
510
+ locked?: boolean;
511
+ style?: StyleShape | undefined;
512
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
513
+ } & import("./../../canvas/types/Shapes.js").Curve & {
514
+ type: "curve";
515
+ } & {
516
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
517
+ } & {
518
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
519
+ }) | ({
520
+ id: string;
521
+ computed: {
522
+ borders: import("./../../canvas/types/Shapes.js").Rect;
523
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
524
+ center: Point;
525
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
526
+ };
527
+ path: Path2D;
528
+ } & {
529
+ id?: string;
530
+ rotation?: number;
531
+ toolId?: string;
532
+ visible?: boolean;
533
+ locked?: boolean;
534
+ style?: StyleShape | undefined;
535
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
536
+ } & import("./../../canvas/types/Shapes.js").Brush & {
537
+ type: "brush";
538
+ scaleX?: number;
539
+ scaleY?: number;
540
+ } & {
541
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
542
+ } & {
543
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
544
+ }) | ({
545
+ id: string;
546
+ computed: {
547
+ borders: import("./../../canvas/types/Shapes.js").Rect;
548
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
549
+ center: Point;
550
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
551
+ };
552
+ path: Path2D;
553
+ } & {
554
+ id?: string;
555
+ rotation?: number;
556
+ toolId?: string;
557
+ visible?: boolean;
558
+ locked?: boolean;
559
+ style?: StyleShape | undefined;
560
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
561
+ } & import("./../../canvas/types/Shapes.js").Rect & {
562
+ type: "group";
563
+ shapes: ShapeEntity[];
564
+ } & {
565
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
566
+ } & {
567
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
568
+ }))[];
569
+ selectHoveredShape: ({ document, interaction }: InternalState) => ({
570
+ id: string;
571
+ computed: {
572
+ borders: import("./../../canvas/types/Shapes.js").Rect;
573
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
574
+ center: Point;
575
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
576
+ };
577
+ path: Path2D;
578
+ } & {
579
+ id?: string;
580
+ rotation?: number;
581
+ toolId?: string;
582
+ visible?: boolean;
583
+ locked?: boolean;
584
+ style?: StyleShape | undefined;
585
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
586
+ } & import("./../../canvas/types/Shapes.js").Line & {
587
+ type: "line";
588
+ } & {
589
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
590
+ } & {
591
+ type: "line";
592
+ arrows?: import("./../../canvas/types/Shapes.js").TriangleEntity[];
593
+ }) | ({
594
+ id: string;
595
+ computed: {
596
+ borders: import("./../../canvas/types/Shapes.js").Rect;
597
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
598
+ center: Point;
599
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
600
+ };
601
+ path: Path2D;
602
+ } & {
603
+ id?: string;
604
+ rotation?: number;
605
+ toolId?: string;
606
+ visible?: boolean;
607
+ locked?: boolean;
608
+ style?: StyleShape | undefined;
609
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
610
+ } & import("./../../canvas/types/Shapes.js").Rect & {
611
+ src: string;
612
+ } & {
613
+ type: "picture";
614
+ img: HTMLImageElement;
615
+ flipX?: boolean;
616
+ flipY?: boolean;
617
+ ratio?: number;
618
+ } & {
619
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
620
+ } & {
621
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
622
+ }) | ({
623
+ id: string;
624
+ computed: {
625
+ borders: import("./../../canvas/types/Shapes.js").Rect;
626
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
627
+ center: Point;
628
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
629
+ };
630
+ path: Path2D;
631
+ } & {
632
+ id?: string;
633
+ rotation?: number;
634
+ toolId?: string;
635
+ visible?: boolean;
636
+ locked?: boolean;
637
+ style?: StyleShape | undefined;
638
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
639
+ } & import("./../../canvas/types/Shapes.js").Rect & {
640
+ value: string[];
641
+ fontSize: number;
642
+ } & {
643
+ type: "text";
644
+ flipX?: boolean;
645
+ flipY?: boolean;
646
+ ratio?: number;
647
+ } & {
648
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
649
+ } & {
650
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
651
+ }) | ({
652
+ id: string;
653
+ computed: {
654
+ borders: import("./../../canvas/types/Shapes.js").Rect;
655
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
656
+ center: Point;
657
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
658
+ };
659
+ path: Path2D;
660
+ } & {
661
+ id?: string;
662
+ rotation?: number;
663
+ toolId?: string;
664
+ visible?: boolean;
665
+ locked?: boolean;
666
+ style?: StyleShape | undefined;
667
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
668
+ } & import("./../../canvas/types/Shapes.js").Rect & {
669
+ type: "rect";
670
+ } & {
671
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
672
+ } & {
673
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
674
+ }) | ({
675
+ id: string;
676
+ computed: {
677
+ borders: import("./../../canvas/types/Shapes.js").Rect;
678
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
679
+ center: Point;
680
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
681
+ };
682
+ path: Path2D;
683
+ } & {
684
+ id?: string;
685
+ rotation?: number;
686
+ toolId?: string;
687
+ visible?: boolean;
688
+ locked?: boolean;
689
+ style?: StyleShape | undefined;
690
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
691
+ } & import("./../../canvas/types/Shapes.js").Rect & {
692
+ type: "square";
693
+ } & {
694
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
695
+ } & {
696
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
697
+ }) | ({
698
+ id: string;
699
+ computed: {
700
+ borders: import("./../../canvas/types/Shapes.js").Rect;
701
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
702
+ center: Point;
703
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
704
+ };
705
+ path: Path2D;
706
+ } & {
707
+ id?: string;
708
+ rotation?: number;
709
+ toolId?: string;
710
+ visible?: boolean;
711
+ locked?: boolean;
712
+ style?: StyleShape | undefined;
713
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
714
+ } & import("./../../canvas/types/Shapes.js").Circle & {
715
+ type: "circle";
716
+ } & {
717
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
718
+ } & {
719
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
720
+ }) | ({
721
+ id: string;
722
+ computed: {
723
+ borders: import("./../../canvas/types/Shapes.js").Rect;
724
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
725
+ center: Point;
726
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
727
+ };
728
+ path: Path2D;
729
+ } & {
730
+ id?: string;
731
+ rotation?: number;
732
+ toolId?: string;
733
+ visible?: boolean;
734
+ locked?: boolean;
735
+ style?: StyleShape | undefined;
736
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
737
+ } & import("./../../canvas/types/Shapes.js").Ellipse & {
738
+ type: "ellipse";
739
+ } & {
740
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
741
+ } & {
742
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
743
+ }) | ({
744
+ id: string;
745
+ computed: {
746
+ borders: import("./../../canvas/types/Shapes.js").Rect;
747
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
748
+ center: Point;
749
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
750
+ };
751
+ path: Path2D;
752
+ } & {
753
+ id?: string;
754
+ rotation?: number;
755
+ toolId?: string;
756
+ visible?: boolean;
757
+ locked?: boolean;
758
+ style?: StyleShape | undefined;
759
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
760
+ } & import("./../../canvas/types/Shapes.js").Polygon & {
761
+ type: "polygon";
762
+ } & {
763
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
764
+ } & {
765
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
766
+ }) | ({
767
+ id: string;
768
+ computed: {
769
+ borders: import("./../../canvas/types/Shapes.js").Rect;
770
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
771
+ center: Point;
772
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
773
+ };
774
+ path: Path2D;
775
+ } & {
776
+ id?: string;
777
+ rotation?: number;
778
+ toolId?: string;
779
+ visible?: boolean;
780
+ locked?: boolean;
781
+ style?: StyleShape | undefined;
782
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
783
+ } & import("./../../canvas/types/Shapes.js").Curve & {
784
+ type: "curve";
785
+ } & {
786
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
787
+ } & {
788
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
789
+ }) | ({
790
+ id: string;
791
+ computed: {
792
+ borders: import("./../../canvas/types/Shapes.js").Rect;
793
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
794
+ center: Point;
795
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
796
+ };
797
+ path: Path2D;
798
+ } & {
799
+ id?: string;
800
+ rotation?: number;
801
+ toolId?: string;
802
+ visible?: boolean;
803
+ locked?: boolean;
804
+ style?: StyleShape | undefined;
805
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
806
+ } & import("./../../canvas/types/Shapes.js").Brush & {
807
+ type: "brush";
808
+ scaleX?: number;
809
+ scaleY?: number;
810
+ } & {
811
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
812
+ } & {
813
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
814
+ }) | ({
815
+ id: string;
816
+ computed: {
817
+ borders: import("./../../canvas/types/Shapes.js").Rect;
818
+ outerBorders: import("./../../canvas/types/Shapes.js").Rect;
819
+ center: Point;
820
+ boundingBox: import("./../../canvas/types/Shapes.js").Rect;
821
+ };
822
+ path: Path2D;
823
+ } & {
824
+ id?: string;
825
+ rotation?: number;
826
+ toolId?: string;
827
+ visible?: boolean;
828
+ locked?: boolean;
829
+ style?: StyleShape | undefined;
830
+ data?: import("./../../canvas/types/Shapes.js").ShapeData | undefined;
831
+ } & import("./../../canvas/types/Shapes.js").Rect & {
832
+ type: "group";
833
+ shapes: ShapeEntity[];
834
+ } & {
835
+ type: "rect" | "square" | "circle" | "ellipse" | "picture" | "text" | "brush" | "group" | "line" | "polygon" | "curve";
836
+ } & {
837
+ type: Exclude<import("./../../canvas/types/Shapes.js").ShapeType, "line" | "triangle">;
838
+ }) | undefined;
839
+ selectWithContextMenu: ({ config }: InternalState) => boolean;
840
+ selectWithDropPicture: (state: InternalState) => boolean;
841
+ selectEditorState: (state: InternalState) => import("./../../canvas/types/editor.js").EditorState;
842
+ selectCanvasView: (state: InternalState) => import("./../../canvas/store/selectors.js").CanvasView;
843
+ selectCursor: (state: InternalState) => string;
844
+ };
845
+ getSettings: (state?: InternalState) => UtilsSettings;
846
+ getEditorState: () => import("./../../canvas/types/editor.js").EditorState;
847
+ actions: EditorActions;
848
+ registerEvent: <E extends import("./../../canvas/types/editor.js").ReactPaintEventName>(event: E, fn: import("./../../canvas/types/editor.js").ReactPaintEvents[E]) => () => void;
849
+ unregisterEvent: <E extends import("./../../canvas/types/editor.js").ReactPaintEventName>(event: E, fn?: import("./../../canvas/types/editor.js").ReactPaintEvents[E]) => void;
850
+ emit: <E extends import("./../../canvas/types/editor.js").ReactPaintEventName>(event: E, ...args: import("./../../canvas/types/editor.js").ReactPaintEventArgs[E]) => void;
851
+ hasListeners: (event: import("./../../canvas/types/editor.js").ReactPaintEventName) => boolean;
852
+ setConfig: (newProps: UseReactPaintProps) => void;
853
+ init: () => void;
854
+ /** Resets the shapes from data given by the consumer */
855
+ resetCanvas: (json?: ShapeInput[], clearHistory?: boolean) => Promise<void>;
856
+ getCurrentImage: (options?: ExportImageOptions) => string;
857
+ getCurrentData: () => StateData;
858
+ getShape: (id: string) => ShapeEntity | undefined;
859
+ getBounds: (ids: string[]) => ShapesBounds | undefined;
860
+ getShapesAt: (point: Point) => ShapeEntity[];
861
+ getShapeAt: (point: Point) => ShapeEntity | undefined;
862
+ toCanvasPosition: ({ x, y }: {
863
+ x: number;
864
+ y: number;
865
+ }) => Point | undefined;
866
+ toClientPosition: (point: Point) => {
867
+ x: number;
868
+ y: number;
869
+ } | undefined;
870
+ setScopeElement: (element: HTMLElement | null) => void;
871
+ setCanvasRootElement: (element: HTMLElement | null) => void;
872
+ setCanvasElement: (element: HTMLCanvasElement | null) => void;
873
+ listenScope: (listeners: Listeners) => () => void;
874
+ setSelectedShape: (newSelectedShape: SelectionType | undefined) => void;
875
+ addShapes: (newShapes: ShapeEntity[], index?: number) => void;
876
+ duplicateShapes: (shapesToDuplicate: ShapeEntity[], translate?: boolean, selectNewOnes?: boolean) => void;
877
+ refreshHoveredShape: (isOverCanvas: boolean, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
878
+ clearHover: () => void;
879
+ updateShapes: (updatedShapes: ShapeEntity[], withSave?: boolean, source?: ChangeSource) => void;
880
+ removeShapes: (shapesToRemove: ShapeEntity[], source?: ChangeSource) => void;
881
+ refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
882
+ setSelectionFrame: (selectionFrame: SelectionFrameState | undefined) => void;
883
+ setActiveTool: (tool: ToolsType) => void;
884
+ setSelectionMode: (selectionMode: SelectionModeData<Point | number>) => void;
885
+ showContextMenu: (menu: Omit<SelectionModeContextMenu<Point | number>, "mode">) => void;
886
+ setHoverMode: (hoverMode: HoverModeData) => void;
887
+ setPanStart: (panStart: PanStart | undefined) => void;
888
+ setMoveAcceleration: (moveAcceleration: Point) => void;
889
+ setModifiers: (patch: Partial<Modifiers>) => void;
890
+ setCanvasSize: (canvasSize: CanvasSize) => void;
891
+ setTransformation: (transformation: CanvasTransformation) => void;
892
+ getViewBounds: (state?: InternalState) => ViewBounds;
893
+ zoomBy: (delta: number, centerPoint: Point) => void;
894
+ scrollBy: ([pixelX, pixelY]: Point) => boolean;
895
+ applyMoveAcceleration: (ratio?: number) => void;
896
+ };
897
+ export type PaintStore = ReturnType<typeof createPaintStore>;
898
+ export {};