WidenNames<R extends string, N extends string>
typeThe slice-name union after adding N.
The
string extends N guard is load-bearing. Passing a string-typed variable rather than
a literal would otherwise widen the union to string, and every S[R1] lookup downstream
would resolve to the union of every slice's state - silently destroying useAtomicProp
inference across the whole application. Degrading to "no widening" is the safe failure.Definition
type
type WidenNames<R extends string, N extends string> = string extends N ? R : R | Nstring extends N ? R : R | N
Type parameters
| Name | Type | Description |
|---|---|---|
R | extends string | |
N | extends string |