import { Connection } from 'mongoose'; import { LikeModuleOptions } from './like-module-options.interface'; /** * LikeService manages persistence and business logic * for adding, removing, and verifying likes on resource entities. * * Why: Encapsulates MongoDB operations and ensures consistent handling * of like-related behavior across all resources that support likes. */ export declare class LikeService { private readonly moduleOptions; private readonly connection; private readonly likeableModel; /** * Constructs the LikeService with a configured model instance. * * Why: Using the provided Mongoose connection and model options ensures * that likes are tied to the correct resource collection dynamically. * * @param {LikeModuleOptions} moduleOptions - Config for the likeable resource model. * @param {Connection} connection - Mongoose database connection. */ constructor(moduleOptions: LikeModuleOptions, connection: Connection); /** * Adds a like from the specified account to a resource. * * @param {string} resourceId - The resource’s ID. * @param {string} accountId - The account ID adding the like. * @returns {Promise} The updated like count. */ addLike(resourceId: string, accountId: string): Promise; /** * Removes a like from the specified account on a resource. * * @param {string} resourceId - The resource’s ID. * @param {string} accountId - The account ID removing the like. * @returns {Promise} The updated like count. */ removeLike(resourceId: string, accountId: string): Promise; /** * Verifies whether a given account has liked a resource. * * @param {string} resourceId - The resource ID. * @param {string} accountId - The account ID to check. * @returns {Promise} True if the account has liked the resource. */ hasLiked(resourceId: string, accountId: string): Promise; }