mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
rename type
This commit is contained in:
parent
c83cc025df
commit
63dd599089
1 changed files with 4 additions and 4 deletions
|
@ -832,7 +832,7 @@ const CONVERTIBLE_LINEAR_TYPES: readonly ConvertibleLinearTypes[] = [
|
||||||
"elbowArrow",
|
"elbowArrow",
|
||||||
];
|
];
|
||||||
|
|
||||||
type NewElementType = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
type ConvertibleType = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
||||||
|
|
||||||
const isConvertibleGenericType = (
|
const isConvertibleGenericType = (
|
||||||
elementType: string,
|
elementType: string,
|
||||||
|
@ -861,7 +861,7 @@ export const convertElementType = <
|
||||||
>,
|
>,
|
||||||
>(
|
>(
|
||||||
element: TElement,
|
element: TElement,
|
||||||
newType: NewElementType,
|
newType: ConvertibleType,
|
||||||
app: AppClassProperties,
|
app: AppClassProperties,
|
||||||
): ExcalidrawElement => {
|
): ExcalidrawElement => {
|
||||||
if (!isValidConversion(element.type, newType)) {
|
if (!isValidConversion(element.type, newType)) {
|
||||||
|
@ -969,8 +969,8 @@ export const convertElementType = <
|
||||||
|
|
||||||
const isValidConversion = (
|
const isValidConversion = (
|
||||||
startType: string,
|
startType: string,
|
||||||
targetType: NewElementType,
|
targetType: ConvertibleType,
|
||||||
): startType is NewElementType => {
|
): startType is ConvertibleType => {
|
||||||
if (
|
if (
|
||||||
isConvertibleGenericType(startType) &&
|
isConvertibleGenericType(startType) &&
|
||||||
isConvertibleGenericType(targetType)
|
isConvertibleGenericType(targetType)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue