From a5d829f61d26a765f868a01c9672e21b036dd6ee Mon Sep 17 00:00:00 2001 From: Chris Combe <24692334+ccombe@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:18:01 +1100 Subject: [PATCH] Mark the remaining type-only imports as types These symbols are only used as types: NodeApi in create-list, RootState in context, TreeProps in initial state, DragItem in the drag and drop hooks, and OpenMap plus the handlers and renderers namespaces in tree props. Co-authored-by: Cursor --- modules/react-arborist/src/context.ts | 2 +- modules/react-arborist/src/data/create-list.ts | 2 +- modules/react-arborist/src/dnd/drag-hook.ts | 2 +- modules/react-arborist/src/dnd/drop-hook.ts | 2 +- modules/react-arborist/src/dnd/outer-drop-hook.ts | 2 +- modules/react-arborist/src/state/initial.ts | 2 +- modules/react-arborist/src/types/tree-props.ts | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/react-arborist/src/context.ts b/modules/react-arborist/src/context.ts index 3b43a56..a0a8b18 100644 --- a/modules/react-arborist/src/context.ts +++ b/modules/react-arborist/src/context.ts @@ -1,6 +1,6 @@ import React, { createContext, useContext } from "react"; import type { TreeApi } from "./interfaces/tree-api.js"; -import { RootState } from "./state/root-reducer.js"; +import type { RootState } from "./state/root-reducer.js"; export const TreeApiContext = createContext | null>(null); diff --git a/modules/react-arborist/src/data/create-list.ts b/modules/react-arborist/src/data/create-list.ts index 131cb09..5b5a441 100644 --- a/modules/react-arborist/src/data/create-list.ts +++ b/modules/react-arborist/src/data/create-list.ts @@ -1,4 +1,4 @@ -import { NodeApi } from "../interfaces/node-api.js"; +import type { NodeApi } from "../interfaces/node-api.js"; import type { TreeApi } from "../interfaces/tree-api.js"; export type ListResult = { diff --git a/modules/react-arborist/src/dnd/drag-hook.ts b/modules/react-arborist/src/dnd/drag-hook.ts index 2e3f0c3..82eb8bb 100644 --- a/modules/react-arborist/src/dnd/drag-hook.ts +++ b/modules/react-arborist/src/dnd/drag-hook.ts @@ -3,7 +3,7 @@ import { ConnectDragSource, useDrag } from "react-dnd"; import { getEmptyImage } from "react-dnd-html5-backend"; import { useTreeApi } from "../context.js"; import { NodeApi } from "../interfaces/node-api.js"; -import { DragItem } from "../types/dnd.js"; +import type { DragItem } from "../types/dnd.js"; import { TreeProps } from "../types/tree-props.js"; import { DropResult } from "./drop-hook.js"; import { actions as dnd } from "../state/dnd-slice.js"; diff --git a/modules/react-arborist/src/dnd/drop-hook.ts b/modules/react-arborist/src/dnd/drop-hook.ts index 9e04b06..c477cfb 100644 --- a/modules/react-arborist/src/dnd/drop-hook.ts +++ b/modules/react-arborist/src/dnd/drop-hook.ts @@ -2,7 +2,7 @@ import { RefObject } from "react"; import { ConnectDropTarget, useDrop } from "react-dnd"; import { useTreeApi } from "../context.js"; import type { NodeApi } from "../interfaces/node-api.js"; -import { DragItem } from "../types/dnd.js"; +import type { DragItem } from "../types/dnd.js"; import { computeDrop } from "./compute-drop.js"; export type DropResult = { diff --git a/modules/react-arborist/src/dnd/outer-drop-hook.ts b/modules/react-arborist/src/dnd/outer-drop-hook.ts index 1cf3bf8..f2aeb0e 100644 --- a/modules/react-arborist/src/dnd/outer-drop-hook.ts +++ b/modules/react-arborist/src/dnd/outer-drop-hook.ts @@ -1,6 +1,6 @@ import { useDrop } from "react-dnd"; import { useTreeApi } from "../context.js"; -import { DragItem } from "../types/dnd.js"; +import type { DragItem } from "../types/dnd.js"; import { computeDrop } from "./compute-drop.js"; import { DropResult } from "./drop-hook.js"; diff --git a/modules/react-arborist/src/state/initial.ts b/modules/react-arborist/src/state/initial.ts index 3d758fc..055198c 100644 --- a/modules/react-arborist/src/state/initial.ts +++ b/modules/react-arborist/src/state/initial.ts @@ -1,4 +1,4 @@ -import { TreeProps } from "../types/tree-props.js"; +import type { TreeProps } from "../types/tree-props.js"; import type { RootState } from "./root-reducer.js"; import { initialDndState } from "./dnd-slice.js"; import { initialDragState } from "./drag-slice.js"; diff --git a/modules/react-arborist/src/types/tree-props.ts b/modules/react-arborist/src/types/tree-props.ts index c3d042a..0eef22f 100644 --- a/modules/react-arborist/src/types/tree-props.ts +++ b/modules/react-arborist/src/types/tree-props.ts @@ -1,11 +1,11 @@ import { BoolFunc } from "./utils.js"; -import * as handlers from "./handlers.js"; -import * as renderers from "./renderers.js"; +import type * as handlers from "./handlers.js"; +import type * as renderers from "./renderers.js"; import { ElementType, MouseEventHandler } from "react"; import { ListOnScrollProps, CommonProps as ReactWindowCommonProps } from "react-window"; import type { NodeApi } from "../interfaces/node-api.js"; -import { OpenMap } from "../state/open-slice.js"; -import { useDragDropManager, DndProviderProps } from "react-dnd"; +import type { OpenMap } from "../state/open-slice.js"; +import { useDragDropManager, type DndProviderProps } from "react-dnd"; /** Returns the height in pixels for a given node's row. */ export type RowHeightAccessor = (node: NodeApi) => number;