type NestedArray = T[] | NestedArray[]; type FixedIndices = (number | null)[] & { length: Exclude; }; /** * Iterates an array over one axis (dimension) while keeping other indices fixed. * E.g. iterates a column in a 2D array. * NOT recursive. * Receives an array of T (at least 2 dimensions), and an incomplete set of fixed * indices (coordinates), and iterates over the missing fixed index, yielding * only one value (i.e. not a sub-array or sub-iterator sliced by the missing * dimension) * NOTE: the use of this iterator is limited, since it does not support dimension * swapping (for rotations). It is good enough for plain use but not for recursive. */ declare class ArrayAxisIterator { private array; private dimension; private fixedIndices; private reverse; /** * @param array - the array to iterate over * @param fixedIndices - an array of fixed indices, with exactly one null value (eg. [1, null, 2]) * @param reverse - to change the order */ constructor(array: NestedArray, fixedIndices: FixedIndices, reverse?: boolean); [Symbol.iterator](): Generator; private getArrayDimensions; } export default ArrayAxisIterator;