Merge pull request #8087 from drywolf/master

[react-dnd] added types for collector functions (DragSource, DragTarget, DragLayer)
This commit is contained in:
Masahiro Wakame
2016-02-26 20:40:17 +09:00
+7 -3
View File
@@ -38,14 +38,14 @@ declare module __ReactDnd {
export function DragSource<P>(
type: Identifier | ((props: P) => Identifier),
spec: DragSourceSpec<P>,
collect: (connect: DragSourceConnector, monitor: DragSourceMonitor) => Object,
collect: DragSourceCollector,
options?: DndOptions<P>
): (componentClass: React.ComponentClass<P>) => DndComponentClass<P>;
export function DropTarget<P>(
types: Identifier | Identifier[] | ((props: P) => Identifier | Identifier[]),
spec: DropTargetSpec<P>,
collect: (connect: DropTargetConnector, monitor: DropTargetMonitor) => Object,
collect: DropTargetCollector,
options?: DndOptions<P>
): (componentClass: React.ComponentClass<P>) => DndComponentClass<P>;
@@ -54,10 +54,14 @@ declare module __ReactDnd {
): (componentClass: React.ComponentClass<P>) => ContextComponentClass<P>;
export function DragLayer<P>(
collect: (monitor: DragLayerMonitor) => Object,
collect: DragLayerCollector,
options?: DndOptions<P>
): (componentClass: React.ComponentClass<P>) => DndComponentClass<P>;
type DragSourceCollector = (connect: DragSourceConnector, monitor: DragSourceMonitor) => Object;
type DropTargetCollector = (connect: DropTargetConnector, monitor: DropTargetMonitor) => Object;
type DragLayerCollector = (monitor: DragLayerMonitor) => Object;
// Shared
// ----------------------------------------------------------------------