excalidraw/src/scene/types.ts
Kostas Bariotis 67805bc7a7
Add collaborators names (#1223)
* add random usernames

* add username state

* add username input

* ability to set names

* fix tests

* set username oon mobile

* remove auto generated names

* remove commented code

* always string

* updaate snapshots

* maintain username when clearing canvas

* Update src/renderer/renderScene.ts

Co-Authored-By: Lipis <lipiridis@gmail.com>

* add border

* fix styles

Co-authored-by: Pete Hunt <petehunt@users.noreply.github.com>
Co-authored-by: Faustino Kialungila <faustino.kialungila@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-07 14:02:42 +01:00

47 lines
1.0 KiB
TypeScript

import { ExcalidrawTextElement } from "../element/types";
import { FlooredNumber } from "../types";
export type SceneState = {
scrollX: FlooredNumber;
scrollY: FlooredNumber;
// null indicates transparent bg
viewBackgroundColor: string | null;
zoom: number;
shouldCacheIgnoreZoom: boolean;
remotePointerViewportCoords: { [id: string]: { x: number; y: number } };
remotePointerButton?: { [id: string]: string | undefined };
remoteSelectedElementIds: { [elementId: string]: string[] };
remotePointerUsernames: { [id: string]: string };
};
export type SceneScroll = {
scrollX: FlooredNumber;
scrollY: FlooredNumber;
};
export interface Scene {
elements: ExcalidrawTextElement[];
}
export type ExportType =
| "png"
| "clipboard"
| "clipboard-svg"
| "backend"
| "svg";
export type ScrollBars = {
horizontal: {
x: number;
y: number;
width: number;
height: number;
} | null;
vertical: {
x: number;
y: number;
width: number;
height: number;
} | null;
};