import { messages } from "./errors.js";
import type { CommunityIpfsType } from "./community/types.js";
import { CID } from "kubo-rpc-client";
import type { Multiaddr } from "@multiformats/multiaddr";
import type { KuboRpcClient } from "./types.js";
import type { AddOptions, AddResult, BlockPutOptions, BlockRmOptions, FilesRmOptions, FilesStatOptions, FilesStatResult, FilesWriteOptions, PinAddOptions, RoutingProvideOptions } from "kubo-rpc-client";
import type { DecryptedChallengeRequestMessageType, DecryptedChallengeRequestMessageTypeWithCommunityAuthor, DecryptedChallengeRequestMessageWithPostCommunityAuthor, DecryptedChallengeRequestMessageWithReplyCommunityAuthor, DecryptedChallengeRequestPublication, PublicationFromDecryptedChallengeRequest, PublicationWithCommunityAuthorFromDecryptedChallengeRequest } from "./pubsub-messages/types.js";
import EventEmitter from "events";
import { RemoteCommunity } from "./community/remote-community.js";
import { PKC } from "./pkc/pkc.js";
import Logger from "./logger.js";
import { type IPNSRecord } from "ipns";
export declare function timestamp(): number;
export declare function createAbortError(message?: string): Error;
export declare function isAbortError(error: unknown): error is Error;
export declare function throwIfAbortSignalAborted(signal?: AbortSignal): void;
export declare function replaceXWithY(obj: Record<string, any>, x: any, y: any): any;
export declare function removeNullUndefinedValues<T extends Object>(obj: T): T;
export declare function removeUndefinedValuesRecursively<T>(obj: T): T;
export declare function removeNullUndefinedEmptyObjectsValuesRecursively<T>(obj: T): T;
export declare const parseDbResponses: (obj: any) => any;
export declare function shortifyAddress(address: string): string;
export declare function shortifyCid(cid: string): string;
export declare function delay(ms: number): Promise<void>;
export declare function firstResolve<T>(promises: Promise<T>[]): Promise<T>;
export declare function getErrorCodeFromMessage(message: string): keyof typeof messages;
export declare function doesDomainAddressHaveCapitalLetter(domainAddress: string): boolean;
export declare function getPostUpdateTimestampRange(postUpdates: CommunityIpfsType["postUpdates"], postTimestamp: number): string[];
export declare function isLinkValid(link: string): boolean;
export declare function isLinkOfMedia(link: string): boolean;
export declare function isLinkOfImage(link: string): boolean;
export declare function isLinkOfVideo(link: string): boolean;
export declare function isLinkOfAnimatedImage(link: string): boolean;
export declare function isLinkOfAudio(link: string): boolean;
export declare function contentContainsMarkdownImages(content: string): boolean;
export declare function contentContainsMarkdownAudio(content: string): boolean;
export declare function contentContainsMarkdownVideos(content: string): boolean;
export declare function genToArray<T>(gen: AsyncIterable<T>): Promise<T[]>;
export declare function isStringDomain(x: string | undefined): boolean;
export declare function isEthAliasDomain(address: string): boolean;
export declare function normalizeEthAliasDomain(address: string): string;
export declare function areEquivalentCommunityAddresses(addressA: string, addressB: string): boolean;
export declare function getEquivalentCommunityAddresses(address: string): string[];
export declare function isIpns(x: string): boolean;
export declare function isIpfsCid(x: string): boolean;
export declare function isIpfsPath(x: string): boolean;
export declare function isIpnsPath(x: string): boolean;
export type KuboRpcClientCreateOption = string | URL | Multiaddr | (Record<string, unknown> & {
    url?: string | URL | Multiaddr;
});
export declare function parseIpfsRawOptionToIpfsOptions(kuboRpcRawOption: KuboRpcClientCreateOption): KuboRpcClient["_clientOptions"];
export declare function deepMergeRuntimeFields(target: any, source: any): void;
export declare function hideClassPrivateProps(_this: any): void;
export declare function derivePublicationFromChallengeRequest<T extends Pick<DecryptedChallengeRequestMessageType | DecryptedChallengeRequestMessageTypeWithCommunityAuthor | DecryptedChallengeRequestMessageType, keyof DecryptedChallengeRequestPublication>>(request: T): T extends DecryptedChallengeRequestMessageTypeWithCommunityAuthor ? PublicationWithCommunityAuthorFromDecryptedChallengeRequest : PublicationFromDecryptedChallengeRequest;
export declare function isRequestPubsubPublicationOfReply(request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor): request is DecryptedChallengeRequestMessageWithReplyCommunityAuthor;
export declare function isRequestPubsubPublicationOfPost(request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor): request is DecryptedChallengeRequestMessageWithPostCommunityAuthor;
export declare function resolveWhenPredicateIsTrue(options: {
    toUpdate: EventEmitter;
    predicate: () => Promise<boolean> | boolean;
    eventName?: string;
}): Promise<void>;
export declare function waitForUpdateInCommunityInstanceWithErrorAndTimeout(community: RemoteCommunity, timeoutMs: number): Promise<void>;
export declare function calculateIpfsCidV0(content: string): Promise<string>;
/**
 * converts a binary record key to a pubsub topic key
 */
