/** * @file * * Mock of Obsidian's `QueryController`, which runs a Bases query and notifies views of results. */ import type { QueryController as QueryControllerOriginal } from 'obsidian'; import type { App } from './App.cjs'; import type { TFile } from './TFile.cjs'; import { Component } from './Component.cjs'; /** * Mock of Obsidian's `QueryController`, which executes a Bases query, evaluates its filters and formulas, and * notifies views of updated results. * * The mock runs no query: it is a bare `Component` whose constructor arguments only reach the construction hook. */ export declare class QueryController extends Component { /** * Creates a query controller. * * @param app - The app instance. * @param plugin - The plugin instance the controller belongs to. * @param containerEl - The element the controller renders into; Obsidian creates the view header and the view * container inside it. * @param currentFile - The file the query is shown for, if any. */ constructor(app: App, plugin: unknown, containerEl: HTMLElement, currentFile?: null | TFile); /** * Mock-only factory: creates a query controller, spyable via `vi.spyOn(QueryController, 'create2__')`. * It is the subclass variant of `Component`'s factory. * * @param app - The app instance. * @param plugin - The plugin instance the controller belongs to. * @param containerEl - The element the controller renders into; Obsidian creates the view header and the view * container inside it. * @param currentFile - The file the query is shown for, if any. * @returns The new query controller. */ static create2__(app: App, plugin: unknown, containerEl: HTMLElement, currentFile?: null | TFile): QueryController; /** * Mock-only: views a value typed as Obsidian's `QueryController` as this mock. * * @param value - The value typed as the original `QueryController`. * @returns The same object, typed as the mock. */ static fromOriginalType2__(value: QueryControllerOriginal): QueryController; /** * Mock-only: views this mock as Obsidian's `QueryController` type. * * @returns The same object, typed as the original `QueryController`. */ asOriginalType2__(): QueryControllerOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(QueryController.prototype, 'constructor2__')`. * * @param _app - The app the controller was created with. * @param _plugin - The plugin the controller was created with. * @param _containerEl - The container element the controller was created with. * @param _currentFile - The current file the controller was created with. */ constructor2__(_app: App, _plugin: unknown, _containerEl: HTMLElement, _currentFile?: null | TFile): void; }