1 | type BaseNamePath = string | number | boolean | (string | number | boolean)[];
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export type DeepNamePath<Store = any, ParentNamePath extends any[] = []> = ParentNamePath['length'] extends 5 ? never : true extends (Store extends BaseNamePath ? true : false) ? ParentNamePath['length'] extends 0 ? Store | BaseNamePath : Store extends any[] ? [...ParentNamePath, number] : never : Store extends any[] ?
|
7 | [
|
8 | ...ParentNamePath,
|
9 | number
|
10 | ] | DeepNamePath<Store[number], [...ParentNamePath, number]> : keyof Store extends never ? Store : {
|
11 | [FieldKey in keyof Store]: Store[FieldKey] extends Function ? never : (ParentNamePath['length'] extends 0 ? FieldKey : never) | [...ParentNamePath, FieldKey] | DeepNamePath<Required<Store>[FieldKey], [...ParentNamePath, FieldKey]>;
|
12 | }[keyof Store];
|
13 | export {};
|