/** * @file * * Opens Obsidian's settings modal on a given tab in the instance the current * test context is already driving. * * The renderer-side work lives in the injected `lib` bag * (`lib.openSettingsTab`), where a callback that also probes the rendered DOM * can reach it. This is the context-resolving entry point for the far more * common case — a screenshot suite that only wants the tab on screen before it * calls `captureObsidianScreenshot`, and would otherwise write the same * `evalInObsidian` wrapper in every plugin. */ import type { OpenSettingsTabParams } from './eval-in-obsidian.cjs'; import type { ObsidianTransport } from './transport.cjs'; /** * Parameters for {@link openObsidianSettingsTab}. */ export interface OpenObsidianSettingsTabParams extends OpenSettingsTabParams { /** * Override the transport. When omitted, the transport the current test * context is driving is used. */ readonly transport?: ObsidianTransport; /** * The vault whose Obsidian window to open the settings in. When omitted, the * current test context's vault is used. */ readonly vaultPath?: string; } /** * Opens Obsidian's settings modal on a given tab and waits until that tab has * actually rendered, resolving the transport and vault from the current test * context. * * See {@link Lib.openSettingsTab} for why `app.setting.open()` can put the modal * in a second Electron window, and why the container is attached **before** it on * a vault that lacks the harness's `settingsPopoutWindow: false` default. * * Close it again from a callback with `app.setting.close()`; re-opening works, * because the attach is idempotent. * * @param params - The tab to open, how long to wait, and transport / vault * overrides. * @returns A {@link Promise} resolving to the names of the setting rows the tab * rendered. * @throws Error if no tab carries {@link OpenSettingsTabParams.tabId}, or if the * tab does not render within the timeout. */ export declare function openObsidianSettingsTab(params: OpenObsidianSettingsTabParams): Promise;