import { SchemaTypeOpts, Types } from 'mongoose'; import { SubDocument, SubDocumentArray, SubDocumentArrayNoId, SubDocumentNoId, Required, Select } from './_shared'; import { OptionIdDisabled, Optional, Convert, OptionalField, Definition } from './schema'; import { Extract } from './extract'; declare type Primitives = number | string | boolean | Date | Types.ObjectId; declare type ExtractOptions = T extends { options: infer U; } ? U : never; declare type RequiredOpt = Record; declare type SharedTypeOptions = Partial & Record>; declare type SharedTypeOptionsWithEnum = SharedTypeOptions & { enum?: ReadonlyArray; }; export declare type TypeOptions = (T extends string ? Omit, keyof SharedTypeOptionsWithEnum> & SharedTypeOptionsWithEnum : Omit, keyof SharedTypeOptions>) & SharedTypeOptions; export declare type EnumOrString; } | undefined> = T extends { enum?: infer U; } ? U extends ReadonlyArray ? U[number] : string : string; declare type IsSchemaType = 0 extends (1 & T) ? NOT : T extends Definition ? IS : NOT; export declare type ArrayOfElements = IsSchemaType extends OptionIdDisabled ? SubDocumentArrayNoId & SubDocumentNoId> : SubDocumentArray & SubDocument>, Array>; export declare type ArrElement = T extends Record ? R extends (Primitives | Array) ? R : { [P in keyof Convert]: Convert[P]; } : T extends (Primitives | Array) ? T : { [P in keyof Convert]: Convert[P]; }; export declare type GetSubDocument = ExtractOptions extends OptionIdDisabled ? SubDocumentNoId : SubDocument; export declare type GetType = Opts extends RequiredOpt ? T : Optional; export {};