@oscarpalmer/atoms 0.184.2 → 0.185.0

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 (88) hide show
  1. package/dist/array/index.d.mts +2 -2
  2. package/dist/array/index.mjs +2 -2
  3. package/dist/array/{position.d.mts → match.d.mts} +9 -6
  4. package/dist/array/{position.mjs → match.mjs} +16 -16
  5. package/dist/array/move.mjs +1 -1
  6. package/dist/array/sort.d.mts +9 -4
  7. package/dist/array/sort.mjs +1 -1
  8. package/dist/array/swap.mjs +1 -1
  9. package/dist/beacon.d.mts +12 -0
  10. package/dist/beacon.mjs +9 -0
  11. package/dist/color/instance.d.mts +8 -0
  12. package/dist/color/instance.mjs +3 -0
  13. package/dist/color/models.d.mts +30 -0
  14. package/dist/function/assert.d.mts +29 -8
  15. package/dist/function/assert.mjs +29 -8
  16. package/dist/function/memoize.d.mts +3 -0
  17. package/dist/function/memoize.mjs +3 -0
  18. package/dist/function/retry.d.mts +3 -0
  19. package/dist/function/retry.mjs +3 -0
  20. package/dist/function/work.mjs +1 -1
  21. package/dist/index.d.mts +271 -158
  22. package/dist/index.mjs +230 -163
  23. package/dist/internal/value/compare.d.mts +2 -1
  24. package/dist/internal/value/equal.d.mts +5 -0
  25. package/dist/internal/value/get.d.mts +2 -2
  26. package/dist/internal/value/has.d.mts +3 -3
  27. package/dist/internal/value/has.mjs +1 -1
  28. package/dist/internal/value/misc.d.mts +2 -2
  29. package/dist/internal/value/misc.mjs +10 -4
  30. package/dist/logger.d.mts +11 -0
  31. package/dist/logger.mjs +11 -0
  32. package/dist/promise/helpers.mjs +1 -1
  33. package/dist/promise/index.d.mts +0 -6
  34. package/dist/promise/models.d.mts +36 -0
  35. package/dist/promise/models.mjs +6 -0
  36. package/dist/queue.d.mts +13 -1
  37. package/dist/queue.mjs +9 -0
  38. package/dist/result/index.d.mts +0 -8
  39. package/dist/result/index.mjs +0 -8
  40. package/dist/result/match.d.mts +4 -4
  41. package/dist/result/work/flow.d.mts +12 -36
  42. package/dist/result/work/pipe.d.mts +11 -33
  43. package/dist/sized/set.d.mts +3 -2
  44. package/dist/sized/set.mjs +3 -2
  45. package/dist/value/handle.mjs +1 -1
  46. package/dist/value/shake.d.mts +3 -0
  47. package/dist/value/smush.d.mts +3 -0
  48. package/dist/value/transform.d.mts +9 -0
  49. package/dist/value/unsmush.d.mts +3 -0
  50. package/package.json +2 -2
  51. package/src/array/difference.ts +4 -0
  52. package/src/array/from.ts +4 -0
  53. package/src/array/index.ts +1 -1
  54. package/src/array/intersection.ts +4 -0
  55. package/src/array/{position.ts → match.ts} +28 -25
  56. package/src/array/move.ts +5 -1
  57. package/src/array/reverse.ts +4 -0
  58. package/src/array/select.ts +2 -0
  59. package/src/array/sort.ts +9 -4
  60. package/src/array/swap.ts +5 -1
  61. package/src/array/toggle.ts +4 -0
  62. package/src/array/union.ts +4 -0
  63. package/src/beacon.ts +12 -0
  64. package/src/color/index.ts +0 -3
  65. package/src/color/instance.ts +9 -1
  66. package/src/color/models.ts +30 -0
  67. package/src/function/assert.ts +66 -7
  68. package/src/function/memoize.ts +3 -0
  69. package/src/function/once.ts +5 -1
  70. package/src/function/retry.ts +3 -0
  71. package/src/internal/value/compare.ts +2 -1
  72. package/src/internal/value/equal.ts +5 -0
  73. package/src/internal/value/get.ts +2 -2
  74. package/src/internal/value/has.ts +6 -6
  75. package/src/internal/value/misc.ts +24 -13
  76. package/src/logger.ts +11 -0
  77. package/src/promise/index.ts +0 -6
  78. package/src/promise/models.ts +36 -0
  79. package/src/queue.ts +13 -1
  80. package/src/result/index.ts +0 -8
  81. package/src/result/match.ts +4 -4
  82. package/src/result/work/flow.ts +12 -36
  83. package/src/result/work/pipe.ts +11 -33
  84. package/src/sized/set.ts +4 -3
  85. package/src/value/shake.ts +3 -0
  86. package/src/value/smush.ts +3 -0
  87. package/src/value/transform.ts +9 -0
  88. package/src/value/unsmush.ts +3 -0
