import type { PeerScoreStatsDump } from "@libp2p/gossipsub/score";
import type { PublishOpts } from "@libp2p/gossipsub/types";
import type { PrivateKey } from "@libp2p/interface";
import { ModuleThread, Worker } from "@chainsafe/threads";
import { routes } from "@lodestar/api";
import { BeaconConfig } from "@lodestar/config";
import type { LoggerNode } from "@lodestar/logger/node";
import { ResponseIncoming, ResponseOutgoing } from "@lodestar/reqresp";
import { Status } from "@lodestar/types";
import { Metrics } from "../../metrics/index.js";
import { AsyncIterableBridgeHandler } from "../../util/asyncIterableToEvents.js";
import { PeerIdStr } from "../../util/peerId.js";
import { NetworkEventBus } from "../events.js";
import { NetworkOptions } from "../options.js";
import { PeerAction, PeerScoreStats } from "../peers/index.js";
import { GetReqRespHandlerFn, IncomingRequestArgs, OutgoingRequestArgs } from "../reqresp/types.js";
import { CommitteeSubscription } from "../subnets/interface.js";
import { INetworkCore, MultiaddrStr, NetworkWorkerApi } from "./types.js";
export type WorkerNetworkCoreOpts = NetworkOptions & {
    metricsEnabled: boolean;
    peerStoreDir?: string;
    activeValidatorCount: number;
    genesisTime: number;
    initialStatus: Status;
    initialCustodyGroupCount: number;
};
export type WorkerNetworkCoreInitModules = {
    opts: WorkerNetworkCoreOpts;
    config: BeaconConfig;
    logger: LoggerNode;
    privateKey: PrivateKey;
    events: NetworkEventBus;
    metrics: Metrics | null;
    getReqRespHandler: GetReqRespHandlerFn;
};
type WorkerNetworkCoreModules = WorkerNetworkCoreInitModules & {
    networkThreadApi: ModuleThread<NetworkWorkerApi>;
    worker: Worker;
};
/**
 * NetworkCore implementation using a Worker thread
 */
export declare class WorkerNetworkCore implements INetworkCore {
    private readonly modules;
    private readonly reqRespBridgeReqCaller;
    protected readonly reqRespBridgeRespHandler: AsyncIterableBridgeHandler<IncomingRequestArgs, ResponseOutgoing>;
    private readonly reqRespBridgeEventBus;
    constructor(modules: WorkerNetworkCoreModules);
    static init(modules: WorkerNetworkCoreInitModules): Promise<WorkerNetworkCore>;
    close(): Promise<void>;
    test(): Promise<void>;
    scrapeMetrics(): Promise<string>;
    updateStatus(status: Status): Promise<void>;
    reStatusPeers(peers: PeerIdStr[]): Promise<void>;
    reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): Promise<void>;
    prepareBeaconCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void>;
    prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void>;
    subscribeGossipCoreTopics(): Promise<void>;
    unsubscribeGossipCoreTopics(): Promise<void>;
    getConnectedPeerCount(): Promise<number>;
    getConnectedPeers(): Promise<PeerIdStr[]>;
    getNetworkIdentity(): Promise<routes.node.NetworkIdentity>;
    sendReqRespRequest(data: OutgoingRequestArgs): AsyncIterable<ResponseIncoming>;
    publishGossip(topic: string, data: Uint8Array, opts?: PublishOpts): Promise<number>;
    setTargetGroupCount(count: number): Promise<void>;
    connectToPeer(peer: PeerIdStr, multiaddr: MultiaddrStr[]): Promise<void>;
    disconnectPeer(peer: PeerIdStr): Promise<void>;
    addDirectPeer(peer: routes.lodestar.DirectPeer): Promise<string | null>;
    removeDirectPeer(peerId: PeerIdStr): Promise<boolean>;
    getDirectPeers(): Promise<string[]>;
    dumpPeers(): Promise<routes.lodestar.LodestarNodePeer[]>;
    dumpPeer(peerIdStr: string): Promise<routes.lodestar.LodestarNodePeer | undefined>;
    dumpPeerScoreStats(): Promise<PeerScoreStats>;
    dumpGossipPeerScoreStats(): Promise<PeerScoreStatsDump>;
    dumpDiscv5KadValues(): Promise<string[]>;
    dumpMeshPeers(): Promise<Record<string, string[]>>;
    writeNetworkThreadProfile(durationMs: number, dirpath: string): Promise<string>;
    writeDiscv5Profile(durationMs: number, dirpath: string): Promise<string>;
    writeNetworkHeapSnapshot(prefix: string, dirpath: string): Promise<string>;
    writeDiscv5HeapSnapshot(prefix: string, dirpath: string): Promise<string>;
    private getApi;
}
export {};
//# sourceMappingURL=networkCoreWorkerHandler.d.ts.map