@@ -593,6 +593,248 @@ declare module '@stdlib/types/array' {
593593 * const x: Collection<number> = [ 1, 2, 3 ];
594594 */
595595 type Collection < T = any > = Array < T > | TypedArray | ArrayLike < T > ; // eslint-disable-line @typescript-eslint/no-explicit-any
596+
597+ /**
598+ * Boolean index array.
599+ */
600+ type BooleanIndexArray = Collection < boolean > | AccessorArrayLike < boolean > ;
601+
602+ /**
603+ * Integer index array.
604+ */
605+ type IntegerIndexArray = Collection < number > | AccessorArrayLike < number > ;
606+
607+ /**
608+ * Index array.
609+ */
610+ type IndexArray = BooleanIndexArray | IntegerIndexArray ;
611+
612+ /**
613+ * Interface describing an array index object.
614+ */
615+ interface BaseArrayIndex {
616+ /**
617+ * Read-only property returning the data associated with an array index object.
618+ */
619+ data : IndexArray ;
620+
621+ /**
622+ * Read-only property returning the underlying index array data type.
623+ */
624+ dtype : DataType ;
625+
626+ /**
627+ * Read-only property returning the unique identifier associated with an array index object.
628+ */
629+ id : string ;
630+
631+ /**
632+ * Boolean indicating if an array index object is actively cached.
633+ */
634+ isCached : boolean ;
635+
636+ /**
637+ * Read-only property returning the array index type.
638+ */
639+ type : 'int' | 'bool' | 'mask' ;
640+
641+ /**
642+ * Serializes an array index object to a string.
643+ *
644+ * @returns serialized string
645+ */
646+ toString ( ) : string ;
647+ }
648+
649+ /**
650+ * Interface describing a mask array index object.
651+ */
652+ interface MaskArrayIndex extends BaseArrayIndex {
653+ /**
654+ * Read-only property returning the array index type.
655+ */
656+ type : 'mask' ;
657+
658+ /**
659+ * Read-only property returning the underlying index array data type.
660+ */
661+ dtype : 'uint8' ;
662+
663+ /**
664+ * Read-only property returning the underlying array data.
665+ */
666+ data : Uint8Array ;
667+ }
668+
669+ /**
670+ * Interface describing an integer array index object.
671+ */
672+ interface Int32ArrayIndex extends BaseArrayIndex {
673+ /**
674+ * Read-only property returning the array index type.
675+ */
676+ type : 'int' ;
677+
678+ /**
679+ * Read-only property returning the underlying index array data type.
680+ */
681+ dtype : 'int32' ;
682+
683+ /**
684+ * Read-only property returning the underlying array data.
685+ */
686+ data : Int32Array ;
687+ }
688+
689+ /**
690+ * Interface describing a boolean array index object.
691+ */
692+ interface BooleanArrayIndex extends BaseArrayIndex {
693+ /**
694+ * Read-only property returning the array index type.
695+ */
696+ type : 'bool' ;
697+
698+ /**
699+ * Read-only property returning the underlying index array data type.
700+ */
701+ dtype : 'generic' ;
702+
703+ /**
704+ * Read-only property returning the underlying array data.
705+ */
706+ data : BooleanIndexArray ;
707+ }
708+
709+ /**
710+ * Interface describing an integer array index object.
711+ */
712+ interface IntegerArrayIndex extends BaseArrayIndex {
713+ /**
714+ * Read-only property returning the array index type.
715+ */
716+ type : 'int' ;
717+
718+ /**
719+ * Read-only property returning the underlying index array data type.
720+ */
721+ dtype : 'generic' ;
722+
723+ /**
724+ * Read-only property returning the underlying array data.
725+ */
726+ data : IntegerIndexArray ;
727+ }
728+
729+ /**
730+ * Array index object.
731+ */
732+ type ArrayIndex = MaskArrayIndex | Int32ArrayIndex | BooleanArrayIndex | IntegerArrayIndex ;
733+
734+ /**
735+ * Interface describing an object containing index array data.
736+ */
737+ interface BaseIndexArrayObject {
738+ /**
739+ * The underlying array associated with an index array.
740+ */
741+ data : IndexArray ;
742+
743+ /**
744+ * The type of index array.
745+ */
746+ type : 'int' | 'bool' | 'mask' ;
747+
748+ /**
749+ * The data type of the underlying array.
750+ */
751+ dtype : DataType ;
752+ }
753+
754+ /**
755+ * Interface describing an object containing mask index array data.
756+ */
757+ interface MaskIndexArrayObject extends BaseIndexArrayObject {
758+ /**
759+ * The underlying array associated with an index array.
760+ */
761+ data : Uint8Array ;
762+
763+ /**
764+ * The type of index array.
765+ */
766+ type : 'mask' ;
767+
768+ /**
769+ * The data type of the underlying array.
770+ */
771+ dtype : 'uint8' ;
772+ }
773+
774+ /**
775+ * Interface describing an object containing integer index array data.
776+ */
777+ interface Int32IndexArrayObject extends BaseIndexArrayObject {
778+ /**
779+ * The underlying array associated with an index array.
780+ */
781+ data : Int32Array ;
782+
783+ /**
784+ * The type of index array.
785+ */
786+ type : 'int' ;
787+
788+ /**
789+ * The data type of the underlying array.
790+ */
791+ dtype : 'int32' ;
792+ }
793+
794+ /**
795+ * Interface describing an object containing integer index array data.
796+ */
797+ interface IntegerIndexArrayObject extends BaseIndexArrayObject {
798+ /**
799+ * The underlying array associated with an index array.
800+ */
801+ data : IntegerIndexArray ;
802+
803+ /**
804+ * The type of index array.
805+ */
806+ type : 'int' ;
807+
808+ /**
809+ * The data type of the underlying array.
810+ */
811+ dtype : 'generic' ;
812+ }
813+
814+ /**
815+ * Interface describing an object containing boolean index array data.
816+ */
817+ interface BooleanIndexArrayObject extends BaseIndexArrayObject {
818+ /**
819+ * The underlying array associated with an index array.
820+ */
821+ data : BooleanIndexArray ;
822+
823+ /**
824+ * The type of index array.
825+ */
826+ type : 'bool' ;
827+
828+ /**
829+ * The data type of the underlying array.
830+ */
831+ dtype : 'generic' ;
832+ }
833+
834+ /**
835+ * Index array data object.
836+ */
837+ type IndexArrayObject = MaskIndexArrayObject | Int32IndexArrayObject | BooleanIndexArrayObject | IntegerIndexArrayObject ;
596838}
597839
598840/**
0 commit comments