import { Signer } from "../signer/index.js"; import type { DecryptedChallengeAnswerMessageType, DecryptedChallengeMessageType, DecryptedChallengeRequest, DecryptedChallengeRequestMessageType, DecryptedChallengeVerification, DecryptedChallengeVerificationMessageType, PublicationFromDecryptedChallengeRequest } from "../pubsub-messages/types.js"; import type { AuthorPubsubJsonType, CreatePublicationOptions, PublicationTypeName } from "../types.js"; import { PKC } from "../pkc/pkc.js"; import { TypedEmitter } from "tiny-typed-emitter"; import { Comment } from "./comment/comment.js"; import type { CommunityIpfsType } from "../community/types.js"; import type { CommentIpfsType } from "./comment/types.js"; import type { PublicationEvents, PublicationPublishingState, PublicationState } from "./types.js"; import type { SignerType } from "../signer/types.js"; import { PublicationClientsManager } from "./publication-client-manager.js"; import { LocalCommunity } from "../runtime/node/community/local-community.js"; declare class Publication extends TypedEmitter { clients: PublicationClientsManager["clients"]; communityAddress: string; shortCommunityAddress: string; communityPublicKey?: string; communityName?: string; timestamp: PublicationFromDecryptedChallengeRequest["timestamp"]; signature: PublicationFromDecryptedChallengeRequest["signature"] | CommentIpfsType["signature"]; signer?: SignerType; author: AuthorPubsubJsonType; protocolVersion: DecryptedChallengeRequestMessageType["protocolVersion"]; challengeRequest?: CreatePublicationOptions["challengeRequest"]; state: PublicationState | Comment["state"]; publishingState: PublicationPublishingState; raw: { pubsubMessageToPublish?: PublicationFromDecryptedChallengeRequest; unsignedPublicationOptions?: CreatePublicationOptions; }; _community?: { address: string; publicKey: string; name?: string; encryption: CommunityIpfsType["encryption"]; pubsubTopic?: CommunityIpfsType["pubsubTopic"]; }; _publishingToLocalCommunity?: LocalCommunity; _backgroundCommunityRefresh?: Promise; private _communityFetchAbortController?; private _communityFetchAbortSignal?; _challengeExchanges: Record; private _publishToDifferentProviderThresholdSeconds; private _setProviderFailureThresholdSeconds; private _rpcPublishSubscriptionId?; _clientsManager: PublicationClientsManager; _pkc: PKC; constructor(pkc: PKC); protected _initClients(): void; setCommunityAddress(communityAddress: string): void; _initBaseRemoteProps(props: CommentIpfsType | PublicationFromDecryptedChallengeRequest): void; _initUnsignedLocalProps; }>(opts: { unsignedOptions: T; challengeRequest?: CreatePublicationOptions["challengeRequest"]; }): void; protected _signPublicationOptionsToPublish(_cleanedPublication: unknown): Promise; private _signPublication; _signPublicationWithCommunityFields(): Promise; _signPublicationWithKnownCommunityFieldsIfAvailable(): Promise; protected _validateSignatureHook(): Promise; protected _verifyDecryptedChallengeVerificationAndUpdateCommentProps(decryptedVerification: DecryptedChallengeVerification): Promise; protected getType(): PublicationTypeName; toJSONPubsubRequestToEncrypt(): DecryptedChallengeRequest; private _handleRpcChallengeVerification; private _handleIncomingChallengePubsubMessage; private _handleIncomingChallengeVerificationPubsubMessage; private _handleChallengeExchange; private _updatePubsubState; publishChallengeAnswers({ challengeAnswers }: { challengeAnswers: DecryptedChallengeAnswerMessageType["challengeAnswers"]; }): Promise<{ success: true; } | undefined>; private _validatePublicationFields; private _validateCommunityFields; _updatePublishingStateNoEmission(newState: Publication["publishingState"]): void; _updatePublishingStateWithEmission(newState: Publication["publishingState"]): void; private _updateRpcClientStateFromPublishingState; protected _setStateNoEmission(newState: Publication["state"]): void; protected _setStateWithEmission(newState: Publication["state"]): void; protected _setRpcClientState(newState: Publication["clients"]["pkcRpcClients"][""]["state"]): void; _communityChallengePubsubExchangeTopic(): string; private _communityChallengeMsgSignerAddress; _getCommunityFetchAbortSignal(): AbortSignal; private _resetCommunityFetchAbortSignal; _getCommunityCache(): NonNullable | undefined; _fetchCommunityForPublishing(): Promise>; stop(): Promise; _isAllAttemptsExhausted(maxNumOfChallengeExchanges: number): boolean; private _abandonProviderIfStoppedWhileSubscribing; private _unregisterFromPkcOncePublishWorkSettles; private _postSucessOrFailurePublishing; private _handleIncomingChallengeRequestFromRpc; private _handleIncomingChallengeFromRpc; private _handleIncomingChallengeAnswerFromRpc; private _handleIncomingChallengeVerificationFromRpc; private _handleIncomingPublishingStateFromRpc; private _handleIncomingStateFromRpc; private _handleIncomingErrorFromRpc; _publishWithRpc(): Promise; private _changePublicationStateEmitEventEmitStateChangeEvent; private _signAndValidateChallengeRequestBeforePublishing; private _didWeReceiveChallengeOrChallengeVerification; private _generateChallengeRequestToPublish; _initCommunity(): Promise; private _challengeExchangesFormattedForErrors; private _libp2pJsClientHeliaContexts; private _handleNotReceivingResponseToChallengeRequest; private _getPubsubProviders; private _publishWithLocalCommunity; publish(): Promise; private _publishAfterRegistering; } export default Publication;