Problem interface User { parent: { name: string; }; age: number; name: string; } type Column = { key: keyof User; }; const columns: Column[] = [ { key: 'name' }, { key: 'name1' }, { key:'parent.name' } ]; Solution type Paths<T> = T extends object ? { [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${Paths<T[K]>}`}` }[keyof T] : never type Column = { key: Paths<User>; }; In addition to writing your own Paths type, you can also use existing libraries, such as the Path type from type-fest.
Jul 22, 2025
When global types in third-party packages don't apply, here’s how to wire them up in TS or JS projects and the ideal @types approach.
Apr 5, 2022
Expose config from package.json into the built app via webpack DefinePlugin, with typing in TS and pitfalls to avoid.
Jan 25, 2022
How to create, package, and reference TypeScript declaration files when contributing typings to open-source projects.
Sep 12, 2021
Covers `never`, `ArrayLike`, and `PromiseLike`, when to use them, and links to further reading.
Sep 5, 2021
Use declaration merging to add custom properties (e.g., loading flags) to AxiosRequestConfig without sacrificing type safety.
Jan 11, 2021
Compares TypeScript enums and ES6 symbols so you know when to choose each for identifiers and constants.
Dec 2, 2020
Key takeaways about TypeScript, including use cases and implementation details, to help you work with the language more effectively.
Nov 10, 2020
Notes from upgrading to TypeScript 4.0—packages to bump, issues encountered, and fixes.
Oct 21, 2020
Overview of TypeScript decorators, how to enable them, and a practical example transforming Redux action types.
May 16, 2020