import * as i0 from '@angular/core'; import { OnChanges, SimpleChanges, PipeTransform } from '@angular/core'; import { ModalService } from '@sinequa/core/modal'; import * as i5 from '@sinequa/core/web-services'; import { HttpService, PrincipalWebService, Principal } from '@sinequa/core/web-services'; import { Observable } from 'rxjs'; import * as i6 from '@sinequa/core/intl'; import { IntlService } from '@sinequa/core/intl'; import * as i4 from '@angular/common'; import * as i7 from '@sinequa/core/login'; import * as i8 from '@sinequa/components/utils'; import * as i9 from '@sinequa/components/collapse'; declare interface CoreComment { commentid: string; docid: string; replyto: string; creation: string; modified: string; subcomments?: Comment[]; } interface DeletedComment extends CoreComment { deleted: true; } interface NormalComment extends CoreComment { message: string; userid: string; username: string; likes: number; likedByUser: boolean; } type Comment = NormalComment | DeletedComment; declare class CommentsWebService extends HttpService { protected endpoint: string; /** * Return the list of comments for a given document * @param docid * @returns */ getComments(docid: string): Observable; /** * Return the number of comments for a given document * @param docid * @returns */ getCommentCount(docid: string): Observable; /** * Return the number of comments for a list of documents * @param docids * @returns */ getCommentCounts(docids: string[]): Observable<{ [id: string]: number; }>; /** * Create a comment with given message for a given document * @param docid * @param message * @param replyto * @returns */ createComment(docid: string, message: string, replyto?: string): Observable; /** * Modify the content of a comment * @param docid * @param commentid * @param message * @returns */ updateComment(docid: string, commentid: string, message: string): Observable; /** * Delete a specific comment * @param docid * @param commentid * @param markAsDeleted * @returns */ deleteComment(docid: string, commentid: string, markAsDeleted: boolean): Observable; /** * Add a like to a comment * @param docid * @param commentid * @returns */ likeComment(docid: string, commentid: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class CommentsComponent implements OnChanges { commentsWebService: CommentsWebService; modalService: ModalService; principalService: PrincipalWebService; docid: string; theme: 'light' | 'dark'; comments: Comment[]; user?: Principal; constructor(commentsWebService: CommentsWebService, modalService: ModalService, principalService: PrincipalWebService); ngOnChanges(simpleChanges: SimpleChanges): void; addComment(replyTo?: Comment): void; likeComment(comment: NormalComment): void; editComment(comment: NormalComment): void; deleteComment(comment: NormalComment): void; protected remove(comments: Comment[], comment: Comment): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class CreationDatePipe implements PipeTransform { intlService: IntlService; constructor(intlService: IntlService); transform(comment: Comment): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class MarkdownPipe implements PipeTransform { transform(value: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class CommentsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const _default$2: { comments: { created: string; modified: string; replyTo: string; add: string; write: string; like: string; reply: string; edit: string; delete: string; editComment: string; markdownNotice: string; noComment: string; deleteNotice: string; deleted: string; }; }; declare const _default$1: { comments: { created: string; modified: string; replyTo: string; add: string; write: string; like: string; reply: string; edit: string; delete: string; editComment: string; markdownNotice: string; noComment: string; deleteNotice: string; deleted: string; }; }; declare const _default: { comments: { created: string; modified: string; replyTo: string; add: string; write: string; like: string; reply: string; edit: string; delete: string; editComment: string; markdownNotice: string; noComment: string; deleteNotice: string; deleted: string; }; }; export { CommentsComponent, CommentsModule, CommentsWebService, CreationDatePipe, MarkdownPipe, _default as deComments, _default$2 as enComments, _default$1 as frComments }; export type { Comment, DeletedComment, NormalComment };