main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | import { Prepend } from './Prepend';
|
---|
| 2 | import { Pos } from '../Iteration/Pos';
|
---|
| 3 | import { Next } from '../Iteration/Next';
|
---|
| 4 | import { Length } from './Length';
|
---|
| 5 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
| 6 | import { Iteration } from '../Iteration/Iteration';
|
---|
| 7 | import { Cast } from '../Any/Cast';
|
---|
| 8 | import { List } from './List';
|
---|
| 9 | import { Naked } from './_Internal';
|
---|
| 10 | import { Extends } from '../Any/Extends';
|
---|
| 11 | /**
|
---|
| 12 | * @hidden
|
---|
| 13 | */
|
---|
| 14 | declare type __Reverse<L extends List, LO extends List, I extends Iteration = IterationOf<0>> = {
|
---|
| 15 | 0: __Reverse<L, Prepend<LO, L[Pos<I>]>, Next<I>>;
|
---|
| 16 | 1: LO;
|
---|
| 17 | }[Extends<Pos<I>, Length<L>>];
|
---|
| 18 | /**
|
---|
| 19 | * @hidden
|
---|
| 20 | */
|
---|
| 21 | export declare type _Reverse<L extends List, LO extends List = []> = __Reverse<Naked<L>, LO> extends infer X ? Cast<X, List> : never;
|
---|
| 22 | /**
|
---|
| 23 | * Turn a [[List]] the other way around
|
---|
| 24 | * @param L to reverse
|
---|
| 25 | * @param LO (?=`[]`) to prepend to
|
---|
| 26 | * @returns [[List]]
|
---|
| 27 | * @example
|
---|
| 28 | * ```ts
|
---|
| 29 | * ```
|
---|
| 30 | */
|
---|
| 31 | export declare type Reverse<L extends List> = L extends unknown ? _Reverse<L> : never;
|
---|
| 32 | export {};
|
---|
Note:
See
TracBrowser
for help on using the repository browser.