ts-data-forge 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/array/array-utils.d.mts +133 -286
  2. package/dist/array/array-utils.d.mts.map +1 -1
  3. package/dist/array/array-utils.mjs +191 -1898
  4. package/dist/array/array-utils.mjs.map +1 -1
  5. package/dist/array/tuple-utils.d.mts +9 -23
  6. package/dist/array/tuple-utils.d.mts.map +1 -1
  7. package/dist/array/tuple-utils.mjs +10 -56
  8. package/dist/array/tuple-utils.mjs.map +1 -1
  9. package/dist/collections/imap-mapped.mjs.map +1 -1
  10. package/dist/collections/imap.mjs.map +1 -1
  11. package/dist/collections/iset-mapped.mjs.map +1 -1
  12. package/dist/collections/iset.mjs.map +1 -1
  13. package/dist/collections/queue.mjs.map +1 -1
  14. package/dist/collections/stack.mjs.map +1 -1
  15. package/dist/functional/match.d.mts +2 -33
  16. package/dist/functional/match.d.mts.map +1 -1
  17. package/dist/functional/match.mjs +2 -119
  18. package/dist/functional/match.mjs.map +1 -1
  19. package/dist/functional/optional.d.mts +29 -51
  20. package/dist/functional/optional.d.mts.map +1 -1
  21. package/dist/functional/optional.mjs +40 -171
  22. package/dist/functional/optional.mjs.map +1 -1
  23. package/dist/functional/pipe.d.mts +2 -15
  24. package/dist/functional/pipe.d.mts.map +1 -1
  25. package/dist/functional/pipe.mjs +2 -110
  26. package/dist/functional/pipe.mjs.map +1 -1
  27. package/dist/functional/result.d.mts +18 -45
  28. package/dist/functional/result.d.mts.map +1 -1
  29. package/dist/functional/result.mjs +40 -196
  30. package/dist/functional/result.mjs.map +1 -1
  31. package/dist/iterator/range.d.mts +2 -6
  32. package/dist/iterator/range.d.mts.map +1 -1
  33. package/dist/iterator/range.mjs +2 -93
  34. package/dist/iterator/range.mjs.map +1 -1
  35. package/dist/json/json.mjs.map +1 -1
  36. package/dist/number/num.d.mts +2 -5
  37. package/dist/number/num.d.mts.map +1 -1
  38. package/dist/number/num.mjs +4 -22
  39. package/dist/number/num.mjs.map +1 -1
  40. package/dist/number/refined-number-utils.mjs.map +1 -1
  41. package/dist/object/object.d.mts +4 -10
  42. package/dist/object/object.d.mts.map +1 -1
  43. package/dist/object/object.mjs +8 -140
  44. package/dist/object/object.mjs.map +1 -1
  45. package/dist/others/map-nullable.d.mts +2 -6
  46. package/dist/others/map-nullable.d.mts.map +1 -1
  47. package/dist/others/map-nullable.mjs +2 -146
  48. package/dist/others/map-nullable.mjs.map +1 -1
  49. package/dist/others/memoize-function.mjs.map +1 -1
  50. package/dist/others/unknown-to-string.mjs.map +1 -1
  51. package/package.json +11 -11
  52. package/src/array/array-utils.mts +703 -809
  53. package/src/array/tuple-utils.mts +20 -41
  54. package/src/functional/match.mts +18 -44
  55. package/src/functional/optional.mts +88 -102
  56. package/src/functional/pipe.mts +25 -20
  57. package/src/functional/result.mts +114 -124
  58. package/src/iterator/range.mts +14 -17
  59. package/src/number/num.mts +15 -11
  60. package/src/object/object.mts +30 -45
  61. package/src/others/map-nullable.mts +13 -15
