import Publication from "../publication.js"; import type { DecryptedChallengeVerification } from "../../pubsub-messages/types.js"; import type { AuthorWithOptionalCommentUpdateJson, PublicationTypeName } from "../../types.js"; import type { RepliesPagesTypeIpfs } from "../../pages/types.js"; import Logger from "../../logger.js"; import { PKC } from "../../pkc/pkc.js"; import type { CommentIpfsType, CommentIpfsWithCidPostCidDefined, CommentPubsubMessagePublication, CommentRawField, CommentState, CommentUpdateForChallengeVerification, CommentUpdateType, CommentWithinRepliesPostsPageJson, CreateCommentOptions, CrosspostRuntime } from "./types.js"; import { RepliesPages } from "../../pages/pages.js"; import type { SignerType } from "../../signer/types.js"; import type { CreatePublicationOptions } from "../../types.js"; import { CommentClientsManager } from "./comment-client-manager.js"; import type { CommunityIpfsType } from "../../community/types.js"; import type { PublicationEventArgs, PublicationEvents } from "../types.js"; export declare class Comment extends Publication implements Partial, CommentPubsubMessagePublication, Partial, Partial> { shortCid?: CommentWithinRepliesPostsPageJson["shortCid"]; clients: CommentClientsManager["clients"]; author: AuthorWithOptionalCommentUpdateJson; title?: CommentPubsubMessagePublication["title"]; link?: CommentPubsubMessagePublication["link"]; linkWidth?: CommentPubsubMessagePublication["linkWidth"]; linkHeight?: CommentPubsubMessagePublication["linkHeight"]; thumbnailUrl?: CommentIpfsType["thumbnailUrl"]; thumbnailUrlWidth?: CommentIpfsType["thumbnailUrlWidth"]; thumbnailUrlHeight?: CommentIpfsType["thumbnailUrlHeight"]; cid?: CommentIpfsWithCidPostCidDefined["cid"]; parentCid?: CommentIpfsType["parentCid"]; quotedCids?: CommentPubsubMessagePublication["quotedCids"]; crosspost?: CrosspostRuntime; content?: CommentPubsubMessagePublication["content"]; previousCid?: CommentIpfsType["previousCid"]; depth?: CommentIpfsType["depth"]; postCid?: CommentIpfsType["postCid"]; pseudonymityMode?: CommentIpfsType["pseudonymityMode"]; linkHtmlTagName?: CommentPubsubMessagePublication["linkHtmlTagName"]; upvoteCount?: CommentUpdateType["upvoteCount"]; downvoteCount?: CommentUpdateType["downvoteCount"]; replyCount?: CommentUpdateType["replyCount"]; childCount?: CommentUpdateType["childCount"]; updatedAt?: CommentUpdateType["updatedAt"]; replies: RepliesPages; edit?: CommentUpdateType["edit"]; flairs?: CommentPubsubMessagePublication["flairs"]; deleted?: CommentWithinRepliesPostsPageJson["deleted"]; spoiler?: CommentIpfsType["spoiler"]; nsfw?: CommentIpfsType["nsfw"]; pinned?: CommentUpdateType["pinned"]; locked?: CommentUpdateType["locked"]; archived?: CommentUpdateType["archived"]; removed?: CommentUpdateType["removed"]; reason?: CommentUpdateType["reason"]; lastChildCid?: CommentUpdateType["lastChildCid"]; lastReplyTimestamp?: CommentUpdateType["lastReplyTimestamp"]; pendingApproval?: CommentUpdateForChallengeVerification["pendingApproval"]; approved?: CommentUpdateType["approved"]; number?: CommentUpdateType["number"]; postNumber?: CommentUpdateType["postNumber"]; signature: CommentPubsubMessagePublication["signature"]; state: CommentState; private _updatingState; raw: CommentRawField; _commentUpdateIpfsPath?: string; _invalidCommentUpdateMfsPaths: Set; private _commentIpfsloadingOperation?; _clientsManager: CommentClientsManager; private _updateRpcSubscriptionId?; private _stopAbortController?; challengeRequest?: CreateCommentOptions["challengeRequest"]; private _communityForUpdating?; private _postForUpdating?; _numOfListenersForUpdatingInstance: number; _updatingCommentInstance?: { comment: Comment; } & Pick; constructor(pkc: PKC); _initClients(): void; _createStopAbortController(): AbortController; _getStopAbortSignal(): AbortSignal | undefined; _isStopAbortRequested(): boolean; _abortStopOperations(reason: string): void; _clearStopAbortController(): void; _initUnsignedLocalProps; }>(opts: { unsignedOptions: T; challengeRequest?: CreatePublicationOptions["challengeRequest"]; }): void; _initLocalProps(props: { comment: CommentPubsubMessagePublication; signer?: SignerType; challengeRequest?: CreateCommentOptions["challengeRequest"]; }): void; protected _signPublicationOptionsToPublish(cleanedPublication: unknown): Promise; _initPubsubMessageProps(props: CommentPubsubMessagePublication): void; _initIpfsProps(props: CommentIpfsType): void; private _setAuthorNameResolvedFromCache; private _copyNameResolvedFromComment; _resolveAuthorNamesInBackground(): void; _initProps(props: CommentIpfsType | CommentPubsubMessagePublication): void; _initCommentUpdate(props: CommentUpdateType | CommentWithinRepliesPostsPageJson, community?: Pick): void; _updateRepliesPostsInstance(newReplies: CommentUpdateType["replies"] | CommentWithinRepliesPostsPageJson["replies"] | Pick, community?: Pick): void; private _verifyChallengeVerificationCommentProps; private _addOwnCommentToIpfsIfConnectedToIpfsClient; _initCommentUpdateFromChallengeVerificationProps(commentUpdate: CommentUpdateForChallengeVerification): void; private _updateCommentPropsFromDecryptedChallengeVerification; protected _verifyDecryptedChallengeVerificationAndUpdateCommentProps(decryptedVerification: DecryptedChallengeVerification): Promise; getType(): PublicationTypeName; setCid(newCid: string): void; setCommunityAddress(newCommunityAddress: string): void; private _isCommentIpfsErrorRetriable; private _retryLoadingCommentIpfs; private _scheduleParallelCommunityConnect; _attemptToFetchCommentIpfsIfNeeded(log: Logger): Promise; _attemptInfintelyToLoadCommentIpfs(): Promise; startCommentUpdateCommunitySubscription(): Promise; loadCommentIpfsAndStartCommentUpdateSubscription(): Promise; _setUpdatingStateNoEmission(newState: Comment["updatingState"]): void; get updatingState(): Comment["_updatingState"]; _changeCommentStateEmitEventEmitStateChangeEvent>(opts: { event: { name: T; args: PublicationEventArgs; }; newUpdatingState?: Comment["updatingState"]; newState?: Comment["state"]; }): void; _setUpdatingStateWithEmissionIfNewState(newState: Comment["updatingState"]): void; protected _setRpcClientState(newState: Comment["clients"]["pkcRpcClients"][""]["state"]): void; protected _updateRpcClientStateFromUpdatingState(updatingState: Comment["updatingState"]): void; private _isRetriableLoadingError; private _handleCommentEventFromRpc; private _handleUpdateEventFromRpc; private _handleRuntimeUpdateEventFromRpc; private _handleUpdatingStateChangeFromRpc; private _handleStateChangeFromRpc; private _handleErrorEventFromRpc; private _updateViaRpc; _useUpdatePropsFromUpdatingStartedCommunityIfPossible(): void; _useUpdatePropsFromUpdatingCommentIfPossible(): void; _useUpdatingCommentFromPKC(updatingCommentInstance: Comment): void; _setUpNewUpdatingCommentInstance(): Promise; update(): Promise; private _stopUpdateLoop; stop(): Promise; protected _validateSignatureHook(): Promise; }