import { HashComputationLevel, Node, Tree } from "@chainsafe/persistent-merkle-tree"; import { Require } from "../util/types.ts"; import { ArrayCompositeType } from "../view/arrayComposite.ts"; import { ListCompositeTreeView } from "../view/listComposite.ts"; import { ListCompositeTreeViewDU } from "../viewDU/listComposite.ts"; import { ByteViews, ValueOf } from "./abstract.ts"; import { ArrayType } from "./array.ts"; import { CompositeType, CompositeView, CompositeViewDU } from "./composite.ts"; export interface ListCompositeOpts { typeName?: string; cachePermanentRootStruct?: boolean; } /** * List: ordered variable-length homogeneous collection, limited to N values * * Array of Composite type: * - Composite types always take at least one chunk * - Composite types are always returned as views */ export declare class ListCompositeType, CompositeViewDU>> extends ArrayType, ListCompositeTreeViewDU> implements ArrayCompositeType { readonly elementType: ElementType; readonly limit: number; readonly typeName: string; readonly itemsPerChunk = 1; readonly depth: number; readonly chunkDepth: number; readonly maxChunkCount: number; readonly fixedSize: null; readonly minSize: number; readonly maxSize: number; readonly isList = true; readonly isViewMutable = true; readonly blockArray: Uint8Array[]; readonly mixInLengthBlockBytes: Uint8Array; readonly mixInLengthBuffer: Buffer; protected readonly defaultLen = 0; constructor(elementType: ElementType, limit: number, opts?: ListCompositeOpts); static named, CompositeViewDU>>(elementType: ElementType, limit: number, opts: Require): ListCompositeType; getView(tree: Tree): ListCompositeTreeView; getViewDU(node: Node, cache?: unknown): ListCompositeTreeViewDU; commitView(view: ListCompositeTreeView): Node; commitViewDU(view: ListCompositeTreeViewDU, hcOffset?: number, hcByLevel?: HashComputationLevel[] | null): Node; cacheOfViewDU(view: ListCompositeTreeViewDU): unknown; value_serializedSize(value: ValueOf[]): number; value_serializeToBytes(output: ByteViews, offset: number, value: ValueOf[]): number; value_deserializeFromBytes(data: ByteViews, start: number, end: number, reuseBytes?: boolean): ValueOf[]; tree_serializedSize(node: Node): number; tree_serializeToBytes(output: ByteViews, offset: number, node: Node): number; tree_deserializeFromBytes(data: ByteViews, start: number, end: number): Node; tree_getLength(node: Node): number; tree_setLength(tree: Tree, length: number): void; tree_getChunksNode(node: Node): Node; tree_chunksNodeOffset(): number; tree_setChunksNode(rootNode: Node, chunksNode: Node, newLength: number | null, hcOffset?: number, hcByLevel?: HashComputationLevel[] | null): Node; hashTreeRoot(value: ValueOf[]): Uint8Array; hashTreeRootInto(value: ValueOf[], output: Uint8Array, offset: number, safeCache?: boolean): void; protected getBlocksBytes(): Uint8Array; }