/* Copyright (c), CKSource Holding sp. z o.o. All rights reserved. */ import AddCommentResponse from './responses/addcommentresponse'; import { type IWebSocketGateway } from './../websocketgateway/websocketgateway'; import type { IThread } from './descriptors/commentsthreaddescriptor'; import type { ICommentsConnectDetails } from './descriptors/connectdetailsdescriptor'; import type SessionCollection from '../sessions/sessioncollection'; import type { IComment } from './descriptors/commentdescriptor'; import AddCommentThreadResponse from './responses/comment-threads/addcommentthreadresponse'; import ResolveCommentThreadResponse from './responses/comment-threads/resolvecommentthreadresponse'; export declare const _SERVICE: number; export interface IAddCommentThreadParams { commentThreadId: string; context?: Record | null; comments?: IComment[]; resolvedAt?: Date | string | null; createdAt?: Date | string | null; resolvedBy?: string | null; deletedAt?: Date | null | string; attributes?: Record | null; } export interface IUpdateCommentThreadParams { commentThreadId: string; context?: Record | null; attributes?: Record | null; unlinkedAt?: Date | null | string; } export interface ICommentsConnectWithDetailsResult { threads: IThread[]; /** * The authors of the comments, when {@link ICommentsConnectDetails#includeUsers} was requested.Fetch the * users with `User.getMany()` then. When the server cannot fetch the users, the connect fails. */ users?: Record[]; } declare const CommentsService_base: import("@ckeditor/ckeditor5-utils").EmitterMixinConstructor object>; declare class CommentsService extends /* #__PURE__ -- @preserve */ CommentsService_base { private readonly _documentId; private _isConnected; private _wsGateway?; private _channel?; private _connectedSessions?; private static readonly _SERVICE; constructor(_documentId: string); get isConnected(): boolean; /** * Connects to WebSocketGateway and starts listening on channel. */ connect(wsGateway: IWebSocketGateway): Promise; /** * Connects as {@link #connect} does, and also resolves with the requested details. */ connectWithDetails(wsGateway: IWebSocketGateway, details: ICommentsConnectDetails): Promise; /** * Disconnects CommentsService from CKEditor Cloud Services. */ disconnect(): void; addComment(commentThreadId: string, commentId: string, content: string, attributes?: Record): Promise; updateComment(commentThreadId: string, commentId: string, content: string, attributes?: Record): Promise; removeComment(commentThreadId: string, commentId: string): Promise; removeCommentThread(commentThreadId: string): Promise; addCommentThread(addCommentThreadParams: IAddCommentThreadParams): Promise; resolveCommentThread(commentThreadId: string): Promise; reopenCommentThread(commentThreadId: string): Promise; updateCommentThread(params: IUpdateCommentThreadParams): Promise; getCommentThread(commentThreadId: string, attempt?: number): Promise; getDocumentThreads(): Promise<{ threads: IThread[]; }>; /** * Returns read-only observable collection with EndUsers Sessions for comments service. */ getConnectedSessions(): Promise; /** * Sends the given connect message and applies its response. */ private _connect; /** * Starts to listen on a given channel. */ private _connectToChannel; /** * Processes websocket gateway state changes. */ private _onWsGatewayStateChange; private _sendRequest; } export default CommentsService;