import { AuditDb } from "./audit-db.js"; import { MemoryGuardAuditEvent } from "../guard/audit-emitter.js"; //#region src/audit/memory-guard-bridge.d.ts /** * Options accepted by `bridgeMemoryGuardToAudit(...)`. * * @stable */ interface BridgeMemoryGuardToAuditOptions { readonly db: AuditDb; readonly onWriteError?: (event: MemoryGuardAuditEvent, error: unknown) => void; } /** * Teardown function returned by `bridgeMemoryGuardToAudit(...)`. * * Calling it detaches the listener; the `.drain()` helper resolves * once every queued audit-log write has settled so test suites and * graceful-shutdown paths can wait for the bridge to finish before * closing the audit database. * * @stable */ interface MemoryGuardBridgeTeardown { (): void; readonly drain: () => Promise; } /** * Subscribe the audit-log subsystem to the guard audit emitter. * Returns a teardown function. * * Writes are serialised through a per-bridge queue so concurrent * guard events never race on `db.latest()` and produce duplicate * `seq` values. Failures are isolated from the guard fast path via * the `onWriteError` callback. * * @stable */ declare function bridgeMemoryGuardToAudit(opts: BridgeMemoryGuardToAuditOptions): MemoryGuardBridgeTeardown; //#endregion export { BridgeMemoryGuardToAuditOptions, MemoryGuardBridgeTeardown, bridgeMemoryGuardToAudit }; //# sourceMappingURL=memory-guard-bridge.d.ts.map