File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ export interface IRoomsModel extends IBaseModel<IRoom> {
204204 setE2eKeyId ( roomId : string , e2eKeyId : string , options ?: FindOptions < IRoom > ) : Promise < UpdateResult > ;
205205 findOneByImportId ( importId : string , options ?: FindOptions < IRoom > ) : Promise < IRoom | null > ;
206206 findOneByNameAndNotId ( name : string , rid : string ) : Promise < IRoom | null > ;
207- findOneByIdAndType ( roomId : IRoom [ '_id' ] , type : IRoom [ 't' ] , options ?: FindOptions < IRoom > ) : Promise < IRoom | null > ;
207+ findOneByIdAndType < T extends Document = IRoom > ( roomId : IRoom [ '_id' ] , type : IRoom [ 't' ] , options ?: FindOptions < T > ) : Promise < T | null > ;
208208 findOneByDisplayName ( displayName : string , options ?: FindOptions < IRoom > ) : Promise < IRoom | null > ;
209209 findOneByNameAndType (
210210 name : string ,
Original file line number Diff line number Diff line change @@ -941,8 +941,12 @@ export class RoomsRaw extends BaseRaw<IRoom> implements IRoomsModel {
941941 return this . findOne ( query , options ) ;
942942 }
943943
944- findOneByIdAndType ( roomId : IRoom [ '_id' ] , type : IRoom [ 't' ] , options : FindOptions < IRoom > = { } ) : Promise < IRoom | null > {
945- return this . findOne ( { _id : roomId , t : type } , options ) ;
944+ findOneByIdAndType < T extends Document = IRoom > (
945+ roomId : IRoom [ '_id' ] ,
946+ type : IRoom [ 't' ] ,
947+ options : FindOptions < T > = { } as FindOptions < T > ,
948+ ) : Promise < T | null > {
949+ return this . findOne < T > ( { _id : roomId , t : type } , options ) ;
946950 }
947951
948952 setCallStatus ( _id : IRoom [ '_id' ] , status : IRoom [ 'callStatus' ] ) : Promise < UpdateResult > {
You can’t perform that action at this time.
0 commit comments