/// <reference types="node" />
import { EventEmitter } from 'events';
import * as Shardus from '../shardus/shardus-types';
import { P2P as P2PTypings } from '@shardeum-foundation/lib-types';
import { ShardusTypes } from '../shardus';
import { VectorBufferStream } from '../utils/serialization/VectorBufferStream';
import { AppHeader } from '@shardeum-foundation/lib-net/build/src/types';
import { InternalBinaryHandler } from '../types/Handler';
export declare class P2P extends EventEmitter {
    registerInternal: (route: any, handler: any) => void;
    registerInternalBinary: (route: string, handler: InternalBinaryHandler) => void;
    registerGossipHandler: (type: any, handler: any) => void;
    unregisterGossipHandler: (type: any) => void;
    unregisterInternal: (route: any) => void;
    ask: (node: ShardusTypes.Node, route: string, message?: {}, logged?: boolean, tracker?: string, extraTime?: number) => Promise<any>;
    askBinary: <TReq, TRes>(node: ShardusTypes.Node, route: string, message: TReq, reqSerializerFunc: (stream: VectorBufferStream, obj: TReq, root?: boolean) => void, respDeserializerFunc: (stream: VectorBufferStream, root?: boolean) => TRes, appHeader: AppHeader, tracker?: string, logged?: boolean, extraTime?: number) => Promise<TRes>;
    tell: (nodes: any, route: any, message: any, logged?: boolean, tracker?: string) => Promise<number>;
    tellBinary: <TReq>(nodes: ShardusTypes.Node[], route: string, message: TReq, serializerFunc: (stream: VectorBufferStream, obj: TReq, root?: boolean) => void, appHeader: AppHeader, logged?: boolean, tracker?: string) => Promise<number>;
    sendGossipIn: (type: any, payload: any, tracker?: string, sender?: any, inpNodes?: Shardus.NodeWithRank[] | Shardus.Node[], isOrigin?: boolean, factor?: number, txId?: string) => Promise<number>;
    sendGossipAll: (type: any, payload: any, tracker?: string, sender?: any, inpNodes?: P2PTypings.NodeListTypes.Node[]) => Promise<number>;
    robustQuery: any;
    state: typeof state;
    constructor();
    get isFirstSeed(): boolean;
    get isActive(): boolean;
    get id(): string;
    getNodeId(): string;
    initApoptosis(message: string, userFriendlyMessage?: string): void;
    allowTransactions(): boolean;
    allowSet(): boolean;
    setJoinRequestToggle(bool: any): void;
    getLatestCycles(amount: any): P2PTypings.CycleCreatorTypes.CycleRecord[];
    shutdown(): void;
    configUpdated(): void;
}
export declare const p2p: P2P;
declare class State extends EventEmitter {
    getNode(id: string): P2PTypings.NodeListTypes.Node | undefined;
    getRemovedNodePubKeyFromCache(id: string): P2PTypings.NodeListTypes.Node['publicKey'] | undefined;
    getNodes(): Map<string, P2PTypings.NodeListTypes.Node>;
    getNodesRequestingJoin(): P2PTypings.P2PTypes.P2PNode[];
    getNodeByPubKey(pubkey: any): P2PTypings.NodeListTypes.Node;
    getActiveNodes_orig(id: any): unknown[];
    getActiveNodes(id?: any): P2PTypings.NodeListTypes.Node[];
    getOrderedSyncingNeighbors(node: any): P2PTypings.NodeListTypes.Node[];
    getLastCycle(): P2PTypings.CycleCreatorTypes.CycleRecord;
    getCycleByCounter(counter: any): P2PTypings.CycleCreatorTypes.CycleRecord;
    getCycleByTimestamp(timestamp: any): P2PTypings.CycleCreatorTypes.CycleRecord;
}
declare const state: State;
export {};
