import { comments } from '@wix/comments'; import { members } from '@wix/members'; import { type ServiceAPI } from '@wix/services-definitions'; import type { Signal } from '@wix/services-definitions/core-services/signals'; export interface CommentResolvedFields { author: members.Member | null | undefined; parentAuthor: members.Member | null | undefined; } export interface CommentWithResolvedFields extends comments.Comment { resolvedFields: CommentResolvedFields; } type RawQueryCommentsSortField = NonNullable; declare const supportedSortFields: ["NEWEST_FIRST", "OLDEST_FIRST"]; type QueryCommentsSortField = Extract; export type QueryCommentsSort = { fieldName: QueryCommentsSortField; }; type LoadingState = 'initial' | 'saving' | 'more' | false; export declare const CommentsServiceDefinition: string & { __api: { isEmpty: (commentId?: string) => boolean; hasNextPage: (commentId?: string) => boolean; isLoading: (commentId?: string) => LoadingState; getComments: (commentId?: string) => CommentWithResolvedFields[]; getComment: (commentId: string) => CommentWithResolvedFields | undefined; getError: (commentId?: string) => string | null; clearError: (commentId?: string) => void; initialLoad: () => Promise; sort: Signal; setSort: (sort: QueryCommentsSort[]) => void; createComment: (content: comments.CommentContent) => Promise; createReply: ( /** Determines which comment will have the replied addded to */ topCommentId: string, /** Determines the parent comment of the reply (nested) */ parentCommentId: string, content: comments.CommentContent) => Promise; deleteComment: (commentId: string) => Promise; loadMore: () => Promise; loadMoreReplies: (commentId: string) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { isEmpty: (commentId?: string) => boolean; hasNextPage: (commentId?: string) => boolean; isLoading: (commentId?: string) => LoadingState; getComments: (commentId?: string) => CommentWithResolvedFields[]; getComment: (commentId: string) => CommentWithResolvedFields | undefined; getError: (commentId?: string) => string | null; clearError: (commentId?: string) => void; initialLoad: () => Promise; sort: Signal; setSort: (sort: QueryCommentsSort[]) => void; createComment: (content: comments.CommentContent) => Promise; createReply: ( /** Determines which comment will have the replied addded to */ topCommentId: string, /** Determines the parent comment of the reply (nested) */ parentCommentId: string, content: comments.CommentContent) => Promise; deleteComment: (commentId: string) => Promise; loadMore: () => Promise; loadMoreReplies: (commentId: string) => Promise; }; export type CommentsServiceAPI = ServiceAPI; export type CommentsServiceConfig = { contextId: string; resourceId: string; pageSize?: number; sort?: QueryCommentsSort[]; }; export declare const CommentsService: import("@wix/services-definitions").ServiceFactory boolean; hasNextPage: (commentId?: string) => boolean; isLoading: (commentId?: string) => LoadingState; getComments: (commentId?: string) => CommentWithResolvedFields[]; getComment: (commentId: string) => CommentWithResolvedFields | undefined; getError: (commentId?: string) => string | null; clearError: (commentId?: string) => void; initialLoad: () => Promise; sort: Signal; setSort: (sort: QueryCommentsSort[]) => void; createComment: (content: comments.CommentContent) => Promise; createReply: ( /** Determines which comment will have the replied addded to */ topCommentId: string, /** Determines the parent comment of the reply (nested) */ parentCommentId: string, content: comments.CommentContent) => Promise; deleteComment: (commentId: string) => Promise; loadMore: () => Promise; loadMoreReplies: (commentId: string) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { isEmpty: (commentId?: string) => boolean; hasNextPage: (commentId?: string) => boolean; isLoading: (commentId?: string) => LoadingState; getComments: (commentId?: string) => CommentWithResolvedFields[]; getComment: (commentId: string) => CommentWithResolvedFields | undefined; getError: (commentId?: string) => string | null; clearError: (commentId?: string) => void; initialLoad: () => Promise; sort: Signal; setSort: (sort: QueryCommentsSort[]) => void; createComment: (content: comments.CommentContent) => Promise; createReply: ( /** Determines which comment will have the replied addded to */ topCommentId: string, /** Determines the parent comment of the reply (nested) */ parentCommentId: string, content: comments.CommentContent) => Promise; deleteComment: (commentId: string) => Promise; loadMore: () => Promise; loadMoreReplies: (commentId: string) => Promise; }, CommentsServiceConfig>; export {};