import { Provable, Field } from 'o1js'; import { Store } from './store.js'; import levelup from 'levelup'; export { RocksStore }; /** * Store based on rocksdb * * @class RocksStore * @implements {Store} * @template V */ declare class RocksStore implements Store { protected db: levelup.LevelUp; protected batch: levelup.LevelUpChain; protected nodesKey: string; protected leavesKey: string; protected eltTyp: Provable; /** * Creates an instance of RocksStore. * @param {levelup.LevelUp} db * @param {Provable} eltTyp * @param {string} smtName * @memberof RocksStore */ constructor(db: levelup.LevelUp, eltTyp: Provable, smtName: string); /** * Clear all prepare operation cache. * * @memberof RocksStore */ clearPrepareOperationCache(): void; /** * Get the tree root. Error is thrown when the root does not exist. * * @return {*} {Promise} * @memberof RocksStore */ getRoot(): Promise; /** * Prepare update the root. Use the commit() method to actually submit changes. * * @param {Field} root * @memberof RocksStore */ prepareUpdateRoot(root: Field): void; /** * Get nodes for a key. Error is thrown when a key that does not exist is being accessed. * * @param {Field} key * @return {*} {Promise} * @memberof RocksStore */ getNodes(key: Field): Promise; /** * Prepare put nodes for a key. Use the commit() method to actually submit changes. * * @param {Field} key * @param {Field[]} value * @memberof RocksStore */ preparePutNodes(key: Field, value: Field[]): void; /** * Prepare delete nodes for a key. Use the commit() method to actually submit changes. * * @param {Field} key * @memberof RocksStore */ prepareDelNodes(key: Field): void; /** * Convert value string to a value of FieldElements type. * * @protected * @param {string} valueStr * @param {AsFieldElements} eltTyp * @return {*} {V} * @memberof RocksStore */ protected strToValue(valueStr: string, eltTyp: Provable): V; /** * Get the value for a key. Error is thrown when a key that does not exist is being accessed. * * @param {Field} path * @return {*} {Promise} * @memberof RocksStore */ getValue(path: Field): Promise; /** * Serialize the value of the FieldElements type into a string * * @protected * @param {V} value * @return {*} {string} * @memberof RocksStore */ protected valueToStr(value: V): string; /** * Prepare put the value for a key. Use the commit() method to actually submit changes. * * @param {Field} path * @param {V} value * @memberof RocksStore */ preparePutValue(path: Field, value: V): void; /** * Prepare delete the value for a key. Use the commit() method to actually submit changes. * * @param {Field} path * @memberof RocksStore */ prepareDelValue(path: Field): void; /** * Use the commit() method to actually submit all prepare changes. * * @return {*} {Promise} * @memberof RocksStore */ commit(): Promise; /** * Clear the store. * * @return {*} {Promise} * @memberof RocksStore */ clear(): Promise; /** * Get values map, key is Field.toString(). * * @return {*} {Promise>} * @memberof RocksStore */ getValuesMap(): Promise>; }