deps.metadata
How to read this API
These are TypeScript APIs compiled into SnapTeX; a .tex project cannot load them at runtime.
function name(...)is a helper that your rule imports and calls.apply(...),render(...),extract(...), andcollect(...)are callbacks that your rule implements and SnapTeX calls.renderer.name(...),context.name(...),input.name(...), anddeps.name(...)are methods SnapTeX supplies to callbacks; do not import or construct them.service.name(...)is an instance method called after your host or test constructsPreviewUpdateService.
Register extension declarations through SNAP_TEX_RULES in src/rules.ts. See Source API Scope for imports, value ownership, output safety, rebuilds, and testing.
Creates a dependency descriptor for one path in document metadata. Call it through deps inside a BlockDependencyRule; it is not a global metadata lookup.
Signature
deps.metadata(path: string): RenderDependencyParameters
path uses dot-separated property names, such as title, authors, or custom.editor.
Returns
A descriptor with ID metadata:${path}. When fingerprinted, string values are used directly, objects and arrays use JSON.stringify, and absent values become an empty string.
Call relationships
- Called inside:
BlockDependencyRule. - Read by:
SmartRendereragainst currentdocument.metadata. - Can mark dirty: a source-unchanged block when the current value differs.
metadata path -> descriptor stored on block -> current metadata value -> fingerprintreturn [
deps.metadata('title'),
deps.metadata('custom.editor')
];The descriptor does not copy metadata into the block snapshot; it stores the path and reads current state during fingerprinting.