@oscarpalmer/atoms 0.216.0 → 0.218.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 (77) hide show
  1. package/dist/array/insert.mjs +1 -1
  2. package/dist/array/slice.mjs +27 -14
  3. package/dist/array/sort.mjs +2 -1
  4. package/dist/array/swap.d.mts +2 -1
  5. package/dist/color/constants.d.mts +2 -1
  6. package/dist/color/misc/get.mjs +3 -1
  7. package/dist/color/space/hex.mjs +1 -1
  8. package/dist/color/space/rgb.d.mts +1 -0
  9. package/dist/function/index.mjs +1 -2
  10. package/dist/function/retry.d.mts +1 -1
  11. package/dist/function/retry.mjs +5 -2
  12. package/dist/herald.mjs +1 -2
  13. package/dist/index.d.mts +335 -113
  14. package/dist/index.mjs +483 -241
  15. package/dist/internal/array/find.mjs +57 -34
  16. package/dist/internal/array/insert.mjs +1 -1
  17. package/dist/internal/array/match.mjs +21 -17
  18. package/dist/internal/array/sets.mjs +7 -1
  19. package/dist/internal/math/aggregate.mjs +4 -1
  20. package/dist/internal/number.d.mts +1 -1
  21. package/dist/internal/number.mjs +4 -2
  22. package/dist/internal/plan/index.d.mts +7 -0
  23. package/dist/internal/plan/index.mjs +18 -0
  24. package/dist/{plan/generate.d.mts → internal/plan/plan.generate.d.mts} +2 -2
  25. package/dist/{plan/generate.mjs → internal/plan/plan.generate.mjs} +7 -7
  26. package/dist/internal/random.d.mts +6 -0
  27. package/dist/internal/random.mjs +13 -2
  28. package/dist/internal/result/attempt.mjs +4 -4
  29. package/dist/internal/string/misc.mjs +2 -1
  30. package/dist/internal/subscription.mjs +1 -1
  31. package/dist/internal/value/equal.mjs +2 -1
  32. package/dist/internal/value/partial.mjs +3 -1
  33. package/dist/models/color.model.d.mts +2 -1
  34. package/dist/models/function/once.model.d.mts +2 -1
  35. package/dist/models/index.d.mts +2 -1
  36. package/dist/models/plan.model.d.mts +160 -29
  37. package/dist/models/plan.model.mjs +15 -5
  38. package/dist/models/queue.model.d.mts +2 -1
  39. package/dist/models/result.model.d.mts +2 -1
  40. package/dist/models/string/string.fuzzy.model.d.mts +1 -1
  41. package/dist/models/string/string.misc.model.mjs +1 -1
  42. package/dist/models/value/value.equal.model.d.mts +2 -1
  43. package/dist/models/value/value.merge.model.d.mts +3 -2
  44. package/dist/models/value/value.misc.model.d.mts +2 -1
  45. package/dist/number.mjs +1 -2
  46. package/dist/plan/index.d.mts +1 -4
  47. package/dist/plan/index.mjs +14 -15
  48. package/dist/plan/is.d.mts +59 -3
  49. package/dist/plan/is.mjs +82 -10
  50. package/dist/plan/misc.d.mts +51 -3
  51. package/dist/plan/misc.mjs +47 -30
  52. package/dist/plan/models.d.mts +2 -2
  53. package/dist/plan/result.d.mts +15 -3
  54. package/dist/plan/result.mjs +5 -11
  55. package/dist/plan/run.d.mts +1 -3
  56. package/dist/plan/run.mjs +5 -11
  57. package/dist/plan/use.d.mts +36 -0
  58. package/dist/plan/use.mjs +69 -0
  59. package/dist/promise/index.d.mts +6 -4
  60. package/dist/promise/index.mjs +4 -4
  61. package/dist/promise/misc.mjs +5 -2
  62. package/dist/promise/models.mjs +1 -2
  63. package/dist/promise/timed.mjs +2 -2
  64. package/dist/queue.mjs +4 -5
  65. package/dist/random.d.mts +2 -2
  66. package/dist/random.mjs +3 -3
  67. package/dist/result/index.mjs +1 -2
  68. package/dist/result/match.mjs +2 -2
  69. package/dist/result/misc.mjs +3 -10
  70. package/dist/result/work/pipe.d.mts +26 -23
  71. package/dist/result/work/pipe.mjs +7 -3
  72. package/dist/string/fuzzy.mjs +1 -1
  73. package/dist/string/index.mjs +1 -1
  74. package/dist/subscription.mjs +1 -2
  75. package/dist/value/clone.mjs +1 -1
  76. package/dist/value/merge.mjs +17 -4
  77. package/package.json +8 -10
package/dist/index.d.mts CHANGED
@@ -3378,7 +3378,7 @@ declare function asyncRetry<Callback extends GenericAsyncCallback>(callback: Cal
3378
3378
  * @param options Retry options
3379
3379
  * @returns Callback result
3380
3380
  */
3381
- declare function asyncRetry<Callback extends GenericCallback>(callback: Callback, options?: RetryOptions): Promise<ReturnType<Callback>>;
3381
+ declare function asyncRetry<Callback extends GenericAsyncCallback>(callback: Callback, options?: RetryOptions): Promise<ReturnType<Callback>>;
3382
3382
  /**
3383
3383
  * Retry a callback a specified number of times
3384
3384
  *
@@ -4660,6 +4660,17 @@ export declare function setValue<Data extends PlainObject, Path extends NestedKe
4660
4660
  export declare function setValue<Data extends PlainObject>(data: Data, path: string, value: unknown, ignoreCase?: boolean): Data;
4661
4661
  //#endregion
4662
4662
  //#region src/models/plan.model.d.ts
4663
+ /**
4664
+ * An immediately failing asynchronous plan
4665
+ */
4666
+ type AsyncFailure<Value> = {
4667
+ /**
4668
+ * Get the generator for the failed plan
4669
+ *
4670
+ * @returns Generator
4671
+ */
4672
+ [Symbol.asyncIterator]: () => AsyncGenerator<Err<Value>, never>;
4673
+ };
4663
4674
  /**
4664
4675
  * An asynchronous plan of execution that can yield intermediate results and eventually return a result
4665
4676
  */
@@ -4686,18 +4697,61 @@ type AsyncPlan<Yielded, Returned, Parameters extends unknown[]> = {
4686
4697
  */
4687
4698
  run: Parameters extends [infer _, ...(infer _)[]] ? (parameters: Parameters, signal?: AbortSignal) => Promise<PlanReturned<Returned>> : (signal?: AbortSignal) => Promise<PlanReturned<Returned>>;
4688
4699
  };
4689
- type AsyncPlanState = {
4690
- generator(...parameters: unknown[]): AsyncGenerator;
4691
- } & BaseState<typeof PLAN_TYPE_PLAN_ASYNC>;
4692
- type BaseState<Type extends PlanType> = {
4693
- type: Type;
4700
+ /**
4701
+ * An immediately succeeding or failing asynchronous plan
4702
+ */
4703
+ type AsyncPlanned<Value, Error> = AsyncSuccess<Value> | AsyncFailure<Error>;
4704
+ /**
4705
+ * A single asynchronous step within a plan of execution
4706
+ */
4707
+ type AsyncStep<Input> = {
4708
+ /**
4709
+ * Get the asynchronous generator for the step
4710
+ *
4711
+ * @returns Asynchronous generator
4712
+ */
4713
+ [Symbol.asyncIterator]: () => AsyncGenerator<AsyncStepYielded<Input>, AsyncStepReturned<Input>>;
4694
4714
  };
4695
- type InternalAsyncPlan = {
4696
- [PLAN_SYMBOL]: AsyncPlanState;
4697
- } & AsyncPlan<never, never, unknown[]>;
4698
- type InternalPlan = {
4699
- [PLAN_SYMBOL]: PlanState;
4700
- } & Plan<never, never, unknown[]>;
4715
+ type AsyncStepReturned<Input> = AsyncStepReturnedItem<Awaited<Input>>;
4716
+ type AsyncStepReturnedItem<Input> = Input extends {
4717
+ [Symbol.asyncIterator](): AsyncGenerator<infer _, infer Returned>;
4718
+ } ? Returned : StepReturned<Input>;
4719
+ type AsyncStepValue<Input> = [Extract<Awaited<Input>, InvalidAsyncStepValue<Awaited<Input>>>] extends [never] ? unknown : never;
4720
+ type AsyncStepYielded<Input> = AsyncStepYieldedItem<Awaited<Input>>;
4721
+ type AsyncStepYieldedItem<Input> = Input extends {
4722
+ [Symbol.asyncIterator](): AsyncGenerator<infer Yielded>;
4723
+ } ? Yielded : StepYielded<Input>;
4724
+ /**
4725
+ * An immediately successful asynchronous plan
4726
+ */
4727
+ type AsyncSuccess<Value> = {
4728
+ /**
4729
+ * Get the generator for the successful plan
4730
+ *
4731
+ * @returns Generator
4732
+ */
4733
+ [Symbol.asyncIterator]: () => AsyncGenerator<never, Value>;
4734
+ };
4735
+ /**
4736
+ * An immediately failing plan
4737
+ */
4738
+ type Failure<Value> = {
4739
+ /**
4740
+ * Get the generator for the failed plan
4741
+ *
4742
+ * @returns Generator
4743
+ */
4744
+ [Symbol.iterator]: () => Generator<Err<Value>, never>;
4745
+ };
4746
+ type InvalidAsyncStepValue<Input> = ((...args: any[]) => unknown) | ParameterizedPlan<Input>;
4747
+ type InvalidStepValue<Input> = ((...args: any[]) => unknown) | {
4748
+ [Symbol.asyncIterator]: unknown;
4749
+ } | ParameterizedPlan<Input> | Promise<unknown>;
4750
+ type ParameterizedPlan<Input> = Input extends {
4751
+ [Symbol.iterator]: (...parameters: infer Parameters) => unknown;
4752
+ } ? [] extends Parameters ? never : Input : Input extends {
4753
+ [Symbol.asyncIterator]: (...parameters: infer Parameters) => unknown;
4754
+ } ? [] extends Parameters ? never : Input : never;
4701
4755
  /**
4702
4756
  * A plan of execution that can yield intermediate results and eventually return a result
4703
4757
  */
@@ -4725,32 +4779,45 @@ type Plan<Yielded, Returned, Parameters extends unknown[]> = {
4725
4779
  run(...parameters: Parameters): PlanReturned<Returned>;
4726
4780
  };
4727
4781
  /**
4728
- * An immediately failing plan
4782
+ * An OK result of a plan execution
4729
4783
  */
4730
- type PlanFailure<E> = {
4731
- /**
4732
- * Get the generator for the failed plan
4733
- *
4734
- * @returns Generator
4735
- */
4736
- [Symbol.iterator]: () => Generator<Err<E>, never>;
4737
- };
4738
4784
  type PlanOk<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned extends Ok<infer Value> ? Value : Returned;
4739
4785
  type PlanErrors<Yielded, Returned> = PlanErrorValues<Yielded> | PlanErrorValues<Returned>;
4786
+ /**
4787
+ * An error result of a plan execution
4788
+ */
4740
4789
  type PlanError<Yielded, Returned> = [PlanErrors<Yielded, Returned>] extends [never] ? Error : PlanErrorValues<Yielded> | PlanErrorValues<Returned>;
4741
- type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer E> ? E : Original extends PlanFailure<infer E> ? E : never;
4790
+ type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer E> ? E : Original extends Failure<infer E> ? E : never;
4791
+ /**
4792
+ * The returned result of a plan execution _(excluding errors, which are thrown)_
4793
+ */
4742
4794
  type PlanReturned<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned;
4743
4795
  /**
4744
- * An immediately successful or failing plan
4796
+ * An immediately succeeding or failing plan
4797
+ */
4798
+ type Planned<Value, Error> = Success<Value> | Failure<Error>;
4799
+ /**
4800
+ * A single step within a plan of execution
4745
4801
  */
4746
- type PlanResult<Success, Failure> = PlanSuccess<Success> | PlanFailure<Failure>;
4747
- type PlanState = {
4748
- generator(...parameters: unknown[]): Generator;
4749
- } & BaseState<typeof PLAN_TYPE_PLAN_SYNC>;
4802
+ type Step<Input> = {
4803
+ /**
4804
+ * Get the generator for the step
4805
+ *
4806
+ * @returns Generator
4807
+ */
4808
+ [Symbol.iterator]: () => Generator<StepYielded<Input>, StepReturned<Input>>;
4809
+ };
4810
+ type StepReturned<Input> = Input extends Error ? never : Input extends Err<infer _> ? never : Input extends Ok<infer Value> ? Value : Input extends {
4811
+ [Symbol.iterator](): Generator<infer _, infer Returned>;
4812
+ } ? Returned : Input;
4813
+ type StepValue<Input> = [Extract<Input, InvalidStepValue<Input>>] extends [never] ? unknown : never;
4814
+ type StepYielded<Input> = Input extends Error ? Err<Input> : Input extends Err<infer _> ? Input : Input extends {
4815
+ [Symbol.iterator](): Generator<infer Yielded>;
4816
+ } ? Yielded : never;
4750
4817
  /**
4751
4818
  * An immediately successful plan
4752
4819
  */
4753
- type PlanSuccess<Value> = {
4820
+ type Success<Value> = {
4754
4821
  /**
4755
4822
  * Get the generator for the successful plan
4756
4823
  *
@@ -4758,10 +4825,172 @@ type PlanSuccess<Value> = {
4758
4825
  */
4759
4826
  [Symbol.iterator]: () => Generator<never, Value>;
4760
4827
  };
4761
- type PlanType = "asyncPlan" | "plan";
4762
- declare const PLAN_SYMBOL: unique symbol;
4763
- declare const PLAN_TYPE_PLAN_ASYNC: PlanType;
4764
- declare const PLAN_TYPE_PLAN_SYNC: PlanType;
4828
+ //#endregion
4829
+ //#region src/plan/index.d.ts
4830
+ /**
4831
+ * Create a plan for an asynchronous generator function
4832
+ *
4833
+ * @param generator Generator to plan for
4834
+ * @returns Generator plan
4835
+ */
4836
+ export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>): AsyncPlan<Yielded, Returned, Parameters>;
4837
+ /**
4838
+ * Create a plan for a generator function
4839
+ *
4840
+ * @param generator Generator to plan for
4841
+ * @returns Generator plan
4842
+ */
4843
+ export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
4844
+ //#endregion
4845
+ //#region src/plan/is.d.ts
4846
+ /**
4847
+ * Is the value an asynchronous, immediately failing plan?
4848
+ *
4849
+ * @param value Value to check
4850
+ * @returns `true` if the value is an asynchronous, immediately failing plan, otherwise `false`
4851
+ */
4852
+ export declare function isAsyncFailure<Value = unknown>(value: unknown): value is AsyncFailure<Value>;
4853
+ /**
4854
+ * Is the value an asynchronous generator?
4855
+ *
4856
+ * @param value Value to check
4857
+ * @returns `true` if the value is an asynchronous generator, otherwise `false`
4858
+ */
4859
+ export declare function isAsyncGenerator<Y = unknown, R = unknown, N = unknown>(value: unknown): value is AsyncGenerator<Y, R, N>;
4860
+ /**
4861
+ * Is the value an asynchronous generator function?
4862
+ *
4863
+ * @param value Value to check
4864
+ * @returns `true` if the value is an asynchronous generator function, otherwise `false`
4865
+ */
4866
+ export declare function isAsyncGeneratorFunction<Y = unknown, R = unknown, N = unknown>(value: unknown): value is () => AsyncGenerator<Y, R, N>;
4867
+ /**
4868
+ * Is the value an asynchronous plan?
4869
+ *
4870
+ * @param value Value to check
4871
+ * @returns `true` if the value is an asynchronous plan, otherwise `false`
4872
+ */
4873
+ export declare function isAsyncPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is AsyncPlan<Yielded, Returned, Parameters>;
4874
+ /**
4875
+ * Is the value an asynchronous step?
4876
+ *
4877
+ * @param value Value to check
4878
+ * @returns `true` if the value is an asynchronous step, otherwise `false`
4879
+ */
4880
+ export declare function isAsyncStep<Value = unknown>(value: unknown): value is AsyncStep<Value>;
4881
+ /**
4882
+ * Is the value an asynchronous, immediately successful plan?
4883
+ *
4884
+ * @param value Value to check
4885
+ * @returns `true` if the value is an asynchronous, immediately successful plan, otherwise `false`
4886
+ */
4887
+ export declare function isAsyncSuccess<Value = unknown>(value: unknown): value is AsyncSuccess<Value>;
4888
+ /**
4889
+ * Is the value an immediately failing plan?
4890
+ *
4891
+ * @param value Value to check
4892
+ * @returns `true` if the value is an immediately failing plan, otherwise `false`
4893
+ */
4894
+ export declare function isFailure<Value = unknown>(value: unknown): value is Failure<Value>;
4895
+ /**
4896
+ * Is the value a generator?
4897
+ *
4898
+ * @param value Value to check
4899
+ * @returns `true` if the value is a generator, otherwise `false`
4900
+ */
4901
+ export declare function isGenerator<Y = unknown, R = unknown, N = unknown>(value: unknown): value is Generator<Y, R, N>;
4902
+ /**
4903
+ * Is the value a generator function?
4904
+ *
4905
+ * @param value Value to check
4906
+ * @returns `true` if the value is a generator function, otherwise `false`
4907
+ */
4908
+ export declare function isGeneratorFunction<Y = unknown, R = unknown, N = unknown>(value: unknown): value is () => Generator<Y, R, N>;
4909
+ /**
4910
+ * Is the value a plan?
4911
+ *
4912
+ * @param value Value to check
4913
+ * @returns `true` if the value is a plan, otherwise `false`
4914
+ */
4915
+ export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is Plan<Yielded, Returned, Parameters>;
4916
+ /**
4917
+ * Is the value a step?
4918
+ *
4919
+ * @param value Value to check
4920
+ * @returns `true` if the value is a step, otherwise `false`
4921
+ */
4922
+ export declare function isStep<Value = unknown>(value: unknown): value is Step<Value>;
4923
+ /**
4924
+ * Is the value an immediately successful plan?
4925
+ *
4926
+ * @param value Value to check
4927
+ * @returns `true` if the value is an immediately successful plan, otherwise `false`
4928
+ */
4929
+ export declare function isSuccess<Value = unknown>(value: unknown): value is Success<Value>;
4930
+ //#endregion
4931
+ //#region src/plan/misc.d.ts
4932
+ /**
4933
+ * Create an immediately failing plan
4934
+ *
4935
+ * @param callback Failure callback
4936
+ * @returns Plan failure
4937
+ */
4938
+ export declare function asyncFail<Value>(callback: () => Value): AsyncFailure<Awaited<Value>>;
4939
+ /**
4940
+ * Create an immediately failing plan
4941
+ *
4942
+ * @param value Failure value
4943
+ * @returns Plan failure
4944
+ */
4945
+ export declare function asyncFail<Value>(value: Value): AsyncFailure<Awaited<Value>>;
4946
+ /**
4947
+ * Create an immediately succeeding plan
4948
+ *
4949
+ * @param callback Success callback
4950
+ * @returns Plan success
4951
+ */
4952
+ export declare function asyncSucceed<Value>(callback: () => Value): AsyncSuccess<Awaited<Value>>;
4953
+ /**
4954
+ * Create an immediately succeeding plan
4955
+ *
4956
+ * @param value Success value
4957
+ * @returns Plan success
4958
+ */
4959
+ export declare function asyncSucceed<Value>(value: Value): AsyncSuccess<Awaited<Value>>;
4960
+ /**
4961
+ * Create an immediately failing plan
4962
+ *
4963
+ * @param callback Failure callback
4964
+ * @returns Plan failure
4965
+ */
4966
+ export declare function fail<Value>(callback: () => Value): Failure<Value>;
4967
+ /**
4968
+ * Create an immediately failing plan
4969
+ *
4970
+ * @param value Failure value
4971
+ * @returns Plan failure
4972
+ */
4973
+ export declare function fail<Value>(value: Value): Failure<Value>;
4974
+ /**
4975
+ * Create an immediately succeeding plan
4976
+ *
4977
+ * @param callback Success callback
4978
+ * @returns Plan success
4979
+ */
4980
+ export declare function succeed<Value>(callback: () => Value): Success<Value>;
4981
+ /**
4982
+ * Create an immediately succeeding plan
4983
+ *
4984
+ * @param value Success value
4985
+ * @returns Plan success
4986
+ */
4987
+ export declare function succeed<Value>(value: Value): Success<Value>;
4988
+ export declare namespace fail {
4989
+ export var async: typeof asyncFail;
4990
+ }
4991
+ export declare namespace succeed {
4992
+ export var async: typeof asyncSucceed;
4993
+ }
4765
4994
  //#endregion
4766
4995
  //#region src/plan/result.d.ts
4767
4996
  /**
@@ -4769,6 +4998,9 @@ declare const PLAN_TYPE_PLAN_SYNC: PlanType;
4769
4998
  *
4770
4999
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4771
5000
  *
5001
+ * @param generator Generator to run
5002
+ * @param parameters Parameters for starting the run
5003
+ * @param signal Optional abort signal
4772
5004
  * @returns Promised result
4773
5005
  */
4774
5006
  export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4777,6 +5009,8 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4777
5009
  *
4778
5010
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4779
5011
  *
5012
+ * @param generator Generator to run
5013
+ * @param signal Optional abort signal
4780
5014
  * @returns Promised result
4781
5015
  */
4782
5016
  export declare function asyncAttemptRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4785,6 +5019,9 @@ export declare function asyncAttemptRun<Yielded, Returned>(generator: () => Asyn
4785
5019
  *
4786
5020
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4787
5021
  *
5022
+ * @param plan Plan to run
5023
+ * @param parameters Parameters for starting the run
5024
+ * @param signal Optional abort signal
4788
5025
  * @returns Promised result
4789
5026
  */
4790
5027
  export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4793,6 +5030,8 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4793
5030
  *
4794
5031
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4795
5032
  *
5033
+ * @param plan Plan to run
5034
+ * @param signal Optional abort signal
4796
5035
  * @returns Promised result
4797
5036
  */
4798
5037
  export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4801,6 +5040,8 @@ export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yield
4801
5040
  *
4802
5041
  * _Returns a {@link Result} instead of a raw value or throwing an error_
4803
5042
  *
5043
+ * @param generator Generator to run
5044
+ * @param parameters Parameters for starting the run
4804
5045
  * @returns Result
4805
5046
  */
4806
5047
  export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
@@ -4809,11 +5050,11 @@ export declare function attemptRun<Yielded, Returned, Parameters extends unknown
4809
5050
  *
4810
5051
  * _Returns a {@link Result} instead of a raw value or throwing an error_
4811
5052
  *
5053
+ * @param plan Plan to run
5054
+ * @param parameters Parameters for starting the run
4812
5055
  * @returns Result
4813
5056
  */
4814
5057
  export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlanOk<Returned>, PlanError<Yielded, Returned>>;
4815
- export declare function attemptRunAsyncPlan(this: never, first: never, second: never): Promise<unknown>;
4816
- export declare function attemptRunPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4817
5058
  export declare namespace attemptRun {
4818
5059
  export var async: typeof asyncAttemptRun;
4819
5060
  }
@@ -4869,8 +5110,6 @@ export declare function run<Yielded, Returned, Parameters extends unknown[]>(gen
4869
5110
  * @returns Result
4870
5111
  */
4871
5112
  export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlanReturned<Returned>;
4872
- export declare function runAsyncPlan(this: InternalAsyncPlan, first: never, second: never): Promise<unknown>;
4873
- export declare function runPlan(this: InternalPlan, ...parameters: unknown[]): unknown;
4874
5113
  export declare namespace asyncRun {
4875
5114
  export var attempt: typeof asyncAttemptRun;
4876
5115
  }
@@ -4879,67 +5118,40 @@ export declare namespace run {
4879
5118
  export var attempt: typeof attemptRun;
4880
5119
  }
4881
5120
  //#endregion
4882
- //#region src/plan/index.d.ts
4883
- /**
4884
- * Create a plan for an asynchronous generator function
4885
- *
4886
- * @param generator Generator to plan for
4887
- * @returns Generator plan
4888
- */
4889
- export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>): AsyncPlan<Yielded, Returned, Parameters>;
4890
- /**
4891
- * Create a plan for a generator function
4892
- *
4893
- * @param generator Generator to plan for
4894
- * @returns Generator plan
4895
- */
4896
- export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
4897
- //#endregion
4898
- //#region src/plan/is.d.ts
4899
- /**
4900
- * Is the value an asynchronous generator function?
4901
- *
4902
- * @param value Value to check
4903
- * @returns `true` if the value is an asynchronous generator function, otherwise `false`
4904
- */
4905
- export declare function isAsyncGenerator(value: unknown): value is () => AsyncGenerator;
5121
+ //#region src/plan/use.d.ts
4906
5122
  /**
4907
- * Is the value an asynchronous plan?
5123
+ * Create an asynchronous step from a callback
4908
5124
  *
4909
- * @param value Value to check
4910
- * @returns `true` if the value is an asynchronous plan, otherwise `false`
5125
+ * @param callback Callback
5126
+ * @returns An asynchronous step
4911
5127
  */
4912
- export declare function isAsyncPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is AsyncPlan<Yielded, Returned, Parameters>;
5128
+ export declare function asyncUse<Value>(callback: () => Value & AsyncStepValue<Value>): AsyncStep<Value>;
4913
5129
  /**
4914
- * Is the value a generator function?
5130
+ * Create an asynchronous step from a value
4915
5131
  *
4916
- * @param value Value to check
4917
- * @returns `true` if the value is a generator function, otherwise `false`
4918
- */
4919
- export declare function isGenerator(value: unknown): value is () => Generator;
4920
- /**
4921
- * Is the value a plan?
4922
- *
4923
- * @param value Value to check
4924
- * @returns `true` if the value is a plan, otherwise `false`
5132
+ * @param value Value
5133
+ * @returns An asynchronous step
4925
5134
  */
4926
- export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is Plan<Yielded, Returned, Parameters>;
4927
- //#endregion
4928
- //#region src/plan/misc.d.ts
5135
+ export declare function asyncUse<Value>(value: Value & AsyncStepValue<Value>): AsyncStep<Value>;
4929
5136
  /**
4930
- * Create an immediately failing plan
5137
+ * Create a step from a callback
4931
5138
  *
4932
- * @param value Failure value
4933
- * @returns Plan failure
5139
+ * @param callback Callback
5140
+ * @returns A step
5141
+ * @throws Error If the input is invalid
4934
5142
  */
4935
- export declare function fail<Value>(value: Value): PlanFailure<Value>;
5143
+ export declare function use<Value>(callback: () => Value & StepValue<Value>): Step<Value>;
4936
5144
  /**
4937
- * Create an immediately succeeding plan
5145
+ * Create a step from a value
4938
5146
  *
4939
- * @param value Success value
4940
- * @returns Plan success
5147
+ * @param value Value
5148
+ * @returns A step
5149
+ * @throws Error If the input is invalid
4941
5150
  */
4942
- export declare function succeed<Value>(value: Value): PlanSuccess<Value>;
5151
+ export declare function use<Value>(value: Value & StepValue<Value>): Step<Value>;
5152
+ export declare namespace use {
5153
+ export var async: typeof asyncUse;
5154
+ }
4943
5155
  //#endregion
4944
5156
  //#region src/models/aborter.model.d.ts
4945
5157
  type Aborter = {
@@ -5069,6 +5281,7 @@ export declare function delay(options?: PromiseOptions): Promise<void>;
5069
5281
  export declare function delay(time?: number): Promise<void>;
5070
5282
  //#endregion
5071
5283
  //#region src/promise/index.d.ts
5284
+ type AttemptPromiseOptions = PromiseOptions | AbortSignal | number;
5072
5285
  /**
5073
5286
  * Wrap a _Promise_ with safety handlers
5074
5287
  *
@@ -5076,7 +5289,7 @@ export declare function delay(time?: number): Promise<void>;
5076
5289
  * @param options Options for the _Promise_
5077
5290
  * @returns Wrapped _Promise_
5078
5291
  */
5079
- export declare function attemptPromise<Value>(promise: Promise<Value>, options?: PromiseOptions | AbortSignal | number): Promise<Value>;
5292
+ export declare function attemptPromise<Value>(promise: Promise<Value>, options?: AttemptPromiseOptions): Promise<Value>;
5080
5293
  /**
5081
5294
  * Wrap a _Promise_-returning callback with safety handlers
5082
5295
  *
@@ -5084,7 +5297,7 @@ export declare function attemptPromise<Value>(promise: Promise<Value>, options?:
5084
5297
  * @param options Options for the _Promise_
5085
5298
  * @returns _Promise_-wrapped callback
5086
5299
  */
5087
- export declare function attemptPromise<Value>(callback: () => Promise<Value>, options?: PromiseOptions | AbortSignal | number): Promise<Value>;
5300
+ export declare function attemptPromise<Value>(callback: () => Promise<Value>, options?: AttemptPromiseOptions): Promise<Value>;
5088
5301
  /**
5089
5302
  * Wrap a callback with a _Promise_ and safety handlers
5090
5303
  *
@@ -5092,7 +5305,7 @@ export declare function attemptPromise<Value>(callback: () => Promise<Value>, op
5092
5305
  * @param options Options for the _Promise_
5093
5306
  * @returns _Promise_-wrapped callback
5094
5307
  */
5095
- export declare function attemptPromise<Value>(callback: () => Value, options?: PromiseOptions | AbortSignal | number): Promise<Value>;
5308
+ export declare function attemptPromise<Value>(callback: () => Value, options?: AttemptPromiseOptions): Promise<Value>;
5096
5309
  /**
5097
5310
  * Handle a list of _Promises_, returning their results in an ordered array
5098
5311
  *
@@ -5628,6 +5841,8 @@ export declare namespace attemptFlow {
5628
5841
  }
5629
5842
  //#endregion
5630
5843
  //#region src/result/work/pipe.d.ts
5844
+ type InitialAsyncPipeValue<Initial> = GenericCallback | Initial | Promise<Initial> | Result<Initial>;
5845
+ type InitialPipeValue<Initial> = GenericCallback | Initial | Result<Initial>;
5631
5846
  type WrapValue<Value> = Result<UnwrapValue<Value>>;
5632
5847
  /**
5633
5848
  * Attempt to pipe a value through a function
@@ -5637,7 +5852,7 @@ type WrapValue<Value> = Result<UnwrapValue<Value>>;
5637
5852
  * @param initial Initial value
5638
5853
  * @returns _Piped_ result
5639
5854
  */
5640
- export declare function attemptAsyncPipe<Initial, Piped>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, pipe: (value: UnwrapValue<Initial>) => Piped): Promise<WrapValue<Piped>>;
5855
+ export declare function attemptAsyncPipe<Initial, Piped>(initial: InitialAsyncPipeValue<Initial>, pipe: (value: UnwrapValue<Initial>) => Piped): Promise<WrapValue<Piped>>;
5641
5856
  /**
5642
5857
  * Attempt to pipe a value through a series of functions
5643
5858
  *
@@ -5646,7 +5861,7 @@ export declare function attemptAsyncPipe<Initial, Piped>(initial: GenericCallbac
5646
5861
  * @param initial Initial value
5647
5862
  * @returns _Piped_ result
5648
5863
  */
5649
- export declare function attemptAsyncPipe<Initial, First, Second>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): Promise<WrapValue<Second>>;
5864
+ export declare function attemptAsyncPipe<Initial, First, Second>(initial: InitialAsyncPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): Promise<WrapValue<Second>>;
5650
5865
  /**
5651
5866
  * Attempt to pipe a value through a series of functions
5652
5867
  *
@@ -5655,7 +5870,7 @@ export declare function attemptAsyncPipe<Initial, First, Second>(initial: Generi
5655
5870
  * @param initial Initial value
5656
5871
  * @returns _Piped_ result
5657
5872
  */
5658
- export declare function attemptAsyncPipe<Initial, First, Second, Third>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): Promise<WrapValue<Third>>;
5873
+ export declare function attemptAsyncPipe<Initial, First, Second, Third>(initial: InitialAsyncPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): Promise<WrapValue<Third>>;
5659
5874
  /**
5660
5875
  * Attempt to pipe a value through a series of functions
5661
5876
  *
@@ -5664,7 +5879,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third>(initial:
5664
5879
  * @param initial Initial value
5665
5880
  * @returns _Piped_ result
5666
5881
  */
5667
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): Promise<WrapValue<Fourth>>;
5882
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(initial: InitialAsyncPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): Promise<WrapValue<Fourth>>;
5668
5883
  /**
5669
5884
  * Attempt to pipe a value through a series of functions
5670
5885
  *
@@ -5673,7 +5888,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(
5673
5888
  * @param initial Initial value
5674
5889
  * @returns _Piped_ result
5675
5890
  */
5676
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Fifth>>;
5891
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Fifth>>;
5677
5892
  /**
5678
5893
  * Attempt to pipe a value through a series of functions
5679
5894
  *
@@ -5682,7 +5897,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5682
5897
  * @param initial Initial value
5683
5898
  * @returns _Piped_ result
5684
5899
  */
5685
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Sixth>>;
5900
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Sixth>>;
5686
5901
  /**
5687
5902
  * Attempt to pipe a value through a series of functions
5688
5903
  *
@@ -5691,7 +5906,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5691
5906
  * @param initial Initial value
5692
5907
  * @returns _Piped_ result
5693
5908
  */
5694
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Seventh>>;
5909
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Seventh>>;
5695
5910
  /**
5696
5911
  * Attempt to pipe a value through a series of functions
5697
5912
  *
@@ -5700,7 +5915,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5700
5915
  * @param initial Initial value
5701
5916
  * @returns _Piped_ result
5702
5917
  */
5703
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Eighth>>;
5918
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Eighth>>;
5704
5919
  /**
5705
5920
  * Attempt to pipe a value through a series of functions
5706
5921
  *
@@ -5709,7 +5924,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5709
5924
  * @param initial Initial value
5710
5925
  * @returns _Piped_ result
5711
5926
  */
5712
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Ninth>>;
5927
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Ninth>>;
5713
5928
  /**
5714
5929
  * Attempt to pipe a value through a series of functions
5715
5930
  *
@@ -5718,7 +5933,7 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5718
5933
  * @param initial Initial value
5719
5934
  * @returns _Piped_ result
5720
5935
  */
5721
- export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: GenericCallback | Initial | Promise<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): Promise<WrapValue<Tenth>>;
5936
+ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: InitialAsyncPipeValue<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): Promise<WrapValue<Tenth>>;
5722
5937
  /**
5723
5938
  * Attempt to pipe a result through a series of functions
5724
5939
  *
@@ -5727,84 +5942,84 @@ export declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth,
5727
5942
  * @param initial Initial result
5728
5943
  * @returns _Piped_ result
5729
5944
  */
5730
- export declare function attemptAsyncPipe<Initial>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): Promise<WrapValue<Initial>>;
5945
+ export declare function attemptAsyncPipe<Initial>(initial: InitialAsyncPipeValue<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): Promise<WrapValue<Initial>>;
5731
5946
  /**
5732
5947
  * Attempt to pipe a value through a function
5733
5948
  *
5734
5949
  * @param initial Initial value
5735
5950
  * @returns _Piped_ result
5736
5951
  */
5737
- export declare function attemptPipe<Initial, Pipe>(initial: GenericCallback | Initial | Result<Initial>, pipe: (value: UnwrapValue<Initial>) => Pipe): WrapValue<Pipe>;
5952
+ export declare function attemptPipe<Initial, Pipe>(initial: InitialPipeValue<Initial>, pipe: (value: UnwrapValue<Initial>) => Pipe): WrapValue<Pipe>;
5738
5953
  /**
5739
5954
  * Attempt to pipe a value through a series of functions
5740
5955
  *
5741
5956
  * @param initial Initial value
5742
5957
  * @returns _Piped_ result
5743
5958
  */
