minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeModel's passed type argument doesn't evaluate correctly

abrman opened this issue · comments

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

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 }>;

I wasn't aware of that! Thank you!