feat: Export THEME from the package (#4055)

* Use Theme type everywhere
* Rename Appearance type to Theme for consistency
* Reorder headers in readme
The host don't need to pass hardcoded strings any more and instead can use the exported constant
This commit is contained in:
Aakansha Doshi 2021-10-14 14:15:57 +05:30 committed by GitHub
parent be2da9539e
commit 463857ad9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 582 additions and 559 deletions

View file

@ -10,6 +10,7 @@ import {
Arrowhead,
ChartType,
FontFamilyValues,
Theme,
} from "./element/types";
import { SHAPES } from "./shapes";
import { Point as RoughPoint } from "roughjs/bin/geometry";
@ -98,7 +99,7 @@ export type AppState = {
showHelpDialog: boolean;
toastMessage: string | null;
zenModeEnabled: boolean;
theme: "light" | "dark";
theme: Theme;
gridSize: number | null;
viewModeEnabled: boolean;
@ -192,7 +193,7 @@ export interface ExcalidrawProps {
zenModeEnabled?: boolean;
gridModeEnabled?: boolean;
libraryReturnUrl?: string;
theme?: "dark" | "light";
theme?: Theme;
name?: string;
renderCustomStats?: (
elements: readonly NonDeletedExcalidrawElement[],