import { EventBridgeClient } from '@aws-sdk/client-eventbridge';
import { a as CascadeFinalizeInput, b as CascadeFinalizeOutput } from './events-CjS-sm0W.js';
export { g as OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR } from './events-CjS-sm0W.js';

/**
 * @see sites/www-docs/content/packages/@openhi/constructs/workflows/control-plane/owning-delete-cascade/finalize-handler.md
 *
 * Final step of the TR-022 hard-delete cascade.
 *
 * After the inline Map state drains every child projection from the
 * owner's partition, this handler:
 *
 * 1. Deletes the owning canonical row at `SK = "CURRENT"` conditional
 *    on `lifecycleState = "deleting"`. Idempotent — a replayed
 *    finalize after a prior successful run returns `deleted: false`
 *    silently.
 * 2. Emits `control-plane.owning-delete-complete.v1` on the ops event
 *    bus, carrying the cascade's chunk count, projections removed,
 *    and duration.
 *
 * The handler only emits the terminal event when the canonical
 * delete actually succeeded on this call (`canonicalDeleted: true`).
 * On replay where the canonical row is already gone, the handler
 * returns without re-emitting — the original event already fired.
 */

/** Test seam: per-handler-call EventBridge client + clock. */
interface FinalizeHandlerDependencies {
    readonly eventBridgeClient?: EventBridgeClient;
    readonly now?: () => Date;
    readonly eventIdGenerator?: () => string;
}
declare const handler: (input: CascadeFinalizeInput, deps?: FinalizeHandlerDependencies) => Promise<CascadeFinalizeOutput>;

export { type FinalizeHandlerDependencies, handler };
