diff --git a/.changeset/eleven-kids-decide.md b/.changeset/eleven-kids-decide.md new file mode 100644 index 00000000000..d93cb9247da --- /dev/null +++ b/.changeset/eleven-kids-decide.md @@ -0,0 +1,5 @@ +--- +"@smithy/types": patch +--- + +fix: broken ChecksumConfiguration interface in TS < 4.4 and conditional generic types in TS<4.1 diff --git a/packages/types/package.json b/packages/types/package.json index f3916f188b5..c48286b239e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -30,7 +30,7 @@ "node": ">=14.0.0" }, "typesVersions": { - "<4.0": { + "<=4.0": { "dist-types/*": [ "dist-types/ts3.4/*" ] diff --git a/packages/types/src/extensions/checksum.ts b/packages/types/src/extensions/checksum.ts index 42e16c2eeb8..1eb488e7ff1 100644 --- a/packages/types/src/extensions/checksum.ts +++ b/packages/types/src/extensions/checksum.ts @@ -21,16 +21,21 @@ export interface ChecksumAlgorithm { } /** - * @internal + * @deprecated unused. */ -export interface ChecksumConfiguration { - addChecksumAlgorithm(algo: ChecksumAlgorithm): void; - checksumAlgorithms(): ChecksumAlgorithm[]; - +type ChecksumConfigurationLegacy = { /** * @deprecated unused. */ - [other: string | number]: any; + [other in string | number]: any; +}; + +/** + * @internal + */ +export interface ChecksumConfiguration extends ChecksumConfigurationLegacy { + addChecksumAlgorithm(algo: ChecksumAlgorithm): void; + checksumAlgorithms(): ChecksumAlgorithm[]; } /**