1 | import { Depth } from '../Object/_Internal';
|
2 | import { CompulsoryPart } from '../Object/Compulsory';
|
3 | import { List } from './List';
|
4 | import { Cast } from '../Any/Cast';
|
5 | /**
|
6 | * Make that `L`'s fields cannot be [[Nullable]] or [[Optional]] (it's like
|
7 | * [[Required]] & [[NonNullable]] at once).
|
8 | * @param L to make compulsory
|
9 | * @param depth (?=`'flat'`) 'deep' to do it deeply
|
10 | * @returns [[List]]
|
11 | * @example
|
12 | * ```ts
|
13 | * * import {L} from 'ts-toolbelt'
|
14 | *
|
15 | * type test0 = L.Compulsory<[1, 2, 3?, 4?]> // [1, 2, 3, 4]
|
16 | * type test1 = L.Compulsory<['a', 'b' | undefined, 'c', 'd', 'e' | null]> // ['a', 'b', 'c', 'd', 'e']
|
17 | * ```
|
18 | */
|
19 | export declare type Compulsory<L extends List, depth extends Depth = 'flat'> = Cast<CompulsoryPart<L, depth>, List>;
|