mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
remove closures from mutateElement, get rid of the element spreading (#902)
This commit is contained in:
parent
13b838117c
commit
83a2f5de28
10 changed files with 218 additions and 196 deletions
|
@ -6,17 +6,15 @@ import { newElement } from "./newElement";
|
|||
* between peers and contain no state local to the peer.
|
||||
*/
|
||||
export type ExcalidrawElement = Readonly<ReturnType<typeof newElement>>;
|
||||
export type MutableExcalidrawElement = ReturnType<typeof newElement>;
|
||||
|
||||
export type MutableExcalidrawTextElement = MutableExcalidrawElement & {
|
||||
type: "text";
|
||||
font: string;
|
||||
text: string;
|
||||
// for backward compatibility
|
||||
actualBoundingBoxAscent?: number;
|
||||
baseline: number;
|
||||
};
|
||||
|
||||
export type ExcalidrawTextElement = Readonly<MutableExcalidrawTextElement>;
|
||||
export type ExcalidrawTextElement = ExcalidrawElement &
|
||||
Readonly<{
|
||||
type: "text";
|
||||
font: string;
|
||||
text: string;
|
||||
// for backward compatibility
|
||||
actualBoundingBoxAscent?: number;
|
||||
baseline: number;
|
||||
}>;
|
||||
|
||||
export type PointerType = "mouse" | "pen" | "touch";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue