import type { VectorIndexDescription } from 'arangojs/indexes'; import type { Field } from '../../../core/model/implementation/field.js'; import type { VectorIndexDefinition } from './vector-index-definition.js'; import { type VectorIndexStatus } from './vector-index-status.js'; export interface ComputeVectorIndexStatusInput { readonly field: Field; readonly existingForField: ReadonlyArray; readonly requiredIndex: VectorIndexDefinition; readonly vectorDocumentCount: number; readonly computedNLists: number; readonly nListsPinned: boolean; readonly nListsRebuildThreshold?: number; readonly forceRecreate: boolean; } /** * Determines the status and required migrations for a single vector-indexed field. * * This is the core decision function of the vector index migration system. It receives * all necessary data (existing indexes, required index definition, document counts) as * explicit parameters, making it a pure function with no I/O. The actual data gathering * is done by VectorIndexAnalyzer, which calls this function. * * The function works in two phases: * * Phase 1 - Stuck-slot detection: If both A and B slots exist (caused by an interrupted * recreation), resolveStuckSlots decides which slot to keep and emits drop migrations. * If the surviving slot is still training, the function returns early with TRAINING or * RETRAINING state and no migrations. * * Phase 2 - Create/recreate decision: With at most one surviving index, evaluateSingleIndex * determines whether to create a new index, recreate an existing one (because parameters * changed or force-recreate was requested), or report that the index is already up-to-date. * * The returned VectorIndexStatus includes the resolved state, any pending migrations, and * diagnostic information like the nLists drift ratio. */ export declare function computeVectorIndexStatus(input: ComputeVectorIndexStatusInput): VectorIndexStatus;