The contract dyna-record needs from a DynamoDB document client: the ability
to send a command.
Deliberately structural rather than the SDK's DynamoDBDocumentClient. That
class extends smithy's Client, which declares a private member, so
TypeScript compares it nominally — a client built from a second installation
of the AWS SDK would fail to satisfy it even when the two interoperate
perfectly at runtime. The never parameters are what make every copy's
overloaded send assignable here without introducing any, and they are
also what make a hand written test double assignable with no cast.
A supplied client governs more than transport: the AWS SDK passes the
sending client's config to every command, and lib-dynamodb reads
translateConfig from it, so a client's marshalling options apply to
dyna-record's own commands. Supply one built with the SDK's defaults — a
client with unmarshallOptions.wrapNumbers enabled is rejected where the
table is declared, since every number attribute would otherwise hydrate as a
wrapper object and fail its schema on the first read.
The contract dyna-record needs from a DynamoDB document client: the ability to send a command.
Deliberately structural rather than the SDK's
DynamoDBDocumentClient. That class extends smithy'sClient, which declares a private member, so TypeScript compares it nominally — a client built from a second installation of the AWS SDK would fail to satisfy it even when the two interoperate perfectly at runtime. Theneverparameters are what make every copy's overloadedsendassignable here without introducingany, and they are also what make a hand written test double assignable with no cast.A supplied client governs more than transport: the AWS SDK passes the sending client's config to every command, and lib-dynamodb reads
translateConfigfrom it, so a client's marshalling options apply to dyna-record's own commands. Supply one built with the SDK's defaults — a client withunmarshallOptions.wrapNumbersenabled is rejected where the table is declared, since every number attribute would otherwise hydrate as a wrapper object and fail its schema on the first read.