Skip to content

vaultmd / CreateVaultConfig

Type Alias: CreateVaultConfig

CreateVaultConfig = VaultIoConfig & object

Defined in: src/vault/models/create-vault-config.ts:9

Configuration passed to createVault. Extends VaultIoConfig with index, link-resolution, and lifecycle settings.

Type Declaration

crossProcessWriterLock?

optional crossProcessWriterLock?: boolean

When true (default), serialise writes via a cross-process advisory lock stored next to the index file. Set to false for single-process scenarios to avoid the lock-file overhead.

indexPath

indexPath: string

Absolute path to the SQLite index file (created automatically if absent).

lazyReconcile?

optional lazyReconcile?: boolean

When true (default), the first read after each TTL window kicks a background reconcile sweep instead of blocking. Set to false to disable background reconciliation entirely.

linkResolution?

optional linkResolution?: LinkResolution

How outbound links are resolved when building the index. 'wikilink' (default) resolves [[Target]] by filename; 'relative' resolves standard [text](./path.md) markdown links.

onCommit?

optional onCommit?: (e) => void | Promise<void>

Optional callback invoked after each committed file operation. Receives a CommitEvent describing the op, path, and (for writes) the new content. Errors thrown here are wrapped in MdVaultError('COMMIT_FAILED').

Parameters

e

CommitEvent

Returns

void | Promise<void>

reconcileTtlMs?

optional reconcileTtlMs?: number

Minimum time in milliseconds between lazy reconcile sweeps (default 2000). Has no effect when lazyReconcile is false.

sqliteBusyTimeoutMs?

optional sqliteBusyTimeoutMs?: number

Milliseconds to wait for a busy SQLite lock before throwing (default 5000). Applies to both read and write operations.