Skip to main content

Type Alias: ReplaceTypeDistributed<T, ConditionType, ReplacementType>

ReplaceTypeDistributed<T, ConditionType, ReplacementType> = T extends ConditionType ? ReplacementType : T

Defined in: src/sdk/utils/types/UtilityTypes.ts:117

Conditionally replaces a type with another one if the former extends a specified type. The type to replace is distributed if it is a union.

Type Parameters

Type ParameterDescription
TThe type to replace.
ConditionTypeThe type that T must extend in order to be replaced.
ReplacementTypeThe type with which to replace T if it extends ConditionType.