beizhedenglong / reactablejs

A react high-order component for interact.js(drag and drop, resizing and multi-touch gestures).
https://beizhedenglong.github.io/reactablejs/
MIT License
64 stars 8 forks source link

fix import location for DraggableOptions, DropzoneOptions, ResizableOptions #13

Open thijs-qv opened 1 year ago

thijs-qv commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch reactablejs@0.3.0 for the project I'm working on.

The imports for DraggableOptions, DropzoneOptions, ResizableOptions could not be resolved.

Here is the diff that solved my problem:

diff --git a/node_modules/reactablejs/dist/src/index.d.ts b/node_modules/reactablejs/dist/src/index.d.ts
index 4645aea..bd8f173 100644
--- a/node_modules/reactablejs/dist/src/index.d.ts
+++ b/node_modules/reactablejs/dist/src/index.d.ts
@@ -1,12 +1,15 @@
+import { DraggableOptions } from '@interactjs/actions/drag/plugin';
+import { DropzoneOptions } from '@interactjs/actions/drop/plugin';
+import { ResizableOptions } from '@interactjs/actions/resize/plugin';
 import * as React from 'react';
 export interface InjectedProps {
     getRef: React.Ref<string> | React.LegacyRef<string>;
 }
 export interface InteractProps {
-    draggable?: Interact.DraggableOptions | boolean;
-    resizable?: Interact.ResizableOptions | boolean;
-    gesturable?: Interact.ResizableOptions | boolean;
-    dropzone?: Interact.DropzoneOptions | boolean;
+    draggable?: DraggableOptions | boolean;
+    resizable?: ResizableOptions | boolean;
+    gesturable?: ResizableOptions | boolean;
+    dropzone?: DropzoneOptions | boolean;
     onDragStart?: Interact.ListenersArg;
     onDragMove?: Interact.ListenersArg;
     onDragEnd?: Interact.ListenersArg;

This issue body was partially generated by patch-package.

beizhedenglong commented 1 year ago

Can you try install the previous version of interactjs? I think that would fix this issue. or would you mind taking a look this issue? This issue might be caused by TS types locations changes of interactjs

thijs-qv commented 1 year ago

Yeah, the type locations probably changed, that's why I included the diff that fixes it