package/dist/index.d.mts CHANGED
@@ -812,8 +812,11 @@ declare function partition<Item>(array: Item[], filter: (item: Item, index: numb
812
812
  */
813
813
  declare function partition<Item>(array: Item[], item: Item): Item[][];
814
814
  //#endregion
815
- //#region src/array/position.d.ts
816
- type ArrayPosition = 'end' | 'inside' | 'invalid' | 'outside' | 'same' | 'start';
815
+ //#region src/array/match.d.ts
816
+ /**
817
+ * Comparison of an array within another array
818
+ */
819
+ type ArrayComparison = 'end' | 'inside' | 'invalid' | 'outside' | 'same' | 'start';
817
820
  /**
818
821
  * Does the needle array end the haystack array?
819
822
  * @param haystack Haystack array
@@ -844,7 +847,7 @@ declare function endsWithArray<Item>(haystack: Item[], needle: Item[]): boolean;
844
847
  * @param key Key to get an item's value for matching
845
848
  * @returns Position of the needle within the haystack
846
849
  */
847
- declare function getArrayPosition<Item extends PlainObject>(haystack: Item[], needle: Item[], key: keyof Item): ArrayPosition;
850
+ declare function getArrayComparison<Item extends PlainObject>(haystack: Item[], needle: Item[], key: keyof Item): ArrayComparison;
848
851
  /**
849
852
  * Get the position of an array within another array
850
853
  * @param haystack Haystack array
@@ -852,14 +855,14 @@ declare function getArrayPosition<Item extends PlainObject>(haystack: Item[], ne
852
855
  * @param callback Callback to get an item's value for matching
853
856
  * @returns Position of the needle within the haystack
854
857
  */
855
- declare function getArrayPosition<Item>(haystack: Item[], needle: Item[], callback: (item: Item, index: number, array: Item[]) => unknown): ArrayPosition;
858
+ declare function getArrayComparison<Item>(haystack: Item[], needle: Item[], callback: (item: Item, index: number, array: Item[]) => unknown): ArrayComparison;
856
859
  /**
857
860
  * Get the position of an array within another array
858
861
  * @param haystack Haystack array
859
862
  * @param needle Needle array
860
863
  * @returns Position of the needle within the haystack
861
864
  */
862
- declare function getArrayPosition<Item>(haystack: Item[], needle: Item[]): ArrayPosition;
865
+ declare function getArrayComparison<Item>(haystack: Item[], needle: Item[]): ArrayComparison;
863
866
  /**
864
867
  * Does the needle array exist within the haystack array?
865
868
  * @param haystack Haystack array
@@ -1535,6 +1538,11 @@ type ComparisonSorter<Item> = (first: Item, second: Item) => number;
1535
1538
  * Direction to sort by
1536
1539
  */
1537
1540
  type SortDirection = 'ascending' | 'descending';
1541
+ /**
1542
+ * Sorter for an array with predefined sorters
1543
+ *
1544
+ * Can be used to sort an array, get the predicted index for an item, and check if an array is sorted
1545
+ */
1538
1546
  type Sorter<Item> = {
1539
1547
  /**
1540
1548
  * Sort an array of items
@@ -1563,7 +1571,7 @@ type Sorter<Item> = {
1563
1571
  *
1564
1572
  * _(If the array is not sorted, it will be treated as sorted, and the result may be inaccurate)_
1565
1573
  *
1566
- * Available as `getSortedIndex` and `sort.index`
1574
+ * Available as `getSortedIndex` and `sort.getIndex`
1567
1575
  * @param array Array to get the index from
1568
1576
  * @param item Item to get the index for
1569
1577
  * @param sorters Sorters to use to determine sorting
@@ -1576,7 +1584,7 @@ declare function getSortedIndex<Item>(array: Item[], item: Item, sorters: Array<
1576
1584
  *
1577
1585
  * _(If the array is not sorted, it will be treated as sorted, and the result may be inaccurate)_
1578
1586
  *
1579
- * Available as `getSortedIndex` and `sort.index`
1587
+ * Available as `getSortedIndex` and `sort.getIndex`
1580
1588
  * @param array Array to get the index from
1581
1589
  * @param item Item to get the index for
1582
1590
  * @param sorter Sorter to use to determine sorting
@@ -1589,7 +1597,7 @@ declare function getSortedIndex<Item>(array: Item[], item: Item, sorter: ArraySo
1589
1597
  *
1590
1598
  * _(If the array is not sorted, it will be treated as sorted, and the result may be inaccurate)_
1591
1599
  *
1592
- * Available as `getSortedIndex` and `sort.index`
1600
+ * Available as `getSortedIndex` and `sort.getIndex`
1593
1601
  * @param array Array to get the index from
1594
1602
  * @param item Item to get the index for
1595
1603
  * @param descending Sorted in descending order? _(defaults to `false`)_
@@ -1679,7 +1687,7 @@ declare function sort<Item>(array: Item[], sorter: ArraySorter<Item>, descending
1679
1687
  */
1680
1688
  declare function sort<Item>(array: Item[], descending?: boolean): Item[];
1681
1689
  declare namespace sort {
1682
- var index: typeof getSortedIndex;
1690
+ var getIndex: typeof getSortedIndex;
1683
1691
  var initialize: typeof initializeSorter;
1684
1692
  var is: typeof isSorted;
1685
1693
  }
@@ -2020,12 +2028,20 @@ declare function toRecordArrays<Item, Callback extends (item: Item, index: numbe
2020
2028
  declare function toRecordArrays<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey): Simplify<Record<KeyedValue<Item, ItemKey>, Item[]>>;
2021
2029
  //#endregion
2022
2030
  //#region src/function/assert.d.ts
2031
+ /**
2032
+ * Asserter for a nested property of a value
2033
+ */
2034
+ type AssertProperty<Value extends PlainObject, Path extends NestedKeys<Value>, Asserted extends NestedPick<Value, Path> = NestedPick<Value, Path>> = Asserter<Asserted>;
2035
+ /**
2036
+ * A function that asserts a value is of a specific type, throwing an error if it is not
2037
+ */
2023
2038
  type Asserter<Value> = (value: unknown) => asserts value is Value;
2039
+ type NestedPick<Value, Path extends string> = Value extends PlainObject ? Path extends `${infer Head}.${infer Rest}` ? Head extends keyof Value ? { [Key in Head]: NestedPick<Value[Key], Rest> } : never : Path extends keyof Value ? { [Key in Path]: Value[Key] } : never : never;
2024
2040
  /**
2025
2041
  * Asserts that a condition is true, throwing an error if it is not
2026
2042
  * @param condition Condition to assert
2027
2043
  * @param message Error message
2028
- * @param error Error constructor
2044
+ * @param error Error constructor _(defaults to `Error`)_
2029
2045
  */
2030
2046
  declare function assert<Condition extends () => boolean>(condition: Condition, message: string, error?: ErrorConstructor): asserts condition;
2031
2047
  declare namespace assert {
@@ -2033,6 +2049,7 @@ declare namespace assert {
2033
2049
  var defined: typeof assertDefined;
2034
2050
  var instanceOf: typeof assertInstanceOf;
2035
2051
  var is: typeof assertIs;
2052
+ var property: typeof assertProperty;
2036
2053
  }
2037
2054
  /**
2038
2055
  * Creates an asserter that asserts a condition is true, throwing an error if it is not
@@ -2040,25 +2057,26 @@ declare namespace assert {
2040
2057
  * Available as `assertCondition` and `assert.condition`
2041
2058
  * @param condition Condition to assert
2042
2059
  * @param message Error message
2043
- * @param error Error constructor
2060
+ * @param error Error constructor _(defaults to `Error`)_
2044
2061
  * @returns Asserter
2045
2062
  */
2046
2063
  declare function assertCondition<Value>(condition: (value: unknown) => boolean, message: string, error?: ErrorConstructor): Asserter<Value>;
2047
2064
  /**
2048
- * Asserts that a value is defined throwing an error if it is not
2065
+ * Asserts that a value is defined, throwing an error if it is not
2049
2066
  *
2050
2067
  * Available as `assertDefined` and `assert.defined`
2051
2068
  * @param value Value to assert
2052
2069
  * @param message Error message
2070
+ * @param error Error constructor _(defaults to `Error`)_
2053
2071
  */
2054
- declare function assertDefined<Value>(value: unknown, message?: string): asserts value is Exclude<Value, null | undefined>;
2072
+ declare function assertDefined<Value>(value: unknown, message?: string, error?: ErrorConstructor): asserts value is Exclude<Value, null | undefined>;
2055
2073
  /**
2056
2074
  * Creates an asserter that asserts a value is an instance of a constructor, throwing an error if it is not
2057
2075
  *
2058
2076
  * Available as `assertInstanceOf` and `assert.instanceOf`
2059
2077
  * @param constructor Constructor to check against
2060
2078
  * @param message Error message
2061
- * @param error Error constructor
2079
+ * @param error Error constructor _(defaults to `Error`)_
2062
2080
  * @returns Asserter
2063
2081
  */
2064
2082
  declare function assertInstanceOf<Value>(constructor: Constructor<Value>, message: string, error?: ErrorConstructor): Asserter<Value>;
@@ -2068,10 +2086,21 @@ declare function assertInstanceOf<Value>(constructor: Constructor<Value>, messag
2068
2086
  * Available as `assertIs` and `assert.is`
2069
2087
  * @param condition Type guard function to check the value
2070
2088
  * @param message Error message
2071
- * @param error Error constructor
2089
+ * @param error Error constructor _(defaults to `Error`)_
2072
2090
  * @returns Asserter
2073
2091
  */
2074
2092
  declare function assertIs<Value>(condition: (value: unknown) => value is Value, message: string, error?: ErrorConstructor): Asserter<Value>;
2093
+ /**
2094
+ * Creates an asserter that asserts a property of a value exists and satisfies a condition, throwing an error if it does not
2095
+ *
2096
+ * Available as `assertProperty` and `assert.property`
2097
+ * @param path Path to the property to check, e.g., `foo.bar.baz` for a nested property
2098
+ * @param condition Condition to assert for the property
2099
+ * @param message Error message
2100
+ * @param error Error constructor _(defaults to `Error`)_
2101
+ * @returns Asserter
2102
+ */
2103
+ declare function assertProperty<Value extends PlainObject, Path extends NestedKeys<Value>, Asserted = NestedPick<Value, Path>>(path: Path, condition: (value: NestedValue<Value, Path>) => boolean, message: string, error?: ErrorConstructor): Asserter<Asserted>;
2075
2104
  //#endregion
2076
2105
  //#region src/internal/function/misc.d.ts
2077
2106
  /**
@@ -2080,6 +2109,9 @@ declare function assertIs<Value>(condition: (value: unknown) => value is Value,
2080
2109
  declare function noop(): void;
2081
2110
  //#endregion
2082
2111
  //#region src/function/memoize.d.ts
2112
+ /**
2113
+ * A memoized function, caching and retrieving results based on the its parameters _(or a custom cache key)_
2114
+ */
2083
2115
  declare class Memoized<Callback extends GenericCallback> {
2084
2116
  #private;
2085
2117
  /**
@@ -2219,6 +2251,9 @@ declare namespace once {
2219
2251
  }
2220
2252
  //#endregion
2221
2253
  //#region src/function/retry.d.ts
2254
+ /**
2255
+ * An error thrown when a retry fails
2256
+ */
2222
2257
  declare class RetryError extends Error {
2223
2258
  readonly original: unknown;
2224
2259
  constructor(message: string, original: unknown);
@@ -2672,6 +2707,7 @@ declare function tryEncode(value: boolean | number | string): unknown;
2672
2707
  declare function words(value: string): string[];
2673
2708
  //#endregion
2674
2709
  //#region src/internal/value/compare.d.ts
2710
+ type Comparator<Value = any> = (first: Value, second: Value) => number;
2675
2711
  /**
2676
2712
  * Compare two values _(for sorting purposes)_
2677
2713
  * @param first First value
@@ -2702,7 +2738,7 @@ declare function deregisterComparator<Instance>(constructor: Constructor<Instanc
2702
2738
  * @param constructor Class constructor
2703
2739
  * @param handler Method name or comparison function _(defaults to `compare`)_
2704
2740
  */
2705
- declare function registerComparator<Instance>(constructor: Constructor<Instance>, handler?: string | ((first: Instance, second: Instance) => number)): void;
2741
+ declare function registerComparator<Instance>(constructor: Constructor<Instance>, handler?: string | Comparator<Instance>): void;
2706
2742
  //#endregion
2707
2743
  //#region src/internal/value/equal.d.ts
2708
2744
  /**
@@ -2722,6 +2758,11 @@ type EqualOptions = {
2722
2758
  */
2723
2759
  relaxedNullish?: boolean;
2724
2760
  };
2761
+ /**
2762
+ * An equalizer function for comparing values for equality, with predefined options
2763
+ *
2764
+ * Can be used to compare values, and register or deregister equality comparison handlers for specific classes
2765
+ */
2725
2766
  type Equalizer = {
2726
2767
  /**
2727
2768
  * Are two strings equal?
@@ -2807,7 +2848,7 @@ declare function registerEqualizer<Instance>(constructor: Constructor<Instance>,
2807
2848
  * @param path Path for value, e.g., `foo.bar.baz`
2808
2849
  * @returns Found value, or `undefined`
2809
2850
  */
2810
- declare function getValue<Data extends PlainObject, Path extends NestedKeys<Data>>(data: Data, path: Path): NestedValue<Data, ToString<Path>>;
2851
+ declare function getValue<Data extends PlainObject, Path extends NestedKeys<Data>>(data: Data, path: Path): NestedValue<Data, Path>;
2811
2852
  /**
2812
2853
  * Get the value from an object using an unknown path
2813
2854
  * @param data Object to get value from
@@ -2845,7 +2886,7 @@ declare namespace hasValue {
2845
2886
  * @param ignoreCase If `true`, the path matching is case-insensitive
2846
2887
  * @return Result object
2847
2888
  */
2848
- declare function hasValueResult<Data extends PlainObject, Path extends NestedKeys<Data>>(data: Data, path: Path, ignoreCase?: boolean): Result<NestedValue<Data, ToString<Path>>, undefined>;
2889
+ declare function hasValueResult<Data extends PlainObject, Path extends NestedKeys<Data>>(data: Data, path: Path, ignoreCase?: boolean): Result<NestedValue<Data, ToString<Path>>, string>;
2849
2890
  /**
2850
2891
  * Check if a nested property is defined in an object, and get its value if it is
2851
2892
  *
@@ -2855,7 +2896,7 @@ declare function hasValueResult<Data extends PlainObject, Path extends NestedKey
2855
2896
  * @param ignoreCase If `true`, the path matching is case-insensitive
2856
2897
  * @return Result object
2857
2898
  */
2858
- declare function hasValueResult<Data extends PlainObject>(data: Data, path: string, ignoreCase?: boolean): Result<unknown, undefined>;
2899
+ declare function hasValueResult<Data extends PlainObject>(data: Data, path: string, ignoreCase?: boolean): Result<unknown, string>;
2859
2900
  //#endregion
2860
2901
  //#region src/internal/value/set.d.ts
2861
2902
  /**
@@ -3431,6 +3472,9 @@ declare function omit<Value extends PlainObject, ValueKey extends keyof Value>(v
3431
3472
  declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Pick<Value, ValueKey>;
3432
3473
  //#endregion
3433
3474
  //#region src/value/shake.d.ts
3475
+ /**
3476
+ * A shaken object, without any `undefined` values
3477
+ */
3434
3478
  type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] extends undefined ? never : Value[Key] };
3435
3479
  /**
3436
3480
  * Shake an object, removing all keys with `undefined` values
@@ -3440,6 +3484,9 @@ type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] exte
3440
3484
  declare function shake<Value extends PlainObject>(value: Value): Shaken<Value>;
3441
3485
  //#endregion
3442
3486
  //#region src/value/smush.d.ts
3487
+ /**
3488
+ * A smushed object, with all nested objects flattened into a single level, using dot notation keys
3489
+ */
3443
3490
  type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>> }>;
3444
3491
  /**
3445
3492
  * Smush an object into a flat object that uses dot notation keys
@@ -3457,6 +3504,9 @@ type KeysOfUnion<ObjectType> = keyof UnionToIntersection<ObjectType extends unkn
3457
3504
  * Thanks, type-fest!
3458
3505
  */
3459
3506
  type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection & Union : never;
3507
+ /**
3508
+ * An unsmushed object, with all dot notation keys turned into nested keys
3509
+ */
3460
3510
  type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey] }, `${string}.${string}`>>;
3461
3511
  /**
3462
3512
  * Unsmush a smushed object _(turning dot notation keys into nested keys)_
@@ -3562,8 +3612,17 @@ declare namespace merge {
3562
3612
  }
3563
3613
  //#endregion
3564
3614
  //#region src/value/transform.d.ts
3615
+ /**
3616
+ * A callback transform an object's properties
3617
+ */
3565
3618
  type TransformCallback<Value extends PlainObject, Key extends keyof Value> = (key: Key, value: Value[Key]) => Value[Key];
3619
+ /**
3620
+ * A collection of keyed callbacks to transform an object's properties
3621
+ */
3566
3622
  type TransformCallbacks<Value extends PlainObject> = Partial<{ [Key in keyof Value]: (value: Value[Key]) => Value[Key] }>;
3623
+ /**
3624
+ * A transformer function for an object, with predefined callbacks for transforming its properties
3625
+ */
3567
3626
  type Transformer<Value extends PlainObject> = {
3568
3627
  (value: Value): Value;
3569
3628
  };
@@ -3602,6 +3661,9 @@ declare namespace transform {
3602
3661
  }
3603
3662
  //#endregion
3604
3663
  //#region src/beacon.d.ts
3664
+ /**
3665
+ * A beacon is a lighthouse, holding an observable value that can be subscribed to and emitted from
3666
+ */
3605
3667
  declare class Beacon<Value> {
3606
3668
  #private;
3607
3669
  /**
@@ -3651,6 +3713,9 @@ type BeaconOptions<Value> = {
3651
3713
  */
3652
3714
  equal?: (first: Value, second: Value) => boolean;
3653
3715
  };
3716
+ /**
3717
+ * An observable holds a value and allows observers to subscribe to changes in that value
3718
+ */
3654
3719
  declare class Observable<Value> {
3655
3720
  #private;
3656
3721
  constructor(instance: Beacon<Value>, observers: Map<Subscription<Value>, Observer<Value>>);
@@ -3678,6 +3743,9 @@ type ObservableState<Value> = {
3678
3743
  closed: boolean;
3679
3744
  observers: Map<Subscription<Value>, Observer<Value>>;
3680
3745
  };
3746
+ /**
3747
+ * An observer receives notifications from an observable
3748
+ */
3681
3749
  type Observer<Value> = {
3682
3750
  /**
3683
3751
  * Callback for when the observable is completed
@@ -3692,6 +3760,9 @@ type Observer<Value> = {
3692
3760
  */
3693
3761
  next?: (value: Value) => void;
3694
3762
  };
3763
+ /**
3764
+ * A subscription represents an active subscription to an observable, holding its state and allowing it to be destroyed or unsubscribed from
3765
+ */
3695
3766
  declare class Subscription<Value> {
3696
3767
  #private;
3697
3768
  constructor(state: ObservableState<Value>);
@@ -3720,22 +3791,60 @@ declare function beacon<Value>(value: Value, options?: BeaconOptions<Value>): Be
3720
3791
  type ColorWithAlpha = {
3721
3792
  alpha: number;
3722
3793
  };
3794
+ /**
3795
+ * An _HSL_-color with an alpha channel
3796
+ */
3723
3797
  type HSLAColor = HSLColor & ColorWithAlpha;
3798
+ /**
3799
+ * An _HSL_-color
3800
+ */
3724
3801
  type HSLColor = {
3802
+ /**
3803
+ * Hue of the color _(in degrees; 0-360)_
3804
+ */
3725
3805
  hue: number;
3806
+ /**
3807
+ * Lightness of the color _(in percentage; 0-100)_
3808
+ */
3726
3809
  lightness: number;
3810
+ /**
3811
+ * Saturation of the color _(in percentage; 0-100)_
3812
+ */
3727
3813
  saturation: number;
3728
3814
  };
3815
+ /**
3816
+ * An _RGB_-color with an alpha channel
3817
+ */
3729
3818
  type RGBAColor = RGBColor & ColorWithAlpha;
3819
+ /**
3820
+ * An _RGB_-color
3821
+ */
3730
3822
  type RGBColor = {
3823
+ /**
3824
+ * Blue channel of the color _(in hexadecimal; 0-255)_
3825
+ */
3731
3826
  blue: number;
3827
+ /**
3828
+ * Green channel of the color _(in hexadecimal; 0-255)_
3829
+ */
3732
3830
  green: number;
3831
+ /**
3832
+ * Red channel of the color _(in hexadecimal; 0-255)_
3833
+ */
3733
3834
  red: number;
3734
3835
  };
3735
3836
  //#endregion
3736
3837
  //#region src/color/instance.d.ts
3838
+ /**
3839
+ * A color that is represented in multiple color formats
3840
+ */
3737
3841
  declare class Color {
3738
3842
  #private;
3843
+ /**
3844
+ * A property to identify this as a Color instance, used for type checking
3845
+ *
3846
+ * @internal
3847
+ */
3739
3848
  private readonly $color;
3740
3849
  /**
3741
3850
  * Get the alpha channel
@@ -4135,6 +4244,11 @@ declare function isNumerical(value: unknown): value is number | `${number}`;
4135
4244
  declare function isObject(value: unknown): value is object;
4136
4245
  //#endregion
4137
4246
  //#region src/logger.d.ts
4247
+ /**
4248
+ * A logger that can be used to log messages to the console
4249
+ *
4250
+ * _(Logging can be enabled or disabled by setting the `enabled` property)_
4251
+ */
4138
4252
  declare class Logger {
4139
4253
  /**
4140
4254
  * Log any number of values at the "debug" log level
@@ -4183,8 +4297,14 @@ declare class Logger {
4183
4297
  */
4184
4298
  time(label: string): Time;
4185
4299
  }
4300
+ /**
4301
+ * A named timer that can be used to log durations to the console
4302
+ */
4186
4303
  declare class Time {
4187
4304
  #private;
4305
+ /**
4306
+ * Is the timer active? _(i.e. has it been started and not stopped, and is logging enabled?)_
4307
+ */
4188
4308
  get active(): boolean;
4189
4309
  /**
4190
4310
  * Log the current duration of the timer _(ignored if logging is disabled)_
@@ -4373,6 +4493,9 @@ declare function clamp(value: number, minimum: number, maximum: number, loop?: b
4373
4493
  declare function getNumber(value: unknown): number;
4374
4494
  //#endregion
4375
4495
  //#region src/promise/models.d.ts
4496
+ /**
4497
+ * A promise that can be canceled
4498
+ */
4376
4499
  declare class CancelablePromise<Value = void> extends Promise<Value> {
4377
4500
  #private;
4378
4501
  constructor(executor: (resolve: (value: Value) => void, reject: (reason: unknown) => void) => void);
@@ -4382,8 +4505,17 @@ declare class CancelablePromise<Value = void> extends Promise<Value> {
4382
4505
  */
4383
4506
  cancel(reason?: unknown): void;
4384
4507
  }
4508
+ /**
4509
+ * A promise that was fulfilled
4510
+ */
4385
4511
  type FulfilledPromise<Value> = {
4512
+ /**
4513
+ * Status of the promise
4514
+ */
4386
4515
  status: typeof PROMISE_TYPE_FULFILLED;
4516
+ /**
4517
+ * Value of the promise
4518
+ */
4387
4519
  value: Awaited<Value>;
4388
4520
  };
4389
4521
  type PromiseData = {
@@ -4394,6 +4526,9 @@ type PromiseHandlers = {
4394
4526
  resolve: (value: unknown[]) => void;
4395
4527
  reject: (reason: unknown) => void;
4396
4528
  };
4529
+ /**
4530
+ * Options for a promise-handling function
4531
+ */
4397
4532
  type PromiseOptions = {
4398
4533
  /**
4399
4534
  * AbortSignal for aborting the promise; when aborted, the promise will reject with the reason of the signal
@@ -4422,20 +4557,41 @@ type PromiseParameters = {
4422
4557
  * - Returns an array of values
4423
4558
  */
4424
4559
  type PromiseStrategy = 'complete' | 'first';
4560
+ /**
4561
+ * An error thrown when a promise times out
4562
+ */
4425
4563
  declare class PromiseTimeoutError extends Error {
4426
4564
  constructor();
4427
4565
  }
4428
4566
  type PromisesItems<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Promise<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Promise<Value> : Promise<Items[ItemsKey]> };
4567
+ /**
4568
+ * Options for handling multiple promises
4569
+ */
4429
4570
  type PromisesOptions = {
4571
+ /**
4572
+ * AbortSignal for aborting the promises; when aborted, the promises will reject with the reason of the signal
4573
+ */
4430
4574
  signal?: AbortSignal;
4575
+ /**
4576
+ * Strategy for handling the promises; defaults to `complete`
4577
+ */
4431
4578
  strategy?: PromiseStrategy;
4432
4579
  };
4433
4580
  type PromisesResult<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never };
4434
4581
  type PromisesUnwrapped<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Awaited<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Awaited<Value> : never };
4435
4582
  type PromisesValue<Value> = FulfilledPromise<Value> | RejectedPromise;
4436
4583
  type PromisesValues<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never : Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never };
4584
+ /**
4585
+ * A promise that was rejected
4586
+ */
4437
4587
  type RejectedPromise = {
4588
+ /**
4589
+ * Status of the promise
4590
+ */
4438
4591
  status: typeof PROMISE_TYPE_REJECTED;
4592
+ /**
4593
+ * Reason for the rejection
4594
+ */
4439
4595
  reason: unknown;
4440
4596
  };
4441
4597
  declare const PROMISE_ABORT_EVENT = "abort";
@@ -4469,8 +4625,6 @@ declare function delay(time?: number): Promise<void>;
4469
4625
  //#region src/promise/index.d.ts
4470
4626
  /**
4471
4627
  * Wrap a promise with safety handlers, with optional abort capabilities and timeout
4472
- *
4473
- * Available as `attemptPromise` and `attempt.promise`
4474
4628
  * @param promise Promise to wrap
4475
4629
  * @param options Options for the promise
4476
4630
  * @returns Wrapped promise
@@ -4478,8 +4632,6 @@ declare function delay(time?: number): Promise<void>;
4478
4632
  declare function attemptPromise<Value>(promise: Promise<Value>, options?: PromiseOptions | AbortSignal | number): Promise<Value>;
4479
4633
  /**
4480
4634
  * Wrap a promise-returning callback with safety handlers, with optional abort capabilities and timeout
4481
- *
4482
- * Available as `attemptPromise` and `attempt.promise`
4483
4635
  * @param callback Callback to wrap
4484
4636
  * @param options Options for the promise
4485
4637
  * @returns Promise-wrapped callback
@@ -4487,8 +4639,6 @@ declare function attemptPromise<Value>(promise: Promise<Value>, options?: Promis
4487
4639
  declare function attemptPromise<Value>(callback: () => Promise<Value>, options?: PromiseOptions | AbortSignal | number): Promise<Value>;
4488
4640
  /**
4489
4641
  * Wrap a callback with a promise and safety handlers, with optional abort capabilities and timeout
4490
- *
4491
- * Available as `attemptPromise` and `attempt.promise`
4492
4642
  * @param callback Callback to wrap
4493
4643
  * @param options Options for the promise
4494
4644
  * @returns Promise-wrapped callback
@@ -4728,6 +4878,9 @@ declare function fromQuery(query: string): PlainObject;
4728
4878
  declare function toQuery(parameters: PlainObject): string;
4729
4879
  //#endregion
4730
4880
  //#region src/queue.d.ts
4881
+ /**
4882
+ * A queue that can be used to manage (a)synchronous tasks with a specific key
4883
+ */
4731
4884
  declare class KeyedQueue<CallbackParameters extends Parameters<GenericAsyncCallback>, CallbackResult> {
4732
4885
  #private;
4733
4886
  /**
@@ -4818,6 +4971,9 @@ declare class KeyedQueue<CallbackParameters extends Parameters<GenericAsyncCallb
4818
4971
  */
4819
4972
  resume(key?: string): void;
4820
4973
  }
4974
+ /**
4975
+ * A queue that can be used to manage (a)synchronous tasks
4976
+ */
4821
4977
  declare class Queue<CallbackParameters extends Parameters<GenericAsyncCallback>, CallbackResult> {
4822
4978
  #private;
4823
4979
  /**
@@ -4881,6 +5037,9 @@ declare class Queue<CallbackParameters extends Parameters<GenericAsyncCallback>,
4881
5037
  */
4882
5038
  resume(): void;
4883
5039
  }
5040
+ /**
5041
+ * An error thrown by the Queue when an operation fails
5042
+ */
4884
5043
  declare class QueueError extends Error {
4885
5044
  constructor(message: string);
4886
5045
  }
@@ -4898,9 +5057,12 @@ type QueueOptions = {
4898
5057
  */
4899
5058
  maximum?: number;
4900
5059
  };
5060
+ /**
5061
+ * A queued item
5062
+ */
4901
5063
  type Queued<Value> = {
4902
5064
  /**
4903
- * ID of the queued promise _(can be used to remove it from the queue)_
5065
+ * ID of the queued item _(can be used to remove it from the queue)_
4904
5066
  */
4905
5067
  readonly id: number;
4906
5068
  /**
@@ -4998,15 +5160,71 @@ declare function getRandomItems<Value>(array: Value[], amount: number): Value[];
4998
5160
  */
4999
5161
  declare function getRandomItems<Value>(array: Value[]): Value[];
5000
5162
  //#endregion
5163
+ //#region src/result/index.d.ts
5164
+ /**
5165
+ * Executes a promise, catching any errors, and returns a result
5166
+ *
5167
+ * Available as `asyncAttempt` and `attempt.async`
5168
+ * @param promise Promise to execute
5169
+ * @param error Error value
5170
+ * @returns Callback result
5171
+ */
5172
+ declare function asyncAttempt<Value, E>(promise: Promise<Value>, error: E): Promise<ExtendedResult<Awaited<Value>, E>>;
5173
+ /**
5174
+ * Executes a callback asynchronously, catching any errors, and returns a result
5175
+ *
5176
+ * Available as `asyncAttempt` and `attempt.async`
5177
+ * @param callback Callback to execute
5178
+ * @param error Error value
5179
+ * @returns Callback result
5180
+ */
5181
+ declare function asyncAttempt<Value, E>(callback: () => Promise<Value>, error: E): Promise<ExtendedResult<Awaited<Value>, E>>;
5182
+ /**
5183
+ * Executes a promise, catching any errors, and returns a result
5184
+ *
5185
+ * Available as `asyncAttempt` and `attempt.async`
5186
+ * @param promise Promise to execute
5187
+ * @returns Callback result
5188
+ */
5189
+ declare function asyncAttempt<Value>(promise: Promise<Value>): Promise<Result<Awaited<Value>>>;
5190
+ /**
5191
+ * Executes a callback asynchronously, catching any errors, and returns a result
5192
+ *
5193
+ * Available as `asyncAttempt` and `attempt.async`
5194
+ * @param callback Callback to execute
5195
+ * @returns Callback result
5196
+ */
5197
+ declare function asyncAttempt<Value>(callback: () => Promise<Value>): Promise<Result<Awaited<Value>>>;
5198
+ /**
5199
+ * Executes a callback, catching any errors, and returns a result
5200
+ * @param callback Callback to execute
5201
+ * @param error Error value
5202
+ * @returns Callback result
5203
+ */
5204
+ declare function attempt<Value, E>(callback: () => Value, error: E): ExtendedResult<Value, E>;
5205
+ /**
5206
+ * Executes a callback, catching any errors, and returns a result
5207
+ * @param callback Callback to execute
5208
+ * @returns Callback result
5209
+ */
5210
+ declare function attempt<Value>(callback: () => Value): Result<Value, Error>;
5211
+ declare namespace attempt {
5212
+ var async: typeof asyncAttempt;
5213
+ }
5214
+ //#endregion
5001
5215
  //#region src/result/match.d.ts
5002
5216
  /**
5003
5217
  * Handles a result with match callbacks
5218
+ *
5219
+ * Available as `asyncMatchResult` and `matchResult.async`
5004
5220
  * @param result Result to handle
5005
5221
  * @param handler Match callbacks
5006
5222
  */
5007
5223
  declare function asyncMatchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>), handler: ResultMatch<Value, Returned, E>): Promise<Returned>;
5008
5224
  /**
5009
5225
  * Handles a result with match callbacks
5226
+ *
5227
+ * Available as `asyncMatchResult` and `matchResult.async`
5010
5228
  * @param result Result to handle
5011
5229
  * @param ok Ok callback
5012
5230
  * @param error Error callback
@@ -5014,16 +5232,12 @@ declare function asyncMatchResult<Value, Returned, E = Error>(result: AnyResult<
5014
5232
  declare function asyncMatchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>), ok: ResultMatch<Value, Returned, E>['ok'], error: ResultMatch<Value, Returned, E>['error']): Promise<Returned>;
5015
5233
  /**
5016
5234
  * Handles a result with match callbacks
5017
- *
5018
- * Available as `matchResult` and `attempt.match`
5019
5235
  * @param result Result to handle
5020
5236
  * @param handler Match callbacks
5021
5237
  */
5022
5238
  declare function matchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | (() => AnyResult<Value, E>), handler: ResultMatch<Value, Returned, E>): Returned;
5023
5239
  /**
5024
5240
  * Handles a result with match callbacks
5025
- *
5026
- * Available as `matchResult` and `attempt.match`
5027
5241
  * @param result Result to handle
5028
5242
  * @param ok Ok callback
5029
5243
  * @param error Error callback
@@ -5045,168 +5259,144 @@ type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...args: Par
5045
5259
  /**
5046
5260
  * Create an asynchronous Flow, a function that attempts to pipe a value through a series of functions
5047
5261
  *
5048
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5262
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5049
5263
  * @returns Flow function
5050
5264
  */
5051
5265
  declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5052
5266
  /**
5053
5267
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5054
5268
  *
5055
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5269
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5056
5270
  * @returns Flow function
5057
5271
  */
5058
5272
  declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptFlowPromise<First, Second>;
5059
5273
  /**
5060
5274
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5061
5275
  *
5062
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5276
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5063
5277
  * @returns Flow function
5064
5278
  */
5065
5279
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): AttemptFlowPromise<First, Third>;
5066
5280
  /**
5067
5281
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5068
5282
  *
5069
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5283
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5070
5284
  * @returns Flow function
5071
5285
  */
5072
5286
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): AttemptFlowPromise<First, Fourth>;
5073
5287
  /**
5074
5288
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5075
5289
  *
5076
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5290
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5077
5291
  * @returns Flow function
5078
5292
  */
5079
5293
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): AttemptFlowPromise<First, Fifth>;
5080
5294
  /**
5081
5295
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5082
5296
  *
5083
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5297
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5084
5298
  * @returns Flow function
5085
5299
  */
