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 MetadataCacheBlockCacheProperties
| Property | Type | Description | |
|---|---|---|---|
| app | App | Reference to the obsidian#App. | |
| cache | Record<string, MetadataCacheBlockCacheFileEntry> | The cached entries, keyed by file path. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| clear() | void | Clears 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: