fix: reoder overloading signatures

This commit is contained in:
yassinedorbozgithub 2024-12-09 20:57:00 +01:00
parent d9a87e99bf
commit 37ae2ec9ad
2 changed files with 30 additions and 30 deletions

View File

@ -256,6 +256,12 @@ export abstract class BaseRepository<
return await this.executeOne(query, this.clsPopulate);
}
protected findQuery(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Query<T[], T, object, T, 'find', object>;
/**
* @deprecated
*/
@ -265,12 +271,6 @@ export abstract class BaseRepository<
projection?: ProjectionType<T>,
): Query<T[], T, object, T, 'find', object>;
protected findQuery(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Query<T[], T, object, T, 'find', object>;
protected findQuery(
filter: TFilterQuery<T>,
pageQuery?: QuerySortDto<T> | PageQueryDto<T>,
@ -293,6 +293,12 @@ export abstract class BaseRepository<
}
}
async find(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<T[]>;
/**
* @deprecated
*/
@ -302,12 +308,6 @@ export abstract class BaseRepository<
projection?: ProjectionType<T>,
): Promise<T[]>;
async find(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<T[]>;
async find(
filter: TFilterQuery<T>,
pageQuery?: QuerySortDto<T> | PageQueryDto<T>,
@ -328,6 +328,12 @@ export abstract class BaseRepository<
}
}
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<TFull[]>;
/**
* @deprecated
*/
@ -337,12 +343,6 @@ export abstract class BaseRepository<
projection?: ProjectionType<T>,
): Promise<TFull[]>;
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<TFull[]>;
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: QuerySortDto<T> | PageQueryDto<T>,

View File

@ -44,6 +44,12 @@ export abstract class BaseService<
return await this.repository.findOneAndPopulate(criteria, projection);
}
async find(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<T[]>;
/**
* @deprecated
*/
@ -53,12 +59,6 @@ export abstract class BaseService<
projection?: ProjectionType<T>,
): Promise<T[]>;
async find(
filter: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<T[]>;
async find(
filter: TFilterQuery<T>,
pageQuery?: QuerySortDto<T> | PageQueryDto<T>,
@ -70,6 +70,12 @@ export abstract class BaseService<
return await this.repository.find(filter, pageQuery, projection);
}
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<TFull[]>;
/**
* @deprecated
*/
@ -79,12 +85,6 @@ export abstract class BaseService<
projection?: ProjectionType<T>,
): Promise<TFull[]>;
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: PageQueryDto<T>,
projection?: ProjectionType<T>,
): Promise<TFull[]>;
async findAndPopulate(
filters: TFilterQuery<T>,
pageQuery?: QuerySortDto<T> | PageQueryDto<T>,