import { Server as RpcWebsocketsServer } from "rpc-websockets"; import { setPKCJs } from "./lib/pkc-js/index.js"; import type { PKCWsServerClassOptions, JsonRpcSendNotificationOptions, CreatePKCWsServerOptions, PKCRpcServerEvents } from "./types.js"; import { PKC } from "../../pkc/pkc.js"; import WebSocket from "ws"; import Publication from "../../publications/publication.js"; import { LocalCommunity } from "../../runtime/node/community/local-community.js"; import type { CommentIpfsType } from "../../publications/comment/types.js"; import type { RpcInternalCommunityRecordBeforeFirstUpdateType } from "../../community/types.js"; import { TypedEmitter } from "tiny-typed-emitter"; import type { AnchorPublishPreparation, PublishedAnchorRecord, RpcSubscriptionIdResult, RpcSuccessResult, RpcFetchCidResult, RpcResolveAuthorNameResult, RpcCommentPageResult, RpcCommunityPageResult, RpcLocalCommunityUpdateResultType, RpcExportCommunityResult, RpcExportCommunityModLogsResult } from "../../clients/rpc-client/types.js"; declare class PKCWsServer extends TypedEmitter { pkc: PKC; rpcWebsockets: RpcWebsocketsServer; ws: RpcWebsocketsServer["wss"]; connections: { [connectionId: string]: WebSocket; }; subscriptionCleanups: { [connectionId: string]: { [subscriptionId: number]: () => Promise; }; }; publishing: { [subscriptionId: number]: { publication: Publication; pkc: PKC; connectionId: string; timeout?: NodeJS.Timeout; }; }; private _setSettingsQueue; authKey: string | undefined; private _trackedCommunityListeners; private _getIpFromConnectionRequest; private _onSettingsChange; private _startedCommunities; private _autoStartOnBoot; private _autoStartConcurrency; private _rpcStateDb; private _allowPrivateKeyExport; private _exportFileMaxAgeMs; private _exportCommunityInstances; private _httpServer; private _ownsHttpServer; private _pendingDisconnectionCleanups; constructor({ port, server, pkc, authKey, startStartedCommunitiesOnStartup, autoStartConcurrency, allowPrivateKeyExport, exportFileMaxAgeMs }: PKCWsServerClassOptions); getStartedCommunity(address: string): Promise; private _findCommunityAddress; private _emitError; private _getRpcStateDb; private _updateCommunityState; private _removeCommunityState; _autoStartPreviousCommunities(): Promise; private _internalStartCommunity; rpcWebsocketsRegister(method: string, callback: Function): void; jsonRpcSendNotification({ method, result, subscription, event, connectionId }: JsonRpcSendNotificationOptions): void; private _registerPublishing; private _clearPublishing; private _forceCleanupPublication; private _retirePKCIfNeeded; _getPKCInstance(): Promise; getComment(params: any): Promise; getCommunityPage(params: any): Promise; getCommentPage(params: any): Promise; createCommunity(params: any): Promise; private _trackCommunityListener; private _untrackCommunityListener; _setupStartedEvents(community: LocalCommunity, connectionId: string, subscriptionId: number): void; startCommunity(params: any, connectionId: string): Promise; stopCommunity(params: any): Promise; private _postStoppingOrDeleting; editCommunity(params: any): Promise; private _getLocalCommunityForAnchorMethod; prepareAnchorPublish(params: any): Promise; publishAnchorRecord(params: any): Promise; deleteCommunity(params: any): Promise; communitiesSubscribe(params: any, connectionId: string): Promise; fetchCid(params: any): Promise; private _serializeSettingsFromPKC; settingsSubscribe(params: any, connectionId: string): Promise; private _initPKC; private _createPKCInstanceFromSetSettings; setSettings(params: any): Promise; commentUpdateSubscribe(params: any, connectionId: string): Promise; communityUpdateSubscribe(params: any, connectionId: string): Promise; private _bindCommunityUpdateSubscription; private _createCommentInstanceFromPublishCommentParams; publishComment(params: any, connectionId: string): Promise; private _createVoteInstanceFromPublishVoteParams; publishVote(params: any, connectionId: string): Promise; private _createCommunityEditInstanceFromPublishCommunityEditParams; publishCommunityEdit(params: any, connectionId: string): Promise; private _createCommentEditInstanceFromPublishCommentEditParams; publishCommentEdit(params: any, connectionId: string): Promise; private _createCommentModerationInstanceFromPublishCommentModerationParams; publishCommentModeration(params: any, connectionId: string): Promise; publishChallengeAnswers(params: any): Promise; resolveAuthorName(params: any): Promise; private _resolveLocalCommunityForExport; private _toWireExportRecord; exportCommunity(params: any, connectionId: string): Promise; exportCommunityModLogs(params: any): Promise; exportsSubscribe(params: any, connectionId: string): Promise; cancelExport(params: any, connectionId: string): Promise; private _exportLoadedCommunities; private _findCommunityOwningExport; _sweepOldExportFiles(): Promise; private _handleExportsHttpRequest; unsubscribe(params: any, connectionId: string): Promise; private _cleanUpDisconnectedClient; destroy(): Promise; } declare const PKCRpc: { PKCWsServer: (options: CreatePKCWsServerOptions) => Promise; setPKCJs: typeof setPKCJs; }; export default PKCRpc;