Skip to content

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

PropertyTypeDescription
contextId?TContextIdA 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?InputAdditional arguments passed to both start and poll (serialized like EvalInObsidianParams.input).
intervalInMilliseconds?numberDelay between poll attempts, in milliseconds.
timeoutInMilliseconds?numberTotal budget before the poll rejects, in milliseconds.
timeoutMessage?stringOptional detail appended to the timeout error message.
transport?ObsidianTransportOverride the transport (forwarded to every underlying evalInObsidian).
vaultPath?stringThe vault path to evaluate against (forwarded to every underlying evalInObsidian).

Methods

MethodReturnsDescription
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)booleanWhether a given poll result is acceptable, evaluated in **Node**. Returning true resolves pollInObsidian with that result.

Links to this page: