Skip to main content

Type Alias: ReplaceType<T, ConditionType, ReplacementType>

ReplaceType<T, ConditionType, ReplacementType> = [T] extends [ConditionType] ? ReplacementType : T

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

Conditionally replaces a type with another one if the former extends a specified type. The type to replace is not 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.