The object type to spread.
The condition type used to determine which properties to spread.
The value type used to spread the properties.
type ArrayExampleCondition = {
length: number
}
type Value = {
prop1: string
}
type Data = {
length: number
inner: { a: string; length: number }
}
type NewType = SpreadDeepWithinObject<Data, ArrayExampleCondition, Value>
type NewTypeResult = {
// outer object remains unchanged
length: number
inner: {
a: string
length: number
prop1: string // <-- New property
}
}
Generated using TypeDoc
Applies SpreadDeep to each property of an object type T with value type of object.
Typically used when the condition also applies to the outer object type, but you need to spread values within the object.