Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#54236 [react-beautiful-dnd] Update types t…
Browse files Browse the repository at this point in the history
…o 13.1. Adds default sensor exports. by @brianspowers

* Update react-beautiful-dnd types to 13.1

* Updated author list.

Co-authored-by: Brian Powers <bpowers@dmsi.com>
  • Loading branch information
brianspowers and brianspowers authored Jul 2, 2021
1 parent a71a3b0 commit 99c0cd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types/react-beautiful-dnd/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for react-beautiful-dnd 13.0
// Type definitions for react-beautiful-dnd 13.1
// Project: https://github.com/atlassian/react-beautiful-dnd
// Definitions by: varHarrie <https://github.com/varHarrie>
// Bradley Ayers <https://github.com/bradleyayers>
Expand All @@ -9,6 +9,7 @@
// Kanitkorn Sujautra <https://github.com/lukyth>
// Arun George <https://github.com/aruniverse>
// Nick Garlis <https://github.com/nickgarlis>
// Brian Powers <https://github.com/brianspowers>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Refer to https://github.com/atlassian/react-beautiful-dnd/blob/master/src/types.js
Expand Down Expand Up @@ -692,3 +693,7 @@ export interface DraggableProps {
export class Draggable extends React.Component<DraggableProps> { }

export function resetServerContext(): void;

export const useMouseSensor: Sensor;
export const useTouchSensor: Sensor;
export const useKeyboardSensor: Sensor;
5 changes: 5 additions & 0 deletions types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
DropResult,
resetServerContext,
ResponderProvided,
useKeyboardSensor,
useMouseSensor,
useTouchSensor,
} from 'react-beautiful-dnd';
import * as ReactDOM from 'react-dom';

Expand Down Expand Up @@ -94,6 +97,8 @@ class App extends React.Component<{}, AppState> {
onDragUpdate={this.onDragUpdate}
onDragEnd={this.onDragEnd}
dragHandleUsageInstructions="Some instruction"
enableDefaultSensors={false}
sensors={[useMouseSensor, useKeyboardSensor, useTouchSensor]}
>
<Droppable droppableId="droppable" ignoreContainerClipping={false} isCombineEnabled={true}>
{(provided, snapshot) => (
Expand Down

0 comments on commit 99c0cd7

Please sign in to comment.