@@ -28,13 +28,13 @@ type TypeMapping = [
2828type TsType = Exclude < TypeMapping [ number ] [ 0 ] , undefined > ;
2929type TsThreeType = Exclude < TypeMapping [ number ] [ 1 ] , undefined > ;
3030
31- export type TsTypeConversion < Tuple extends [ ...unknown [ ] ] > = {
31+ type TsTypeConversion < Tuple extends [ ...unknown [ ] ] > = {
3232 [ i in keyof Tuple ] : Tuple [ i ] extends any [ ] ? TsTypeConversion < Tuple [ i ] > : DownSampleTsType < Tuple [ i ] > ;
3333} & { length : Tuple [ "length" ] } ;
3434
3535type DownSampleTsType < T > = T extends TsType ? Extract < TypeMapping [ number ] , [ T , any ] > [ 1 ] : T ;
3636
37- export type UpSampleTsTypes < Tuple extends [ ...unknown [ ] ] > = {
37+ type UpSampleTsTypes < Tuple extends [ ...unknown [ ] ] > = {
3838 [ i in keyof Tuple ] : Tuple [ i ] extends any [ ] ? UpSampleTsTypes < Tuple [ i ] > : UpSampleTsType < Tuple [ i ] > ;
3939} & { length : Tuple [ "length" ] } ;
4040
@@ -48,27 +48,31 @@ type UpSampleTsType<T> = T extends TsThreeType ? Extract<TypeMapping[number], [a
4848
4949/**
5050 * Convert TS4 to TS3 types
51- */
51+ * @internal
52+ */
5253export function downSampleTsTypes < T extends [ ...unknown [ ] ] > ( ...args : T ) : TsTypeConversion < T > {
5354 return args as TsTypeConversion < T > ;
5455}
5556
5657/**
5758 * Convert TS4 to TS3 type
59+ * @internal
5860 */
5961export function downSampleTsType < T > ( v : T ) : DownSampleTsType < T > {
6062 return v as DownSampleTsType < T > ;
6163}
6264
6365/**
6466 * Convert TS3 to TS4 types
67+ * @internal
6568 */
6669export function upSampleTsTypes < T extends [ ...unknown [ ] ] > ( ...args : T ) : UpSampleTsTypes < T > {
6770 return args as UpSampleTsTypes < T > ;
6871}
6972
7073/**
7174 * Convert TS3 to TS4 type
75+ * @internal
7276 */
7377export function upSampleTsType < T extends TsThreeType > ( v : T ) : UpSampleTsType < T > {
7478 return v as UpSampleTsType < T > ;
0 commit comments