Skip to content

dnd.d.ts doesn't have 'Position' and 'FluidDragActions' exported #509

@alekseykarpenko

Description

@alekseykarpenko

First of all, thanks for forking/maintaining this beautiful library! 💪

It's been a while since I use it in my project. Recently I've needed to switch from react-beautiful-dnd (v13.0.0) to @hello-pangea/dnd (v16.2.0) due to upgrading to react v18. As soon as my project is written with typescript, I'm now facing some typing/import issues.

Expected behavior

I have SensorAPI widely used with typescript, so I've used to import FluidDragActions and Position directly from react-beautiful-dnd, as described in original documentation:
https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/sensors/sensor-api.md#controlling-a-drag-pre-drag-predragaction
So I was expecting to simply switch my import from this:

import {FluidDragActions, Position, SensorAPI} from "react-beautiful-dnd"

to this:

import {FluidDragActions, Position, SensorAPI} from "@hello-pangea/dnd"

Actual behavior

I have this issues while building the project, as some types are not exported anymore, while SensorAPI is still good:

TS2459: Module '"@hello-pangea/dnd"' declares 'FluidDragActions' locally, but it is not exported.
TS2459: Module '"@hello-pangea/dnd"' declares 'Position' locally, but it is not exported.

I couldn't find any mentions of changing imports in forked documentation:
https://github.com/hello-pangea/dnd/blob/main/docs/sensors/sensor-api.md#controlling-a-drag-pre-drag-predragaction

Steps to reproduce

Obviously: try to import some types needed for sensors, as described in documentation

Suggested solution?

I'm not familiar with building typings for npm, but I could guess there might be some issue with generating declarations here:

output: [{ file: 'dist/dnd.d.ts', format: 'es' }],

or with exporting types here:
export interface FluidDragActions extends DragActions {

What version of React are you using?

v18.2.0

What version of @hello-pangea/dnd are you running?

v16.2.0

Metadata

Metadata

Assignees

Labels

typesNeed an update to types

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions