UNPKG

833 BTypeScriptView Raw
1import { Key } from './_Internal';
2import { Either as OEither } from '../Object/Either';
3import { ObjectOf } from './ObjectOf';
4import { _ListOf } from '../Object/ListOf';
5import { List } from './List';
6import { Boolean } from '../Boolean/_Internal';
7/**
8 * Split `L` into a [[Union]] with `K` keys in such a way that none of
9 * the keys are ever present with one another within the different unions.
10 * @param L to split
11 * @param K to split with
12 * @param strict (?=`1`) to force excess property checks https://github.com/microsoft/TypeScript/issues/20863
13 * @returns [[List]] [[Union]]
14 * @example
15 * ```ts
16 * ```
17 */
18export declare type Either<L extends List, K extends Key, strict extends Boolean = 1> = OEither<ObjectOf<L>, `${K & number}` | K, strict> extends infer OE ? OE extends unknown ? _ListOf<OE & {}> : never : never;