Skip to content

CanvasIndex

Unofficial

Index that tracks and resolves links, embeds, and metadata across all canvas files.

Import:

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

Signature:

export interface CanvasIndex extends Component

Extends: Component

Constructor

new CanvasIndex()

Constructor.

To extract the constructor type, use ExtractConstructor<Component>.

Properties

PropertyTypeDescription
_childrenComponent[]Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from Component)
_eventsEventRef[]Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from Component)
_loadedbooleanWhether the component and its children are loaded.
(Inherited from Component)
appAppReference to the Obsidian app instance.
fileQueueunknown[]Queue of files waiting to be processed by the indexer.
framenullCurrent animation frame request, or null when idle.
indexRecord<string, CanvasIndexEntry>Index of canvas entries keyed by file path.
refNodeIdsWeakMap<object, unknown>Weak map tracking reference node IDs for canvas files.

Methods

MethodReturnsDescription
addChild(component)TAdds a child component, loading it if this component is loaded.
(Inherited from Component)
canProcess(arg1)unknownCheck whether a file can be processed by the canvas indexer.
get(arg1)unknownGet the index entry for the specified file.
getAll()unknownGet all index entries.
getForPath(arg1)unknownGet the index entry for the specified file path.
load()voidLoad this component and its children.
(Inherited from Component)
onCreate(arg1)unknownHandle a file creation event.
onDelete(arg1)unknownHandle a file deletion event.
onload()unknownInitialize the index when the component loads.
onModify(arg1)unknownHandle a file modification event.
onRename(arg1, arg2)unknownHandle a file rename event.
onunload()unknownClean up the index when the component unloads.
parseText(arg1)Promise<unknown>Parse canvas text content and extract metadata.
process(arg1)Promise<unknown>Process a single canvas file and update the index.
queue(arg1)unknownAdd a file to the processing queue.
register(cb)voidRegisters a callback to be called when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from Component)
registerEvent(eventRef)voidRegisters an event to be detached when unloading.
(Inherited from Component)
registerInterval(id)numberRegisters an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from Component)
registerScopeEvent(keymapEventHandler)voidRegister a scope keymap event handler to be removed on unload.
(Inherited from Component)
removeChild(component)TRemoves a child component, unloading it.
(Inherited from Component)
requestFrame()unknownRequest an animation frame to process queued files.
run()Promise<unknown>Run the indexer to process all queued files.
unload()voidOverride this to unload your component.
(Inherited from Component)

Links to this page: