UNPKG

@aggris2/ssz

Version:

Simple Serialize

40 lines 1.98 kB
import { LeafNode, Node } from "@chainsafe/persistent-merkle-tree"; import { ByteViews } from "./abstract"; import { BasicType } from "./basic"; export declare type StringBigintByteLen = 1 | 2 | 4 | 8 | 16 | 32; /** * Uint: N-bit unsigned integer (where N in [8, 16, 32, 64, 128, 256]) * - Notation: uintN * * UintBigint is represented as the Javascript primitive value 'BigInt'. * * The BigInt type is a numeric primitive in JavaScript that can represent integers with arbitrary precision. * With BigInts, you can safely store and operate on large integers even beyond the safe integer limit for Numbers. * * As of 2021 performance of 'Number' is extremely faster than 'BigInt'. For Uint values under 53 bits use UintNumber. * For other values that may exceed 53 bits, use UintBigint. */ export declare class StringBigintType extends BasicType<string> { readonly byteLength: StringBigintByteLen; readonly typeName: string; readonly itemsPerChunk: number; readonly fixedSize: number; readonly minSize: number; readonly maxSize: number; constructor(byteLength: StringBigintByteLen); defaultValue(): string; value_serializeToBytes({ dataView }: ByteViews, offset: number, v: string): number; value_deserializeFromBytes({ dataView }: ByteViews, start: number, end: number): string; tree_serializeToBytes(output: ByteViews, offset: number, node: Node): number; tree_deserializeFromBytes(data: ByteViews, start: number, end: number): Node; tree_getFromNode(leafNode: LeafNode): string; /** Mutates node to set value */ tree_setToNode(leafNode: LeafNode, value: string): void; /** EXAMPLE of `tree_getFromNode` */ tree_getFromPackedNode(leafNode: LeafNode, index: number): string; /** Mutates node to set value */ tree_setToPackedNode(leafNode: LeafNode, index: number, v: string): void; fromJson(json: unknown): string; toJson(value: string): unknown; } //# sourceMappingURL=string.d.ts.map