import Connection from '../../connection/grpc.js'; import { ConsistencyLevel } from '../../data/index.js'; import { DbVersionSupport } from '../../utils/dbVersion.js'; import { FilterValue } from '../filters/index.js'; import { BatchObjectsReturn, BatchReferencesReturn, DataObject, DeleteManyReturn, NonReferenceInputs, Properties, ReferenceInput, ReferenceInputs, Vectors } from '../types/index.js'; /** The available options to the `data.deleteMany` method. */ export type DeleteManyOptions = { /** Whether to return verbose information about the operation */ verbose?: V; /** Whether to perform a dry run of the operation */ dryRun?: boolean; }; /** The available options to the `data.insert` method. */ export type InsertObject = { /** The ID of the object to be inserted. If not provided, a new ID will be generated. */ id?: string; /** The properties of the object to be inserted */ properties?: NonReferenceInputs; /** The references of the object to be inserted */ references?: ReferenceInputs; /** The vector(s) of the object to be inserted */ vectors?: number[] | Vectors; }; /** The arguments of the `data.referenceX` methods */ export type ReferenceArgs = { /** The ID of the object that will have the reference */ fromUuid: string; /** The property of the object that will have the reference */ fromProperty: string; /** The object(s) to reference */ to: ReferenceInput; }; /** The available options to the `data.replace` method. */ export type ReplaceObject = { /** The ID of the object to be replaced */ id: string; /** The properties of the object to be replaced */ properties?: NonReferenceInputs; /** The references of the object to be replaced */ references?: ReferenceInputs; vectors?: number[] | Vectors; }; /** The available options to the `data.update` method. */ export type UpdateObject = { /** The ID of the object to be updated */ id: string; /** The properties of the object to be updated */ properties?: Partial>; /** The references of the object to be updated */ references?: Partial>; vectors?: number[] | Vectors; }; export interface Data { deleteById: (id: string) => Promise; deleteMany: (where: FilterValue, opts?: DeleteManyOptions) => Promise>; exists: (id: string) => Promise; ingest: (objs: Iterable | NonReferenceInputs>) => Promise>; /** * Insert a single object into the collection. * * If you don't provide any options to the function, then an empty object will be created. * * @param {InsertArgs | NonReferenceInputs} [args] The object to insert. If an `id` is provided, it will be used as the object's ID. If not, a new ID will be generated. * @returns {Promise} The ID of the inserted object. */ insert: (obj?: InsertObject | NonReferenceInputs) => Promise; /** * Insert multiple objects into the collection. * * This object does not perform any batching for you. It sends all objects in a single request to Weaviate. * * @param {(DataObject | NonReferenceInputs)[]} objects The objects to insert. * @returns {Promise>} The result of the batch insert. */ insertMany: (objects: (DataObject | NonReferenceInputs)[]) => Promise>; /** * Create a reference between an object in this collection and any other object in Weaviate. * * @param {ReferenceArgs

} args The reference to create. * @returns {Promise} */ referenceAdd:

(args: ReferenceArgs

) => Promise; /** * Create multiple references between an object in this collection and any other object in Weaviate. * * This method is optimized for performance and sends all references in a single request. * * @param {ReferenceArgs

[]} refs The references to create. * @returns {Promise} The result of the batch reference creation. */ referenceAddMany:

(refs: ReferenceArgs

[]) => Promise; /** * Delete a reference between an object in this collection and any other object in Weaviate. * * @param {ReferenceArgs

} args The reference to delete. * @returns {Promise} */ referenceDelete:

(args: ReferenceArgs

) => Promise; /** * Replace a reference between an object in this collection and any other object in Weaviate. * * @param {ReferenceArgs

} args The reference to replace. * @returns {Promise} */ referenceReplace:

(args: ReferenceArgs

) => Promise; /** * Replace an object in the collection. * * This is equivalent to a PUT operation. * * @param {ReplaceOptions} [opts] The object attributes to replace. * @returns {Promise} */ replace: (obj: ReplaceObject) => Promise; /** * Update an object in the collection. * * This is equivalent to a PATCH operation. * * @param {UpdateArgs} [opts] The object attributes to replace. * @returns {Promise} */ update: (obj: UpdateObject) => Promise; } declare const data: (connection: Connection, name: string, dbVersionSupport: DbVersionSupport, consistencyLevel?: ConsistencyLevel, tenant?: string) => Data; export default data;