import type { StorageInterface, GatewayClient, KuboRpcClient, PKCEvents, PubsubClient, ParsedPKCOptions, LRUStorageInterface, LRUStorageConstructor, InputPKCOptions, PKCMemCaches, GetCommunityArgs, GetCommentArgs } 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/browser/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 type Publication from "../publications/publication.js"; import { IndexedTrackedInstanceRegistry } from "./tracked-instance-registry.js"; export declare class PKC extends PKCTypedEmitter 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[number]]: GatewayClient; }; kuboRpcClients: { [kuboRpcClientUrl: string]: KuboRpcClient; }; pubsubKuboRpcClients: { [pubsubKuboClientUrl: string]: PubsubClient; }; pkcRpcClients: { [pkcRpcUrl: NonNullable[number]]: PKCRpcClient; }; libp2pJsClients: { [libp2pJsClientKey: NonNullable[number]["key"]]: Libp2pJsClient; }; }; communities: string[]; settings: { challenges?: Record; }; _pkcRpcClient?: PKCRpcClient; private _pubsubSubscriptions; _clientsManager: PKCClientsManager; _userPKCOptions: InputPKCOptions; _stats: Stats; _storage: StorageInterface; _updatingCommunities: IndexedTrackedInstanceRegistry; _updatingComments: IndexedTrackedInstanceRegistry; _startedCommunities: IndexedTrackedInstanceRegistry; _publishingPublications: Set; 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; _waitForHttpRoutersSetupToSettle(): Promise; _init(): Promise; getCommunity(getCommunityArgs: GetCommunityArgs): Promise; getComment(getCommentArgs: GetCommentArgs): Promise; 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; _canCreateNewLocalCommunity(): boolean; protected _setCommunityIpfsOnInstanceIfPossible(community: RpcRemoteCommunity | RemoteCommunity, options: CreateRemoteCommunityOptions | CommunityIpfsType | RemoteCommunityJson | RpcRemoteCommunityJson): Promise; protected _waitForCommunitiesToBeDefined(): Promise; _awaitCommunitiesToIncludeCommunity(communityAddress: string): Promise; private _createRemoteCommunityInstance; private _createLocalCommunity; private _createCommunityInstanceFromJsonifiedCommunity; createCommunity(options?: z.infer | CommunityJson, opts?: { abortSignal?: AbortSignal; }): Promise; _createVoteInstanceFromJsonfiedVote(jsonfied: VoteJson): Promise; createVote(options: CreateVoteOptions | VotePubsubMessagePublication | VoteJson): Promise; _createCommentEditInstanceFromJsonfiedCommentEdit(jsonfied: CommentEditTypeJson): Promise; createCommentEdit(options: CreateCommentEditOptions | CommentEditPubsubMessagePublication | CommentEditTypeJson): Promise; _createCommentModerationInstanceFromJsonfiedCommentModeration(jsonfied: CommentModerationTypeJson): Promise; createCommentModeration(options: CreateCommentModerationOptions | CommentModerationPubsubMessagePublication | CommentModerationTypeJson): Promise; _createCommunityEditInstanceFromJsonfiedCommunityEdit(jsonfied: CommunityEditJson): Promise; createCommunityEdit(options: CreateCommunityEditPublicationOptions | CommunityEditPubsubMessagePublication | CommunityEditJson): Promise; createSigner(createSignerOptions?: CreateSignerOptions): Promise; fetchCid(fetchCidArgs: CidRpcParam): Promise; pubsubSubscribe(pubsubTopic: string): Promise; pubsubUnsubscribe(pubsubTopic: string): Promise; resolveAuthorName(resolveAuthorNameArgs: AuthorNameRpcParam): Promise<{ resolvedAuthorName: string | null; }>; validateComment(comment: Comment | PageTypeJson["comments"][number], opts?: { validateReplies?: boolean; }): Promise; _createStorageLRU(opts: Omit): Promise; _getDestroyAbortSignal(): AbortSignal; _combineWithDestroyAbortSignal(abortSignal?: AbortSignal): AbortSignal; destroy(): Promise; }