import { hexstring } from '@shardeum-foundation/lib-crypto-utils';
import { P2P } from '@shardeum-foundation/lib-types';
import { FIFOCache } from '../utils';
export declare let nodes: Map<P2P.NodeListTypes.Node['id'], P2P.NodeListTypes.Node>;
export declare let byPubKey: Map<P2P.NodeListTypes.Node['publicKey'], P2P.NodeListTypes.Node>;
export declare let byIpPort: Map<string, P2P.NodeListTypes.Node>;
export declare let byJoinOrder: P2P.NodeListTypes.Node[];
export declare let byIdOrder: P2P.NodeListTypes.Node[];
export declare let othersByIdOrder: P2P.NodeListTypes.Node[];
export declare let activeByIdOrder: P2P.NodeListTypes.Node[];
export declare let activeIdToPartition: Map<string, number>;
export declare let syncingByIdOrder: P2P.NodeListTypes.Node[];
export declare let selectedByIdOrder: P2P.NodeListTypes.Node[];
export declare let standbyByIdOrder: P2P.NodeListTypes.Node[];
export declare let readyByTimeAndIdOrder: P2P.NodeListTypes.Node[];
export declare let activeOthersByIdOrder: P2P.NodeListTypes.Node[];
export declare let potentiallyRemoved: Set<P2P.NodeListTypes.Node['id']>;
export declare let selectedById: Map<P2P.NodeListTypes.Node['id'], number>;
export declare let removedNodeIDCache: FIFOCache<P2P.NodeListTypes.Node['id'], P2P.NodeListTypes.Node['publicKey']>;
/** FUNCTIONS */
export declare function init(): void;
export declare function reset(caller: string): void;
export declare function addNode(node: P2P.NodeListTypes.Node, caller: string, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function addNodes(newNodes: P2P.NodeListTypes.Node[], caller: string, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function getRemovedNodePubKeyFromCache(nodeId: P2P.NodeListTypes.Node['id']): string;
export declare function removeSelectedNode(id: string): void;
export declare function removeSyncingNode(id: string): void;
export declare function removeReadyNode(id: string): void;
export declare function removeNode(id: string, raiseEvents: boolean, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function emitSyncTimeoutEvent(node: P2P.NodeListTypes.Node, cycle: P2P.CycleCreatorTypes.CycleRecord): void;
export declare function removeNodes(ids: string[], raiseEvents: boolean, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function updateNode(update: P2P.NodeListTypes.Update, raiseEvents: boolean, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function updateNodes(updates: P2P.NodeListTypes.Update[], raiseEvents: boolean, cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function updateProblematicNodeTracking(cycle: P2P.CycleCreatorTypes.CycleRecord | null): void;
export declare function isNodeLeftNetworkEarly(node: P2P.NodeListTypes.Node): boolean;
export declare function isNodeRefuted(node: P2P.NodeListTypes.Node): boolean;
export declare function createNode(joined: P2P.JoinTypes.JoinedConsensor): P2P.NodeListTypes.Node;
export declare function ipPort(ip: string, port: number): string;
export declare function getDebug(): string;
/**
 * The index starts at 1, not 0.  1 is the youngest node, idx === total is the oldest node.
 * @returns {idx: number, total: number} - idx is the index of the node in the list, total is the total number of nodes in the list
 */
export declare function getAgeIndex(): {
    idx: number;
    total: number;
};
export declare function getAgeIndexForNodeId(nodeId: string): {
    idx: number;
    total: number;
};
/** Returns the validator list hash. It is a hash of the NodeList sorted by join order. This will also update the recorded `lastHashedList` of nodes, which can be retrieved via `getLastHashedNodeList`. */
export declare function computeNewNodeListHash(log?: boolean): hexstring;
/**
 * For Sync v2, returns the validator list hash from the last complete cycle, if available. If you
 * want to compute a new hash instead, use `computeNewNodeListHash`.
 *
 * If Sync v2 is not enabled, it returns the hash of a sorted list of active node IDs.
 */
export declare function getNodeListHash(): hexstring | undefined;
/** Returns the last list of nodes that had its hash computed. */
export declare function getLastHashedNodeList(): P2P.NodeListTypes.Node[];
export declare function changeNodeListInRestore(cycleStartTimestamp: number): void;
