import Connection from '../../connection/index.js'; import { WeaviateShardStatus } from '../../openapi/types.js'; import { DbVersionSupport } from '../../utils/dbVersion.js'; import { PropertyConfigCreate, ReferenceMultiTargetConfigCreate, ReferenceSingleTargetConfigCreate, VectorizersConfigAdd } from '../configure/types/index.js'; import { BQConfig, CollectionConfig, CollectionConfigUpdate, InvertedIndexName, PQConfig, QuantizerConfig, RQConfig, SQConfig, VectorIndexConfig, VectorIndexConfigDynamic, VectorIndexConfigFlat, VectorIndexConfigHNSW } from './types/index.js'; declare const config: (connection: Connection, name: string, dbVersionSupport: DbVersionSupport, tenant?: string) => Config; export default config; export interface Config { /** * Add a property to the collection in Weaviate. * * @param {PropertyConfigCreate} property The property configuration. * @returns {Promise} A promise that resolves when the property has been added. */ addProperty: (property: PropertyConfigCreate) => Promise; /** * Add a reference to the collection in Weaviate. * * @param {ReferenceSingleTargetConfigCreate | ReferenceMultiTargetConfigCreate} reference The reference configuration. * @returns {Promise} A promise that resolves when the reference has been added. */ addReference: (reference: ReferenceSingleTargetConfigCreate | ReferenceMultiTargetConfigCreate) => Promise; /** * Add one or more named vectors to the collection in Weaviate. * Named vectors can be added to collections with existing named vectors only. * * Existing named vectors are immutable in Weaviate. The client will not include * any of those in the request. * * @param {VectorizersConfigAdd} vectors Vector configurations. * @returns {Promise} A promise that resolves when the named vector has been created. */ addVector: (vectors: VectorizersConfigAdd) => Promise; /** * Get the configuration for this collection from Weaviate. * * @returns {Promise>} A promise that resolves with the collection configuration. */ get: () => Promise; /** * Get the statuses of the shards of this collection. * * If the collection is multi-tenancy and you did not call `.with_tenant` then you * will receive the statuses of all the tenants within the collection. Otherwise, call * `.with_tenant` on the collection first and you will receive only that single shard. * * @returns {Promise[]>} A promise that resolves with the shard statuses. */ getShards: () => Promise[]>; /** * Update the status of one or all shards of this collection. * * @param {'READY' | 'READONLY'} status The new status of the shard(s). * @param {string | string[]} [names] The name(s) of the shard(s) to update. If not provided, all shards will be updated. * @returns {Promise[]>} A promise that resolves with the updated shard statuses. */ updateShards: (status: 'READY' | 'READONLY', names?: string | string[]) => Promise[]>; /** * Update the configuration for this collection in Weaviate. * * Use the `weaviate.classes.Reconfigure` class to generate the necessary configuration objects for this method. * * @param {CollectionConfigUpdate} [config] The configuration to update. Only a subset of the actual collection configuration can be updated. * @returns {Promise} A promise that resolves when the collection has been updated. */ update: (config?: CollectionConfigUpdate) => Promise; /** * Drop an inverted index from a property of this collection. * * @param {string} propertyName The name of the property to drop the index from. * @param {InvertedIndexName} indexName The index to drop: 'filterable', 'searchable', or 'rangeFilters'. * @returns {Promise} A promise that resolves when the index has been dropped. */ dropInvertedIndex: (propertyName: string, indexName: InvertedIndexName) => Promise; } export declare class VectorIndex { static isHNSW(config?: VectorIndexConfig): config is VectorIndexConfigHNSW; static isFlat(config?: VectorIndexConfig): config is VectorIndexConfigFlat; static isDynamic(config?: VectorIndexConfig): config is VectorIndexConfigDynamic; } export declare class Quantizer { static isPQ(config?: QuantizerConfig): config is PQConfig; static isBQ(config?: QuantizerConfig): config is BQConfig; static isSQ(config?: QuantizerConfig): config is SQConfig; static isRQ(config?: QuantizerConfig): config is RQConfig; } export declare const configGuards: { quantizer: typeof Quantizer; vectorIndex: typeof VectorIndex; };