mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: DRY out tool typing (#7086)
This commit is contained in:
parent
fa33aa08ab
commit
e6f74350ac
3 changed files with 26 additions and 42 deletions
|
@ -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 },
|
||||
) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue