/** * Base entity interface */ export interface Entity { /** * Unique identifier for the entity */ id: string; /** * Additional properties */ [key: string]: any; } /** * Methods available for entity operations */ export interface EntityMethods { /** * List entities with optional sorting, pagination, and field selection * @param sort Optional sorting parameter * @param limit Optional limit for pagination * @param skip Optional skip for pagination * @param fields Optional fields to include */ list(sort?: string, limit?: number, skip?: number, fields?: string[] | string): Promise; /** * Filter entities by query with optional sorting, pagination, and field selection * @param query Filter query * @param sort Optional sorting parameter * @param limit Optional limit for pagination * @param skip Optional skip for pagination * @param fields Optional fields to include */ filter(query: any, sort?: string, limit?: number, skip?: number, fields?: string[] | string): Promise; /** * Get a single entity by ID * @param id Entity ID */ get(id: string): Promise; /** * Create a new entity * @param data Entity data */ create(data: Record): Promise; /** * Update an existing entity * @param id Entity ID * @param data Updated entity data */ update(id: string, data: Record): Promise; /** * Delete an entity * @param id Entity ID */ delete(id: string): Promise; /** * Delete multiple entities matching a query * @param query Filter query for entities to delete */ deleteMany(query: Record): Promise; /** * Create multiple entities in a single operation * @param data Array of entity data */ bulkCreate(data: Record[]): Promise; /** * Import entities from a file * @param file File containing entity data */ importEntities(file: File): Promise; } /** * Module for accessing entities */ export interface EntitiesModule { /** * Dynamic access to entity methods by entity name */ [entityName: string]: EntityMethods; }