Move utility types in common

This commit is contained in:
Marcel Mraz 2025-03-18 19:43:21 +01:00
parent 0a7e9c51d6
commit e1ea33836e
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
46 changed files with 76 additions and 50 deletions

View file

@ -11,6 +11,8 @@ import { clearElementsForExport } from "@excalidraw/element";
import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
import type { ValueOf } from "@excalidraw/common/utility-types";
import { cleanAppStateForExport } from "../appState";
import { CanvasError, ImageSceneDataError } from "../errors";
@ -25,7 +27,6 @@ import { restore, restoreLibraryItems } from "./restore";
import type { FileSystemHandle } from "./filesystem";
import type { AppState, DataURL, LibraryItem } from "../types";
import type { ValueOf } from "../utility-types";
import type { ImportedLibraryData } from "./types";
const parseFileContents = async (blob: Blob | File): Promise<string> => {

View file

@ -21,6 +21,8 @@ import { getCommonBoundingBox } from "@excalidraw/element/bounds";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { MaybePromise } from "@excalidraw/common/utility-types";
import { atom, editorJotaiStore } from "../editor-jotai";
import { Emitter } from "../emitter";
@ -41,7 +43,6 @@ import type {
LibraryItemsSource,
LibraryItems_anyVersion,
} from "../types";
import type { MaybePromise } from "../utility-types";
/**
* format: hostname or hostname/pathname

View file

@ -10,8 +10,9 @@ import {
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
import type { MakeBrand } from "@excalidraw/common/utility-types";
import type { AppState } from "../types";
import type { MakeBrand } from "../utility-types";
export type ReconciledExcalidrawElement = OrderedExcalidrawElement &
MakeBrand<"ReconciledElement">;

View file

@ -61,6 +61,8 @@ import type {
StrokeRoundness,
} from "@excalidraw/element/types";
import type { MarkOptional, Mutable } from "@excalidraw/common/utility-types";
import { getDefaultAppState } from "../appState";
import { getLineHeight } from "../fonts/FontMetadata";
@ -71,7 +73,6 @@ import {
} from "../scene";
import type { AppState, BinaryFiles, LibraryItem } from "../types";
import type { MarkOptional, Mutable } from "../utility-types";
import type { ImportedDataState, LegacyAppState } from "./types";
type RestoredAppState = Omit<

View file

@ -59,9 +59,9 @@ import type {
VerticalAlign,
} from "@excalidraw/element/types";
import { getLineHeight } from "../fonts/FontMetadata";
import type { MarkOptional } from "@excalidraw/common/utility-types";
import type { MarkOptional } from "../utility-types";
import { getLineHeight } from "../fonts/FontMetadata";
export type ValidLinearElement = {
type: "arrow" | "line";