@flex-development/tutils
Version:
TypeScript utilities
18 lines (17 loc) • 548 B
text/typescript
/**
* @file Type Definitions - Path
* @module tutils/types/Path
*/
import type ObjectPlain from './object-plain.cjs';
import type PathNT from './path-nt.cjs';
/**
* Constructs a union type of nested and top level properties of `T`.
*
* **Note**: This type recurses **two levels (`foo.nested`)** deep.
*
* @see https://github.com/ghoullier/awesome-template-literal-types
*
* @template T - Object type
*/
declare type Path<T extends ObjectPlain> = PathNT<T> extends string | keyof T ? PathNT<T> : keyof T;
export { type Path as default };