import { KinesisStreamEvent, KinesisStreamBatchResponse } from 'aws-lambda';
import { D as DynamoDbStreamKinesisRecord } from './dynamodb-stream-record-CJtV6a1t.js';
import '@aws-sdk/client-dynamodb';

/**
 * Reset module-scoped caches. Test-only helper; do not invoke from production
 * code paths. Exposed so unit and integration tests can run multiple
 * scenarios within a single Jest worker without leaking state across cases.
 */
declare function __resetReplicationModuleStateForTests(): void;
interface UpsertParams {
    tenantId: string;
    workspaceId: string;
    resourceType: string;
    resourceId: string;
    version: string;
    lastUpdated: Date;
    resourceJson: string;
}
interface SoftDeleteParams {
    tenantId: string;
    workspaceId: string;
    resourceType: string;
    resourceId: string;
    version: string;
    deletedAt: Date;
}
type WriteIntent = {
    kind: "upsert";
    params: UpsertParams;
} | {
    kind: "delete";
    params: SoftDeleteParams;
} | {
    kind: "drop";
};
/**
 * Translate a single Kinesis-wrapped DynamoDB stream record into a write
 * intent against the `resources` table. Returns `drop` for replica-side
 * global-table records, non-CURRENT items, and any record whose resource
 * payload cannot be decoded as JSON.
 */
declare function buildWriteIntent(change: DynamoDbStreamKinesisRecord, awsRegion: string): WriteIntent;
interface PgQueryable {
    query: (text: string, values?: ReadonlyArray<unknown>) => Promise<unknown> | unknown;
}
/**
 * Execute a write intent against an open Postgres connection or pool. Pure
 * SQL dispatch — extracted from the handler so unit tests can drive it with a
 * mock client and integration tests can drive it with a real pool.
 */
declare function applyWriteIntent(client: PgQueryable, schemaName: string, intent: WriteIntent): Promise<void>;
declare function handler(event: KinesisStreamEvent): Promise<KinesisStreamBatchResponse>;

export { __resetReplicationModuleStateForTests, applyWriteIntent, buildWriteIntent, handler };
