//================================================================ /** * @packageDocumentation * @module std.ranges */ //================================================================ import { IForwardContainer } from "./IForwardContainer"; import { IRandomAccessIterator } from "../../iterator/IRandomAccessIterator"; import { IPointer } from "../../functional/IPointer"; import { Vector } from "../../container/Vector"; /** * Random-access iterable container. * * @template Iterator Iterator type * @author Jeongho Nam - https://github.com/samchon */ export interface IRandomAccessContainer< IteratorT extends IRandomAccessIterator< IPointer.ValueType, IteratorT >, > extends IForwardContainer {} export namespace IRandomAccessContainer { /** * Deduct iterator type. */ export type IteratorType< Container extends Array | IRandomAccessContainer, > = Container extends Array ? Vector.Iterator : Container extends IRandomAccessContainer ? Iterator : unknown; /** * Deduct value type. */ export type ValueType< Container extends Array | IRandomAccessContainer, > = IForwardContainer.ValueType>; }