5744
- export declare function attemptPipe<Initial, First, Second>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): WrapValue<Second>;
5959
+ export declare function attemptPipe<Initial, First, Second>(initial: InitialPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): WrapValue<Second>;
5745
5960
  /**
5746
5961
  * Attempt to pipe a value through a series of functions
5747
5962
  *
5748
5963
  * @param initial Initial value
5749
5964
  * @returns _Piped_ result
5750
5965
  */
5751
- export 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>;
5966
+ export declare function attemptPipe<Initial, First, Second, Third>(initial: InitialPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): WrapValue<Third>;
5752
5967
  /**
5753
5968
  * Attempt to pipe a value through a series of functions
5754
5969
  *
5755
5970
  * @param initial Initial value
5756
5971
  * @returns _Piped_ result
5757
5972
  */
5758
- export 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>;
5973
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth>(initial: InitialPipeValue<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): WrapValue<Fourth>;
5759
5974
  /**
5760
5975
  * Attempt to pipe a value through a series of functions
5761
5976
  *
5762
5977
  * @param initial Initial value
5763
5978
  * @returns _Piped_ result
5764
5979
  */
5765
- export 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>;
5980
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: InitialPipeValue<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>;
5766
5981
  /**
5767
5982
  * Attempt to pipe a value through a series of functions
5768
5983
  *
5769
5984
  * @param initial Initial value
5770
5985
  * @returns _Piped_ result
5771
5986
  */
