Trilium Backend API
    Preparing search index...

    Class TaskContext<T>

    Type Parameters

    Index
    • Type Parameters

      Parameters

      Returns TaskContext<T>

    data: TaskData<T>
    noteDeletionHandlerTriggered: boolean
    • Returns void

    • Parameters

      • message: string

      Returns void

    • Resets the running progress count back to zero. Useful for multi-phase tasks (e.g. zip export, which first walks the tree to build metadata and then walks it again to write content) so a later phase can drive a 0→100% progress bar from scratch instead of continuing the earlier phase's count.

      Returns void

    • Labels the phase the subsequent progress counts belong to, so the client can render a phase-specific message (e.g. "Extracted X items" vs "Processed X notes"). Typically paired with resetProgressCount() and setTotalCount() at a phase boundary so each phase drives its own 0→100% bar. Forces the next progress message to send immediately (bypassing the throttle) so the label switches without delay.

      Parameters

      Returns void

    • Sets the total expected units of work, so progress messages can carry a denominator and the client can show a progress bar instead of a bare count. Optional — tasks that don't know their total up front simply never call this.

      Parameters

      • totalCount: number

      Returns void

    • Parameters

      Returns void