/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { DocumentRevisionTarget, LockedDocumentRevision } from '../../@types/index.js'; import type { DocumentLifecycleContext } from './context.js'; /** Public lifecycle services own their commit boundary, including post-commit hooks. */ export declare function assertLifecycleTransactionOwnership(ctx: DocumentLifecycleContext): void; /** Authorized preflight: reject known staleness before hooks or external preparation. */ export declare function readDocumentForMutation(ctx: DocumentLifecycleContext, params: { documentId: string; expectedRevision: number; locale?: string; lenient?: boolean; }): Promise>; /** Internal final boundary. The callback contains storage work only, never user hooks. */ export declare function commitGuardedDocumentMutation(ctx: DocumentLifecycleContext, target: Omit, write: (locked: LockedDocumentRevision) => Promise<{ value: T; changed: boolean; }>, options?: { collectionLock?: 'exclusive'; structuralScope?: 'collection'; }): Promise<{ value: T; revision: number; affectedDocuments: { documentId: string; revision: number; }[]; scheduledPublicationsNeedReconfirmation: boolean; }>;