import { BucketName, CollectionName, CouchbaseClusterTypes, DocDefMatchingBody, type MapEntry, ScopeName } from '@cbjsdev/shared'; import { Collection } from '../../../collection.js'; import { type NodeCallback, type VoidNodeCallback } from '../../../utilities.js'; /** * CouchbaseMap provides a simplified interface for storing a map * within a Couchbase document. * * @see {@link Collection.map} * @category Datastructures */ export declare class CouchbaseMap, S extends ScopeName, C extends CollectionName, Key extends DocDefMatchingBody, T, B, S, C>['Key'], MapDoc extends Record> { private _coll; private _key; /** * @internal */ constructor(collection: Collection, key: Key); private _get; /** * Returns an object representing all items in the map. * * @param callback A node-style callback to be invoked after execution. */ getAll(callback?: NodeCallback): Promise; /** * Iterates through every item in the map. * * @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: MapDoc[keyof MapDoc], key: keyof MapDoc, map: this) => void, callback?: VoidNodeCallback): Promise; /** * Provides the ability to async-for loop this object. */ [Symbol.asyncIterator](): AsyncIterator>; /** * Sets a specific to the specified value in the map. * * @param item The key in the map to set. * @param value The new value to set. * @param callback A node-style callback to be invoked after execution. */ set(item: Item, value: MapDoc[Item], callback?: VoidNodeCallback): Promise; /** * Fetches a specific key from the map. * * @param itemKey The key in the map to retrieve. * @param callback A node-style callback to be invoked after execution. */ get(itemKey: ItemKey, callback?: NodeCallback): Promise; /** * Removes a specific key from the map. * * @param item The key in the map to remove. * @param callback A node-style callback to be invoked after execution. */ remove(item: ItemKey, callback?: VoidNodeCallback): Promise; /** * Checks whether a specific key exists in the map. * * @param item The key in the map to search for. * @param callback A node-style callback to be invoked after execution. */ exists(item: Key, callback?: NodeCallback): Promise; /** * Returns a list of all the keys which exist in the map. * * @param callback A node-style callback to be invoked after execution. */ keys(callback?: NodeCallback>): Promise>; /** * Returns a list of all the values which exist in the map. * * @param callback A node-style callback to be invoked after execution. */ values(callback?: NodeCallback>): Promise>; /** * Returns the number of items that exist in the map. * * @param callback A node-style callback to be invoked after execution. */ size(callback?: NodeCallback): Promise; }