5772
- export 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>;
5987
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: InitialPipeValue<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>;
5773
5988
  /**
5774
5989
  * Attempt to pipe a value through a series of functions
5775
5990
  *
5776
5991
  * @param initial Initial value
5777
5992
  * @returns _Piped_ result
5778
5993
  */
5779
- export 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>;
5994
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: InitialPipeValue<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>;
5780
5995
  /**
5781
5996
  * Attempt to pipe a value through a series of functions
5782
5997
  *
5783
5998
  * @param initial Initial value
5784
5999
  * @returns _Piped_ result
5785
6000
  */
5786
- export 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>;
6001
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: InitialPipeValue<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>;
5787
6002
  /**
5788
6003
  * Attempt to pipe a value through a series of functions
5789
6004
  *
5790
6005
  * @param initial Initial value
5791
6006
  * @returns _Piped_ result
5792
6007
  */
5793
- export 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>;
6008
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: InitialPipeValue<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>;
5794
6009
  /**
5795
6010
  * Attempt to pipe a value through a series of functions
5796
6011
  *
5797
6012
  * @param initial Initial value
5798
6013
  * @returns _Piped_ result
5799
6014
  */
5800
- export 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>;
6015
+ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: InitialPipeValue<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>;
5801
6016
  /**
5802
6017
  * Attempt to pipe a result through a series of functions
5803
6018
  *
5804
6019
  * @param initial Initial result
5805
6020
  * @returns _Piped_ result
5806
6021
  */
