Skip to content

VaultTransactionConstructorParams

Parameters for the VaultTransaction constructor.

Import:

import type { VaultTransactionConstructorParams } from 'obsidian-dev-utils/obsidian/vault-transaction';

Signature:

export interface VaultTransactionConstructorParams

Properties

PropertyTypeDescription
appAppThe Obsidian application instance.
stagingFolderPath?stringThe dot-prefixed folder that soft-deleted resources are moved into until the transaction is committed or rolled back. It must stay .-prefixed so Obsidian leaves the staged resources untracked.

Methods

MethodReturnsDescription
openMutationBypass(this)DisposableOpens an ambient mutation-bypass scope covering the paths this transaction touches, so the transaction's own writes pass a shouldBlockMutations lock that the owning operation holds. It is called once when the transaction is constructed, and the returned Disposable is disposed when the transaction settles (on commit, rollback, or await using disposal) — so the bypass stays active through rollback, including auto-rollback, which a caller managing the scope itself could easily get wrong. Typically () => resourceLockComponent.bypassBlockedMutations(lockedPathsOrFiles). Omit it for the common standalone case where the transaction operates on unlocked paths.