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 } 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<CommunityEvents> implements Omit<Partial<CommunityIpfsType>, "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<RemoteCommunity, keyof CommunityEditOptions>;
    state: CommunityState;
    clients: CommunityClientsManager["clients"];
    updateCid?: string;
    ipnsName?: string;
    ipnsHops?: string[];
    ipnsPubsubTopic?: string;
    ipnsPubsubTopicRoutingCid?: string;
    pubsubTopicRoutingCid?: string;
    _pkc: PKC;
    _clientsManager: CommunityClientsManager;
    raw: {
        communityIpfs?: CommunityIpfsType;
        runtimeFieldsFromRpc?: Record<string, any>;
    };
    _updatingCommunityInstanceWithListeners?: {
        community: RemoteCommunity;
    } & Pick<CommunityEvents, "error" | "updatingstatechange" | "update" | "statechange">;
    _numOfListenersForUpdatingInstance: number;
    protected _ipnsName?: string;
    protected _ipnsHops?: string[];
    protected _ipnsPubsubTopic?: string;
    protected _ipnsPubsubTopicRoutingCid?: string;
    protected _stopAbortController?: AbortController;
    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<NonNullable<CommunityIpfsType["posts"]>, "pageCids">): void;
    _updateLocalModQueueInstance(newModQueue: CommunityIpfsType["modQueue"] | CommunityJson["modQueue"] | Pick<NonNullable<CommunityIpfsType["modQueue"]>, "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(): Pick<this, "signature" | "name" | "flairs" | "protocolVersion" | "lastCommentCid" | "encryption" | "createdAt" | "updatedAt" | "statsCid" | "title" | "challenges" | "description" | "pubsubTopic" | "postUpdates" | "roles" | "rules" | "lastPostCid" | "features" | "suggested">;
    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<T extends keyof Omit<CommunityEvents, "statechange" | "updatingstatechange">>(opts: {
        event: {
            name: T;
            args: CommunityEventArgs<T>;
        };
        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;
    update(): Promise<void>;
    private _cleanUpUpdatingCommunityInstanceWithListeners;
    stop(): Promise<void>;
    edit(options: CommunityEditOptions): Promise<any>;
    delete(): Promise<void>;
    start(): Promise<void>;
    get exports(): CommunityExportRecord[];
    export(options?: ExportCommunityUserOptions): Promise<{
        exportId: string;
    }>;
    exportCommunityModLogs(opts?: ExportCommunityModLogsOptions): Promise<{
        moderations: CommentModerationTableRow[];
    }>;
}
