2020-01-06 19:34:22 +04:00
|
|
|
import { newElement } from "./newElement";
|
|
|
|
|
2020-03-08 10:20:55 -07:00
|
|
|
/**
|
|
|
|
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
|
|
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
|
|
* between peers and contain no state local to the peer.
|
|
|
|
*/
|
2020-03-09 22:34:50 -07:00
|
|
|
export type ExcalidrawElement = Readonly<ReturnType<typeof newElement>>;
|
|
|
|
|
2020-03-10 20:11:02 -07:00
|
|
|
export type ExcalidrawTextElement = ExcalidrawElement &
|
|
|
|
Readonly<{
|
|
|
|
type: "text";
|
|
|
|
font: string;
|
|
|
|
text: string;
|
|
|
|
// for backward compatibility
|
|
|
|
actualBoundingBoxAscent?: number;
|
|
|
|
baseline: number;
|
|
|
|
}>;
|
2020-03-09 22:34:50 -07:00
|
|
|
|
2020-02-21 14:34:18 -05:00
|
|
|
export type PointerType = "mouse" | "pen" | "touch";
|