import { LabComment, LabJsonContentRichtext } from 'itlab-functions'; import { CommentsModuleOptions } from './comments-module-options.interface'; import { CommentsService } from './comments.service'; /** * Factory function for creating a CommentsController 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. `/comment/news` or `/comment/event`). * * @param {CommentsModuleOptions} options - * @returns A dynamically generated controller class. */ export declare function createCommentsController(options: CommentsModuleOptions): { new (commentService: CommentsService): { readonly commentService: CommentsService; /** * Creates a new comment on a specific resource. * * Why: Centralizes comment creation logic in the service while ensuring * authentication, resource validation, and proper rich text handling. * * @param {string} resourceId - MongoDB ObjectId of the resource being commented on. * @param {string} accountId - Authenticated user's account ID. * @param {LabJsonContentRichtext} comment - Rich text content of the comment. * @returns {Promise} The saved comment object. */ postComment(resourceId: string, accountId: string, comment: LabJsonContentRichtext): Promise; }; };