Skip to content

webshrine / stdtyp/src / KeysDeep

Type Alias: KeysDeep<T, Depth>

KeysDeep<T, Depth>: Depth extends -1 ? never : T extends ReadonlyArray<infer I> ? KeysDeep<Extract<I, Collection>, Decrement[Depth]> : T extends Record<infer D, any> ? StringifyKey<D> | KeysDeep<Extract<T[D], Collection>, Decrement[Depth]> : never

The same as Keys<T>, but recursively for all nested objects

Type Parameters

T extends Collection

Depth extends number = 20

Defined in

packages/stdtyp/src/utilities/other.ts:54