import { IPagination } from '@metad/contracts'; import { DeepPartial, FindOptionsWhere } from 'typeorm'; import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity'; import { BaseEntity } from '../entities/internal'; import { ICrudService } from './icrud.service'; import { OptionsSelect, PaginationParams } from './pagination-params'; export declare abstract class CrudController { private readonly crudService; protected constructor(crudService: ICrudService); /** * Get the total count of all records. * * This endpoint retrieves the total count of all records for the given entity. * * @param options Optional query options for filtering records. * @returns A promise resolving to the count of all records. */ getCount(options?: FindOptionsWhere): Promise; pagination(filter?: PaginationParams, ...options: any[]): Promise | void>; findAll(filter: PaginationParams, where?: PaginationParams['where'], relations?: PaginationParams['relations'], order?: PaginationParams['order'], take?: PaginationParams['take'], skip?: PaginationParams['skip'], select?: OptionsSelect['select'], ...options: any[]): Promise>; findMyAll(params: PaginationParams): Promise>; findById(id: string, relations?: PaginationParams['relations'], select?: PaginationParams['select'], ...options: any[]): Promise; create(entity: DeepPartial, ...options: any[]): Promise; update(id: string, entity: QueryDeepPartialEntity, ...options: any[]): Promise; delete(id: string, ...options: any[]): Promise; /** * Soft deletes a record by ID. * * This endpoint marks a record as deleted without physically removing it from the database. * The soft-deleted record can be restored later. * * @param id The ID of the record to soft delete. * @returns The soft-deleted record. */ softRemove(id: T['id'], ...options: any[]): Promise; /** * Restores a soft-deleted record by ID. * * This endpoint restores a record that was previously soft-deleted, * allowing it to be used again in the application. * * @param id The ID of the record to restore. * @returns The restored record. */ softRecover(id: T['id'], ...options: any[]): Promise; }