import { PKC } from "../pkc/pkc.js"; import { TypedEmitter } from "tiny-typed-emitter"; import { PKCError } from "../pkc-error.js"; import type { CreateRemoteCommunityOptions, CommunityIpfsType, RpcRemoteCommunityType, CommunityJson, CommunityUpdatingState, CommunityState, CommunityStartedState, CommunitySettings, RpcLocalCommunityLocalProps, CommunityEditOptions, CommunityEventArgs, CommunityEvents, CommunityExportRecord, ExportCommunityUserOptions, ExportCommunityModLogsOptions, CommunityAnchor } from "./types.js"; import type { CommentModerationTableRow } from "../publications/comment-moderation/types.js"; import { ModQueuePages, PostsPages } from "../pages/pages.js"; import { SignerWithPublicKeyAddress } from "../signer/index.js"; import { CommunityClientsManager } from "./community-client-manager.js"; export declare class RemoteCommunity extends TypedEmitter implements Omit, "posts"> { title?: CommunityIpfsType["title"]; description?: CommunityIpfsType["description"]; roles?: CommunityIpfsType["roles"]; lastPostCid?: CommunityIpfsType["lastPostCid"]; lastCommentCid?: CommunityIpfsType["lastCommentCid"]; posts: PostsPages; modQueue: ModQueuePages; pubsubTopic?: CommunityIpfsType["pubsubTopic"]; features?: CommunityIpfsType["features"]; suggested?: CommunityIpfsType["suggested"]; flairs?: CommunityIpfsType["flairs"]; name?: CommunityIpfsType["name"]; publicKey?: string; nameResolved?: boolean; address: string; shortAddress: string; statsCid?: CommunityIpfsType["statsCid"]; createdAt?: CommunityIpfsType["createdAt"]; updatedAt?: CommunityIpfsType["updatedAt"]; encryption?: CommunityIpfsType["encryption"]; protocolVersion?: CommunityIpfsType["protocolVersion"]; signature?: CommunityIpfsType["signature"]; rules?: CommunityIpfsType["rules"]; challenges?: CommunityIpfsType["challenges"]; postUpdates?: CommunityIpfsType["postUpdates"]; startedState?: "stopped" | CommunityStartedState; started?: boolean; signer?: SignerWithPublicKeyAddress | RpcLocalCommunityLocalProps["signer"]; settings?: CommunitySettings; editable?: Pick; state: CommunityState; clients: CommunityClientsManager["clients"]; updateCid?: string; ipnsName?: string; ipnsHops?: string[]; anchor?: CommunityAnchor; ipnsPubsubTopic?: string; ipnsPubsubTopicRoutingCid?: string; pubsubTopicRoutingCid?: string; _pkc: PKC; _clientsManager: CommunityClientsManager; raw: { communityIpfs?: CommunityIpfsType; runtimeFieldsFromRpc?: Record; }; _updatingCommunityInstanceWithListeners?: { community: RemoteCommunity; } & Pick; _numOfListenersForUpdatingInstance: number; protected _ipnsName?: string; protected _ipnsHops?: string[]; protected _ipnsPubsubTopic?: string; protected _ipnsPubsubTopicRoutingCid?: string; protected _stopAbortController?: AbortController; protected _pendingWarmStartKeyMigration?: { previousPublicKey: string; newPublicKey: string; }; protected _updatingState: CommunityUpdatingState; constructor(pkc: PKC); _createStopAbortController(): AbortController; _getStopAbortSignal(): AbortSignal | undefined; _isStopAbortRequested(): boolean; _abortStopOperations(reason: string): void; _clearStopAbortController(): void; protected _defineEnumerableUpdatingState(): void; protected _defineIpnsAccessorProps(): void; _updateLocalPostsInstance(newPosts: CommunityIpfsType["posts"] | CommunityJson["posts"] | Pick, "pageCids">): void; _updateLocalModQueueInstance(newModQueue: CommunityIpfsType["modQueue"] | CommunityJson["modQueue"] | Pick, "pageCids">): void; initCommunityIpfsPropsNoMerge(newProps: CommunityIpfsType): void; _updateIpnsPubsubPropsIfNeeded(newProps: CommunityJson | CreateRemoteCommunityOptions | CommunityIpfsType): void; initRemoteCommunityPropsNoMerge(newProps: CommunityJson | CreateRemoteCommunityOptions | CommunityIpfsType): void; private _assertHasIdentity; setAddress(newAddress: string): void; _clearDataForKeyMigration(newPublicKey: string): void; _toJSONIpfsBaseNoPosts(): Omit; toJSONRpcRemote(): RpcRemoteCommunityType; get updatingState(): CommunityUpdatingState; protected _getIpnsName(): string | undefined; protected _setIpnsName(value: string | undefined): void; protected _getIpnsHops(): string[] | undefined; protected _setIpnsHops(value: string[] | undefined): void; protected _getIpnsPubsubTopic(): string | undefined; protected _setIpnsPubsubTopic(value: string | undefined): void; protected _getIpnsPubsubTopicRoutingCid(): string | undefined; protected _setIpnsPubsubTopicRoutingCid(value: string | undefined): void; _setState(newState: RemoteCommunity["state"]): void; _setStateNoEmission(newState: RemoteCommunity["state"]): void; _changeStateEmitEventEmitStateChangeEvent>(opts: { event: { name: T; args: CommunityEventArgs; }; newUpdatingState?: RemoteCommunity["updatingState"]; newState?: RemoteCommunity["state"]; newStartedState?: RemoteCommunity["startedState"]; }): void; _setUpdatingStateNoEmission(newState: RemoteCommunity["updatingState"]): void; _setUpdatingStateWithEventEmissionIfNewState(newState: RemoteCommunity["updatingState"]): void; protected _setStartedStateNoEmission(newState: CommunityStartedState): void; _setStartedStateWithEmission(newState: CommunityStartedState): void; _isRetriableErrorWhenLoading(err: PKCError | Error): boolean; _setCommunityIpfsPropsFromUpdatingCommunitiesIfPossible(): void; protected _adoptMirroredNameResolved(source: { name?: string; nameResolved?: boolean; }, nameResolvedBeforeMirror: boolean | undefined): void; private _initCommunityInstanceWithListeners; private fetchLatestCommunityOrSubscribeToEvent; private _announcePendingWarmStartKeyMigrationIfAny; update(): Promise; private _cleanUpUpdatingCommunityInstanceWithListeners; stop(): Promise; edit(options: CommunityEditOptions): Promise; delete(): Promise; start(): Promise; get exports(): CommunityExportRecord[]; export(options?: ExportCommunityUserOptions): Promise<{ exportId: string; }>; exportCommunityModLogs(opts?: ExportCommunityModLogsOptions): Promise<{ moderations: CommentModerationTableRow[]; }>; }