import { IterationOf } from '../Iteration/IterationOf'; import { Iteration } from '../Iteration/Iteration'; import { Pos } from '../Iteration/Pos'; import { Prepend } from './Prepend'; import { Way } from '../Iteration/_Internal'; import { List } from './List'; import { Prev } from '../Iteration/Prev'; import { Cast } from '../Any/Cast'; import { Tail } from './Tail'; import { Extends } from '../Any/Extends'; /** * starts in reverse from `N` till `N` = 0 * @hidden */ declare type TakeForth, LN extends List = []> = { 0: TakeForth, Prepend]>>; 1: LN; }[Extends<-1, Pos>]; /** * starts in reverse from the end till `N` = 0 * @hidden */ declare type TakeBack = { 0: TakeBack, Prev>; 1: L; }[Extends<0, Pos>]; /** * @hidden */ declare type __Take = { '->': TakeForth; '<-': TakeBack; }[way]; /** * @hidden */ export declare type _Take = __Take, way> extends infer X ? Cast : never; /** * Extract `N` entries out of `L` * @param L to extract from * @param N to extract out * @param way (?=`'->'`) to extract from end * @returns [[List]] * @example * ```ts * ``` */ export declare type Take = L extends unknown ? N extends unknown ? _Take : never : never; export {};