excalidraw / excalidraw-desktop

An Electron wrapper for Excalidraw (Deprecated)

Home Page:https://excalidraw.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Establish communication with the client from Electron

lipis opened this issue · comments

commented

For example we need a special case when exporting scenes via shareable URL

Here’s the event for receiving an opened file: https://www.electronjs.org/docs/api/app#event-open-file-macos.

I think we might want to export a global object from the main app like so:

globalThis.__EXCALIDRAW_API_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
  openFile(blob) { ... },
  onDragToExport(...) { ... }, // drag & drop the preview image out of the export window perhaps?
  onOpenInDesktop(data) { ... }, // maybe add a button in the web app that switches your current drawing to the desktop app?
  // etc
}