import type { Value } from './common.js'; /** * An array backed by a persistent store. Can not have any holes in it. */ interface BaseAztecArray { /** * Pushes values to the end of the array * @param vals - The values to push to the end of the array * @returns The new length of the array */ push(...vals: T[]): Promise; /** * Pops a value from the end of the array. * @returns The value that was popped, or undefined if the array was empty */ pop(): Promise; /** * Updates the value at the given index. Index can be in the range [-length, length - 1). * @param index - The index to set the value at * @param val - The value to set * @returns Whether the value was set */ setAt(index: number, val: T): Promise; } /** * An array backed by a persistent store. Can not have any holes in it. */ export interface AztecAsyncArray extends BaseAztecArray { /** * The size of the array */ lengthAsync(): Promise; /** * Gets the value at the given index. Index can be in the range [-length, length - 1). * If the index is negative, it will be treated as an offset from the end of the array. * * @param index - The index to get the value from * @returns The value at the given index or undefined if the index is out of bounds */ atAsync(index: number): Promise; /** * Iterates over the array with indexes. */ entriesAsync(): AsyncIterableIterator<[number, T]>; /** * Iterates over the array. */ valuesAsync(): AsyncIterableIterator; /** * Iterates over the array. */ [Symbol.asyncIterator](): AsyncIterableIterator; } export interface AztecArray extends BaseAztecArray { /** * The size of the array */ length: number; /** * Gets the value at the given index. Index can be in the range [-length, length - 1). * If the index is negative, it will be treated as an offset from the end of the array. * * @param index - The index to get the value from * @returns The value at the given index or undefined if the index is out of bounds */ at(index: number): T | undefined; /** * Iterates over the array with indexes. */ entries(): IterableIterator<[number, T]>; /** * Iterates over the array. */ values(): IterableIterator; /** * Iterates over the array. */ [Symbol.iterator](): IterableIterator; } export {}; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXkuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2VzL2FycmF5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUV6Qzs7R0FFRztBQUNILFVBQVUsY0FBYyxDQUFDLEN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