import type { SqliteDatabase } from '../db/adapter.js'; import { type EntryKind, type EntryStatus, type JsonObject, type TrustLevel } from '../serialization/validate.js'; export interface EntryRevisionRecord { entryId: string; workspace: string; revision: number; kind: EntryKind; title: string; body: string; summary: string | null; scope: JsonObject; provenance: JsonObject; tags: string[]; contentHash: string; createdBy: string; createdAt: string; } export interface EntryRevisionInput { entryId: string; workspace: string; revision: number; kind: EntryKind; title: string; body: string; summary?: string | null; scope?: JsonObject; provenance?: JsonObject; tags?: string[]; contentHash?: string; createdBy: string; createdAt: string; } export interface StoredRevisionValues { entryId: unknown; workspace: unknown; revision: unknown; kind: unknown; title: unknown; body: unknown; summary: unknown; scopeJson: unknown; provenanceJson: unknown; contentHash: unknown; createdBy: unknown; createdAt: unknown; } export interface StoredEntryValues { id: unknown; workspace: unknown; status: unknown; trustLevel: unknown; confidence: unknown; currentRevision: unknown; minRevision: unknown; maxRevision: unknown; revisionCount: unknown; invalidRevisionCount: unknown; supersededBy: unknown; createdBy: unknown; createdAt: unknown; updatedAt: unknown; verifiedAt: unknown; } export interface DecodedStoredEntryValues { id: string; workspace: string; status: EntryStatus; trustLevel: TrustLevel; confidence: number; currentRevision: number; supersededBy: string | null; createdBy: string; createdAt: string; updatedAt: string; verifiedAt: string | null; } export interface DecodeStoredMemoryOptions { requireStructuredScope?: boolean; } export interface DecodedStoredStructuredScope { scope: JsonObject; canonicalScope: JsonObject; } /** Normalize caller-supplied structured scope before it is persisted. */ export declare function normalizeStructuredScopeInput(scope: JsonObject): JsonObject; /** Decode only the canonical persisted structured-scope representation. */ export declare function decodeStoredStructuredScope(scope: JsonObject, required?: boolean): DecodedStoredStructuredScope; /** Decode persisted entry/revision data without trusting TypeScript row casts. */ export declare function decodeStoredMemoryRow(input: { revision: StoredRevisionValues; tags: unknown[]; entry?: StoredEntryValues; options?: DecodeStoredMemoryOptions; }): { revision: EntryRevisionRecord; entry?: DecodedStoredEntryValues; }; export declare function readEntryRevision(database: SqliteDatabase, input: { entryId: string; workspace: string; revision: number; }): EntryRevisionRecord; export declare function findEntryRevision(database: SqliteDatabase, input: { entryId: string; workspace: string; revision: number; }): EntryRevisionRecord | undefined; export declare function insertEntryRevisionInTransaction(database: SqliteDatabase, input: EntryRevisionInput): EntryRevisionRecord; //# sourceMappingURL=revisions.d.ts.map