import { LikeModuleOptions } from './like-module-options.interface'; import { LikeService } from './like.service'; /** * Factory function for creating a LikeController bound to a specific route suffix. * * Why: Instead of writing separate controllers for each resource type, * we generate one dynamically. This ensures DRY principles while still * supporting custom routes (e.g. `/like/news` or `/like/event`). * * @param {LikeModuleOptions} options - * @returns A dynamically generated controller class. */ export declare function createLikeController(options: LikeModuleOptions): { new (likeService: LikeService): { readonly likeService: LikeService; /** * Adds the authenticated user's like to a given resource. * * Why: Prevents duplicate likes using `$addToSet`, * ensuring idempotency of repeated requests. * * @param {string} resourceId - The MongoDB ObjectId of the resource. * @param {string} accountId - The authenticated account performing the like. * @returns {Promise} The updated like count. */ addLikeToResource(resourceId: string, accountId: string): Promise; /** * Removes the authenticated user's like from a given resource. * * Why: Uses `$pull` to ensure the user’s ID is removed only if present, * maintaining database consistency without errors. * * @param {string} resourceId - The MongoDB ObjectId of the resource. * @param {string} accountId - The authenticated account removing the like. * @returns {Promise} The updated like count. */ removeLikeFromResource(resourceId: string, accountId: string): Promise; /** * Determines whether the authenticated user has liked a given resource. * * Why: Useful for rendering UI states (e.g. "Like" vs. "Unlike" buttons) * without fetching all likes. * * @param {string} resourceId - The MongoDB ObjectId of the resource. * @param {string} accountId - The authenticated account to check. * @returns {Promise} True if the resource is liked by the user. */ isResourceLikedByUser(resourceId: string, accountId: string): Promise; }; };