@oscarpalmer/atoms 0.215.0 → 0.217.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 (39) hide show
  1. package/dist/array/swap.d.mts +2 -1
  2. package/dist/color/constants.d.mts +2 -1
  3. package/dist/color/space/rgb.d.mts +1 -0
  4. package/dist/function/index.mjs +1 -2
  5. package/dist/herald.mjs +1 -2
  6. package/dist/index.d.mts +253 -40
  7. package/dist/index.mjs +262 -102
  8. package/dist/internal/plan/index.d.mts +7 -0
  9. package/dist/internal/plan/index.mjs +18 -0
  10. package/dist/{plan/generate.d.mts → internal/plan/plan.generate.d.mts} +2 -2
  11. package/dist/{plan/generate.mjs → internal/plan/plan.generate.mjs} +4 -4
  12. package/dist/models/color.model.d.mts +2 -1
  13. package/dist/models/function/once.model.d.mts +2 -1
  14. package/dist/models/index.d.mts +2 -1
  15. package/dist/models/plan.model.d.mts +158 -29
  16. package/dist/models/plan.model.mjs +13 -5
  17. package/dist/models/queue.model.d.mts +2 -1
  18. package/dist/models/result.model.d.mts +2 -1
  19. package/dist/models/value/value.equal.model.d.mts +2 -1
  20. package/dist/models/value/value.merge.model.d.mts +2 -1
  21. package/dist/models/value/value.misc.model.d.mts +2 -1
  22. package/dist/number.mjs +1 -2
  23. package/dist/plan/index.mjs +14 -14
  24. package/dist/plan/is.d.mts +59 -3
  25. package/dist/plan/is.mjs +82 -10
  26. package/dist/plan/misc.d.mts +51 -3
  27. package/dist/plan/misc.mjs +47 -30
  28. package/dist/plan/models.d.mts +2 -2
  29. package/dist/plan/result.d.mts +15 -3
  30. package/dist/plan/result.mjs +5 -11
  31. package/dist/plan/run.d.mts +1 -3
  32. package/dist/plan/run.mjs +5 -11
  33. package/dist/plan/use.d.mts +36 -0
  34. package/dist/plan/use.mjs +69 -0
  35. package/dist/promise/models.mjs +1 -2
  36. package/dist/result/index.mjs +1 -2
  37. package/dist/result/work/pipe.d.mts +2 -1
  38. package/dist/subscription.mjs +1 -2
  39. package/package.json +8 -10
@@ -182,4 +182,5 @@ declare function swapIndices<Item>(array: Item[], first: number, second: number)
182
182
  export declare namespace swap {
183
183
  export var indices: typeof swapIndices;
184
184
  }
185
- //#endregion
185
+ //#endregion
186
+ export {};
@@ -55,4 +55,5 @@ export declare const COLOR_SRGB: {
55
55
  luminanceThreshold: number;
56
56
  };
57
57
  export declare const colorSubscription: SubscriptionProperty;
58
- //#endregion
58
+ //#endregion
59
+ export {};
@@ -52,6 +52,7 @@ export declare function rgbToHsla(rgb: RGBAColor | RGBColor): HSLAColor;
52
52
  export declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
53
53
  /**
54
54
  * Convert an _RGB(A)_ color to an _HWBA_ color
55
+
55
56
  * _If the value is unable to be converted, a black _HWBA_ color will be returned_
56
57
  *
57
58
  * _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
@@ -1,2 +1 @@
1
- import { noop } from "../internal/function/misc.mjs";
2
- export { noop };
1
+ export { noop } from "../internal/function/misc.mjs";
package/dist/herald.mjs CHANGED
@@ -1,2 +1 @@
1
- import { herald, isHerald, isHeraldEvents, isHeraldSubscription } from "./internal/herald.mjs";
2
- export { herald, isHerald, isHeraldEvents, isHeraldSubscription };
1
+ export { herald, isHerald, isHeraldEvents, isHeraldSubscription } from "./internal/herald.mjs";
package/dist/index.d.mts CHANGED
@@ -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
4745
4797
  */
