Skip to content

evaluateBaseHeadless

Unofficial

Evaluate a .base file in headless mode — with no leaf or open view — and return its entries.

It renders the base off-screen via getBasesControllerFromRender, waits for the initial vault scan to settle, then reads the controller’s results. Everything is torn down before returning.

Import:

import { evaluateBaseHeadless } from '@obsidian-typings/obsidian-catalyst-latest/implementations';

Signature:

function evaluateBaseHeadless(app: App, content: string, sourcePath: string): Promise<BasesEntry[]>

Parameters:

ParameterTypeDescription
appAppThe app instance.
contentstringThe .base file content (the body of a base code block).
sourcePathstringThe path supplying the query’s file context.

Returns: Promise<BasesEntry[]> — The evaluated base entries.