-
Notifications
You must be signed in to change notification settings - Fork 1
/
react-beautiful-dnd.d.ts
108 lines (88 loc) · 2.87 KB
/
react-beautiful-dnd.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
declare module 'react-beautiful-dnd' {
import * as React from 'react';
export interface DragDropContextProps {
onDragEnd: (result: DropResult) => void;
onDragStart?: (initial: DragStart) => void;
onDragUpdate?: (initial: DragUpdate) => void;
children: React.ReactNode;
}
export class DragDropContext extends React.Component<DragDropContextProps> {}
export interface DroppableProps {
droppableId: string;
type?: string;
direction?: 'horizontal' | 'vertical';
isDropDisabled?: boolean;
isCombineEnabled?: boolean;
ignoreContainerClipping?: boolean;
renderClone?: DraggableChildrenFn;
getContainerForClone?: () => HTMLElement;
children: (provided: DroppableProvided, snapshot: DroppableStateSnapshot) => React.ReactNode;
}
export class Droppable extends React.Component<DroppableProps> {}
export interface DraggableProps {
draggableId: string;
index: number;
isDragDisabled?: boolean;
disableInteractiveElementBlocking?: boolean;
children: (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => React.ReactNode;
}
export class Draggable extends React.Component<DraggableProps> {}
export interface DragStart {
draggableId: string;
type: string;
source: DraggableLocation;
mode: MovementMode;
}
export interface DragUpdate extends DragStart {
destination?: DraggableLocation;
combine?: Combine;
}
export interface DropResult extends DragUpdate {
reason: DropReason;
}
export type MovementMode = 'FLUID' | 'SNAP';
export interface DraggableLocation {
droppableId: string;
index: number;
}
export interface DraggableProvided {
innerRef: (element?: HTMLElement | null) => any;
draggableProps: any;
dragHandleProps: any;
}
export interface DraggableStateSnapshot {
isDragging: boolean;
isDropAnimating: boolean;
draggingOver: string | null;
dropAnimation?: DropAnimation;
mode: MovementMode;
combineTargetFor: string | null;
combineWith: string | null;
}
export interface DroppableProvided {
innerRef: (element?: HTMLElement | null) => any;
droppableProps: any;
placeholder: React.ReactElement | null;
}
export interface DroppableStateSnapshot {
isDraggingOver: boolean;
draggingOverWith: string | null;
isUsingPlaceholder: boolean;
}
export interface DropAnimation {
duration: number;
curve: string;
moveTo: Position;
opacity?: number;
scale?: number;
}
export interface Position {
x: number;
y: number;
}
export interface Combine {
draggableId: string;
droppableId: string;
}
export type DropReason = 'DROP' | 'CANCEL';
}