mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 08:58:58 +01:00
chore(react/type_widget): add missing interface
This commit is contained in:
parent
206618fd54
commit
adea3abff4
@ -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 one
|
||||
const libraryItems = await api.updateLibrary({
|
||||
libraryItems() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user