import { HashComputationLevel, Node } from "@chainsafe/persistent-merkle-tree"; import { Type } from "../type/abstract.ts"; import { BasicType } from "../type/basic.ts"; import { CompositeType } from "../type/composite.ts"; import { BasicContainerTypeGeneric, ContainerTypeGeneric } from "../view/container.ts"; import { TreeViewDU } from "./abstract.ts"; export type FieldsViewDU>> = { [K in keyof Fields]: Fields[K] extends CompositeType ? TVDU : Fields[K] extends BasicType ? V : never; }; export type ContainerTreeViewDUType>> = FieldsViewDU & TreeViewDU>; export type ContainerTreeViewDUTypeConstructor>> = { new (type: ContainerTypeGeneric, node: Node, cache?: unknown): ContainerTreeViewDUType; }; export type ChangedNode = { index: number; node: Node; }; type ContainerTreeViewDUCache = { nodes: Node[]; caches: unknown[]; nodesPopulated: boolean; }; export declare class BasicContainerTreeViewDU>> extends TreeViewDU> { readonly type: BasicContainerTypeGeneric; protected _rootNode: Node; protected nodes: Node[]; protected caches: unknown[]; protected readonly nodesChanged: Set; protected readonly viewsChanged: Map; private nodesPopulated; constructor(type: BasicContainerTypeGeneric, _rootNode: Node, cache?: ContainerTreeViewDUCache); get node(): Node; get cache(): ContainerTreeViewDUCache; /** * When we need to compute HashComputations (hcByLevel != null): * - if old _rootNode is hashed, then only need to put pending changes to hcByLevel * - if old _rootNode is not hashed, need to traverse and put to hcByLevel */ commit(hcOffset?: number, hcByLevel?: HashComputationLevel[] | null): void; protected parseNodesChanged(nodes: ChangedNode[]): { indexes: number[]; nodes: Node[]; }; protected clearCache(): void; } export declare function getContainerTreeViewDUClass>>(type: ContainerTypeGeneric): ContainerTreeViewDUTypeConstructor; export {};