import { Document, Types } from 'mongoose'; import { SubDocument, SubDocumentNoId, SubDocumentArray, SubDocumentArrayNoId } from './_shared'; import { Convert, Definition, DefinitionField } from './schema'; export declare type Extract = T extends Record ? Convert : never; export declare type ExtractProps = DeepExtractObjProps; export declare type ExtractFromReq = { [P in keyof T]: DeepExtractFromReq; }; export declare type ExtractDoc = T[DefinitionField] & Document; declare type DeepExtractProps = T extends ((infer R & SubDocument) | (infer R & SubDocumentNoId)) ? R : T extends (SubDocumentArray | SubDocumentArrayNoId) ? Array<{ [P in keyof DeepExtractObjProps]: DeepExtractObjProps[P]; }> : T extends Date ? Date : T extends Types.ObjectId ? Types.ObjectId : T extends Types.Decimal128 ? Types.Decimal128 : T extends {} ? { [P in keyof DeepExtractObjProps]: DeepExtractObjProps[P]; } : T; declare type DeepExtractObjProps = { [P in keyof T]: DeepExtractProps; }; declare type DeepExtractFromReq = 0 extends (1 & T) ? any : T extends (Date | Types.ObjectId | Types.Decimal128) ? string : T extends Array ? Array<0 extends (1 & R) ? any : R extends (Date | Types.ObjectId) ? string : { [P in keyof ExtractFromReq]: ExtractFromReq[P]; }> : T extends {} ? { [P in keyof ExtractFromReq]: ExtractFromReq[P]; } : T; export {};