Skip to main content

Type Alias: PropertyTypeOfDistributed<T, K>

PropertyTypeOfDistributed<T, K> = ReplaceExactType<T extends Record<any, any> ? OptionalPropertyTypeOf<T, K> : never, undefined, never>

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

Gets the type of another type's property. If the parent type is a union, then it will be distributed. If a property exists on at least one distributed parent type and also does not exist on at least one other parent type, then the property type is returned as a union with undefined. If a property does not exist on any distributed parent type, then never is returned.

Type Parameters

Type ParameterDescription
TThe type containing the property for which to get a type.
KThe key of the property for which to get a type.