5086
5300
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): AttemptFlowPromise<First, Sixth>;
5087
5301
  /**
5088
5302
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5089
5303
  *
5090
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5304
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5091
5305
  * @returns Flow function
5092
5306
  */
5093
5307
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): AttemptFlowPromise<First, Seventh>;
5094
5308
  /**
5095
5309
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5096
5310
  *
5097
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5311
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5098
5312
  * @returns Flow function
5099
5313
  */
5100
5314
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): AttemptFlowPromise<First, Eighth>;
5101
5315
  /**
5102
5316
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5103
5317
  *
5104
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5318
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5105
5319
  * @returns Flow function
5106
5320
  */
5107
5321
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): AttemptFlowPromise<First, Ninth>;
5108
5322
  /**
5109
5323
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5110
5324
  *
5111
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5325
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5112
5326
  * @returns Flow function
5113
5327
  */
5114
5328
  declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): AttemptFlowPromise<First, Tenth>;
5115
5329
  /**
5116
5330
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5117
5331
  *
5118
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5332
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5119
5333
  * @returns Flow function
5120
5334
  */
5121
5335
  declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptFlowPromise<Fn, ReturnType<Fn>>;
5122
5336
  /**
5123
5337
  * Create an asynchronous Flow, a function that pipes values through a series of functions
5124
5338
  *
5125
- * Available as `attemptAsyncFlow` and `attempt.flow.async`
5339
+ * Available as `attemptAsyncFlow` and `attemptFlow.async`
5126
5340
  * @returns Flow function
5127
5341
  */
5128
5342
  declare function attemptAsyncFlow(...fns: GenericCallback[]): (...args: unknown[]) => Promise<Result<unknown>>;
5129
5343
  /**
5130
5344
  * Create a Flow, a function that attempts to pipe values through a function
5131
- *
5132
- * Available as `attemptFlow` and `attempt.flow`
5133
5345
  * @returns Flow function
5134
5346
  */
5135
5347
  declare function attemptFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlow<Fn, ReturnType<Fn>>;
5136
5348
  /**
5137
5349
  * Create a Flow, a function that attempts to pipe values through a series of functions
5138
- *
5139
- * Available as `attemptFlow` and `attempt.flow`
5140
5350
  * @returns Flow function
5141
5351
  */
5142
5352
  declare function attemptFlow<First extends GenericCallback, Second>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second): AttemptFlow<First, Second>;
5143
5353
  /**
5144
5354
  * Create a Flow, a function that attempts to pipe values through a series of functions
5145
- *
5146
- * Available as `attemptFlow` and `attempt.flow`
5147
5355
  * @returns Flow function
5148
5356
  */
5149
5357
  declare function attemptFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third): AttemptFlow<First, Third>;
5150
5358
  /**
5151
5359
  * Create a Flow, a function that attempts to pipe values through a series of functions
5152
- *
5153
- * Available as `attemptFlow` and `attempt.flow`
5154
5360
  * @returns Flow function
5155
5361
  */
5156
5362
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): AttemptFlow<First, Fourth>;
5157
5363
  /**
5158
5364
  * Create a Flow, a function that attempts to pipe values through a series of functions
5159
- *
5160
- * Available as `attemptFlow` and `attempt.flow`
5161
5365
  * @returns Flow function
5162
5366
  */
5163
5367
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): AttemptFlow<First, Fifth>;
5164
5368
  /**
5165
5369
  * Create a Flow, a function that attempts to pipe values through a series of functions
5166
- *
5167
- * Available as `attemptFlow` and `attempt.flow`
5168
5370
  * @returns Flow function
5169
5371
  */
5170
5372
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): AttemptFlow<First, Sixth>;
5171
5373
  /**
5172
5374
  * Create a Flow, a function that attempts to pipe values through a series of functions
5173
- *
5174
- * Available as `attemptFlow` and `attempt.flow`
5175
5375
  * @returns Flow function
5176
5376
  */
5177
5377
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): AttemptFlow<First, Seventh>;
5178
5378
  /**
5179
5379
  * Create a Flow, a function that attempts to pipe values through a series of functions
5180
- *
5181
- * Available as `attemptFlow` and `attempt.flow`
5182
5380
  * @returns Flow function
5183
5381
  */
5184
5382
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): AttemptFlow<First, Eighth>;
5185
5383
  /**
5186
5384
  * Create a Flow, a function that attempts to pipe values through a series of functions
5187
- *
5188
- * Available as `attemptFlow` and `attempt.flow`
5189
5385
  * @returns Flow function
5190
5386
  */
5191
5387
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): AttemptFlow<First, Ninth>;
5192
5388
  /**
5193
5389
  * Create a Flow, a function that attempts to pipe values through a series of functions
5194
- *
5195
- * Available as `attemptFlow` and `attempt.flow`
5196
5390
  * @returns Flow function
5197
5391
  */
5198
5392
  declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): AttemptFlow<First, Tenth>;
5199
5393
  /**
5200
5394
  * Create a Flow, a function that attempts to pipe values through a series of functions
5201
- *
5202
- * Available as `attemptFlow` and `attempt.flow`
5203
5395
  * @returns Flow function
5204
5396
  */
5205
5397
  declare function attemptFlow<First extends GenericCallback>(first: First, ...fns: Array<(value: UnwrapValue<ReturnType<First>>) => unknown>): AttemptFlow<First, ReturnType<First>>;
5206
5398
  /**
5207
5399
  * Create a Flow, a function that attempts to pipe values through a series of functions
5208
- *
5209
- * Available as `attemptFlow` and `attempt.flow`
5210
5400
  * @returns Flow function
5211
5401
  */
5212
5402
  declare function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
@@ -5219,7 +5409,7 @@ type WrapValue<Value> = Result<UnwrapValue<Value>>;
5219
5409
  /**
5220
5410
  * Attempt to pipe a value through a function
5221
5411
  *
5222
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5412
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5223
5413
  * @param initial Initial value
5224
5414
  * @returns Piped result
5225
5415
  */
