Typescript

This commit is contained in:
Mitchell McCaffrey
2021-07-16 18:59:29 +10:00
parent 2ce9d2dd08
commit a1fb67df7b
22 changed files with 314 additions and 203 deletions
+12 -2
View File
@@ -1,4 +1,4 @@
import { useContext } from "react";
import React, { useContext } from "react";
import {
InteractionEmitterContext,
@@ -45,10 +45,20 @@ import {
} from "../contexts/GridContext";
import DatabaseContext, { useDatabase } from "../contexts/DatabaseContext";
type StageRender = (wrapped: React.ReactNode) => React.ReactElement;
type KonvaBridgeProps = {
stageRender: StageRender;
children: React.ReactNode;
};
/**
* Provide a bridge for konva that forwards our contexts
*/
function KonvaBridge({ stageRender, children }: { stageRender: any, children: any}) {
function KonvaBridge({
stageRender,
children,
}: KonvaBridgeProps): React.ReactElement {
const mapStageRef = useMapStage();
const userId = useUserId();
const settings = useSettings();
+1
View File
@@ -350,6 +350,7 @@ export function gridDistance(
);
}
}
return 0;
}
/**