extract type

This commit is contained in:
Bruno Windels 2020-07-10 18:31:53 +02:00
parent 725b7f8950
commit 49f7170d95

View file

@ -86,6 +86,12 @@ interface IProps {
// TODO: Account for https://github.com/vector-im/riot-web/issues/14179 // TODO: Account for https://github.com/vector-im/riot-web/issues/14179
} }
// TODO: Use re-resizer's NumberSize when it is exposed as the type
interface ResizeDelta {
width: number,
height: number,
}
type PartialDOMRect = Pick<DOMRect, "left" | "top" | "height">; type PartialDOMRect = Pick<DOMRect, "left" | "top" | "height">;
interface IState { interface IState {
@ -161,7 +167,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
e: MouseEvent | TouchEvent, e: MouseEvent | TouchEvent,
travelDirection: Direction, travelDirection: Direction,
refToElement: HTMLDivElement, refToElement: HTMLDivElement,
delta: { width: number, height: number }, // TODO: Use re-resizer's NumberSize when it is exposed as the type delta: ResizeDelta,
) => { ) => {
// Do some sanity checks, but in reality we shouldn't need these. // Do some sanity checks, but in reality we shouldn't need these.
if (travelDirection !== "bottom") return; if (travelDirection !== "bottom") return;