SatisfiesSlices<T, K extends string>
typeProves to the compiler that a widened state record still covers every slice name.
StoreInstance constrains S extends Record<R, any>, and TypeScript cannot correlate
WidenState with WidenNames well enough to see that the widened record
always carries the widened key set - both branch on string extends N, but it checks each
in isolation.
The intersection is with unknown, **never any**. T & unknown reduces to T, so every
slice keeps its exact type; T & any is any, which silently collapses every slice's
state and destroys the inference this feature exists to provide. That was a real bug caught
by the spike, and it is the reason this helper is written out rather than inlined.Definition
type
type SatisfiesSlices<T, K extends string> = Prettify<T & Record<K, unknown>>Prettify<T & Record<K, unknown>>
Type parameters
| Name | Type | Description |
|---|---|---|
T | — | |
K | extends string |