minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.
MIT License
519 stars 69 forks source link

NodeModel's passed type argument doesn't evaluate correctly #174

Closed abrman closed 1 year ago

abrman commented 1 year ago

Describe the bug NodeModel's passed type argument doesn't evaluate correctly

To Reproduce Create a .d.ts file and set its' content to be

type NodeModel = import("@minoru/react-dnd-treeview").NodeModel;

type CustomNode = NodeModel<{
  test: boolean;
}>;

Expected behavior CustomNode should have a type declaration other than any

Screenshots image

minop1205 commented 1 year ago

I think the reason is that the NodeModel declared on line 14 is no longer generics. If you write the following, you should get the intended type.

type NodeModel = import("@minoru/react-dnd-treeview").NodeModel<{ test: boolean }>;
abrman commented 1 year ago

I wasn't aware of that! Thank you!