import { BucketName, CollectionName, CouchbaseClusterTypes, DefaultClusterTypes, ScopeName } from '@cbjsdev/shared'; import { AnalyticsMetaData, AnalyticsQueryOptions, AnalyticsResult } from './analyticstypes.js'; import { CppConnection } from './binding.js'; import { Bucket } from './bucket.js'; import { Cluster } from './cluster.js'; import { Collection } from './collection.js'; import { QueryMetaData, QueryOptions, QueryResult } from './querytypes.js'; import { ScopeEventingFunctionManager } from './scopeeventingfunctionmanager.js'; import { ScopeSearchIndexManager } from './scopesearchindexmanager.js'; import { SearchMetaData, SearchQueryOptions, SearchRequest, SearchResult, SearchRow } from './searchtypes.js'; import { StreamableRowPromise } from './streamablepromises.js'; import { Transcoder } from './transcoders.js'; import { NodeCallback } from './utilities.js'; /** * Exposes the operations which are available to be performed against a scope. * Namely the ability to access to Collections for performing operations. * * @category Core */ export declare class Scope = BucketName, in out S extends ScopeName = ScopeName> { /** * @internal */ static readonly DEFAULT_NAME = "_default"; readonly bucket: Bucket; readonly name: S; readonly conn: CppConnection; /** @internal */ constructor(bucket: Bucket, scopeName: S); get cluster(): Cluster; /** @internal */ get transcoder(): Transcoder; /** * Creates a Collection object reference to a specific collection. * * @param collectionName The name of the collection to reference. */ collection>(collectionName: C): Collection; /** * Returns a SearchIndexManager which can be used to manage the search * indexes of this scope. * */ searchIndexes(): ScopeSearchIndexManager; /** * Returns a ScopeEventingFunctionManager which can be used to manage the eventing * functions of this scope. * Uncommitted: This API is subject to change in the future. */ eventingFunctions(): ScopeEventingFunctionManager; /** * Executes a N1QL query against the cluster scoped to this scope. * * @param statement The N1QL statement to execute. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ query(statement: string, options: QueryOptions, callback?: NodeCallback>): StreamableRowPromise, TRow, QueryMetaData>; query(statement: string, callback?: NodeCallback>): StreamableRowPromise, TRow, QueryMetaData>; /** * Executes an analytics query against the cluster scoped this scope. * * @param statement The analytics statement to execute. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ analyticsQuery(statement: string, options: AnalyticsQueryOptions, callback?: NodeCallback>): StreamableRowPromise, TRow, AnalyticsMetaData>; analyticsQuery(statement: string, callback?: NodeCallback>): StreamableRowPromise, TRow, AnalyticsMetaData>; /** * Executes a search query against the scope. * * @param indexName The name of the index to query. * @param request The SearchRequest describing the search to execute. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ search(indexName: string, request: SearchRequest, options: SearchQueryOptions, callback?: NodeCallback): StreamableRowPromise; /** * Executes a search query against the scope. * * @param indexName The name of the index to query. * @param request The SearchRequest describing the search to execute. * @param callback A node-style callback to be invoked after execution. */ search(indexName: string, request: SearchRequest, callback?: NodeCallback): StreamableRowPromise; }