import { Metadata } from 'nice-grpc'; import { ConsistencyLevel } from '../data/index.js'; import { BatchObject, BatchObjectsReply, BatchStreamReply, BatchStreamRequest } from '../proto/v1/batch.js'; import { WeaviateClient } from '../proto/v1/weaviate.js'; import { RetryOptions } from 'nice-grpc-client-middleware-retry'; import { Filters } from '../proto/v1/base.js'; import { BatchDeleteReply } from '../proto/v1/batch_delete.js'; import Base from './base.js'; export interface Batch { withDelete: (args: BatchDeleteArgs) => Promise; withObjects: (args: BatchObjectsArgs) => Promise; withStream: (reqs: AsyncGenerator) => AsyncGenerator; } export interface BatchObjectsArgs { objects: BatchObject[]; } export interface BatchDeleteArgs { filters: Filters | undefined; verbose?: boolean; dryRun?: boolean; } export default class Batcher extends Base implements Batch { static use(connection: WeaviateClient, collection: string, metadata: Metadata, timeout: number, consistencyLevel?: ConsistencyLevel, tenant?: string): Batch; withStream: (reqs: AsyncGenerator) => AsyncGenerator; withDelete: (args: BatchDeleteArgs) => Promise; withObjects: (args: BatchObjectsArgs) => Promise; private callStream; private callDelete; private callObjects; }