The event system is the primary communication mechanism between runtime services, plugins, and UI components. Almost every class in the API package extends EventDispatcher.
Component.registerEvent(ref) tracks event subscriptions and automatically unsubscribes them when the component is unloaded. This prevents memory leaks in views and plugins.
// In a Plugin or View:
this.registerEvent(
app.vault.on("modify", (file) => { ... })
);
// Automatically cleaned up on unload
A committed restorable layout mutation is persisted
layout-will-show-overlay
event: WorkspaceLayoutDropEvent
A renderer drop target is deciding whether to expose an overlay
layout-will-drop
event: WorkspaceLayoutDropEvent
A drag/drop layout mutation is about to commit; listeners may cancel
layout-did-drop
event: WorkspaceLayoutDropEvent
A drag/drop layout mutation committed successfully
layout-ready
—
Layout fully loaded
Current workspace renderer coverage actively emits layout-will-show-overlay, layout-will-drop, layout-did-drop, layout-change, and layout-ready. Workspace also exposes typed layout-drag-start and layout-drag-end helpers for future drag backends, but the current HTML5 renderer path does not yet emit those start/end events consistently.
Metadata cache events are intentionally low-level and per-file. Search indexing and other vault-wide derived-state owners may listen broadly, but view surfaces are expected to filter these events to the active file or directly affected reference neighborhood whenever they can do so safely.