import { BucketName, CouchbaseClusterTypes, DefaultClusterTypes, DefaultScopeCollectionName, DefaultScopeName, ScopeName } from '@cbjsdev/shared'; import { CppConnection } from './binding.js'; import { Cluster } from './cluster.js'; import { DefaultCollection, DefaultScope } from './clusterTypes/index.js'; import { Collection } from './collection.js'; import { CollectionManager } from './collectionmanager.js'; import { PingOptions, PingResult } from './diagnosticstypes.js'; import { Scope } from './scope.js'; import { StreamableRowPromise } from './streamablepromises.js'; import { Transcoder } from './transcoders.js'; import { NodeCallback } from './utilities.js'; import { ViewIndexManager } from './viewindexmanager.js'; import { ViewMetaData, ViewQueryOptions, ViewResult, ViewRow } from './viewtypes.js'; /** * Exposes the operations which are available to be performed against a bucket. * Namely the ability to access to Collections as well as performing management * operations against the bucket. * * @category Core */ export declare class Bucket = BucketName> { readonly cluster: Cluster; readonly name: B; readonly conn: CppConnection; /** @internal */ constructor(cluster: Cluster, bucketName: B); /** @internal */ get transcoder(): Transcoder; /** * Creates a Scope object reference to a specific scope. * * @param scopeName The name of the scope to reference. */ scope(scopeName: DefaultScopeName): DefaultScope; scope>(scopeName: S): Scope; /** * Creates a Scope object reference to the default scope. */ defaultScope(): DefaultScope; /** * Creates a Collection object reference to a specific collection. * * @param collectionName The name of the collection to reference. */ collection>(collectionName: C): Collection & DefaultScopeName, C>; /** * Creates a Collection object reference to the default collection. */ defaultCollection(): DefaultCollection; /** * Returns a ViewIndexManager which can be used to manage the view indexes * of this bucket. * * @deprecated Since version 4.7.0. Views are deprecated in Couchbase Server 7.0+, and will be removed from a future server version. * Views are not compatible with the Magma storage engine. Instead of views, use indexes and queries using the * Index Service (GSI) and the Query Service (SQL++). */ viewIndexes(): ViewIndexManager; /** * Returns a CollectionManager which can be used to manage the collections * of this bucket. */ collections(): CollectionManager; /** * Executes a view query. * * @deprecated Since version 4.7.0. Views are deprecated in Couchbase Server 7.0+, and will be removed from a future server version. * Views are not compatible with the Magma storage engine. Instead of views, use indexes and queries using the * Index Service (GSI) and the Query Service (SQL++). * * @param designDoc The name of the design document containing the view to execute. * @param viewName The name of the view to execute. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ viewQuery(designDoc: string, viewName: string, callback?: NodeCallback>): StreamableRowPromise, ViewRow, ViewMetaData>; viewQuery(designDoc: string, viewName: string, options: ViewQueryOptions, callback?: NodeCallback>): StreamableRowPromise, ViewRow, ViewMetaData>; /** * Performs a ping operation against the cluster. Pinging the bucket services * which are specified (or all services if none are specified). Returns a report * which describes the outcome of the ping operations which were performed. * * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ ping(callback?: NodeCallback): Promise; ping(options: PingOptions, callback?: NodeCallback): Promise; }