Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(react/type_widget): add missing interface
Elian Doranadea3abff49e
diff --git a/apps/client/src/widgets/type_widgets/Canvas.tsx b/apps/client/src/widgets/type_widgets/Canvas.tsxindex c245164551..1cf83cb53a 100644--- a/apps/client/src/widgets/type_widgets/Canvas.tsx+++ b/apps/client/src/widgets/type_widgets/Canvas.tsx@@ -9,8 +9,7 @@ import "./Canvas.css";import FNote from "../../entities/fnote";import { RefObject } from "preact";import server from "../../services/server";-import { NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types";-import { CanvasContent } from "../type_widgets_old/canvas_el";+import { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types";import { goToLinkExt } from "../../services/link";// currently required by excalidraw, in order to allows self-hosting fonts locally.@@ -22,6 +21,12 @@ interface AttachmentMetadata {attachmentId: string;}+interface CanvasContent {+ elements: ExcalidrawElement[];+ files: BinaryFileData[];+ appState: Partial<AppState>;+}+export default function Canvas({ note }: TypeWidgetProps) {const apiRef = useRef<ExcalidrawImperativeAPI>(null);const isReadOnly = options.is("databaseReadonly");@@ -141,9 +146,8 @@ function usePersistence(note: FNote, apiRef: RefObject<ExcalidrawImperativeAPI>,const { content, svg } = await getData(api);const attachments = [{ role: "image", title: "canvas-export.svg", mime: "image/svg+xml", content: svg, position: 0 }];+ // libraryChanged is unset in dataSaved()if (libraryChanged.current) {- // this.libraryChanged is unset in dataSaved()-// there's no separate method to get library items, so have to abuse this oneconst libraryItems = await api.updateLibrary({libraryItems() {