4746
- type PlanResult<Success, Failure> = PlanSuccess<Success> | PlanFailure<Failure>;
4747
- type PlanState = {
4748
- generator(...parameters: unknown[]): Generator;
4749
- } & BaseState<typeof PLAN_TYPE_PLAN_SYNC>;
4798
+ type Planned<Value, Error> = Success<Value> | Failure<Error>;
4799
+ /**
4800
+ * A single step within a plan of execution
4801
+ */
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,6 @@ 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;
4765
4828
  //#endregion
4766
4829
  //#region src/plan/result.d.ts
4767
4830
  /**
@@ -4769,6 +4832,9 @@ declare const PLAN_TYPE_PLAN_SYNC: PlanType;
4769
4832
  *
4770
4833
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4771
4834
  *
4835
+ * @param generator Generator to run
4836
+ * @param parameters Parameters for starting the run
4837
+ * @param signal Optional abort signal
4772
4838
  * @returns Promised result
4773
4839
  */
4774
4840
  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 +4843,8 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4777
4843
  *
4778
4844
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4779
4845
  *
4846
+ * @param generator Generator to run
4847
+ * @param signal Optional abort signal
4780
4848
  * @returns Promised result
4781
4849
  */
4782
4850
  export declare function asyncAttemptRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4785,6 +4853,9 @@ export declare function asyncAttemptRun<Yielded, Returned>(generator: () => Asyn
4785
4853
  *
4786
4854
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4787
4855
  *
4856
+ * @param plan Plan to run
4857
+ * @param parameters Parameters for starting the run
4858
+ * @param signal Optional abort signal
4788
4859
  * @returns Promised result
4789
4860
  */
4790
4861
  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 +4864,8 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
4793
4864
  *
4794
4865
  * _Returns a promised {@link Result} instead of a raw value or throwing an error_
4795
4866
  *
4867
+ * @param plan Plan to run
4868
+ * @param signal Optional abort signal
4796
4869
  * @returns Promised result
4797
4870
  */
4798
4871
  export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<Result<PlanOk<Returned>, PlanError<Yielded, Returned>>>;
@@ -4801,6 +4874,8 @@ export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yield
4801
4874
  *
4802
4875
  * _Returns a {@link Result} instead of a raw value or throwing an error_
4803
4876
  *
4877
+ * @param generator Generator to run
4878
+ * @param parameters Parameters for starting the run
4804
4879
  * @returns Result
4805
4880
  */
4806
4881
  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 +4884,11 @@ export declare function attemptRun<Yielded, Returned, Parameters extends unknown
4809
4884
  *
4810
4885
  * _Returns a {@link Result} instead of a raw value or throwing an error_
4811
4886
  *
4887
+ * @param plan Plan to run
4888
+ * @param parameters Parameters for starting the run
4812
4889
  * @returns Result
4813
4890
  */
4814
4891
  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
4892
  export declare namespace attemptRun {
4818
4893
  export var async: typeof asyncAttemptRun;
4819
4894
  }
@@ -4869,8 +4944,6 @@ export declare function run<Yielded, Returned, Parameters extends unknown[]>(gen
4869
4944
  * @returns Result
4870
4945
  */
4871
4946
  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
4947
  export declare namespace asyncRun {
4875
4948
  export var attempt: typeof asyncAttemptRun;
4876
4949
  }
@@ -4896,13 +4969,27 @@ export declare function plan<Yielded, Returned, Parameters extends unknown[]>(ge
4896
4969
  export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
4897
4970
  //#endregion
4898
4971
  //#region src/plan/is.d.ts
4972
+ /**
4973
+ * Is the value an asynchronous, immediately failing plan?
4974
+ *
4975
+ * @param value Value to check
4976
+ * @returns `true` if the value is an asynchronous, immediately failing plan, otherwise `false`
4977
+ */
4978
+ export declare function isAsyncFailure<Value = unknown>(value: unknown): value is AsyncFailure<Value>;
4979
+ /**
4980
+ * Is the value an asynchronous generator?
4981
+ *
4982
+ * @param value Value to check
4983
+ * @returns `true` if the value is an asynchronous generator, otherwise `false`
4984
+ */
4985
+ export declare function isAsyncGenerator<Y = unknown, R = unknown, N = unknown>(value: unknown): value is AsyncGenerator<Y, R, N>;
4899
4986
  /**
4900
4987
  * Is the value an asynchronous generator function?
4901
4988
  *
4902
4989
  * @param value Value to check
4903
4990
  * @returns `true` if the value is an asynchronous generator function, otherwise `false`
4904
4991
  */
4905
- export declare function isAsyncGenerator(value: unknown): value is () => AsyncGenerator;
4992
+ export declare function isAsyncGeneratorFunction<Y = unknown, R = unknown, N = unknown>(value: unknown): value is () => AsyncGenerator<Y, R, N>;
4906
4993
  /**
4907
4994
  * Is the value an asynchronous plan?
4908
4995
  *
@@ -4910,13 +4997,41 @@ export declare function isAsyncGenerator(value: unknown): value is () => AsyncGe
4910
4997
  * @returns `true` if the value is an asynchronous plan, otherwise `false`
4911
4998
  */
4912
4999
  export declare function isAsyncPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is AsyncPlan<Yielded, Returned, Parameters>;
5000
+ /**
5001
+ * Is the value an asynchronous step?
5002
+ *
5003
+ * @param value Value to check
5004
+ * @returns `true` if the value is an asynchronous step, otherwise `false`
5005
+ */
5006
+ export declare function isAsyncStep<Value = unknown>(value: unknown): value is AsyncStep<Value>;
5007
+ /**
5008
+ * Is the value an asynchronous, immediately successful plan?
5009
+ *
5010
+ * @param value Value to check
5011
+ * @returns `true` if the value is an asynchronous, immediately successful plan, otherwise `false`
5012
+ */
5013
+ export declare function isAsyncSuccess<Value = unknown>(value: unknown): value is AsyncSuccess<Value>;
5014
+ /**
5015
+ * Is the value an immediately failing plan?
5016
+ *
5017
+ * @param value Value to check
5018
+ * @returns `true` if the value is an immediately failing plan, otherwise `false`
5019
+ */
5020
+ export declare function isFailure<Value = unknown>(value: unknown): value is Failure<Value>;
5021
+ /**
5022
+ * Is the value a generator?
5023
+ *
5024
+ * @param value Value to check
5025
+ * @returns `true` if the value is a generator, otherwise `false`
5026
+ */
5027
+ export declare function isGenerator<Y = unknown, R = unknown, N = unknown>(value: unknown): value is Generator<Y, R, N>;
4913
5028
  /**
4914
5029
  * Is the value a generator function?
4915
5030
  *
4916
5031
  * @param value Value to check
4917
5032
  * @returns `true` if the value is a generator function, otherwise `false`
4918
5033
  */
4919
- export declare function isGenerator(value: unknown): value is () => Generator;
5034
+ export declare function isGeneratorFunction<Y = unknown, R = unknown, N = unknown>(value: unknown): value is () => Generator<Y, R, N>;
4920
5035
  /**
4921
5036
  * Is the value a plan?
4922
5037
  *
@@ -4924,22 +5039,119 @@ export declare function isGenerator(value: unknown): value is () => Generator;
4924
5039
  * @returns `true` if the value is a plan, otherwise `false`
4925
5040
  */
4926
5041
  export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is Plan<Yielded, Returned, Parameters>;
5042
+ /**
5043
+ * Is the value a step?
5044
+ *
5045
+ * @param value Value to check
5046
+ * @returns `true` if the value is a step, otherwise `false`
5047
+ */
5048
+ export declare function isStep<Value = unknown>(value: unknown): value is Step<Value>;
5049
+ /**
5050
+ * Is the value an immediately successful plan?
5051
+ *
5052
+ * @param value Value to check
5053
+ * @returns `true` if the value is an immediately successful plan, otherwise `false`
5054
+ */
5055
+ export declare function isSuccess<Value = unknown>(value: unknown): value is Success<Value>;
4927
5056
  //#endregion
4928
5057
  //#region src/plan/misc.d.ts
5058
+ /**
5059
+ * Create an immediately failing plan
5060
+ *
5061
+ * @param callback Failure callback
5062
+ * @returns Plan failure
5063
+ */
5064
+ export declare function asyncFail<Value>(callback: () => Value): AsyncFailure<Awaited<Value>>;
4929
5065
  /**
4930
5066
  * Create an immediately failing plan
4931
5067
  *
4932
5068
  * @param value Failure value
4933
5069
  * @returns Plan failure
4934
5070
  */
4935
- export declare function fail<Value>(value: Value): PlanFailure<Value>;
5071
+ export declare function asyncFail<Value>(value: Value): AsyncFailure<Awaited<Value>>;
5072
+ /**
5073
+ * Create an immediately succeeding plan
5074
+ *
5075
+ * @param callback Success callback
5076
+ * @returns Plan success
5077
+ */
5078
+ export declare function asyncSucceed<Value>(callback: () => Value): AsyncSuccess<Awaited<Value>>;
4936
5079
  /**
4937
5080
  * Create an immediately succeeding plan
4938
5081
  *
4939
5082
  * @param value Success value
4940
5083
  * @returns Plan success
4941
5084
  */
4942
- export declare function succeed<Value>(value: Value): PlanSuccess<Value>;
5085
+ export declare function asyncSucceed<Value>(value: Value): AsyncSuccess<Awaited<Value>>;
5086
+ /**
5087
+ * Create an immediately failing plan
5088
+ *
5089
+ * @param callback Failure callback
5090
+ * @returns Plan failure
5091
+ */
5092
+ export declare function fail<Value>(callback: () => Value): Failure<Value>;
5093
+ /**
5094
+ * Create an immediately failing plan
5095
+ *
5096
+ * @param value Failure value
5097
+ * @returns Plan failure
5098
+ */
5099
+ export declare function fail<Value>(value: Value): Failure<Value>;
5100
+ /**
5101
+ * Create an immediately succeeding plan
5102
+ *
5103
+ * @param callback Success callback
5104
+ * @returns Plan success
5105
+ */
5106
+ export declare function succeed<Value>(callback: () => Value): Success<Value>;
5107
+ /**
5108
+ * Create an immediately succeeding plan
5109
+ *
5110
+ * @param value Success value
5111
+ * @returns Plan success
5112
+ */
5113
+ export declare function succeed<Value>(value: Value): Success<Value>;
5114
+ export declare namespace fail {
5115
+ export var async: typeof asyncFail;
5116
+ }
5117
+ export declare namespace succeed {
5118
+ export var async: typeof asyncSucceed;
5119
+ }
5120
+ //#endregion
5121
+ //#region src/plan/use.d.ts
5122
+ /**
5123
+ * Create an asynchronous step from a callback
5124
+ *
5125
+ * @param callback Callback
5126
+ * @returns An asynchronous step
5127
+ */
5128
+ export declare function asyncUse<Value>(callback: () => Value & AsyncStepValue<Value>): AsyncStep<Value>;
5129
+ /**
5130
+ * Create an asynchronous step from a value
5131
+ *
5132
+ * @param value Value
5133
+ * @returns An asynchronous step
5134
+ */
5135
+ export declare function asyncUse<Value>(value: Value & AsyncStepValue<Value>): AsyncStep<Value>;
5136
+ /**
5137
+ * Create a step from a callback
5138
+ *
5139
+ * @param callback Callback
5140
+ * @returns A step
5141
+ * @throws Error If the input is invalid
5142
+ */
5143
+ export declare function use<Value>(callback: () => Value & StepValue<Value>): Step<Value>;
5144
+ /**
5145
+ * Create a step from a value
5146
+ *
5147
+ * @param value Value
5148
+ * @returns A step
5149
+ * @throws Error If the input is invalid
5150
+ */
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 = {
@@ -7664,6 +7876,7 @@ export declare function rgbToHsla(rgb: RGBAColor | RGBColor): HSLAColor;
7664
7876
  export declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
7665
7877
  /**
7666
7878
  * Convert an _RGB(A)_ color to an _HWBA_ color
7879
+
7667
7880
  * _If the value is unable to be converted, a black _HWBA_ color will be returned_
7668
7881
  *
7669
7882
  * _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
@@ -8685,4 +8898,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
8685
8898
  get(value: Value, update?: boolean): Value | undefined;
8686
8899
  }
8687
8900
  //#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 };
8901
+ 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 };