import { BucketName, CollectionName, CouchbaseClusterTypes, DocDefMatchingBody, ScopeName } from '@cbjsdev/shared'; import type { Collection } from '../../../collection.js'; import { type NodeCallback, type VoidNodeCallback } from '../../../utilities.js'; /** * CouchbaseList provides a simplified interface for storing lists * within a Couchbase document. * * @see {@link Collection.list} * @category Datastructures */ export declare class CouchbaseList, S extends ScopeName, C extends CollectionName, Key extends DocDefMatchingBody, T, B, S, C>['Key'], Item> { private _coll; private _key; /** * @internal */ constructor(collection: Collection, key: Key); private _get; /** * Returns the entire list of items in this list. * * @param callback A node-style callback to be invoked after execution. */ getAll(callback?: NodeCallback): Promise; /** * Iterates each item in the list. * * @param rowCallback A callback invoked for each item in the list. * @param callback A node-style callback to be invoked after execution. */ forEach(rowCallback: (value: Item, index: number, array: this) => void, callback?: VoidNodeCallback): Promise; /** * Provides the ability to async-for loop this object. */ [Symbol.asyncIterator](): AsyncIterator; /** * Retrieves the item at a specific index in the list. * * @param index The index to retrieve. * @param callback A node-style callback to be invoked after execution. */ getAt(index: number, callback?: NodeCallback): Promise; /** * Removes an item at a specific index from the list. * * @param index The index to remove. * @param callback A node-style callback to be invoked after execution. */ removeAt(index: number, callback?: VoidNodeCallback): Promise; /** * Returns the index of a specific value from the list. * * @param value The value to search for. * @param callback A node-style callback to be invoked after execution. */ indexOf(value: Item, callback?: NodeCallback): Promise; /** * Returns the number of items in the list. * * @param callback A node-style callback to be invoked after execution. */ size(callback?: NodeCallback): Promise; /** * Adds a new item to the end of the list. * * @param value The value to add. * @param callback A node-style callback to be invoked after execution. */ push(value: Item, callback?: VoidNodeCallback): Promise; /** * Adds a new item to the beginning of the list. * * @param value The value to add. * @param callback A node-style callback to be invoked after execution. */ unshift(value: Item, callback?: VoidNodeCallback): Promise; }