/** * Strategy seam for the optional accounting-periods service. Core * imports `PeriodsStrategy` type-only + `NO_PERIODS` stub; the real * `loadPeriods` / `chainAnchor` / `assertTsWritable` / * `validatePeriodName` / `appendPeriodLedgerEntry` functions are * only reachable via `withPeriods()` in `./active.ts`. * * Applications that never call `vault.closePeriod()` / * `vault.openPeriod()` ship none of the ~363 LOC. * * @internal */ import type { EncryptedEnvelope, NoydbStore } from '../../kernel/types.js'; import type { LedgerStore } from '../../with-commit/history/ledger/store.js'; import type { PeriodRecord } from './periods.js'; /** * @internal */ export interface PeriodsStrategy { loadPeriods(adapter: NoydbStore, vault: string, decrypt: (envelope: EncryptedEnvelope) => Promise): Promise; chainAnchor(records: readonly PeriodRecord[]): Promise<{ priorPeriodName?: string; priorPeriodHash: string; }>; assertTsWritable(existing: { ts: string | null; record: Record | null; } | null, incoming: Record | null, periods: readonly PeriodRecord[]): void; validatePeriodName(name: string, existing: readonly PeriodRecord[]): void; appendPeriodLedgerEntry(ledger: LedgerStore | null, actor: string, envelope: EncryptedEnvelope, periodName: string, collection?: string): Promise; } export declare const NO_PERIODS: PeriodsStrategy;