export declare function binaryKeyToPubsubTopic(key: Uint8Array): string;
export declare function ipnsNameToIpnsOverPubsubTopic(ipnsName: string): string;
export declare const pubsubTopicToDhtKey: (pubsubTopic: string) => string;
export declare const pubsubTopicToDhtKeyCid: (pubsubTopic: string) => CID;
export declare function retryKuboBlockPutPinAndProvidePubsubTopic({ ipfsClient: kuboRpcClient, log, pubsubTopic, inputNumOfRetries, blockPutOptions, pinAddOptions, provideOptions }: {
    ipfsClient: Pick<PKC["clients"]["kuboRpcClients"][string]["_client"], "block" | "pin" | "routing">;
    log: Logger;
    pubsubTopic: string;
    inputNumOfRetries?: number;
    blockPutOptions?: BlockPutOptions;
    pinAddOptions?: PinAddOptions;
    provideOptions?: RoutingProvideOptions;
}): Promise<CID>;
export declare function retryKuboIpfsAddAndProvide({ ipfsClient: kuboRpcClient, log, content, inputNumOfRetries, addOptions, provideOptions, provideInBackground }: {
    ipfsClient: Pick<PKC["clients"]["kuboRpcClients"][string]["_client"], "add" | "routing">;
    log: Logger;
    content: string;
    inputNumOfRetries?: number;
    addOptions?: AddOptions;
    provideOptions?: RoutingProvideOptions;
    provideInBackground: boolean;
}): Promise<AddResult>;
export declare function retryKuboIpfsAdd({ ipfsClient: kuboRpcClient, log, content, inputNumOfRetries, options }: {
    ipfsClient: Pick<PKC["clients"]["kuboRpcClients"][string]["_client"], "add">;
    log: Logger;
    content: string;
    inputNumOfRetries?: number;
    options?: AddOptions;
}): Promise<AddResult>;
type KuboFilesWriteParameters = Parameters<PKC["clients"]["kuboRpcClients"][string]["_client"]["files"]["write"]>;
export declare function writeKuboFilesWithTimeout({ ipfsClient: kuboRpcClient, log, path, content, inputNumOfRetries, options, timeoutMs }: {
    ipfsClient: Pick<PKC["clients"]["kuboRpcClients"][string]["_client"], "files">;
    log: Logger;
    path: KuboFilesWriteParameters[0];
    content: KuboFilesWriteParameters[1];
    inputNumOfRetries?: number;
    options?: FilesWriteOptions;
    timeoutMs?: number;
}): Promise<void>;
export declare function removeBlocksFromKuboNode({ ipfsClient: kuboRpcClient, log, cids, inputNumOfRetries, options }: {
    ipfsClient: Pick<PKC["clients"]["kuboRpcClients"][string]["_client"], "block">;
    log: Logger;
    cids: string[];
    inputNumOfRetries?: number;
    options?: BlockRmOptions;
}): Promise<string[]>;
export declare function removeMfsFilesSafely({ kuboRpcClient, paths, log, inputNumOfRetries, rmOptions }: {
    kuboRpcClient: PKC["clients"]["kuboRpcClients"][string];
    paths: string[];
    log?: Logger;
    inputNumOfRetries?: number;
    rmOptions?: FilesRmOptions;
}): Promise<void>;
export declare function statMfsPathSafely({ kuboRpcClient, path, statOptions, log, inputNumOfRetries }: {
    kuboRpcClient: PKC["clients"]["kuboRpcClients"][string];
    path: string;
    statOptions?: FilesStatOptions;
    log?: Logger;
    inputNumOfRetries?: number;
}): Promise<FilesStatResult>;
export declare const MAX_IPNS_RECORD_SIZE: number;
export declare function getIpnsRecordInLocalKuboNode(kuboRpcClient: KuboRpcClient, ipnsName: string): Promise<IPNSRecord>;
export declare function fetchAndValidateIpnsRecordFromGateway(gatewayUrl: string, ipnsName: string, opts?: {
    abortSignal?: AbortSignal;
    recordContext?: Record<string, unknown>;
}): Promise<IPNSRecord>;
export declare function calculateStringSizeSameAsIpfsAddCidV0(content: string): Promise<number>;
export type NetworkErrorDetails = {
    name: string;
    message: string;
    code?: string;
    errno?: number;
    syscall?: string;
    address?: string;
    port?: number;
    causes?: NetworkErrorDetails[];
};
export declare function extractNetworkErrorDetails(err: unknown, depth?: number): NetworkErrorDetails | undefined;
export {};
