UNPKG

weaviate-client

Version:
43 lines (42 loc) • 1.43 kB
import Connection from '../../connection/grpc.js'; import { ConsistencyLevel } from '../../index.js'; import { DbVersionSupport } from '../../utils/dbVersion.js'; import { BatchObject, BatchReference, ErrorObject, ErrorReference } from '../index.js'; type InternalError<E> = { index: number; message: string; entry: E; type: 'error'; }; type InternalSuccess = { index: number; uuid?: string; beacon?: string; type: 'success'; }; export declare const isInternalError: (obj: InternalError<any> | InternalSuccess) => obj is InternalError<any>; export interface Batching { addObject: (obj: BatchObject<any>) => Promise<string>; addReference: (ref: BatchReference) => Promise<void>; stop: () => Promise<void>; hasErrors: () => boolean; uuids: () => Record<number, string>; beacons: () => Record<number, string>; objErrors: () => Record<number, ErrorObject<any>>; refErrors: () => Record<number, ErrorReference>; } export interface Batch { stream: (consistencyLevel?: ConsistencyLevel) => Promise<Batching>; } export default function (connection: Connection, dbVersionSupport: DbVersionSupport): Batch; export declare class Queue<T> { private resolvers; private promises; constructor(); _add(): void; _readd(promise: Promise<T>): void; push(t: T): void; pull(timeout?: number): Promise<T | null>; get length(): number; } export {};