11/// <reference path="./utility.d.ts" />
22
33declare module 'mongoose' {
4- type VirtualPathFunctions < DocType = { } , PathType = unknown , TInstanceMethods = { } > = {
5- get ?: ( this : Document < any , any , DocType > & DocType ) => PathType ;
6- set ?: ( this : Document < any , any , DocType > & DocType , ... args : any ) => unknown ;
4+ type VirtualPathFunctions < DocType = { } , PathValueType = unknown , TInstanceMethods = { } > = {
5+ get ?: TVirtualPathFN < DocType , PathValueType , TInstanceMethods , PathValueType > ;
6+ set ?: TVirtualPathFN < DocType , PathValueType , TInstanceMethods , void > ;
77 options ?: VirtualTypeOptions < HydratedDocument < DocType , TInstanceMethods > , DocType > ;
88 } ;
99
10- type VirtualsSchemaOptionsPropertyType < DocType = any , virtualPaths = Record < any , unknown > , TInstanceMethods = { } > = {
11- [ K in keyof virtualPaths ] : VirtualPathFunctions < IsItRecordAndNotAny < DocType > extends true ? DocType : any , virtualPaths [ K ] , TInstanceMethods >
10+ type TVirtualPathFN < DocType = { } , PathType = unknown , TInstanceMethods = { } , TReturn = unknown > =
11+ < T = HydratedDocument < DocType , TInstanceMethods > > ( this : Document < any , any , DocType > & DocType , value : PathType , virtual : VirtualType < T > , doc : Document < any , any , DocType > & DocType ) => TReturn ;
12+
13+ type SchemaOptionsVirtualsPropertyType < DocType = any , VirtualPaths = Record < any , unknown > , TInstanceMethods = { } > = {
14+ [ K in keyof VirtualPaths ] : VirtualPathFunctions < IsItRecordAndNotAny < DocType > extends true ? DocType : any , VirtualPaths [ K ] , TInstanceMethods >
1215 } ;
1316}
0 commit comments