import { Getter } from '@loopback/core'; import { Count, Filter, FilterExcludingWhere, Where } from '@loopback/repository'; import { SchemaRef } from '@loopback/rest'; import { CrudRestControllerOptions } from '@loopback/rest-crud'; import { EntityRelationType, IdType } from '../../common/types'; import { IJWTTokenPayload } from '../../components/authenticate/common/types'; import { BaseEntity } from '../models'; import { DefaultCrudRepository } from '../repositories'; export interface ICrudControllerOptions { entity: typeof BaseEntity & { prototype: E; }; repository: { name: string; }; controller: CrudRestControllerOptions & { defaultLimit?: number; }; schema?: { find?: SchemaRef; findOne?: SchemaRef; findById?: SchemaRef; count?: SchemaRef; createRequestBody?: SchemaRef; create?: SchemaRef; updateAll?: SchemaRef; updateByIdRequestBody?: SchemaRef; updateById?: SchemaRef; replaceById?: SchemaRef; deleteById?: SchemaRef; }; doInjectCurrentUser?: boolean; } export declare const defineCrudController: (opts: ICrudControllerOptions) => { new (repository: DefaultCrudRepository): { repository: DefaultCrudRepository; defaultLimit: number; find(filter?: Filter): Promise<(E & EntityRelationType)[]>; findById(id: IdType, filter?: FilterExcludingWhere): Promise; findOne(filter?: Filter): Promise<(E & EntityRelationType) | null>; count(where?: Where): Promise; }; } | { new (repository: DefaultCrudRepository, getCurrentUser?: Getter): { getCurrentUser?: Getter; _getContextUser(): Promise<{ userId: IdType; roles: { id: IdType; identifier: string; priority: number; }[]; }>; create(data: Omit): Promise; updateAll(data: Partial, where?: Where): Promise; updateById(id: IdType, data: Partial): Promise; replaceById(id: IdType, data: E): Promise; deleteById(id: IdType): Promise<{ id: IdType; }>; repository: DefaultCrudRepository; defaultLimit: number; find(filter?: Filter): Promise<(E & EntityRelationType)[]>; findById(id: IdType, filter?: FilterExcludingWhere): Promise; findOne(filter?: Filter): Promise<(E & EntityRelationType) | null>; count(where?: Where): Promise; }; }; //# sourceMappingURL=crud.controller.d.ts.map