/** * Dedicated notification databaser. * * KERIpy correspondence: * - ports the `Noter` sidecar and `Notice` storage model from * `keri.app.notifying` * * Ownership rule: * - this is a separate additive sidecar like `Mailboxer`, not a `Baser` * family * - higher-level notification policy lives in `app/notifying.ts` */ import type { Operation } from "effection"; import { Cigar } from "../../../cesr/mod.js"; import { LMDBer, type LMDBerOptions } from "./core/lmdber.js"; import { CesrSuber, Suber } from "./subing.js"; /** Notification attribute payload stored inside a `Notice`. */ export type NoticeAttrs = Record; /** Durable notice pad matching KERIpy `Notice.pad`. */ export interface NoticePad { i: string; dt: string; r: boolean; a: T; } /** Options for opening the dedicated notification sidecar. */ export interface NoterOptions extends LMDBerOptions { compat?: boolean; } /** * Signed durable controller notification. * * KERIpy correspondence: * - mirrors `Notice` from `keri.app.notifying` * - `i` is a random notice id, not a KEL SAID */ export declare class Notice { #private; constructor(init: { raw: Uint8Array; } | { pad: Omit>, "a"> & { a: T; }; }); /** Serialized raw JSON bytes used for signing and storage. */ get raw(): Uint8Array; set raw(raw: Uint8Array); /** Parsed mutable pad view. */ get pad(): NoticePad; set pad(pad: Omit>, "a"> & { a: T; }); /** Random stable notice id. */ get rid(): string; /** ISO-8601 notice creation time. */ get datetime(): string; /** User-facing notification payload. */ get attrs(): T; /** Plain stored shape for inspection and CLI projection. */ asDict(): NoticePad; /** Read/unread status. */ get read(): boolean; set read(read: boolean); } /** Raw-byte notice subdb family keyed by `(dt, rid)`. */ declare class NoticeSuber extends Suber { protected _ser(val: Notice): Uint8Array; protected _des(val: Uint8Array | null): Notice | null; } /** * Dedicated notification sidecar. * * Storage model: * - `.nots` stores raw `Notice` bytes keyed by `(dt, rid)` * - `.nidx` stores `rid -> dt` * - `.ncigs` stores detached `Cigar`s for integrity verification */ export declare class Noter extends LMDBer { notes: NoticeSuber; nidx: Suber; ncigs: CesrSuber; static readonly TailDirPath = "keri/not"; static readonly AltTailDirPath = ".tufa/not"; static readonly CompatAltTailDirPath = ".keri/not"; static readonly TempPrefix = "keri_not_"; static readonly MaxNamedDBs = 8; /** Select `.tufa/not` by default while preserving `.keri/not` compat mode. */ constructor(options?: NoterOptions); /** Open all notice, reverse-index, and detached-signature families. */ reopen(options?: Partial): Generator; /** Add one new notice iff its `rid` is not already present. */ add(note: Notice, cigar: Cigar): boolean; /** Update one existing notice and detached signature in place. */ update(note: Notice, cigar: Cigar): boolean; /** Retrieve one stored notice/signature pair by notice id. */ getNotice(rid: string): [Notice, Cigar] | null; /** Remove one notice and its signature/index rows. */ removeNotice(rid: string): boolean; /** Count all stored notices. */ countNotices(): number; /** List stored notice/signature pairs in datetime order. */ listNotices(start?: number, limit?: number): Array<[Notice, Cigar]>; } /** Open a notification sidecar and return the ready-to-use databaser. */ export declare function createNoter(options?: NoterOptions): Operation; export {}; //# sourceMappingURL=noting.d.ts.map