refactor: DRY out tool typing (#7086)

This commit is contained in:
David Luzar 2023-10-04 23:39:00 +02:00 committed by GitHub
parent fa33aa08ab
commit e6f74350ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 42 deletions

View file

@ -211,7 +211,7 @@ import {
import Scene from "../scene/Scene";
import { RenderInteractiveSceneCallback, ScrollBars } from "../scene/types";
import { getStateForZoom } from "../scene/zoom";
import { findShapeByKey, SHAPES } from "../shapes";
import { findShapeByKey } from "../shapes";
import {
AppClassProperties,
AppProps,
@ -230,6 +230,7 @@ import {
SidebarName,
SidebarTabName,
KeyboardModifiersObject,
ToolType,
} from "../types";
import {
debounce,
@ -3113,12 +3114,7 @@ class App extends React.Component<AppProps, AppState> {
setActiveTool = (
tool:
| {
type:
| typeof SHAPES[number]["value"]
| "eraser"
| "hand"
| "frame"
| "embeddable";
type: ToolType;
}
| { type: "custom"; customType: string },
) => {