File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/renderer/extensions/vueNodes/composables Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ import { ref } from 'vue'
3
3
4
4
import type { TransformState } from '@/renderer/core/layout/injectionKeys'
5
5
6
+ interface Size {
7
+ width : number
8
+ height : number
9
+ }
10
+
11
+ interface Position {
12
+ x : number
13
+ y : number
14
+ }
15
+
6
16
interface UseNodeResizeOptions {
7
17
/** Transform state for coordinate conversion */
8
18
transformState : TransformState
@@ -15,18 +25,15 @@ interface UseNodeResizeOptions {
15
25
* Handles pointer capture, coordinate calculations, and size constraints.
16
26
*/
17
27
export function useNodeResize (
18
- resizeCallback : (
19
- size : { width : number ; height : number } ,
20
- element : HTMLElement
21
- ) => void ,
28
+ resizeCallback : ( size : Size , element : HTMLElement ) => void ,
22
29
options : UseNodeResizeOptions
23
30
) {
24
31
const { transformState } = options
25
32
26
33
const isResizing = ref ( false )
27
- const resizeStartPos = ref < { x : number ; y : number } | null > ( null )
28
- const resizeStartSize = ref < { width : number ; height : number } | null > ( null )
29
- const intrinsicMinSize = ref < { width : number ; height : number } | null > ( null )
34
+ const resizeStartPos = ref < Position | null > ( null )
35
+ const resizeStartSize = ref < Size | null > ( null )
36
+ const intrinsicMinSize = ref < Size | null > ( null )
30
37
31
38
const startResize = ( event : PointerEvent ) => {
32
39
event . preventDefault ( )
You can’t perform that action at this time.
0 commit comments