@@ -5227,7 +5417,7 @@ declare function attemptAsyncPipe<Initial, Piped>(initial: GenericCallback | Ini
5227
5417
  /**
5228
5418
  * Attempt to pipe a value through a series of functions
5229
5419
  *
5230
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5420
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5231
5421
  * @param initial Initial value
5232
5422
  * @returns Piped result
5233
5423
  */
@@ -5235,7 +5425,7 @@ declare function attemptAsyncPipe<Initial, First, Second>(initial: GenericCallba
5235
5425
  /**
5236
5426
  * Attempt to pipe a value through a series of functions
5237
5427
  *
5238
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5428
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5239
5429
  * @param initial Initial value
5240
5430
  * @returns Piped result
5241
5431
  */
@@ -5243,7 +5433,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third>(initial: Generi
5243
5433
  /**
5244
5434
  * Attempt to pipe a value through a series of functions
5245
5435
  *
5246
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5436
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5247
5437
  * @param initial Initial value
5248
5438
  * @returns Piped result
5249
5439
  */
@@ -5251,7 +5441,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(initial
5251
5441
  /**
5252
5442
  * Attempt to pipe a value through a series of functions
5253
5443
  *
5254
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5444
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5255
5445
  * @param initial Initial value
5256
5446
  * @returns Piped result
5257
5447
  */
@@ -5259,7 +5449,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth>(
5259
5449
  /**
5260
5450
  * Attempt to pipe a value through a series of functions
5261
5451
  *
5262
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5452
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5263
5453
  * @param initial Initial value
5264
5454
  * @returns Piped result
5265
5455
  */
@@ -5267,7 +5457,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth,
5267
5457
  /**
5268
5458
  * Attempt to pipe a value through a series of functions
5269
5459
  *
5270
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5460
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5271
5461
  * @param initial Initial value
5272
5462
  * @returns Piped result
5273
5463
  */
@@ -5275,7 +5465,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth,
5275
5465
  /**
5276
5466
  * Attempt to pipe a value through a series of functions
5277
5467
  *
5278
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5468
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5279
5469
  * @param initial Initial value
5280
5470
  * @returns Piped result
5281
5471
  */
@@ -5283,7 +5473,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth,
5283
5473
  /**
5284
5474
  * Attempt to pipe a value through a series of functions
5285
5475
  *
5286
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5476
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5287
5477
  * @param initial Initial value
5288
5478
  * @returns Piped result
5289
5479
  */
@@ -5291,7 +5481,7 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth,
5291
5481
  /**
5292
5482
  * Attempt to pipe a value through a series of functions
5293
5483
  *
5294
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5484
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5295
5485
  * @param initial Initial value
5296
5486
  * @returns Piped result
5297
5487
  */
@@ -5299,95 +5489,73 @@ declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth,
5299
5489
  /**
5300
5490
  * Attempt to pipe a result through a series of functions
5301
5491
  *
5302
- * Available as `attemptAsyncPipe` and `attempt.pipe.async`
5492
+ * Available as `attemptAsyncPipe` and `attemptPipe.async`
5303
5493
  * @param initial Initial result
5304
5494
  * @returns Piped result
5305
5495
  */
5306
5496
  declare function attemptAsyncPipe<Initial>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): Promise<WrapValue<Initial>>;
5307
5497
  /**
5308
5498
  * Attempt to pipe a value through a function
5309
- *
5310
- * Available as `attemptPipe` and `attempt.pipe`
5311
5499
  * @param initial Initial value
5312
5500
  * @returns Piped result
5313
5501
  */
5314
5502
  declare function attemptPipe<Initial, Pipe>(initial: GenericCallback | Initial | Result<Initial>, pipe: (value: UnwrapValue<Initial>) => Pipe): WrapValue<Pipe>;
5315
5503
  /**
5316
5504
  * Attempt to pipe a value through a series of functions
5317
- *
5318
- * Available as `attemptPipe` and `attempt.pipe`
5319
5505
  * @param initial Initial value
5320
5506
  * @returns Piped result
5321
5507
  */
5322
5508
  declare function attemptPipe<Initial, First, Second>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): WrapValue<Second>;
5323
5509
  /**
5324
5510
  * Attempt to pipe a value through a series of functions
5325
- *
5326
- * Available as `attemptPipe` and `attempt.pipe`
5327
5511
  * @param initial Initial value
5328
5512
  * @returns Piped result
5329
5513
  */
5330
5514
  declare function attemptPipe<Initial, First, Second, Third>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): WrapValue<Third>;
5331
5515
  /**
5332
5516
  * Attempt to pipe a value through a series of functions
5333
- *
5334
- * Available as `attemptPipe` and `attempt.pipe`
5335
5517
  * @param initial Initial value
5336
5518
  * @returns Piped result
5337
5519
  */
5338
5520
  declare function attemptPipe<Initial, First, Second, Third, Fourth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): WrapValue<Fourth>;
5339
5521
  /**
5340
5522
  * Attempt to pipe a value through a series of functions
5341
- *
5342
- * Available as `attemptPipe` and `attempt.pipe`
5343
5523
  * @param initial Initial value
5344
5524
  * @returns Piped result
5345
5525
  */
5346
5526
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): WrapValue<Fifth>;
5347
5527
  /**
5348
5528
  * Attempt to pipe a value through a series of functions
5349
- *
5350
- * Available as `attemptPipe` and `attempt.pipe`
5351
5529
  * @param initial Initial value
5352
5530
  * @returns Piped result
5353
5531
  */
5354
5532
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): WrapValue<Sixth>;
5355
5533
  /**
5356
5534
  * Attempt to pipe a value through a series of functions
5357
- *
5358
- * Available as `attemptPipe` and `attempt.pipe`
5359
5535
  * @param initial Initial value
5360
5536
  * @returns Piped result
5361
5537
  */
5362
5538
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): WrapValue<Seventh>;
5363
5539
  /**
5364
5540
  * Attempt to pipe a value through a series of functions
5365
- *
5366
- * Available as `attemptPipe` and `attempt.pipe`
5367
5541
  * @param initial Initial value
5368
5542
  * @returns Piped result
5369
5543
  */
5370
5544
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): WrapValue<Eighth>;
5371
5545
  /**
5372
5546
  * Attempt to pipe a value through a series of functions
5373
- *
5374
- * Available as `attemptPipe` and `attempt.pipe`
5375
5547
  * @param initial Initial value
5376
5548
  * @returns Piped result
5377
5549
  */
5378
5550
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): WrapValue<Ninth>;
5379
5551
  /**
5380
5552
  * Attempt to pipe a value through a series of functions
5381
- *
5382
- * Available as `attemptPipe` and `attempt.pipe`
5383
5553
  * @param initial Initial value
5384
5554
  * @returns Piped result
5385
5555
  */
5386
5556
  declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): WrapValue<Tenth>;
5387
5557
  /**
5388
5558
  * Attempt to pipe a result through a series of functions
5389
- *
5390
- * Available as `attemptPipe` and `attempt.pipe`
5391
5559
  * @param initial Initial result
5392
5560
  * @returns Piped result
5393
5561
  */
@@ -5396,62 +5564,6 @@ declare namespace attemptPipe {
5396
5564
  var async: typeof attemptAsyncPipe;
5397
5565
  }
5398
5566
  //#endregion
5399
- //#region src/result/index.d.ts
5400
- /**
5401
- * Executes a promise, catching any errors, and returns a result
5402
- *
5403
- * Available as `asyncAttempt` and `attempt.async`
5404
- * @param promise Promise to execute
5405
- * @param error Error value
5406
- * @returns Callback result
5407
- */
5408
- declare function asyncAttempt<Value, E>(promise: Promise<Value>, error: E): Promise<ExtendedResult<Awaited<Value>, E>>;
5409
- /**
5410
- * Executes a callback asynchronously, catching any errors, and returns a result
5411
- *
5412
- * Available as `asyncAttempt` and `attempt.async`
5413
- * @param callback Callback to execute
5414
- * @param error Error value
5415
- * @returns Callback result
5416
- */
5417
- declare function asyncAttempt<Value, E>(callback: () => Promise<Value>, error: E): Promise<ExtendedResult<Awaited<Value>, E>>;
5418
- /**
5419
- * Executes a promise, catching any errors, and returns a result
5420
- *
5421
- * Available as `asyncAttempt` and `attempt.async`
5422
- * @param promise Promise to execute
5423
- * @returns Callback result
5424
- */
5425
- declare function asyncAttempt<Value>(promise: Promise<Value>): Promise<Result<Awaited<Value>>>;
5426
- /**
5427
- * Executes a callback asynchronously, catching any errors, and returns a result
5428
- *
5429
- * Available as `asyncAttempt` and `attempt.async`
5430
- * @param callback Callback to execute
5431
- * @returns Callback result
5432
- */
5433
- declare function asyncAttempt<Value>(callback: () => Promise<Value>): Promise<Result<Awaited<Value>>>;
5434
- /**
5435
- * Executes a callback, catching any errors, and returns a result
5436
- * @param callback Callback to execute
5437
- * @param error Error value
5438
- * @returns Callback result
5439
- */
5440
- declare function attempt<Value, E>(callback: () => Value, error: E): ExtendedResult<Value, E>;
5441
- /**
5442
- * Executes a callback, catching any errors, and returns a result
5443
- * @param callback Callback to execute
5444
- * @returns Callback result
5445
- */
5446
- declare function attempt<Value>(callback: () => Value): Result<Value, Error>;
5447
- declare namespace attempt {
5448
- var async: typeof asyncAttempt;
5449
- var flow: typeof attemptFlow;
5450
- var match: typeof matchResult;
5451
- var pipe: typeof attemptPipe;
5452
- var promise: typeof attemptPromise;
5453
- }
5454
- //#endregion
5455
5567
  //#region src/sized/map.d.ts
5456
5568
  /**
5457
5569
  * A Map with a maximum size
@@ -5499,8 +5611,9 @@ declare class SizedMap<SizedKey = unknown, SizedValue = unknown> extends Map<Siz
5499
5611
  //#endregion
5500
5612
  //#region src/sized/set.d.ts
5501
5613
  /**
5502
- * - A Set with a maximum size
5503
- * - Behavior is similar to a _LRU_-cache, where the oldest values are removed
5614
+ * A Set with a maximum size
5615
+ *
5616
+ * Behavior is similar to a _LRU_-cache, where the oldest values are removed
5504
5617
  */
