@@ -10,12 +10,6 @@ import * as utils from './utils'
1010export type IsFinite < Tuple extends any [ ] , Finite = true , Infinite = false > =
1111 utils . IsFinite < Tuple , Finite , Infinite >
1212
13- /**
14- * Split an infinite tuple into a finite tuple and an array
15- * @example SplitInfiniteTuple<[0, 1, 2, ...number[]]> → [[0, 1, 2], number[]]
16- */
17- export type SplitInfiniteTuple < Tuple extends any [ ] > = utils . SplitInfiniteTuple < Tuple >
18-
1913/**
2014 * Get type of first element
2115 * @example First<[0, 1, 2]> → 0
@@ -34,81 +28,6 @@ export type Last<Tuple extends any[]> = utils.Last<Tuple>
3428 */
3529export type Tail < Tuple extends any [ ] > = utils . Tail < Tuple >
3630
37- /**
38- * Find index of a type in tuple
39- * @example FirstIndexEqual<'x', ['a', 'b', 'c', 'x', 'd']> → 3
40- * @example FirstIndexEqual<'x', ['a', 'b', 'c']> → never
41- * @example FirstIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'> → 'NotFound'
42- */
43- export type FirstIndexEqual < Type , Tuple extends any [ ] , NotFound = never > =
44- utils . FirstIndexEqual < Type , Tuple , NotFound >
45-
46- /**
47- * Find index of the first element in tuple that satifies a type
48- * @example FirstIndexSubset<string, [true, false, 'x', 3]> → 2
49- * @example FirstIndexSubset<string, [true, false, 0, 1]> → never
50- * @example FirstIndexSubset<string, [true, false, 0, 1], 'NotFound'> → 'NotFound'
51- */
52- export type FirstIndexSubset < Type , Tuple extends any [ ] , NotFound = never > =
53- utils . FirstIndexSubset < Type , Tuple , NotFound >
54-
55- /**
56- * Find index of the first element in tuple that satifies a type
57- * @example FirstIndexSuperset<5, [boolean, string, number, object]> → 2
58- * @example FirstIndexSuperset<5, [boolean, string, object]> → never
59- * @example FirstIndexSuperset<5, [boolean, string, object], 'NotFound'> → 'NotFound'
60- */
61- export type FirstIndexSuperset < Type , Tuple extends any [ ] , NotFound = never > =
62- utils . FirstIndexSuperset < Type , Tuple , NotFound >
63-
64- /**
65- * Find index of a type in tuple
66- * @example LastIndexEqual<'x', ['a', 'b', 'c', 'x', 'd']> → 3
67- * @example LastIndexEqual<'x', ['a', 'b', 'c']> → never
68- * @example LastIndexEqual<'x', ['a', 'b', 'c'], 'NotFound'> → 'NotFound'
69- */
70- export type LastIndexEqual < Type , Tuple extends any [ ] , NotFound = never > =
71- utils . LastIndexEqual < Type , Tuple , NotFound >
72-
73- /**
74- * Find index of the first element in tuple that satifies a type
75- * @example LastIndexSubset<string, [true, false, 'x', 3]> → 2
76- * @example LastIndexSubset<string, [true, false, 0, 1]> → never
77- * @example LastIndexSubset<string, [true, false, 0, 1], 'NotFound'> → 'NotFound'
78- */
79- export type LastIndexSubset < Type , Tuple extends any [ ] , NotFound = never > =
80- utils . LastIndexSubset < Type , Tuple , NotFound >
81-
82- /**
83- * Find index of the first element in tuple that satifies a type
84- * @example LastIndexSuperset<5, [boolean, string, number, object]> → 2
85- * @example LastIndexSuperset<5, [boolean, string, object]> → never
86- * @example LastIndexSuperset<5, [boolean, string, object], 'NotFound'> → 'NotFound'
87- */
88- export type LastIndexSuperset < Type , Tuple extends any [ ] , NotFound = never > =
89- utils . LastIndexSuperset < Type , Tuple , NotFound >
90-
91- /**
92- * Find all indexes of a type in tuple
93- * @example AllIndexesEqual<'x', ['a', 'b', 'x', 'c', 'x', 'x']> → [2, 4, 5]
94- */
95- export type AllIndexesEqual < Type , Tuple extends any [ ] > =
96- utils . _IndexesNormalize < utils . _AllIndexesEqual < Type , Tuple > >
97-
98- /**
99- * Find all indexes of a type in tuple
100- * @example AllIndexesSubset<string, [0, false, 'a', 1, 'b', 'c']> → [2, 4, 5]
101- */
102- export type AllIndexesSubset < Type , Tuple extends any [ ] > =
103- utils . _IndexesNormalize < utils . _AllIndexesSubset < Type , Tuple > >
104-
105- /**
106- * Find all indexes of a type in tuple
107- * @example AllIndexesSuperset<'x', [number, boolean, string, 0, 'x', 'a' | 'b']> → [2, 4, 5]
108- */
109- export type AllIndexesSuperset < Type , Tuple extends any [ ] > =
110- utils . _IndexesNormalize < utils . _AllIndexesSuperset < Type , Tuple > >
111-
11231/**
11332 * Add an element to the end of a tuple
11433 * @example Append<[0, 1, 2], 'new'> → [0, 1, 2, 'new']
@@ -165,13 +84,6 @@ export type SliceStartQuantity<
16584 Quantity extends number
16685> = utils . SliceStartQuantity < Tuple , Start , Quantity >
16786
168- /**
169- * Create a set of tuple of single element
170- * @example SingleTupleSet<[0, 1, 2]> → [[0], [1], [2]]
171- * @example SingleTupleSet<[0, 1, 2, ...number[]]> → [[0], [1], [2], ...[number][]]
172- */
173- export type SingleTupleSet < Types extends any [ ] > = utils . SingleTupleSet < Types >
174-
17587/**
17688 * Fill a tuple of types
17789 * @example FillTuple<[0, 1, 2], 'x'> → ['x', 'x', 'x']
0 commit comments