appState.ts 621 B

123456789101112131415161718192021222324
  1. import { AppState } from "./types";
  2. import { getDateTime } from "./utils";
  3. const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
  4. export function getDefaultAppState(): AppState {
  5. return {
  6. draggingElement: null,
  7. resizingElement: null,
  8. editingElement: null,
  9. elementType: "selection",
  10. elementLocked: false,
  11. exportBackground: true,
  12. currentItemStrokeColor: "#000000",
  13. currentItemBackgroundColor: "transparent",
  14. currentItemFont: "20px Virgil",
  15. viewBackgroundColor: "#ffffff",
  16. scrollX: 0,
  17. scrollY: 0,
  18. cursorX: 0,
  19. cursorY: 0,
  20. name: DEFAULT_PROJECT_NAME
  21. };
  22. }