@@ -553,10 +553,6 @@ export type GenericIndex = {
553553 * Additional stats about this index.
554554 */
555555 figures ?: Record < string , any > ;
556- /**
557- * Progress of this index if it is still being created.
558- */
559- progress ?: number ;
560556} ;
561557
562558/**
@@ -670,6 +666,21 @@ export type InvertedIndex = GenericIndex & {
670666 optimizeTopK : string [ ] ;
671667} ;
672668
669+ /**
670+ * An object representing an arangosearch index.
671+ */
672+ export type InternalArangosearchIndex = {
673+ id : string ;
674+ type : "arangosearch" ;
675+ view : string ;
676+ figures ?: Record < string , any > ;
677+ analyzers : string [ ] ;
678+ fields : Record < string , Record < string , any > > ;
679+ includeAllFields : boolean ;
680+ trackListPositions : boolean ;
681+ storeValues : "none" | "id" ;
682+ } ;
683+
673684/**
674685 * An object representing an index.
675686 */
@@ -681,6 +692,33 @@ export type Index =
681692 | MdiIndex
682693 | InvertedIndex ;
683694
695+ /**
696+ * An object representing an internal index.
697+ */
698+ export type InternalIndex = InternalArangosearchIndex ;
699+
700+ /**
701+ * An object representing a potentially hidden index.
702+ *
703+ * This type can be used to cast the result of `collection.indexes` to better
704+ * reflect the actual data returned by the server when using the `withHidden`
705+ * option:
706+ *
707+ * ```ts
708+ * const indexes = await collection.indexes<HiddenIndex>({
709+ * withHidden: true
710+ * }));
711+ * // indexes may include internal indexes and indexes with a "progress"
712+ * // property
713+ * ```
714+ */
715+ export type HiddenIndex = ( Index | InternalArangosearchIndex ) & {
716+ /**
717+ * Progress of this index if it is still being created.
718+ */
719+ progress ?: number ;
720+ } ;
721+
684722export type IndexDetails = Index & {
685723 figures ?: Record < string , any > ;
686724 progress ?: number ;
0 commit comments