PollInObsidianParams<Input, PollResult, TContextId>
Parameters for pollInObsidian. Mirrors EvalInObsidianParams for the shared forwarded fields (input / contextId / transport / vaultPath); start / poll are the in-Obsidian closures and until is the Node-side acceptance predicate.
Import:
import type { PollInObsidianParams } from 'obsidian-integration-testing';Signature:
export interface PollInObsidianParams<Input extends GenericObject, PollResult, TContextId extends ContextId<unknown> | undefined = undefined>Properties
| Property | Type | Description |
|---|---|---|
| contextId? | TContextId | A ContextId shared by start and poll, so start can stash non-serializable state that poll later reads. When omitted, each closure gets a fresh empty context. |
| input? | Input | Additional arguments passed to both start and poll (serialized like EvalInObsidianParams.input). |
| intervalInMilliseconds? | number | Delay between poll attempts, in milliseconds. |
| timeoutInMilliseconds? | number | Total budget before the poll rejects, in milliseconds. |
| timeoutMessage? | string | Optional detail appended to the timeout error message. |
| transport? | ObsidianTransport | Override the transport (forwarded to every underlying evalInObsidian). |
| vaultPath? | string | The vault path to evaluate against (forwarded to every underlying evalInObsidian). |
Methods
| Method | Returns | Description |
|---|---|---|
| poll(this, input) | Promisable<PollResult> | The closure polled repeatedly inside Obsidian. Keep it short (well under the ~30s CDP cap): it should read and return a JSON-serializable status, not await the long operation itself. |
| start(this, input) | Promisable<unknown> | An optional closure run **once** before polling begins, to kick off the long-running work (fire-and-forget from Node's perspective). Keep it short — start the work and return; do not await it to completion here. |
| until(this, result) | boolean | Whether a given poll result is acceptable, evaluated in **Node**. Returning true resolves pollInObsidian with that result. |
Links to this page: