<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`MetadataCache`](MetadataCache) ## MetadataCache class Linktext is any internal link that is composed of a path and a subpath, such as 'My note\#Heading' Linkpath (or path) is the path part of a linktext Subpath is the heading/block ID part of a linktext. **Signature:** ```typescript export class MetadataCache extends Events ``` **Extends:** [`Events`](Events) ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [`resolvedLinks`](MetadataCache/resolvedLinks) | | <code>Record</code><code>&lt;string, </code><code>Record</code><code>&lt;string, number&gt;&gt;</code> | Contains all resolved links. This object maps each source file's path to an object of destination file paths with the link count. Source and destination paths are all vault absolute paths that comes from <code>TFile.path</code> and can be used with <code>Vault.getAbstractFileByPath(path)</code>. | | [`unresolvedLinks`](MetadataCache/unresolvedLinks) | | <code>Record</code><code>&lt;string, </code><code>Record</code><code>&lt;string, number&gt;&gt;</code> | Contains all unresolved links. This object maps each source file to an object of unknown destinations with count. Source paths are all vault absolute paths, similar to <code>resolvedLinks</code>. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | | [`fileToLinktext(file, sourcePath, omitMdExtension)`](MetadataCache/fileToLinktext) | | <p>Generates a linktext for a file.</p><p>If file name is unique, use the filename. If not unique, use full path.</p> | | [`getCache(path)`](MetadataCache/getCache) | | | | [`getFileCache(file)`](MetadataCache/getFileCache) | | | | [`getFirstLinkpathDest(linkpath, sourcePath)`](MetadataCache/getFirstLinkpathDest) | | Get the best match for a linkpath. | | [`off(name, callback)`](Events/off) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`offref(ref)`](Events/offref) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`on(name: 'changed', callback, ctx)`](MetadataCache/on('changed').md) | | <p>Called when a file has been indexed, and its (updated) cache is now available.</p><p>Note: This is not called when a file is renamed for performance reasons. You must hook the vault rename event for those.</p> | | [`on(name: 'deleted', callback, ctx)`](MetadataCache/on('deleted').md) | | Called when a file has been deleted. A best-effort previous version of the cached metadata is presented, but it could be null in case the file was not successfully cached previously. | | [`on(name: 'resolve', callback, ctx)`](MetadataCache/on('resolve').md) | | Called when a file has been resolved for <code>resolvedLinks</code> and <code>unresolvedLinks</code>. This happens sometimes after a file has been indexed. | | [`on(name: 'resolved', callback, ctx)`](MetadataCache/on('resolved').md) | | Called when all files has been resolved. This will be fired each time files get modified after the initial load. | | [`trigger(name, data)`](Events/trigger) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`tryTrigger(evt, args)`](Events/tryTrigger) | | <p>(Inherited from [Events](Events)<!-- -->)</p> |