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

This commit is contained in:
Aakansha Doshi 2020-07-11 18:43:20 +05:30 committed by GitHub
parent 0ee2c15929
commit 953cd5563c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// time in milliseconds // time in milliseconds
export const TAP_TWICE_TIMEOUT = 300; 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 SYNC_FULL_SCENE_INTERVAL_MS = 20000;
export const TOUCH_CTX_MENU_TIMEOUT = 500; export const TOUCH_CTX_MENU_TIMEOUT = 500;

View File

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