import { e as RenameCascadeChunkInput } from './events-Da_cFgtc.js';
import '@openhi/workflows';

/**
 * Cascade Step Functions Distributed-Map iteration handler. Receives
 * one chunk of \<=50 rewrite targets from the list-targets step and
 * issues a single `TransactWriteItems` via `executeMultiWrite` (#1010).
 *
 * Each target maps to either:
 *
 * - **SK rewrite** — `delete oldKey` + `put newItem` pair (2 transact
 *   items). Used when the SK encodes the renamed normalized name.
 * - **Attr-only update** — single `put newItem` overwrite at the same
 *   key. Used when only the denormalized display-name attribute
 *   changes (the SK is rename-stable).
 *
 * Idempotency: the chunk's `chunkToken` flows through to ElectroDB's
 * `ClientRequestToken` so a Map iteration replayed by Step Functions
 * retry lands on the same transaction id. The state machine's `Catch`
 * block also absorbs `DynamoDB.TransactionCanceledException` as a no-op
 * success — common on partial-replay when the prior run already
 * rewrote the rows (the `vid` race is "rewrite loses to a later
 * write" per TR-023 idempotency rule).
 */

interface RewriteChunkOutput {
    readonly entityType: string;
    readonly entityId: string;
    readonly tenantId?: string;
    readonly targetsRewritten: number;
    readonly transactItemCount: number;
}
declare const handler: (input: RenameCascadeChunkInput) => Promise<RewriteChunkOutput>;

export { type RewriteChunkOutput, handler };
