Skip to content

KeyPath

KeyPath<T> = PathsOf<NonNullable<T>, 1>

The dot-separated key paths of T, e.g. 'name' | 'address' | 'address.city' for { name: string; address: { city: string } }. Use it to type key lists ahead of time (KeyConfig<T>, ObjectSearchOptions<T>); key names written directly in a searchObjects / FuzzyObjectIndex call are checked segment by segment at any depth.

Array elements are addressed by index ('tags.0'); methods are excluded. To keep the union small, paths are listed two segments deep: a longer path is accepted when its first two segments are valid ('a.b.${string}'). Paths into wide types (any, unknown, object, types with an index signature) accept any string.

Type Parameter
T