From 953cd5563caa3c0fb5a0b99db1e681582a02e2a5 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sat, 11 Jul 2020 18:43:20 +0530 Subject: [PATCH] move the excalidraw props to correct file and typo fix (#1907) --- src/components/App.tsx | 9 ++++----- src/element/types.ts | 5 ----- src/time_constants.ts | 2 +- src/types.ts | 5 +++++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index cce721cb..7f127c37 100644 --- a/src/components/App.tsx +++ b/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 { height: window.innerHeight, }; - constructor(props: any) { + constructor(props: ExcalidrawProps) { super(props); const defaultAppState = getDefaultAppState(); @@ -1035,7 +1034,7 @@ class App extends React.Component { // initial SCENE_UPDATE message const initializationTimer = setTimeout( initialize, - INITAL_SCENE_UPDATE_TIMEOUT, + INITIAL_SCENE_UPDATE_TIMEOUT, ); const updateScene = ( diff --git a/src/element/types.ts b/src/element/types.ts index ffba4b12..de5a9f3c 100644 --- a/src/element/types.ts +++ b/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; -} diff --git a/src/time_constants.ts b/src/time_constants.ts index 96400d61..27423b8f 100644 --- a/src/time_constants.ts +++ b/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; diff --git a/src/types.ts b/src/types.ts index f6c16a36..9dd59523 100644 --- a/src/types.ts +++ b/src/types.ts @@ -107,3 +107,8 @@ export type SocketUpdateData = SocketUpdateDataSource[keyof SocketUpdateDataSour }; export type LibraryItems = readonly NonDeleted[][]; + +export interface ExcalidrawProps { + width: number; + height: number; +}