5505
5618
  declare class SizedSet<Value = unknown> extends Set<Value> {
5506
5619
  #private;
@@ -5541,4 +5654,4 @@ declare class SizedSet<Value = unknown> extends Set<Value> {
5541
5654
  get(value: Value, update?: boolean): Value | undefined;
5542
5655
  }
5543
5656
  //#endregion
5544
- export { AnyResult, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayPosition, ArrayValueSorter, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise, type Beacon, type BeaconOptions, BuiltIns, CancelableCallback, CancelablePromise, type Color, Constructor, DiffOptions, DiffResult, DiffValue, EqualOptions, Err, EventPosition, type Events, ExtendedErr, ExtendedResult, Flow, FlowPromise, Frozen, FulfilledPromise, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzySearchOptions, GenericAsyncCallback, GenericCallback, type HSLAColor, type HSLColor, type Kalas, Key$1 as Key, type KeyedQueue, KeyedValue, type Logger, type Memoized, type MemoizedOptions, MergeOptions, Merger, NestedArray, NestedKeys, NestedPartial, NestedValue, NestedValues, NormalizeOptions, Normalizer, NumericalKeys, NumericalValues, type Observable, type Observer, Ok, OnceAsyncCallback, OnceCallback, PROMISE_ABORT_EVENT, PROMISE_ABORT_OPTIONS, PROMISE_ERROR_NAME, PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_RESULT, PROMISE_MESSAGE_EXPECTATION_TIMED, PROMISE_MESSAGE_TIMEOUT, PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED, PlainObject, Primitive, PromiseData, PromiseHandlers, PromiseOptions, PromiseParameters, PromiseStrategy, PromiseTimeoutError, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValue, PromisesValues, type Queue, type QueueError, type QueueOptions, type Queued, type QueuedResult, type RGBAColor, type RGBColor, RejectedPromise, RequiredKeys, Result, ResultMatch, RetryError, RetryOptions, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, Shaken, Simplify, SizedMap, SizedSet, Smushed, SortDirection, Sorter, type Subscription, TemplateOptions, type Time, ToString, Transformer, TypedArray, Unsmushed, Unsubscriber, UnwrapValue, assert, assertCondition, assertDefined, assertInstanceOf, assertIs, assign, asyncAttempt, asyncDebounce, asyncFlow, asyncMatchResult, asyncOnce, asyncPipe, asyncThrottle, attempt, attemptAsyncFlow, attemptAsyncPipe, attemptFlow, attemptPipe, attemptPromise, average, beacon, between, camelCase, cancelable, capitalize, ceil, chunk, clamp, clone, compact, compare, count, debounce, deburr, dedent, delay, deregisterCloner, deregisterComparator, deregisterEqualizer, diff, difference, drop, endsWith, endsWithArray, equal, error, exclude, exists, filter, find, findLast, first, firstOrDefault, flatten, floor, flow, freeze, fromQuery, toPromise as fromResult, toPromise, fuzzy, fuzzyMatch, getArray, getArrayPosition, getColor, getError, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getNormalizedHex, getNumber, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems, getRgbColor, getRgbaColor, getSortedIndex, getString, getTimedPromise, getUuid, getValue, groupArraysBy, groupBy, handleResult, hasValue, hexToHsl, hexToHsla, hexToRgb, hexToRgba, hslToHex, hslToRgb, hslToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, intersection, isArrayOrPlainObject, isColor, isConstructor, isEmpty, isError, isFulfilled, isHexColor, isHslColor, isHslLike, isHslaColor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isOk, isPlainObject, isPrimitive, isRejected, isResult, isRgbColor, isRgbLike, isRgbaColor, isSorted, isTypedArray, join, kalas, kebabCase, keyedQueue, last, lastIndexOf, lastOrDefault, logger, lowerCase, matchResult, max, median, memoize, merge, min, move, moveIndices, moveToIndex, noop, normalize, ok, omit, once, parse, partition, pascalCase, pick, pipe, promises, push, queue, range, registerCloner, registerComparator, registerEqualizer, resultPromises, retry, reverse, rgbToHex, rgbToHsl, rgbToHsla, round, select, setValue, settlePromise, shake, shuffle, single, slice, smush, snakeCase, sort, splice, startsWith, startsWithArray, sum, swap, take, template, throttle, timed, times, titleCase, toMap, toMapArrays, toQuery, toRecord, toRecordArrays, toResult, toSet, toggle, transform, trim, truncate, tryDecode, tryEncode, union, unique, unsmush, unwrap, update, upperCase, words };
5657
+ export { AnyResult, ArrayComparison, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayValueSorter, AssertProperty, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise, type Beacon, type BeaconOptions, BuiltIns, CancelableCallback, CancelablePromise, type Color, Constructor, DiffOptions, DiffResult, DiffValue, EqualOptions, Err, EventPosition, type Events, ExtendedErr, ExtendedResult, Flow, FlowPromise, Frozen, FulfilledPromise, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzySearchOptions, GenericAsyncCallback, GenericCallback, type HSLAColor, type HSLColor, type Kalas, Key$1 as Key, type KeyedQueue, KeyedValue, type Logger, type Memoized, type MemoizedOptions, MergeOptions, Merger, NestedArray, NestedKeys, NestedPartial, NestedValue, NestedValues, NormalizeOptions, Normalizer, NumericalKeys, NumericalValues, type Observable, type Observer, Ok, OnceAsyncCallback, OnceCallback, PROMISE_ABORT_EVENT, PROMISE_ABORT_OPTIONS, PROMISE_ERROR_NAME, PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_RESULT, PROMISE_MESSAGE_EXPECTATION_TIMED, PROMISE_MESSAGE_TIMEOUT, PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED, PlainObject, Primitive, PromiseData, PromiseHandlers, PromiseOptions, PromiseParameters, PromiseStrategy, PromiseTimeoutError, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValue, PromisesValues, type Queue, type QueueError, type QueueOptions, type Queued, type QueuedResult, type RGBAColor, type RGBColor, RejectedPromise, RequiredKeys, Result, ResultMatch, RetryError, RetryOptions, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, Shaken, Simplify, SizedMap, SizedSet, Smushed, SortDirection, Sorter, type Subscription, TemplateOptions, type Time, ToString, Transformer, TypedArray, Unsmushed, Unsubscriber, UnwrapValue, assert, assertCondition, assertDefined, assertInstanceOf, assertIs, assertProperty, assign, asyncAttempt, asyncDebounce, asyncFlow, asyncMatchResult, asyncOnce, asyncPipe, asyncThrottle, attempt, attemptAsyncFlow, attemptAsyncPipe, attemptFlow, attemptPipe, attemptPromise, average, beacon, between, camelCase, cancelable, capitalize, ceil, chunk, clamp, clone, compact, compare, count, debounce, deburr, dedent, delay, deregisterCloner, deregisterComparator, deregisterEqualizer, diff, difference, drop, endsWith, endsWithArray, equal, error, exclude, exists, filter, find, findLast, first, firstOrDefault, flatten, floor, flow, freeze, fromQuery, toPromise as fromResult, toPromise, fuzzy, fuzzyMatch, getArray, getArrayComparison, getColor, getError, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getNormalizedHex, getNumber, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems, getRgbColor, getRgbaColor, getSortedIndex, getString, getTimedPromise, getUuid, getValue, groupArraysBy, groupBy, handleResult, hasValue, hasValueResult, hexToHsl, hexToHsla, hexToRgb, hexToRgba, hslToHex, hslToRgb, hslToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, intersection, isArrayOrPlainObject, isColor, isConstructor, isEmpty, isError, isFulfilled, isHexColor, isHslColor, isHslLike, isHslaColor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isOk, isPlainObject, isPrimitive, isRejected, isResult, isRgbColor, isRgbLike, isRgbaColor, isSorted, isTypedArray, join, kalas, kebabCase, keyedQueue, last, lastIndexOf, lastOrDefault, logger, lowerCase, matchResult, max, median, memoize, merge, min, move, moveIndices, moveToIndex, noop, normalize, ok, omit, once, parse, partition, pascalCase, pick, pipe, promises, push, queue, range, registerCloner, registerComparator, registerEqualizer, resultPromises, retry, reverse, rgbToHex, rgbToHsl, rgbToHsla, round, select, setValue, settlePromise, shake, shuffle, single, slice, smush, snakeCase, sort, splice, startsWith, startsWithArray, sum, swap, take, template, throttle, timed, times, titleCase, toMap, toMapArrays, toQuery, toRecord, toRecordArrays, toResult, toSet, toggle, transform, trim, truncate, tryDecode, tryEncode, union, unique, unsmush, unwrap, update, upperCase, words };