deps.citedKeys
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 the document's stable cited-key set. Call it through deps inside a bibliography dependency collector.
Signature
deps.citedKeys(): RenderDependencyReturns
A descriptor with ID citations:list. Its current value is a renderer-provided fingerprint of deduplicated, sorted citation keys.
Call relationships
- Called inside: bibliography dependency collectors.
- Read by:
SmartRendererduring dependency fingerprinting. - Can mark dirty: an unchanged bibliography block after citations elsewhere are added or removed.
deps.citedKeys() -> descriptor stored on bibliography block
-> current cited-key fingerprint -> dirty or unchangedconst BIBLIOGRAPHY_DEPENDENCY = defineBlockDependencyRule(({ text, deps }) => text.includes('\\bibliography')
? [deps.citedKeys()]
: []
);The descriptor does not store a copy of every key. Sorting is appropriate for dependency comparison because SnapTeX's rendered bibliography is author-ordered, while getCitedKeys still exposes first-seen render order.