MergeProps
The type of mergeProps(...sources), folded left to right: a later source's key replaces an earlier one, and a later key that may be undefined keeps the earlier type as well.
The type of mergeProps(...sources), folded left to right: a later source's key replaces an
earlier one, and a later key that may be undefined keeps the earlier type as well.
Import#
ts
import type { MergeProps } from "@shadow-js/core";
Signature#
ts
type MergeProps<T extends readonly unknown[], Acc = object> = T extends readonly [
infer Head,
...infer Rest,
]
? MergeProps<Rest, Overlay<Acc, PropsOf<Head>>>
: Acc