5807
- export declare function attemptPipe<Initial>(initial: GenericCallback | Initial | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): WrapValue<Initial>;
6022
+ export declare function attemptPipe<Initial>(initial: InitialPipeValue<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): WrapValue<Initial>;
5808
6023
  export declare namespace attemptPipe {
5809
6024
  export var async: typeof attemptAsyncPipe;
5810
6025
  }
@@ -6549,7 +6764,7 @@ export declare function unsmush<Value extends PlainObject>(value: Value): Unsmus
6549
6764
  /**
6550
6765
  * Options for assigning values
6551
6766
  */
6552
- type AssignOptions = BaseOptions;
6767
+ type AssignOptions = { [Key in keyof BaseOptions]: BaseOptions[Key]; };
6553
6768
  type BaseOptions = {
6554
6769
  /**
6555
6770
  * Key _(or key epxressions)_ for values that should be replaced
@@ -7664,6 +7879,7 @@ export declare function rgbToHsla(rgb: RGBAColor | RGBColor): HSLAColor;
7664
7879
  export declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
7665
7880
  /**
7666
7881
  * Convert an _RGB(A)_ color to an _HWBA_ color
7882
+
7667
7883
  * _If the value is unable to be converted, a black _HWBA_ color will be returned_
7668
7884
  *
7669
7885
  * _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
@@ -8271,7 +8487,7 @@ export declare function sum(values: number[]): number;
8271
8487
  *
8272
8488
  * @param value Value to check
8273
8489
  * @param minimum Minimum value
8274
- * @param maximum Maximum value
8490
+ * @param maximum Maximum value _(inclusive)_
8275
8491
  * @returns `true` if the value is between the minimum and maximum, otherwise `false`
8276
8492
  */
8277
8493
  export declare function between(value: number, minimum: number, maximum: number): boolean;
@@ -8568,6 +8784,12 @@ export declare namespace queue {
8568
8784
  }
8569
8785
  //#endregion
8570
8786
  //#region src/internal/random.d.ts
8787
+ /**
8788
+ * Get a random number between 0 _(inclusive)_ and 1 _(exclusive)_
8789
+ *
8790
+ * @returns Random number
8791
+ */
8792
+ export declare function getRandom(): number;
8571
8793
  /**
8572
8794
  * Get a random floating-point number
8573
8795
  *
@@ -8685,4 +8907,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
8685
8907
  get(value: Value, update?: boolean): Value | undefined;
8686
8908
  }
8687
8909
  //#endregion
8688
- export { type ArrayComparisonSorter, type ArrayKeySorter, type ArrayKeySorters, type ArraySorter, type ArraySorters, type ArrayValueSorter, type Asserter, type AssignOptions, type Assigner, type AsyncFlow, type AsyncLimiter, type AsyncOnce, type AsyncPlan, type Beacon, type BeaconOptions, type CloneOptions, type Cloner, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type CompareCallback, type ComparisonSorter, type DiffOptions, type DiffResult, type EqualOptions, type Equalizer, type Flow, type FulfilledPromise, type Fuzzy, type FuzzyItem, type FuzzyOptions, type FuzzyResult, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, type HeraldEvents, type HeraldOptions, Key$1 as Key, type KeyedQueue, type Limiter, Logger, type Memoized, type MemoizedOptions, type MergeOptions, type Merger, type NormalizeOptions, type Normalizer, type Observable, type Observer, type Once, type Plan, type PlanFailure, type PlanResult, type PlanSuccess, type PromiseOptions, type PromiseStrategy, type PromisesOptions, type Queue, type QueueOptions, type Queued, type RGBAColor, type RGBColor, type RejectedPromise, type Renderer, type Shaken, type Smushed, type SortDirection, type Sorter, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type TemplateOptions, type Templater, type TemplaterOptions, type TemplaterRenderer, type TimeLogger, type TransformCallback, type TransformCallbacks, type Transformer, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };
8910
+ export { type ArrayComparisonSorter, type ArrayKeySorter, type ArrayKeySorters, type ArraySorter, type ArraySorters, type ArrayValueSorter, type Asserter, type AssignOptions, type Assigner, type AsyncFailure, type AsyncFlow, type AsyncLimiter, type AsyncOnce, type AsyncPlan, type AsyncPlanned, type AsyncStep, type AsyncSuccess, type Beacon, type BeaconOptions, type CloneOptions, type Cloner, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type CompareCallback, type ComparisonSorter, type DiffOptions, type DiffResult, type EqualOptions, type Equalizer, type Failure, type Flow, type FulfilledPromise, type Fuzzy, type FuzzyItem, type FuzzyOptions, type FuzzyResult, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, type HeraldEvents, type HeraldOptions, Key$1 as Key, type KeyedQueue, type Limiter, Logger, type Memoized, type MemoizedOptions, type MergeOptions, type Merger, type NormalizeOptions, type Normalizer, type Observable, type Observer, type Once, type Plan, type PlanError, type PlanOk, type PlanReturned, type Planned, type PromiseOptions, type PromiseStrategy, type PromisesOptions, type Queue, type QueueOptions, type Queued, type RGBAColor, type RGBColor, type RejectedPromise, type Renderer, type Shaken, type Smushed, type SortDirection, type Sorter, type Step, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type Success, type TemplateOptions, type Templater, type TemplaterOptions, type TemplaterRenderer, type TimeLogger, type TransformCallback, type TransformCallbacks, type Transformer, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };