import { aws_dynamodb } from "aws-cdk-lib";
import { ToAttributeMap } from "typesafe-dynamodb/lib/attribute-value";
import { FormatObject, JsonFormat } from "typesafe-dynamodb/lib/json-format";
import { TableKey } from "typesafe-dynamodb/lib/key";
import { Narrow } from "typesafe-dynamodb/lib/narrow";
import { DynamoDBAppsyncExpression } from "./appsync";
import { ITable } from "./table";
import { AttributeKeyToObject } from "./util";
export declare type PutItemReturnValues = "NONE" | "ALL_OLD";
export interface PutItemInput<Item extends object, ReturnValue extends PutItemReturnValues | undefined, Format extends JsonFormat> extends Omit<AWS.DynamoDB.PutItemInput, "Item" | "TableName"> {
    Item: FormatObject<Item, Format>;
    ReturnValues?: ReturnValue;
}
export interface PutItemOutput<Item extends object, ReturnValue extends PutItemReturnValues | undefined, Format extends JsonFormat> extends Omit<AWS.DynamoDB.PutItemOutput, "Attributes"> {
    Attributes?: ReturnValue extends undefined | "NONE" ? undefined : FormatObject<Item, Format>;
}
export declare type PutItem<Item extends object, Format extends JsonFormat> = <I extends Item, ReturnValue extends PutItemReturnValues | undefined>(input: PutItemInput<I, ReturnValue, Format>) => Promise<PutItemOutput<I, ReturnValue, Format>>;
export declare function createPutItemIntegration<Item extends object, Format extends JsonFormat>(table: aws_dynamodb.ITable, format: Format): PutItem<Item, Format>;
/**
 * @see https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-dynamodb.html#aws-appsync-resolver-mapping-template-reference-dynamodb-getitem
 */
export declare type PutItemAppsync<Item extends object, PartitionKey extends keyof Item, RangeKey extends keyof Item | undefined> = <Key extends TableKey<Item, PartitionKey, RangeKey, JsonFormat.AttributeValue>>(input: {
    key: Key;
    attributeValues: ToAttributeMap<Omit<Narrow<Item, AttributeKeyToObject<Key>, JsonFormat.Document>, Exclude<PartitionKey | RangeKey, undefined>>>;
    condition?: DynamoDBAppsyncExpression;
    _version?: number;
}) => Promise<Narrow<Item, AttributeKeyToObject<Key>, JsonFormat.Document>>;
export declare function createPutItemAppsyncIntegration<Item extends object, PartitionKey extends keyof Item, RangeKey extends keyof Item | undefined>(table: ITable<Item, PartitionKey, RangeKey>): PutItemAppsync<Item, PartitionKey, RangeKey>;
//# sourceMappingURL=put-item.d.ts.map