export const LEAF_NODE_LAYER: -1;
export const STRUCT_LAYER: -2;
export const CONFLICT_RECONCILE_LAYER: -3;
export function initialByzantineClientStore(store: ByzantineStore, client: number): {
    leafNodeList: MerkleTreeLeafNodeList;
    layerNodeList: MerkleTreeLayerNodeList;
    merkleTreeRoot: null;
    hashTable: Map<any, any>;
};
export function createFHash(leafNode: MerkleTreeLeafNode, clientByzantineStore: {
    leafNodeList: MerkleTreeLeafNodeList;
    layerNodeList: MerkleTreeLayerNodeList;
    merkleTreeRoot: MerkleTreeHashNode | null | undefined;
}): string;
export function getFHashNodes(leafNode: MerkleTreeLeafNode, clientByzantineStore: {
    leafNodeList: MerkleTreeLeafNodeList;
    layerNodeList: MerkleTreeLayerNodeList;
    merkleTreeRoot: MerkleTreeHashNode | null | undefined;
}): {
    layer: number;
    offset: number;
    hash: string;
    item: MerkleTreeLeafNode | MerkleTreeHashNode;
}[];
export function addLeafNodesToMerkleTree(leafNodesMap: Map<number, Array<MerkleTreeLeafNode>>, store: ByzantineStore): void;
export function addPendingMerkleTreeLeafNodesToTransaction(transaction: Transaction, structId: ID, leafNodes: Array<MerkleTreeLeafNode>): void;
export function findMerkleTreeLeafNodeInStore(store: ByzantineStore, struct: Item, id: ID): MerkleTreeLeafNode | null;
export function addMerkleTreeLeafNodes(store: ByzantineStore, struct: Item, transaction: Transaction): Array<MerkleTreeLeafNode>;
export function readByzantineState(doc: Doc): Map<number, {
    state: number;
    fhash: string;
}>;
export function writeByzantineStateToEncoder(encoder: encoding.Encoder, doc: Doc): boolean;
export function writeByzantineUpdateMessageFromTransaction(encoder: encoding.Encoder, transaction: Transaction): boolean;
export function readByzantineStateFromDecoder(decoder: decoding.Decoder): Map<number, {
    state: number;
    fhash: string;
}>;
export function getFanNodesFromByzantineStates(byzantineStates: Map<number, {
    state: number;
    fhash: string;
}>, doc: Doc): Map<number, Array<{
    layer: number;
    offset: number;
    hash: string;
    item: MerkleTreeLeafNode | MerkleTreeHashNode;
}>>;
export function writeFanNodesToEncoder(encoder: encoding.Encoder, fanNodes: Map<number, Array<{
    layer: number;
    offset: number;
    hash?: string;
    hashs?: Array<string>;
    item?: MerkleTreeLeafNode | MerkleTreeHashNode;
    localMissing?: Array<Item | GC>;
    remoteMissing?: Array<string>;
}>>, doc: Doc): boolean;
export function readFanNodesFromDecoder(decoder: decoding.Decoder, doc: Doc, transaction?: Transaction | null): Map<number, Array<{
    layer: number;
    offset: number;
    hash?: string;
    hashs?: Array<string>;
    item?: MerkleTreeLeafNode | MerkleTreeHashNode;
    localMissing?: Array<Item | GC>;
    remoteMissing?: Array<string>;
}>>;
export function getFanNodeByPosition(byzantineStore: ByzantineStore, client: number, layer: number, offset: number): MerkleTreeLeafNode | MerkleTreeHashNode | undefined;
export function getStructFHashByID(id: ID, doc: Doc): null | string;
export function diffByzantineStates(remoteByzantineState: Map<number, {
    state: number;
    fhash: string;
}>, localByzantineState: Map<number, {
    state: number;
    fhash: string;
}>): Array<number>;
export function clearLeafNodeFHashsFromIndex(store: {
    leafNodeList: MerkleTreeLeafNodeList;
    layerNodeList: MerkleTreeLayerNodeList;
    merkleTreeRoot: MerkleTreeHashNode | null | undefined;
}, index: number): void;
export class ByzantineStore {
    /**
     * @type {Map<number,{
     *   leafNodeList: MerkleTreeLeafNodeList,
     *   layerNodeList: MerkleTreeLayerNodeList,
     *   merkleTreeRoot: MerkleTreeHashNode | null | undefined,
     *   hashTable: Map<string, Item>
     * }>}
     */
    clients: Map<number, {
        leafNodeList: MerkleTreeLeafNodeList;
        layerNodeList: MerkleTreeLayerNodeList;
        merkleTreeRoot: MerkleTreeHashNode | null | undefined;
        hashTable: Map<string, Item>;
    }>;
    /**
     * 记录所有当前由于各种原因无法引入历史中的冲突structs
     * @type {null | { structs: Map<number, Array<Item | GC>> }}
     */
    pendingStructs: {
        structs: Map<number, Array<Item | GC>>;
    } | null;
}
import { MerkleTreeLeafNodeList } from "./MerkleTree/LeafNodeList";
import { MerkleTreeLayerNodeList } from "./MerkleTree/LayerNodeList";
import { MerkleTreeLeafNode } from "./MerkleTree/LeafNode";
import { MerkleTreeHashNode } from "./MerkleTree/HashNode";
import { Transaction } from "../utils/Transaction";
import { ID } from "../utils/ID";
import { Item } from "../structs/Item";
import { Doc } from "../utils/Doc";
import { encoding } from "lib0";
import { decoding } from "lib0";
import { GC } from "../structs/GC";
