mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Fix react-dnd HTML5 Backend
The type signatures previously did not match the JavaScript definition for this module.
This commit is contained in:
@@ -13,7 +13,7 @@ import DragSource = ReactDnd.DragSource;
|
||||
import DropTarget = ReactDnd.DropTarget;
|
||||
import DragLayer = ReactDnd.DragLayer;
|
||||
import DragDropContext = ReactDnd.DragDropContext;
|
||||
import HTML5Backend = require('react-dnd/modules/backends/HTML5');
|
||||
import HTML5Backend, { getEmptyImage } from 'react-dnd/modules/backends/HTML5';
|
||||
import TestBackend = require('react-dnd/modules/backends/Test');
|
||||
|
||||
// Game Component
|
||||
@@ -82,11 +82,11 @@ module Knight {
|
||||
|
||||
export class Knight extends React.Component<KnightP, {}> {
|
||||
static defaultProps: KnightP;
|
||||
|
||||
|
||||
static create = React.createFactory(Knight);
|
||||
|
||||
componentDidMount() {
|
||||
var img = HTML5Backend.getEmptyImage();
|
||||
var img = getEmptyImage();
|
||||
img.onload = () => this.props.connectDragPreview(img);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ module BoardSquare {
|
||||
|
||||
export class BoardSquare extends React.Component<BoardSquareP, {}> {
|
||||
static defaultProps: BoardSquareP;
|
||||
|
||||
|
||||
private _renderOverlay = (color: string) => {
|
||||
return r.div({
|
||||
style: {
|
||||
|
||||
Vendored
+3
-7
@@ -176,13 +176,9 @@ declare module "react-dnd" {
|
||||
}
|
||||
|
||||
declare module "react-dnd/modules/backends/HTML5" {
|
||||
enum _NativeTypes { FILE, URL, TEXT }
|
||||
class HTML5Backend implements __ReactDnd.Backend {
|
||||
static getEmptyImage(): any; // Image
|
||||
static NativeTypes: _NativeTypes;
|
||||
}
|
||||
|
||||
export = HTML5Backend;
|
||||
export enum NativeTypes { FILE, URL, TEXT }
|
||||
export function getEmptyImage(): any; // Image
|
||||
export default class HTML5Backend implements __ReactDnd.Backend {}
|
||||
}
|
||||
|
||||
declare module "react-dnd/modules/backends/Test" {
|
||||
|
||||
Reference in New Issue
Block a user