import { Database } from '@strapi/database'; import { Strapi } from '../../'; type ID = number | string; type EntityServiceAction = | 'findMany' | 'findPage' | 'findWithRelationCounts' | 'findOne' | 'count' | 'create' | 'update' | 'delete'; type PaginationInfo = { page: number; pageSize: number; pageCount: number; total: number; }; type Params = { fields?: (keyof T)[]; filters?: any; _q?: string; populate?: any; sort?: any; start?: number; limit?: number; page?: number; pageSize?: number; publicationState?: string; data?: any; files?: any; }; export interface EntityService { uploadFiles(uid: K, entity, files); wrapParams( params: Params, { uid: K, action: EntityServiceAction } ); findMany( uid: K, params: Params ): Promise; findPage( uid: K, params: Params ): Promise<{ results: T[]; pagination: PaginationInfo; }>; findWithRelationCounts( uid: K, params: Params ): Promise<{ results: T[]; pagination: PaginationInfo; }>; findOne( uid: K, entityId: ID, params: Params ): Promise; count(uid: K, params: Params): Promise; create(uid: K, params: Params): Promise; update( uid: K, entityId: ID, params: Params ): Promise; delete( uid: K, entityId: ID, params: Params ): Promise; } export default function(opts: { strapi: Strapi; db: Database; // TODO: define types eventHub: any; entityValidator: any; }): EntityService;