import type { StorageInterface, GatewayClient, KuboRpcClient, PKCEvents, PubsubClient, ParsedPKCOptions, LRUStorageInterface, LRUStorageConstructor, InputPKCOptions, PKCMemCaches, GetCommunityArgs } from "../types.js";
import { Comment } from "../publications/comment/comment.js";
import Vote from "../publications/vote/vote.js";
import { CommentEdit } from "../publications/comment-edit/comment-edit.js";
import Stats from "../stats.js";
import { PKCClientsManager } from "./pkc-client-manager.js";
import PKCRpcClient from "../clients/rpc-client/pkc-rpc-client.js";
import { InflightFetchManager } from "../util/inflight-fetch-manager.js";
import type { ChallengeFileFactoryInput, CreateRemoteCommunityOptions, CommunityJson, CommunityIpfsType, RemoteCommunityJson, RpcRemoteCommunityJson } from "../community/types.js";
import { RemoteCommunity } from "../community/remote-community.js";
import { RpcRemoteCommunity } from "../community/rpc-remote-community.js";
import { RpcLocalCommunity } from "../community/rpc-local-community.js";
import type { LocalCommunity } from "../runtime/node/community/local-community.js";
import { z } from "zod";
import type { CreateSignerOptions } from "../signer/types.js";
import type { CommentEditPubsubMessagePublication, CommentEditTypeJson, CreateCommentEditOptions } from "../publications/comment-edit/types.js";
import type { CreateVoteOptions, VoteJson, VotePubsubMessagePublication } from "../publications/vote/types.js";
import type { CommentIpfsType, CommentIpfsWithCidDefined, CommentJson, CommentPubsubMessagePublication, CommentUpdateType, CommentWithinRepliesPostsPageJson, CreateCommentOptions, MinimumCommentFieldsToFetchPages } from "../publications/comment/types.js";
import { CreateCommunityFunctionArgumentsSchema } from "../community/schema.js";
import { CommentModeration } from "../publications/comment-moderation/comment-moderation.js";
import type { CommentModerationPubsubMessagePublication, CommentModerationTypeJson, CreateCommentModerationOptions } from "../publications/comment-moderation/types.js";
import CommunityEdit from "../publications/community-edit/community-edit.js";
import type { CreateCommunityEditPublicationOptions, CommunityEditJson, CommunityEditPubsubMessagePublication } from "../publications/community-edit/types.js";
import { PKCTypedEmitter } from "../clients/pkc-typed-emitter.js";
import type { PageTypeJson } from "../pages/types.js";
import type { Libp2pJsClient } from "../helia/libp2pjsClient.js";
import type { AuthorNameRpcParam, CidRpcParam, RpcFetchCidResult } from "../clients/rpc-client/types.js";
import { IndexedTrackedInstanceRegistry } from "./tracked-instance-registry.js";
export declare class PKC extends PKCTypedEmitter<PKCEvents> implements ParsedPKCOptions {
    ipfsGatewayUrls: ParsedPKCOptions["ipfsGatewayUrls"];
    kuboRpcClientsOptions?: ParsedPKCOptions["kuboRpcClientsOptions"];
    pubsubKuboRpcClientsOptions: ParsedPKCOptions["pubsubKuboRpcClientsOptions"];
    pkcRpcClientsOptions?: ParsedPKCOptions["pkcRpcClientsOptions"];
    libp2pJsClientsOptions?: ParsedPKCOptions["libp2pJsClientsOptions"];
    dataPath?: ParsedPKCOptions["dataPath"];
    resolveAuthorNames: ParsedPKCOptions["resolveAuthorNames"];
    nameResolvers?: ParsedPKCOptions["nameResolvers"];
    parsedPKCOptions: ParsedPKCOptions;
    publishInterval: ParsedPKCOptions["publishInterval"];
    updateInterval: ParsedPKCOptions["updateInterval"];
    noData: ParsedPKCOptions["noData"];
    validatePages: ParsedPKCOptions["validatePages"];
    userAgent: ParsedPKCOptions["userAgent"];
    httpRoutersOptions: ParsedPKCOptions["httpRoutersOptions"];
    clients: {
        ipfsGateways: {
            [ipfsGatewayUrl: NonNullable<ParsedPKCOptions["ipfsGatewayUrls"]>[number]]: GatewayClient;
        };
        kuboRpcClients: {
            [kuboRpcClientUrl: string]: KuboRpcClient;
        };
        pubsubKuboRpcClients: {
            [pubsubKuboClientUrl: string]: PubsubClient;
        };
        pkcRpcClients: {
            [pkcRpcUrl: NonNullable<ParsedPKCOptions["pkcRpcClientsOptions"]>[number]]: PKCRpcClient;
        };
        libp2pJsClients: {
            [libp2pJsClientKey: NonNullable<ParsedPKCOptions["libp2pJsClientsOptions"]>[number]["key"]]: Libp2pJsClient;
        };
    };
    communities: string[];
    settings: {
        challenges?: Record<string, ChallengeFileFactoryInput>;
    };
    _pkcRpcClient?: PKCRpcClient;
    private _pubsubSubscriptions;
    _clientsManager: PKCClientsManager;
    _userPKCOptions: InputPKCOptions;
    _stats: Stats;
    _storage: StorageInterface;
    _updatingCommunities: IndexedTrackedInstanceRegistry<RemoteCommunity | RpcRemoteCommunity | RpcLocalCommunity | LocalCommunity>;
    _updatingComments: IndexedTrackedInstanceRegistry<Comment>;
    _startedCommunities: IndexedTrackedInstanceRegistry<LocalCommunity | RpcLocalCommunity>;
    private _communityFsWatchAbort?;
    private _destroyAbortController?;
    private _httpRouterSetupPromise?;
    destroyed: boolean;
    private _promiseToWaitForFirstCommunitieschangeEvent;
    private _storageLRUs;
    _memCaches: PKCMemCaches;
    _inflightFetchManager: InflightFetchManager;
    _timeouts: {
        "community-ipns": number;
        "community-ipfs": number;
        "comment-ipfs": number;
        "comment-update-ipfs": number;
        "page-ipfs": number;
        "generic-ipfs": number;
        "resolve-author-name": number;
    };
    constructor(options: InputPKCOptions);
    _initMemCaches(): void;
    private _initKuboRpcClientsIfNeeded;
    private _initKuboPubsubClientsIfNeeded;
    private _initLibp2pJsClientsIfNeeded;
    private _initRpcClientsIfNeeded;
    private _initIpfsGatewaysIfNeeded;
    private _setupHttpRoutersWithKuboNodeInBackground;
    _init(): Promise<void>;
    getCommunity(getCommunityArgs: GetCommunityArgs): Promise<RemoteCommunity>;
    getComment(cid: CidRpcParam): Promise<Comment>;
    private _initMissingFieldsOfPublicationBeforeSigning;
    private _createCommentInstanceFromAnotherCommentInstance;
    createComment(options: CommentIpfsType | CommentPubsubMessagePublication | {
        cid: CommentUpdateType["cid"];
        communityAddress?: string;
        subplebbitAddress?: string;
        communityPublicKey?: string;
        communityName?: string;
    } | MinimumCommentFieldsToFetchPages | CreateCommentOptions | CommentJson | Comment | CommentWithinRepliesPostsPageJson | CommentIpfsWithCidDefined): Promise<Comment>;
    _canCreateNewLocalCommunity(): boolean;
    protected _setCommunityIpfsOnInstanceIfPossible(community: RpcRemoteCommunity | RemoteCommunity, options: CreateRemoteCommunityOptions | CommunityIpfsType | RemoteCommunityJson | RpcRemoteCommunityJson): Promise<void>;
    protected _waitForCommunitiesToBeDefined(): Promise<void>;
    _awaitCommunitiesToIncludeCommunity(communityAddress: string): Promise<void>;
    private _createRemoteCommunityInstance;
    private _createLocalCommunity;
    private _createCommunityInstanceFromJsonifiedCommunity;
    createCommunity(options?: z.infer<typeof CreateCommunityFunctionArgumentsSchema> | CommunityJson): Promise<RemoteCommunity | RpcRemoteCommunity | RpcLocalCommunity | LocalCommunity>;
    _createVoteInstanceFromJsonfiedVote(jsonfied: VoteJson): Promise<Vote>;
    createVote(options: CreateVoteOptions | VotePubsubMessagePublication | VoteJson): Promise<Vote>;
    _createCommentEditInstanceFromJsonfiedCommentEdit(jsonfied: CommentEditTypeJson): Promise<CommentEdit>;
    createCommentEdit(options: CreateCommentEditOptions | CommentEditPubsubMessagePublication | CommentEditTypeJson): Promise<CommentEdit>;
    _createCommentModerationInstanceFromJsonfiedCommentModeration(jsonfied: CommentModerationTypeJson): Promise<CommentModeration>;
    createCommentModeration(options: CreateCommentModerationOptions | CommentModerationPubsubMessagePublication | CommentModerationTypeJson): Promise<CommentModeration>;
    _createCommunityEditInstanceFromJsonfiedCommunityEdit(jsonfied: CommunityEditJson): Promise<CommunityEdit>;
    createCommunityEdit(options: CreateCommunityEditPublicationOptions | CommunityEditPubsubMessagePublication | CommunityEditJson): Promise<CommunityEdit>;
    createSigner(createSignerOptions?: CreateSignerOptions): Promise<import("../signer/index.js").SignerWithPublicKeyAddress>;
    fetchCid(fetchCidArgs: CidRpcParam): Promise<RpcFetchCidResult>;
    pubsubSubscribe(pubsubTopic: string): Promise<void>;
    pubsubUnsubscribe(pubsubTopic: string): Promise<void>;
    resolveAuthorName(resolveAuthorNameArgs: AuthorNameRpcParam): Promise<{
        resolvedAuthorName: string | null;
    }>;
    validateComment(comment: Comment | PageTypeJson["comments"][number], opts?: {
        validateReplies?: boolean;
    }): Promise<void>;
    _createStorageLRU(opts: Omit<LRUStorageConstructor, "pkc">): Promise<LRUStorageInterface>;
    _getDestroyAbortSignal(): AbortSignal;
    destroy(): Promise<void>;
}
