Skip to content

MetadataCacheBlockCache

Unofficial

Per-file cache of the blocks a note offers as block-link suggestions, held at MetadataCache.blockCache.

It is not a obsidian#BlockCache: it parses a note’s whole text, and offers every top-level block and list item as a suggestion, whether or not it carries a block ID.

Import:

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

Signature:

export interface MetadataCacheBlockCache

Properties

PropertyTypeDescription
appAppReference to the obsidian#App.
cacheRecord<string, MetadataCacheBlockCacheFileEntry>The cached entries, keyed by file path.

Methods

MethodReturnsDescription
clear()voidClears every cached entry.
getAll(runnable)AsyncGenerator<MetadataCacheBlockCacheFileEntry | null>Gets the entry of every markdown file in the vault, one file at a time.
getForFile(runnable, file)Promise<MetadataCacheBlockCacheFileEntry | null>Gets the entry of a file, reading and parsing the file unless the cached entry is for the same file and modification time.

Links to this page: