import type { VectorIndexDescription } from 'arangojs/indexes'; import { type SchemaMigration } from '../migrations.js'; import type { VectorIndexDefinition } from './vector-index-definition.js'; import { VectorIndexState } from './vector-index-status.js'; export interface EvaluateSingleIndexParams { readonly survivingIndex: VectorIndexDescription | undefined; readonly requiredIndex: VectorIndexDefinition; readonly vectorDocumentCount: number; readonly nListsPinned: boolean; readonly nListsRebuildThreshold?: number; readonly forceRecreate: boolean; } export interface EvaluateSingleIndexResult { readonly state: VectorIndexState; readonly migrations: ReadonlyArray; } /** * Decides what migrations are needed for a single surviving index (or none). * * This is phase 2 of computeVectorIndexStatus, called after stuck-slot resolution * has reduced the indexes to at most one survivor. The decision tree: * * - No surviving index + empty collection -> DEFERRED (ArangoDB < 3.12.9 throws * when creating a vector index on an empty collection) * - No surviving index + has documents -> NEEDS_CREATE (slot A) * - Surviving index + forceRecreate -> NEEDS_RECREATE (opposite slot) * - Surviving index + parameters changed (metric, dimension, sparse, storedValues, * or nLists drift exceeds threshold) -> NEEDS_RECREATE (opposite slot) * - Surviving index + still training -> TRAINING (wait, no migrations) * - Surviving index + ready + matches model -> UP_TO_DATE */ export declare function evaluateSingleIndex(params: EvaluateSingleIndexParams): EvaluateSingleIndexResult;