@@ -97,12 +97,9 @@ export declare namespace Arr {
97
97
  * @see {@link isEmpty} for checking if size is 0
98
98
  * @see {@link isNonEmpty} for checking if size > 0
99
99
  */
100
- export const size: SizeFnOverload;
101
- type SizeFnOverload = {
102
- <Ar extends NonEmptyArray<unknown>>(array: Ar): IntersectBrand<PositiveNumber, SizeType.Arr>;
103
- <Ar extends readonly unknown[]>(array: Ar): SizeType.Arr;
104
- };
105
- export const length: SizeFnOverload;
100
+ export function size<Ar extends NonEmptyArray<unknown>>(array: Ar): IntersectBrand<PositiveNumber, SizeType.Arr>;
101
+ export function size<Ar extends readonly unknown[]>(array: Ar): SizeType.Arr;
102
+ export const length: typeof size;
106
103
  /**
107
104
  * Type guard that checks if a value is an array, excluding types that cannot be arrays.
108
105
  * This function refines the type by filtering out non-array types from unions.
@@ -391,21 +388,18 @@ export declare namespace Arr {
391
388
  * expectType<typeof maybeEmpty, readonly 0[]>('=');
392
389
  * ```
393
390
  */
394
- export const zeros: ZerosFnOverload;
395
- type ZerosFnOverload = {
396
- /**
397
- * Create array of zeros with compile-time length.
398
- */
399
- <N extends SmallUint>(len: N): ArrayOfLength<N, 0>;
400
- /**
401
- * Create non-empty array of zeros.
402
- */
403
- (len: SizeType.ArgArrPositive): NonEmptyArray<0>;
404
- /**
405
- * Create array of zeros.
406
- */
407
- (len: SizeType.ArgArrNonNegative): readonly 0[];
408
- };
391
+ /**
392
+ * Create array of zeros with compile-time length.
393
+ */
394
+ export function zeros<N extends SmallUint>(len: N): ArrayOfLength<N, 0>;
395
+ /**
396
+ * Create non-empty array of zeros.
397
+ */
398
+ export function zeros(len: SizeType.ArgArrPositive): NonEmptyArray<0>;
399
+ /**
400
+ * Create array of zeros.
401
+ */
402
+ export function zeros(len: SizeType.ArgArrNonNegative): readonly 0[];
409
403
  /**
410
404
  * Creates a sequence of consecutive integers from 0 to `len-1`.
411
405
  *
@@ -447,12 +441,9 @@ export declare namespace Arr {
447
441
  * expectType<typeof single, readonly [0]>('=');
448
442
  * ```
449
443
  */
450
- export const seq: SeqFnOverload;
451
- type SeqFnOverload = {
452
- <N extends SmallUint>(len: N): Seq<N>;
453
- (len: SizeType.ArgArrPositive): NonEmptyArray<SizeType.Arr>;
454
- (len: SizeType.ArgArrNonNegative): readonly SizeType.Arr[];
455
- };
444
+ export function seq<N extends SmallUint>(len: N): Seq<N>;
445
+ export function seq(len: SizeType.ArgArrPositive): NonEmptyArray<SizeType.Arr>;
446
+ export function seq(len: SizeType.ArgArrNonNegative): readonly SizeType.Arr[];
456
447
  /**
457
448
  * Creates a new array of the specified length, with each position filled with the provided initial value.
458
449
  *
@@ -501,13 +492,10 @@ export declare namespace Arr {
501
492
  * @see {@link zeros} for creating arrays filled with zeros
502
493
  * @see {@link seq} for creating sequences of consecutive integers
503
494
  */
504
- export const create: CreateFnOverload;
505
- type CreateFnOverload = {
506
- <const V, N extends SmallUint>(len: N, init: V): ArrayOfLength<N, V>;
507
- <const V>(len: SizeType.ArgArrPositive, init: V): NonEmptyArray<V>;
508
- <const V>(len: SizeType.ArgArrNonNegative, init: V): readonly V[];
509
- };
510
- export const newArray: CreateFnOverload;
495
+ export function create<const V, N extends SmallUint>(len: N, init: V): ArrayOfLength<N, V>;
496
+ export function create<const V>(len: SizeType.ArgArrPositive, init: V): NonEmptyArray<V>;
497
+ export function create<const V>(len: SizeType.ArgArrNonNegative, init: V): readonly V[];
498
+ export const newArray: typeof create;
511
499
  /**
512
500
  * Creates an array from a generator function.
513
501
  *
@@ -707,12 +695,9 @@ export declare namespace Arr {
707
695
  * @see {@link SmallUint} for understanding the constraint that enables precise typing
708
696
  * @see {@link SafeInt} and {@link SafeUint} for the safe integer types used
709
697
  */
710
- export const range: RangeFnOverload;
711
- type RangeFnOverload = {
712
- <S extends SmallUint, E extends SmallUint>(start: S, end: E, step?: 1): RangeList<S, E>;
713
- (start: SafeUintWithSmallInt, end: SafeUintWithSmallInt, step?: PositiveSafeIntWithSmallInt): readonly SafeUint[];
714
- (start: SafeIntWithSmallInt, end: SafeIntWithSmallInt, step?: NonZeroSafeIntWithSmallInt): readonly SafeInt[];
715
- };
698
+ export function range<S extends SmallUint, E extends SmallUint>(start: S, end: E, step?: 1): RangeList<S, E>;
699
+ export function range(start: SafeUintWithSmallInt, end: SafeUintWithSmallInt, step?: PositiveSafeIntWithSmallInt): readonly SafeUint[];
700
+ export function range(start: SafeIntWithSmallInt, end: SafeIntWithSmallInt, step?: NonZeroSafeIntWithSmallInt): readonly SafeInt[];
716
701
  /**
717
702
  * Safely retrieves an element at a given index from an array, returning an {@link Optional}.
718
703
  *
@@ -823,14 +808,8 @@ export declare namespace Arr {
823
808
  * @see {@link Optional.unwrapOr} for safe unwrapping with defaults
824
809
  * @see {@link Optional.map} for transforming Optional values
825
810
  */
826
- export const at: AtFnOverload;
827
- /**
828
- * Function type for safely accessing an array element at a given index.
829
- */
830
- type AtFnOverload = {
831
- <E>(array: readonly E[], index: SizeType.ArgArr): Optional<E>;
832
- (index: SizeType.ArgArr): <E>(array: readonly E[]) => Optional<E>;
833
- };
811
+ export function at<E>(array: readonly E[], index: SizeType.ArgArr): Optional<E>;
812
+ export function at(index: SizeType.ArgArr): <E>(array: readonly E[]) => Optional<E>;
834
813
  /**
835
814
  * Returns the first element of an array wrapped in an Optional.
836
815
  *
@@ -902,25 +881,10 @@ export declare namespace Arr {
902
881
  * @see {@link at} for accessing elements at specific indices
903
882
  * @see {@link tail} for getting all elements except the first
904
883
  */
905
- export const head: HeadFnOverload;
906
- type HeadFnOverload = {
907
- /**
908
- * Get head of empty array.
909
- */
910
- (array: readonly []): Optional.None;
911
- /**
912
- * Get head of tuple.
913
- */
914
- <E, L extends readonly unknown[]>(array: readonly [E, ...L]): Optional.Some<E>;
915
- /**
916
- * Get head of non-empty array.
917
- */
918
- <E>(array: NonEmptyArray<E>): Optional.Some<E>;
919
- /**
920
- * Get head of any array.
921
- */
922
- <E>(array: readonly E[]): Optional<E>;
923
- };
884
+ export function head(array: readonly []): Optional.None;
885
+ export function head<E, L extends readonly unknown[]>(array: readonly [E, ...L]): Optional.Some<E>;
886
+ export function head<E>(array: NonEmptyArray<E>): Optional.Some<E>;
887
+ export function head<E>(array: readonly E[]): Optional<E>;
924
888
  /**
925
889
  * Returns the last element of an array wrapped in an Optional.
926
890
  *
@@ -1001,25 +965,10 @@ export declare namespace Arr {
1001
965
  * @see {@link at} for accessing elements at specific indices with negative indexing support
1002
966
  * @see {@link butLast} for getting all elements except the last
1003
967
  */
1004
- export const last: LastFnOverload;
1005
- type LastFnOverload = {
1006
- /**
1007
- * Get last of empty array.
1008
- */
1009
- (array: readonly []): Optional.None;
1010
- /**
1011
- * Get last of tuple.
1012
- */
1013
- <Ar extends readonly unknown[], L>(array: readonly [...Ar, L]): Optional.Some<L>;
1014
- /**
1015
- * Get last of non-empty array.
1016
- */
1017
- <E>(array: NonEmptyArray<E>): Optional.Some<E>;
1018
- /**
1019
- * Get last of any array.
1020
- */
1021
- <E>(array: readonly E[]): Optional<E>;
1022
- };
968
+ export function last(array: readonly []): Optional.None;
969
+ export function last<Ar extends readonly unknown[], L>(array: readonly [...Ar, L]): Optional.Some<L>;
970
+ export function last<E>(array: NonEmptyArray<E>): Optional.Some<E>;
971
+ export function last<E>(array: readonly E[]): Optional<E>;
1023
972
  /**
1024
973
  * Slices an array with automatically clamped start and end indices for safe bounds handling.
1025
974
  *
@@ -1103,11 +1052,8 @@ export declare namespace Arr {
1103
1052
  * @see {@link skip} for skipping the first N elements
1104
1053
  * @see {@link takeLast} for taking the last N elements
1105
1054
  */
1106
- export const sliceClamped: SliceClampedFnOverload;
1107
- type SliceClampedFnOverload = {
1108
- <E>(array: readonly E[], start: SizeType.ArgArr, end: SizeType.ArgArr): readonly E[];
1109
- (start: SizeType.ArgArr, end: SizeType.ArgArr): <E>(array: readonly E[]) => readonly E[];
1110
- };
1055
+ export function sliceClamped<E>(array: readonly E[], start: SizeType.ArgArr, end: SizeType.ArgArr): readonly E[];
1056
+ export function sliceClamped(start: SizeType.ArgArr, end: SizeType.ArgArr): <E>(array: readonly E[]) => readonly E[];
1111
1057
  /**
1112
1058
  * Returns all elements of an array except the first one.
1113
1059
  * @template E The type of the array (can be a tuple for more precise typing).
@@ -1157,15 +1103,12 @@ export declare namespace Arr {
1157
1103
  * console.log(result); // [1, 2, 3]
1158
1104
  * ```
1159
1105
  */
1160
- export const take: TakeFnOverload;
1161
- type TakeFnOverload = {
1162
- <Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.Take<N, Ar>;
1163
- <N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.Take<N, Ar>;
1164
- <E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): NonEmptyArray<E>;
1165
- (num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => NonEmptyArray<E>;
1166
- <E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1167
- (num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1168
- };
1106
+ export function take<Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.Take<N, Ar>;
1107
+ export function take<N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.Take<N, Ar>;
1108
+ export function take<E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): NonEmptyArray<E>;
1109
+ export function take(num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => NonEmptyArray<E>;
1110
+ export function take<E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1111
+ export function take(num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1169
1112
  /**
1170
1113
  * Takes the last N elements from an array.
1171
1114
  *
@@ -1189,15 +1132,12 @@ export declare namespace Arr {
1189
1132
  * console.log(result); // [4, 5]
1190
1133
  * ```
1191
1134
  */
1192
- export const takeLast: TakeLastFnOverload;
1193
- type TakeLastFnOverload = {
1194
- <Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.TakeLast<N, Ar>;
1195
- <N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.TakeLast<N, Ar>;
1196
- <E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): NonEmptyArray<E>;
1197
- (num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => NonEmptyArray<E>;
1198
- <E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1199
- (num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1200
- };
1135
+ export function takeLast<Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.TakeLast<N, Ar>;
1136
+ export function takeLast<N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.TakeLast<N, Ar>;
1137
+ export function takeLast<E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): NonEmptyArray<E>;
1138
+ export function takeLast(num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => NonEmptyArray<E>;
1139
+ export function takeLast<E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1140
+ export function takeLast(num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1201
1141
  /**
1202
1142
  * Skips the first N elements of an array.
1203
1143
  *
@@ -1221,15 +1161,12 @@ export declare namespace Arr {
1221
1161
  * console.log(result); // [3, 4, 5]
1222
1162
  * ```
1223
1163
  */
1224
- export const skip: SkipFnOverload;
1225
- type SkipFnOverload = {
1226
- <Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.Skip<N, Ar>;
1227
- <E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): readonly E[];
1228
- <E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1229
- <N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.Skip<N, Ar>;
1230
- (num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => readonly E[];
1231
- (num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1232
- };
1164
+ export function skip<Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.Skip<N, Ar>;
1165
+ export function skip<E>(array: NonEmptyArray<E>, num: SizeType.ArgArrPositive): readonly E[];
1166
+ export function skip<E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1167
+ export function skip<N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.Skip<N, Ar>;
1168
+ export function skip(num: SizeType.ArgArrPositive): <E>(array: NonEmptyArray<E>) => readonly E[];
1169
+ export function skip(num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1233
1170
  /**
1234
1171
  * Skips the last N elements of an array.
1235
1172
  *
@@ -1253,13 +1190,10 @@ export declare namespace Arr {
1253
1190
  * console.log(result); // [1, 2, 3]
1254
1191
  * ```
1255
1192
  */
1256
- export const skipLast: SkipLastFnOverload;
1257
- type SkipLastFnOverload = {
1258
- <Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.SkipLast<N, Ar>;
1259
- <E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1260
- <N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.SkipLast<N, Ar>;
1261
- (num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1262
- };
1193
+ export function skipLast<Ar extends readonly unknown[], N extends SmallUint>(array: Ar, num: N): List.SkipLast<N, Ar>;
1194
+ export function skipLast<N extends SmallUint>(num: N): <Ar extends readonly unknown[]>(array: Ar) => List.SkipLast<N, Ar>;
1195
+ export function skipLast<E>(array: readonly E[], num: SizeType.ArgArrNonNegative): readonly E[];
1196
+ export function skipLast(num: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1263
1197
  /**
1264
1198
  * Returns a new array with the element at the specified index updated by a function.
1265
1199
  *
@@ -1414,11 +1348,8 @@ export declare namespace Arr {
1414
1348
  * @see {@link SizeType.ArgArrNonNegative} for the index type constraint
1415
1349
  * @see Immutable update patterns for functional programming approaches
1416
1350
  */
1417
- export const toUpdated: ToUpdatedFnOverload;
1418
- type ToUpdatedFnOverload = {
1419
- <E, U>(array: readonly E[], index: SizeType.ArgArrNonNegative, updater: (prev: E) => U): readonly (E | U)[];
1420
- <E, U>(index: SizeType.ArgArrNonNegative, updater: (prev: E) => U): (array: readonly E[]) => readonly (E | U)[];
1421
- };
1351
+ export function toUpdated<E, U>(array: readonly E[], index: SizeType.ArgArrNonNegative, updater: (prev: E) => U): readonly (E | U)[];
1352
+ export function toUpdated<E, U>(index: SizeType.ArgArrNonNegative, updater: (prev: E) => U): (array: readonly E[]) => readonly (E | U)[];
1422
1353
  /**
1423
1354
  * Returns a new array with a new value inserted at the specified index.
1424
1355
  * Index can be out of bounds (e.g., negative or greater than length), `toSpliced` handles this.
@@ -1438,11 +1369,8 @@ export declare namespace Arr {
1438
1369
  * console.log(result); // [99, 1, 2, 3]
1439
1370
  * ```
1440
1371
  */
1441
- export const toInserted: ToInsertedFnOverload;
1442
- type ToInsertedFnOverload = {
1443
- <E, const V = E>(array: readonly E[], index: SizeType.ArgArrNonNegative, newValue: V): NonEmptyArray<E | V>;
1444
- <E, const V = E>(index: SizeType.ArgArrNonNegative, newValue: V): (array: readonly E[]) => NonEmptyArray<E | V>;
1445
- };
1372
+ export function toInserted<E, const V = E>(array: readonly E[], index: SizeType.ArgArrNonNegative, newValue: V): NonEmptyArray<E | V>;
1373
+ export function toInserted<E, const V = E>(index: SizeType.ArgArrNonNegative, newValue: V): (array: readonly E[]) => NonEmptyArray<E | V>;
1446
1374
  /**
1447
1375
  * Returns a new array with the element at the specified index removed.
1448
1376
  * If index is out of bounds, `toSpliced` handles this (usually by returning a copy).
@@ -1461,11 +1389,8 @@ export declare namespace Arr {
1461
1389
  * console.log(result); // [20, 30]
1462
1390
  * ```
1463
1391
  */
1464
- export const toRemoved: ToRemovedFnOverload;
1465
- type ToRemovedFnOverload = {
1466
- <E>(array: readonly E[], index: SizeType.ArgArrNonNegative): readonly E[];
1467
- (index: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1468
- };
1392
+ export function toRemoved<E>(array: readonly E[], index: SizeType.ArgArrNonNegative): readonly E[];
1393
+ export function toRemoved(index: SizeType.ArgArrNonNegative): <E>(array: readonly E[]) => readonly E[];
1469
1394
  /**
1470
1395
  * Returns a new array with a value added to the end.
1471
1396
  * @template E The type of the input array (can be a tuple).
@@ -1484,11 +1409,8 @@ export declare namespace Arr {
1484
1409
  * console.log(result); // [1, 2, 3, 0]
1485
1410
  * ```
1486
1411
  */
1487
- export const toPushed: ToPushedFnOverload;
1488
- type ToPushedFnOverload = {
1489
- <Ar extends readonly unknown[], const V>(array: Ar, newValue: V): readonly [...Ar, V];
1490
- <const V>(newValue: V): <Ar extends readonly unknown[]>(array: Ar) => readonly [...Ar, V];
1491
- };
1412
+ export function toPushed<Ar extends readonly unknown[], const V>(array: Ar, newValue: V): readonly [...Ar, V];
1413
+ export function toPushed<const V>(newValue: V): <Ar extends readonly unknown[]>(array: Ar) => readonly [...Ar, V];
1492
1414
  /**
1493
1415
  * Returns a new array with a value added to the beginning.
1494
1416
  * @template E The type of the input array (can be a tuple).
@@ -1507,11 +1429,8 @@ export declare namespace Arr {
1507
1429
  * console.log(result); // [0, 1, 2, 3]
1508
1430
  * ```
1509
1431
  */
1510
- export const toUnshifted: ToUnshiftedFnOverload;
1511
- type ToUnshiftedFnOverload = {
1512
- <Ar extends readonly unknown[], const V>(array: Ar, newValue: V): readonly [V, ...Ar];
1513
- <const V>(newValue: V): <Ar extends readonly unknown[]>(array: Ar) => readonly [V, ...Ar];
1514
- };
1432
+ export function toUnshifted<Ar extends readonly unknown[], const V>(array: Ar, newValue: V): readonly [V, ...Ar];
1433
+ export function toUnshifted<const V>(newValue: V): <Ar extends readonly unknown[]>(array: Ar) => readonly [V, ...Ar];
1515
1434
  /**
1516
1435
  * Fills an array with a value (creates a new filled array).
1517
1436
  * @param array The array.
@@ -1532,16 +1451,10 @@ export declare namespace Arr {
1532
1451
  * console.log(result2); // [1, 0, 0, 4]
1533
1452
  * ```
1534
1453
  */
1535
- export const toFilled: ToFilledFnOverload;
1536
- type ToFilledFnOverload = {
1537
- <E>(array: readonly E[], value: E): readonly E[];
1538
- <E>(value: E): (array: readonly E[]) => readonly E[];
1539
- };
1540
- export const toRangeFilled: ToRangeFilledFnOverload;
1541
- type ToRangeFilledFnOverload = {
1542
- <E>(array: readonly E[], value: E, fillRange: readonly [start: SizeType.ArgArr, end: SizeType.ArgArr]): readonly E[];
1543
- <E>(value: E, fillRange: readonly [start: SizeType.ArgArr, end: SizeType.ArgArr]): (array: readonly E[]) => readonly E[];
1544
- };
1454
+ export function toFilled<E>(array: readonly E[], value: E): readonly E[];
1455
+ export function toFilled<E>(value: E): (array: readonly E[]) => readonly E[];
1456
+ export function toRangeFilled<E>(array: readonly E[], value: E, fillRange: readonly [start: SizeType.ArgArr, end: SizeType.ArgArr]): readonly E[];
1457
+ export function toRangeFilled<E>(value: E, fillRange: readonly [start: SizeType.ArgArr, end: SizeType.ArgArr]): (array: readonly E[]) => readonly E[];
1545
1458
  /**
1546
1459
  * Safely finds the first element in an array that satisfies a predicate function.
1547
1460
  *
@@ -1579,11 +1492,8 @@ export declare namespace Arr {
1579
1492
  * @see {@link indexOf} for finding elements by equality
1580
1493
  * @see {@link Optional} for working with the returned Optional values
1581
1494
  */
1582
- export const find: FindFnOverload;
1583
- type FindFnOverload = {
1584
- <E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr, arr: readonly E[]) => boolean): Optional<E>;
1585
- <E>(predicate: (value: E, index: SizeType.Arr, arr: readonly E[]) => boolean): (array: readonly E[]) => Optional<E>;
1586
- };
1495
+ export function find<E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr, arr: readonly E[]) => boolean): Optional<E>;
1496
+ export function find<E>(predicate: (value: E, index: SizeType.Arr, arr: readonly E[]) => boolean): (array: readonly E[]) => Optional<E>;
1587
1497
  /**
1588
1498
  * Safely finds the index of the first element in an array that satisfies a predicate function.
1589
1499
  *
@@ -1689,11 +1599,8 @@ export declare namespace Arr {
1689
1599
  * @see {@link lastIndexOf} for finding the last occurrence
1690
1600
  * @see {@link Optional} for working with the returned Optional values
1691
1601
  */
1692
- export const findIndex: FindIndexFnOverload;
1693
- type FindIndexFnOverload = {
1694
- <E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr) => boolean): SizeType.Arr | -1;
1695
- <E>(predicate: (value: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => SizeType.Arr | -1;
1696
- };
1602
+ export function findIndex<E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr) => boolean): SizeType.Arr | -1;
1603
+ export function findIndex<E>(predicate: (value: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => SizeType.Arr | -1;
1697
1604
  /**
1698
1605
  * Gets the index of a value in an array.
1699
1606
  * @param array The array to search.
@@ -1715,16 +1622,10 @@ export declare namespace Arr {
1715
1622
  * console.log(Optional.unwrapOr(result2, -1)); // 1
1716
1623
  * ```
1717
1624
  */
1718
- export const indexOf: IndexOfFnOverload;
1719
- type IndexOfFnOverload = {
1720
- <E>(array: readonly E[], searchElement: E): SizeType.Arr | -1;
1721
- <E>(searchElement: E): (array: readonly E[]) => SizeType.Arr | -1;
1722
- };
1723
- export const indexOfFrom: IndexOfFromFnOverload;
1724
- type IndexOfFromFnOverload = {
1725
- <E>(array: readonly E[], searchElement: E, fromIndex: SizeType.ArgArr): SizeType.Arr | -1;
1726
- <E>(searchElement: E, fromIndex: SizeType.ArgArr): (array: readonly E[]) => SizeType.Arr | -1;
1727
- };
1625
+ export function indexOf<E>(array: readonly E[], searchElement: E): SizeType.Arr | -1;
1626
+ export function indexOf<E>(searchElement: E): (array: readonly E[]) => SizeType.Arr | -1;
1627
+ export function indexOfFrom<E>(array: readonly E[], searchElement: E, fromIndex: SizeType.ArgArr): SizeType.Arr | -1;
1628
+ export function indexOfFrom<E>(searchElement: E, fromIndex: SizeType.ArgArr): (array: readonly E[]) => SizeType.Arr | -1;
1728
1629
  /**
1729
1630
  * Gets the last index of a value in an array.
1730
1631
  * @param array The array to search.
@@ -1746,16 +1647,10 @@ export declare namespace Arr {
1746
1647
  * console.log(Optional.unwrapOr(result2, -1)); // 3
1747
1648
  * ```
1748
1649
  */
1749
- export const lastIndexOf: LastIndexOfFnOverload;
1750
- type LastIndexOfFnOverload = {
1751
- <E>(array: readonly E[], searchElement: E): SizeType.Arr | -1;
1752
- <E>(searchElement: E): (array: readonly E[]) => SizeType.Arr | -1;
1753
- };
1754
- export const lastIndexOfFrom: LastIndexOfFromFnOverload;
1755
- type LastIndexOfFromFnOverload = {
1756
- <E>(array: readonly E[], searchElement: E, fromIndex: SizeType.ArgArr): SizeType.Arr | -1;
1757
- <E>(searchElement: E, fromIndex: SizeType.ArgArr): (array: readonly E[]) => SizeType.Arr | -1;
1758
- };
1650
+ export function lastIndexOf<E>(array: readonly E[], searchElement: E): SizeType.Arr | -1;
1651
+ export function lastIndexOf<E>(searchElement: E): (array: readonly E[]) => SizeType.Arr | -1;
1652
+ export function lastIndexOfFrom<E>(array: readonly E[], searchElement: E, fromIndex: SizeType.ArgArr): SizeType.Arr | -1;
1653
+ export function lastIndexOfFrom<E>(searchElement: E, fromIndex: SizeType.ArgArr): (array: readonly E[]) => SizeType.Arr | -1;
1759
1654
  /**
1760
1655
  * Applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
1761
1656
  * This is an alias for `Array.prototype.reduce`.
@@ -1771,11 +1666,8 @@ export declare namespace Arr {
1771
1666
  * Arr.foldl(['a', 'b', 'c'], (acc, str) => acc + str.toUpperCase(), ''); // 'ABC'
1772
1667
  * ```
1773
1668
  */
1774
- export const foldl: FoldlFnOverload;
1775
- type FoldlFnOverload = {
1776
- <E, P>(array: readonly E[], callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): P;
1777
- <E, P>(callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): (array: readonly E[]) => P;
1778
- };
1669
+ export function foldl<E, P>(array: readonly E[], callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): P;
1670
+ export function foldl<E, P>(callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): (array: readonly E[]) => P;
1779
1671
  /**
1780
1672
  * Applies a function against an accumulator and each element in the array (from right to left) to reduce it to a single value.
1781
1673
  * This is an alias for `Array.prototype.reduceRight`.
@@ -1796,11 +1688,8 @@ export declare namespace Arr {
1796
1688
  * console.log(result); // "abc"
1797
1689
  * ```
1798
1690
  */
1799
- export const foldr: FoldrFnOverload;
1800
- type FoldrFnOverload = {
1801
- <E, P>(array: readonly E[], callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): P;
1802
- <E, P>(callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): (array: readonly E[]) => P;
1803
- };
1691
+ export function foldr<E, P>(array: readonly E[], callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): P;
1692
+ export function foldr<E, P>(callbackfn: (previousValue: P, currentValue: E, currentIndex: SizeType.Arr) => P, initialValue: P): (array: readonly E[]) => P;
1804
1693
  /**
1805
1694
  * Finds the minimum value in an array.
1806
1695
  * @template E The type of numbers in the array (must extend `number`).
@@ -1814,13 +1703,10 @@ export declare namespace Arr {
1814
1703
  * Arr.min([]); // Optional.none
1815
1704
  * ```
1816
1705
  */
1817
- export const min: MinFnOverload;
1818
- type MinFnOverload = {
1819
- <E extends number>(array: NonEmptyArray<E>, comparator?: (x: E, y: E) => number): Optional.Some<E>;
1820
- <E extends number>(array: readonly E[], comparator?: (x: E, y: E) => number): Optional<E>;
1821
- <E>(array: NonEmptyArray<E>, comparator: (x: E, y: E) => number): Optional.Some<E>;
1822
- <E>(array: readonly E[], comparator: (x: E, y: E) => number): Optional<E>;
1823
- };
1706
+ export function min<E extends number>(array: NonEmptyArray<E>, comparator?: (x: E, y: E) => number): Optional.Some<E>;
1707
+ export function min<E extends number>(array: readonly E[], comparator?: (x: E, y: E) => number): Optional<E>;
1708
+ export function min<E>(array: NonEmptyArray<E>, comparator: (x: E, y: E) => number): Optional.Some<E>;
1709
+ export function min<E>(array: readonly E[], comparator: (x: E, y: E) => number): Optional<E>;
1824
1710
  /**
1825
1711
  * Finds the maximum value in an array.
1826
1712
  *
@@ -1839,13 +1725,10 @@ export declare namespace Arr {
1839
1725
  * Arr.max([]); // Optional.none
1840
1726
  * ```
1841
1727
  */
1842
- export const max: MaxFnOverload;
1843
- type MaxFnOverload = {
1844
- <E extends number>(array: NonEmptyArray<E>, comparator?: (x: E, y: E) => number): Optional.Some<E>;
1845
- <E extends number>(array: readonly E[], comparator?: (x: E, y: E) => number): Optional<E>;
1846
- <E>(array: NonEmptyArray<E>, comparator: (x: E, y: E) => number): Optional.Some<E>;
1847
- <E>(array: readonly E[], comparator: (x: E, y: E) => number): Optional<E>;
1848
- };
1728
+ export function max<E extends number>(array: NonEmptyArray<E>, comparator?: (x: E, y: E) => number): Optional.Some<E>;
1729
+ export function max<E extends number>(array: readonly E[], comparator?: (x: E, y: E) => number): Optional<E>;
1730
+ export function max<E>(array: NonEmptyArray<E>, comparator: (x: E, y: E) => number): Optional.Some<E>;
1731
+ export function max<E>(array: readonly E[], comparator: (x: E, y: E) => number): Optional<E>;
1849
1732
  /**
1850
1733
  * Finds the element with the minimum value according to a mapped numeric value.
1851
1734
  *
@@ -1866,13 +1749,10 @@ export declare namespace Arr {
1866
1749
  * Arr.minBy([], p => p.age); // Optional.none
1867
1750
  * ```
1868
1751
  */
1869
- export const minBy: MinByFnOverload;
1870
- type MinByFnOverload = {
1871
- <E>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => number): Optional.Some<E>;
1872
- <E>(array: readonly E[], comparatorValueMapper: (value: E) => number): Optional<E>;
1873
- <E, V>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional.Some<E>;
1874
- <E, V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional<E>;
1875
- };
1752
+ export function minBy<E>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => number): Optional.Some<E>;
1753
+ export function minBy<E>(array: readonly E[], comparatorValueMapper: (value: E) => number): Optional<E>;
1754
+ export function minBy<E, V>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional.Some<E>;
1755
+ export function minBy<E, V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional<E>;
1876
1756
  /**
1877
1757
  * Finds the element with the maximum value according to a mapped numeric value.
1878
1758
  *
@@ -1893,13 +1773,10 @@ export declare namespace Arr {
1893
1773
  * Arr.maxBy([], p => p.age); // Optional.none
1894
1774
  * ```
1895
1775
  */
1896
- export const maxBy: MaxByFnOverload;
1897
- type MaxByFnOverload = {
1898
- <E>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => number): Optional.Some<E>;
1899
- <E>(array: readonly E[], comparatorValueMapper: (value: E) => number): Optional<E>;
1900
- <E, V>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional.Some<E>;
1901
- <E, V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional<E>;
1902
- };
1776
+ export function maxBy<E>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => number): Optional.Some<E>;
1777
+ export function maxBy<E>(array: readonly E[], comparatorValueMapper: (value: E) => number): Optional<E>;
1778
+ export function maxBy<E, V>(array: NonEmptyArray<E>, comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional.Some<E>;
1779
+ export function maxBy<E, V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): Optional<E>;
1903
1780
  /**
1904
1781
  * Counts the number of elements in an array that satisfy a predicate.
1905
1782
  * @template E The type of elements in the array.
@@ -1917,11 +1794,8 @@ export declare namespace Arr {
1917
1794
  * console.log(result); // 3
1918
1795
  * ```
1919
1796
  */
1920
- export const count: CountFnOverload;
1921
- type CountFnOverload = {
1922
- <E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr) => boolean): SizeType.Arr;
1923
- <E>(predicate: (value: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => SizeType.Arr;
1924
- };
1797
+ export function count<E>(array: readonly E[], predicate: (value: E, index: SizeType.Arr) => boolean): SizeType.Arr;
1798
+ export function count<E>(predicate: (value: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => SizeType.Arr;
1925
1799
  /**
1926
1800
  * Groups elements of an array by a key derived from each element and counts the elements in each group.
1927
1801
  * @template E The type of elements in the array.
@@ -1942,11 +1816,8 @@ export declare namespace Arr {
1942
1816
  * // IMap { 'a' => 2, 'b' => 1 }
1943
1817
  * ```
1944
1818
  */
1945
- export const countBy: CountByFnOverload;
1946
- type CountByFnOverload = {
1947
- <E, G extends MapSetKeyType>(array: readonly E[], grouper: (value: E, index: SizeType.Arr) => G): IMap<G, SizeType.Arr>;
1948
- <E, G extends MapSetKeyType>(grouper: (value: E, index: SizeType.Arr) => G): (array: readonly E[]) => IMap<G, SizeType.Arr>;
1949
- };
1819
+ export function countBy<E, G extends MapSetKeyType>(array: readonly E[], grouper: (value: E, index: SizeType.Arr) => G): IMap<G, SizeType.Arr>;
1820
+ export function countBy<E, G extends MapSetKeyType>(grouper: (value: E, index: SizeType.Arr) => G): (array: readonly E[]) => IMap<G, SizeType.Arr>;
1950
1821
  /**
1951
1822
  * Calculates the sum of numbers in an array.
1952
1823
  * @param array The input array of numbers.
@@ -1958,14 +1829,11 @@ export declare namespace Arr {
1958
1829
  * Arr.sum([-1, 0, 1]); // 0
1959
1830
  * ```
1960
1831
  */
1961
- export const sum: SumFnOverload;
1962
- type SumFnOverload = {
1963
- (array: readonly []): 0;
1964
- <N extends number>(array: readonly [N]): N;
1965
- (array: readonly Uint[]): Uint;
1966
- (array: readonly Int[]): Int;
1967
- (array: readonly number[]): number;
1968
- };
1832
+ export function sum(array: readonly []): 0;
1833
+ export function sum<N extends number>(array: readonly [N]): N;
1834
+ export function sum(array: readonly Uint[]): Uint;
1835
+ export function sum(array: readonly Int[]): Int;
1836
+ export function sum(array: readonly number[]): number;
1969
1837
  /**
1970
1838
  * Joins array elements into a string.
1971
1839
  * @param array The array to join.
@@ -1986,11 +1854,8 @@ export declare namespace Arr {
1986
1854
  * console.log(Result.unwrapOr(result2, '')); // "a,b,c"
1987
1855
  * ```
1988
1856
  */
1989
- export const join: JoinFnOverload;
1990
- type JoinFnOverload = {
1991
- <E>(array: readonly E[], separator?: string): Result<string, Error>;
1992
- (separator?: string): <E>(array: readonly E[]) => Result<string, Error>;
1993
- };
1857
+ export function join<E>(array: readonly E[], separator?: string): Result<string, Error>;
1858
+ export function join(separator?: string): <E>(array: readonly E[]) => Result<string, Error>;
1994
1859
  /**
1995
1860
  * Creates an array of tuples by pairing up corresponding elements from two arrays.
1996
1861
  * The resulting array has a length equal to the minimum of the two input array lengths.
@@ -2026,11 +1891,8 @@ export declare namespace Arr {
2026
1891
  * console.log(result); // [1, 3, 5]
2027
1892
  * ```
2028
1893
  */
2029
- export const filterNot: FilterNotFnOverload;
2030
- type FilterNotFnOverload = {
2031
- <E>(array: readonly E[], predicate: (a: E, index: SizeType.Arr) => boolean): readonly E[];
2032
- <E>(predicate: (a: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => readonly E[];
2033
- };
1894
+ export function filterNot<E>(array: readonly E[], predicate: (a: E, index: SizeType.Arr) => boolean): readonly E[];
1895
+ export function filterNot<E>(predicate: (a: E, index: SizeType.Arr) => boolean): (array: readonly E[]) => readonly E[];
2034
1896
  /**
2035
1897
  * Concatenates two arrays.
2036
1898
  * @template E1 The type of the first array (can be a tuple).
@@ -2061,11 +1923,8 @@ export declare namespace Arr {
2061
1923
  * Arr.partition([1, 2, 3, 4, 5, 6, 7], 3); // [[1, 2, 3], [4, 5, 6], [7]]
2062
1924
  * ```
2063
1925
  */
2064
- export const partition: PartitionFnOverload;
2065
- type PartitionFnOverload = {
2066
- <N extends WithSmallInt<PositiveInt & SizeType.Arr>, E>(array: readonly E[], chunkSize: N): readonly (readonly E[])[];
2067
- <N extends WithSmallInt<PositiveInt & SizeType.Arr>>(chunkSize: N): <E>(array: readonly E[]) => readonly (readonly E[])[];
2068
- };
1926
+ export function partition<N extends WithSmallInt<PositiveInt & SizeType.Arr>, E>(array: readonly E[], chunkSize: N): readonly (readonly E[])[];
1927
+ export function partition<N extends WithSmallInt<PositiveInt & SizeType.Arr>>(chunkSize: N): <E>(array: readonly E[]) => readonly (readonly E[])[];
2069
1928
  /**
2070
1929
  * Sorts an array by a value derived from its elements, using a numeric mapping.
2071
1930
  * @template E The type of elements in the array.
@@ -2082,11 +1941,8 @@ export declare namespace Arr {
2082
1941
  * // [{ name: 'Adam', score: 90 }, { name: 'Bob', score: 80 }, { name: 'Eve', score: 70 }]
2083
1942
  * ```
2084
1943
  */
2085
- export const toSortedBy: ToSortedByFnOverload;
2086
- type ToSortedByFnOverload = {
2087
- <E>(array: readonly E[], comparatorValueMapper: (value: E) => number, comparator?: (x: number, y: number) => number): readonly E[];
2088
- <E, const V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): readonly E[];
2089
- };
1944
+ export function toSortedBy<E>(array: readonly E[], comparatorValueMapper: (value: E) => number, comparator?: (x: number, y: number) => number): readonly E[];
1945
+ export function toSortedBy<E, const V>(array: readonly E[], comparatorValueMapper: (value: E) => V, comparator: (x: V, y: V) => number): readonly E[];
2090
1946
  /**
2091
1947
  * Returns an array of successively reduced values from an array, starting with an initial value.
2092
1948
  *
@@ -2243,11 +2099,8 @@ export declare namespace Arr {
2243
2099
  * @see {@link SizeType.Arr} for the index parameter type
2244
2100
  * @see Array.prototype.reduce for the standard reduce function
2245
2101
  */
2246
- export const scan: ScanFnOverload;
2247
- type ScanFnOverload = {
2248
- <E, S>(array: readonly E[], reducer: (accumulator: S, currentValue: E, currentIndex: SizeType.Arr) => S, init: S): NonEmptyArray<S>;
2249
- <E, S>(reducer: (accumulator: S, currentValue: E, currentIndex: SizeType.Arr) => S, init: S): (array: readonly E[]) => NonEmptyArray<S>;
2250
- };
2102
+ export function scan<E, S>(array: readonly E[], reducer: (accumulator: S, currentValue: E, currentIndex: SizeType.Arr) => S, init: S): NonEmptyArray<S>;
2103
+ export function scan<E, S>(reducer: (accumulator: S, currentValue: E, currentIndex: SizeType.Arr) => S, init: S): (array: readonly E[]) => NonEmptyArray<S>;
2251
2104
  /**
2252
2105
  * Groups elements of an array by a key derived from each element, returning an immutable {@link IMap}.
2253
2106
  *
@@ -2397,11 +2250,8 @@ export declare namespace Arr {
2397
2250
  * @see {@link IMap.map} for transforming grouped data
2398
2251
  * @see {@link Optional} for handling potentially missing groups
2399
2252
  */
2400
- export const groupBy: GroupByFnOverload;
2401
- type GroupByFnOverload = {
2402
- <E, G extends MapSetKeyType>(array: readonly E[], grouper: (value: E, index: SizeType.Arr) => G): IMap<G, readonly E[]>;
2403
- <E, G extends MapSetKeyType>(grouper: (value: E, index: SizeType.Arr) => G): (array: readonly E[]) => IMap<G, readonly E[]>;
2404
- };
2253
+ export function groupBy<E, G extends MapSetKeyType>(array: readonly E[], grouper: (value: E, index: SizeType.Arr) => G): IMap<G, readonly E[]>;
2254
+ export function groupBy<E, G extends MapSetKeyType>(grouper: (value: E, index: SizeType.Arr) => G): (array: readonly E[]) => IMap<G, readonly E[]>;
2405
2255
  /**
2406
2256
  * Creates a new array with unique elements from the input array. Order is preserved from the first occurrence.
2407
2257
  * Uses `Set` internally for efficient uniqueness checking.
@@ -2435,11 +2285,8 @@ export declare namespace Arr {
2435
2285
  * Arr.uniqBy(users, user => user.id); // [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]
2436
2286
  * ```
2437
2287
  */
2438
- export const uniqBy: UniqByFnOverload;
2439
- type UniqByFnOverload = {
2440
- <E, P extends Primitive>(array: NonEmptyArray<E>, mapFn: (value: E) => P): NonEmptyArray<E>;
2441
- <E, P extends Primitive>(array: readonly E[], mapFn: (value: E) => P): readonly E[];
2442
- };
2288
+ export function uniqBy<E, P extends Primitive>(array: NonEmptyArray<E>, mapFn: (value: E) => P): NonEmptyArray<E>;
2289
+ export function uniqBy<E, P extends Primitive>(array: readonly E[], mapFn: (value: E) => P): readonly E[];
2443
2290
  /**
2444
2291
  * Checks if two arrays are equal by performing a shallow comparison of their elements.
2445
2292
  * @template E The type of elements in the arrays.
@@ -2550,7 +2397,7 @@ export declare namespace Arr {
2550
2397
  * Alias for `head`. Returns the first element of an array.
2551
2398
  * @see {@link head}
2552
2399
  */
2553
- export const first: HeadFnOverload;
2400
+ export const first: typeof head;
2554
2401
  /**
2555
2402
  * Alias for `tail`. Returns all elements of an array except the first one.
2556
2403
  * @see {@link tail}
@@ -2560,22 +2407,22 @@ export declare namespace Arr {
2560
2407
  * Alias for `skip`. Skips the first N elements of an array.
2561
2408
  * @see {@link skip}
2562
2409
  */
2563
- export const drop: SkipFnOverload;
2410
+ export const drop: typeof skip;
2564
2411
  /**
2565
2412
  * Alias for `foldl`. Applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
2566
2413
  * @see {@link foldl}
2567
2414
  */
2568
- export const reduce: FoldlFnOverload;
2415
+ export const reduce: typeof foldl;
2569
2416
  /**
2570
2417
  * Alias for `foldr`. Applies a function against an accumulator and each element in the array (from right to left) to reduce it to a single value.
2571
2418
  * @see {@link foldr}
2572
2419
  */
2573
- export const reduceRight: FoldrFnOverload;
2420
+ export const reduceRight: typeof foldr;
2574
2421
  /**
2575
2422
  * Alias for `partition`. Splits an array into chunks of a specified size.
2576
2423
  * @see {@link partition}
2577
2424
  */
2578
- export const chunk: PartitionFnOverload;
2425
+ export const chunk: typeof partition;
2579
2426
  export {};
2580
2427
  }
2581
2428
  //# sourceMappingURL=array-utils.d.mts.map