type BaseNamePath = string | number | boolean | (string | number | boolean)[]; /** * Store: The store type from `FormInstance` * ParentNamePath: Auto generate by nest logic. Do not fill manually. */ export type DeepNamePath = ParentNamePath['length'] extends 3 ? never : true extends (Store extends BaseNamePath ? true : false) ? ParentNamePath['length'] extends 0 ? Store | BaseNamePath : Store extends any[] ? [...ParentNamePath, number] : never : Store extends any[] ? // Connect path. e.g. { a: { b: string }[] } [ ...ParentNamePath, number ] | DeepNamePath : keyof Store extends never ? Store : { [FieldKey in keyof Store]: Store[FieldKey] extends Function ? never : (ParentNamePath['length'] extends 0 ? FieldKey : never) | [...ParentNamePath, FieldKey] | DeepNamePath[FieldKey], [...ParentNamePath, FieldKey]>; }[keyof Store]; export {};