mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Fix react-dnd HTML5 Backend
The type signatures previously did not match the JavaScript definition for this module.
This commit is contained in:
parent
66f88ec518
commit
31b6fe5575
@ -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: {
|
||||
|
||||
10
react-dnd/react-dnd.d.ts
vendored
10
react-dnd/react-dnd.d.ts
vendored
@ -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" {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user