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-catalyst-latest';

Signature:

export interface CanvasPluginInstance extends InternalPluginInstance<CanvasPlugin>

Extends: InternalPluginInstance<CanvasPlugin>

Properties

Property Type Description
app App Reference to the Obsidian app instance.
defaultOn true Whether this plugin is enabled by default.
description string Human-readable description of this plugin.
(Inherited from InternalPluginInstance)
id string Unique identifier for this plugin.
(Inherited from InternalPluginInstance)
index CanvasIndex Index for resolving links and embeds within canvas files.
localDataManager CanvasDataManager Manager for loading, saving, and handling canvas local data.
name string Human-readable display name of this plugin.
(Inherited from InternalPluginInstance)
options CanvasPluginInstanceOptions User-configurable options for the canvas plugin.
plugin CanvasPlugin Reference to the parent canvas plugin.
renameQueue PromisedQueue Queue for processing file rename operations sequentially.
renames unknown[] Pending rename operations to be processed.
requestProcessRename Debouncer<[], unknown> Debounced function to process pending rename operations.

Methods

Method Returns Description
createNewCanvasFile(location?, filename?, contents?) Promise<TFile> Creates a new canvas file.
getNewFileParent(sourcePath, newFilePath?) TFolder Gets the folder a new canvas file should be created in.
init(app, plugin) void Initialize the plugin instance with app and plugin references.
(Inherited from InternalPluginInstance)
onDelete(file) void Handles deletion of a canvas file.
onDisable(app, plugin) void Called 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?) void Adds canvas-related items to the file context menu.
onRename(file, oldPath) void Handles renaming of a canvas file.
onUserDisable(app) void Called when the user manually disables the plugin.
(Inherited from InternalPluginInstance)
onUserEnable(app) void Called when the user manually enables the plugin.
(Inherited from InternalPluginInstance)
rerenderCanvases() void Re-renders all open canvas views.
saveOptions() void Persists the plugin's options.

Links to this page: