/Users/pablo/Library/Mobile Documents/com~apple~CloudDocs/pablion-files/arrow/Coding/Typescript/Interface readability
- @2022-04-13
- To increase the readability on hovering over an type, we can use the infer type to expand all properties.
-
Moreover there's a written snippet for this functionality from Stack Overflow
````typescript export type Expand
= T extends (...args: infer A) => infer R ? (...args: Expand) => Expand : T extends infer O ? { [K in keyof O]: O[K] } : never; export type ExpandRecursively
= T extends (...args: infer A) => infer R ? (...args: ExpandRecursively ) => ExpandRecursively: T extends object ? T extends infer O ? { [K in keyof O]: ExpandRecursively } : never : T; ````
- Learned in algorand-js-sdk.