/** * 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 { CollectionDefinition, ReadContext, ReadMode } from '../@types/index.js'; /** * Fire the `afterRead` hook for one reconstructed document. * * No-op when the collection has no hook, when this exact materialized object * completed the hook already. An active logical version fails closed with * `ERR_READ_RECURSION`: even the same object may be only partially processed, * so returning it cannot be proven safe. Fresh raw objects are always redacted * once the active call completes. Failed hooks do not mark the object complete, * and active state is cleared in `finally` so a later retry can proceed. * * The hook receives the raw storage-shape document (mutable) and the * operation's authenticated context plus the shared `ReadContext`, so it can * redact by actor and thread the same context through any * nested `client.collection(...).findById(id, { _readContext })` calls. */ export declare function applyAfterRead(params: { doc: Record; definition: CollectionDefinition; readContext: ReadContext; requestContext: import('@byline/auth').RequestContext; locale?: string; readMode?: ReadMode; projection?: readonly string[]; materialization?: string; }): Promise;