BacklinksSnapshot<TPayload>
A captured snapshot of a set of backlinks: the path of each backlink-holding note, mapped to the identity keys of that note’s own links to the target(s), each mapped to the payload recorded for it.
The snapshot exists so that the fetch and the rewrite can happen at different moments. A rename invalidates the metadata cache for the old path, so a caller that rewrites links after renaming has to capture the backlinks before — which is why editBacklinksSnapshot takes a snapshot rather than a path.
The payload is whatever the caller needs to remember per link. It is undefined for a single-target rewrite (the target is implied), and the old target’s path for a multi-target one, where one note’s links may point at several files that all moved and each link has to be resolved to its own new path.
Import:
import type { BacklinksSnapshot } from 'obsidian-dev-utils/obsidian/link';Signature:
export type BacklinksSnapshot<TPayload>Signature:
type BacklinksSnapshot<TPayload> = ReadonlyMap<string, ReadonlyMap<string, TPayload>>Type: ReadonlyMap<string, ReadonlyMap<string, TPayload>>
Links to this page: