Skip to content

CanvasPluginInstance

Unofficial

Plugin instance for the Canvas internal plugin, managing canvas indexing, data, and rename operations.

Import:

import type { CanvasPluginInstance } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface CanvasPluginInstance extends InternalPluginInstance<CanvasPlugin>

Extends: InternalPluginInstance<CanvasPlugin>

Properties

PropertyTypeDescription
appAppReference to the Obsidian app instance.
defaultOntrueWhether this plugin is enabled by default.
descriptionstringHuman-readable description of this plugin.
(Inherited from InternalPluginInstance)
idstringUnique identifier for this plugin.
(Inherited from InternalPluginInstance)
indexCanvasIndexIndex for resolving links and embeds within canvas files.
localDataManagerCanvasDataManagerManager for loading, saving, and handling canvas local data.
namestringHuman-readable display name of this plugin.
(Inherited from InternalPluginInstance)
optionsCanvasPluginInstanceOptionsUser-configurable options for the canvas plugin.
pluginCanvasPluginReference to the parent canvas plugin.
renameQueuePromisedQueueQueue for processing file rename operations sequentially.
renamesunknown[]Pending rename operations to be processed.
requestProcessRenameDebouncer<[], unknown>Debounced function to process pending rename operations.

Methods

MethodReturnsDescription
createNewCanvasFile(location?, filename?, contents?)Promise<TFile>Creates a new canvas file.
getNewFileParent(sourcePath, newFilePath?)TFolderGets the folder a new canvas file should be created in.
init(app, plugin)voidInitialize the plugin instance with app and plugin references.
(Inherited from InternalPluginInstance)
onDelete(file)voidHandles deletion of a canvas file.
onDisable(app, plugin)voidCalled when the plugin is disabled.
(Inherited from InternalPluginInstance)
onEnable(app, plugin)Promise<void>Called when the plugin is enabled.
(Inherited from InternalPluginInstance)
onExternalSettingsChange()Promise<void>Handles a settings change made externally (e.g. by Sync).
onFileMenu(menu, file, source, leaf?)voidAdds canvas-related items to the file context menu.
onRename(file, oldPath)voidHandles renaming of a canvas file.
onUserDisable(app)voidCalled when the user manually disables the plugin.
(Inherited from InternalPluginInstance)
onUserEnable(app)voidCalled when the user manually enables the plugin.
(Inherited from InternalPluginInstance)
rerenderCanvases()voidRe-renders all open canvas views.
saveOptions()voidPersists the plugin's options.

Links to this page: