source: node_modules/ts-toolbelt/out/Union/ListOf.d.ts

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: 674 bytes
Line 
1import { Last } from './Last';
2import { Prepend } from '../List/Prepend';
3import { Exclude } from './Exclude';
4import { List } from '../List/List';
5import { Cast } from '../Any/Cast';
6import { Extends } from '../Any/Extends';
7/**
8 * @hidden
9 */
10declare type _ListOf<U, LN extends List = [], LastU = Last<U>> = {
11 0: _ListOf<Exclude<U, LastU>, Prepend<LN, LastU>>;
12 1: LN;
13}[Extends<[U], [never]>];
14/**
15 * Transform a [[Union]] into a [[List]]
16 * (⚠️ it might not preserve order)
17 * @param U to transform
18 * @returns [[List]]
19 * @example
20 * ```ts
21 * ```
22 */
23export declare type ListOf<U extends any> = _ListOf<U> extends infer X ? Cast<X, List> : never;
24export {};
Note: See TracBrowser for help on using the repository browser.