Ver código fonte

move the excalidraw props to correct file and typo fix (#1907)

Aakansha Doshi 5 anos atrás
pai
commit
953cd5563c
4 arquivos alterados com 10 adições e 11 exclusões
  1. 4 5
      src/components/App.tsx
  2. 0 5
      src/element/types.ts
  3. 1 1
      src/time_constants.ts
  4. 5 0
      src/types.ts

+ 4 - 5
src/components/App.tsx

@@ -55,10 +55,9 @@ import {
 import Portal from "./Portal";
 
 import { renderScene } from "../renderer";
-import { AppState, GestureEvent, Gesture } from "../types";
+import { AppState, GestureEvent, Gesture, ExcalidrawProps } from "../types";
 import {
   ExcalidrawElement,
-  ExcalidrawProps,
   ExcalidrawTextElement,
   NonDeleted,
   ExcalidrawGenericElement,
@@ -126,7 +125,7 @@ import {
   LOCAL_STORAGE_KEY_COLLAB_FORCE_FLAG,
 } from "../constants";
 import {
-  INITAL_SCENE_UPDATE_TIMEOUT,
+  INITIAL_SCENE_UPDATE_TIMEOUT,
   TAP_TWICE_TIMEOUT,
   SYNC_FULL_SCENE_INTERVAL_MS,
   TOUCH_CTX_MENU_TIMEOUT,
@@ -247,7 +246,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
     height: window.innerHeight,
   };
 
-  constructor(props: any) {
+  constructor(props: ExcalidrawProps) {
     super(props);
     const defaultAppState = getDefaultAppState();
 
@@ -1035,7 +1034,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
       //  initial SCENE_UPDATE message
       const initializationTimer = setTimeout(
         initialize,
-        INITAL_SCENE_UPDATE_TIMEOUT,
+        INITIAL_SCENE_UPDATE_TIMEOUT,
       );
 
       const updateScene = (

+ 0 - 5
src/element/types.ts

@@ -77,8 +77,3 @@ export type VerticalAlign = "top" | "middle";
 
 export type FontFamily = keyof typeof FONT_FAMILY;
 export type FontString = string & { _brand: "fontString" };
-
-export interface ExcalidrawProps {
-  width: number;
-  height: number;
-}

+ 1 - 1
src/time_constants.ts

@@ -1,5 +1,5 @@
 // time in milliseconds
 export const TAP_TWICE_TIMEOUT = 300;
-export const INITAL_SCENE_UPDATE_TIMEOUT = 5000;
+export const INITIAL_SCENE_UPDATE_TIMEOUT = 5000;
 export const SYNC_FULL_SCENE_INTERVAL_MS = 20000;
 export const TOUCH_CTX_MENU_TIMEOUT = 500;

+ 5 - 0
src/types.ts

@@ -107,3 +107,8 @@ export type SocketUpdateData = SocketUpdateDataSource[keyof SocketUpdateDataSour
 };
 
 export type LibraryItems = readonly NonDeleted<ExcalidrawElement>[][];
+
+export interface ExcalidrawProps {
+  width: number;
+  height: number;
+}