chore: Add missing typings in PanelResizer

This commit is contained in:
Johannes Schill 2019-01-30 15:32:29 +01:00
parent 1230f3e48d
commit ef4611eb56

View File

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { throttle } from 'lodash'; import { throttle } from 'lodash';
import Draggable from 'react-draggable'; import Draggable, { DraggableEventHandler } from 'react-draggable';
import { PanelModel } from '../panel_model'; import { PanelModel } from '../panel_model';
@ -42,7 +42,7 @@ export class PanelResizer extends PureComponent<Props, State> {
return 100; return 100;
} }
changeHeight = height => { changeHeight = (height: number) => {
const sh = this.smallestHeight; const sh = this.smallestHeight;
const lh = this.largestHeight; const lh = this.largestHeight;
height = height < sh ? sh : height; height = height < sh ? sh : height;
@ -54,7 +54,7 @@ export class PanelResizer extends PureComponent<Props, State> {
}); });
}; };
onDrag = (evt, data) => { onDrag: DraggableEventHandler = (evt, data) => {
const newHeight = this.state.editorHeight + data.y; const newHeight = this.state.editorHeight + data.y;
this.throttledChangeHeight(newHeight); this.throttledChangeHeight(newHeight);
this.throttledResizeDone(); this.throttledResizeDone();