@oscarpalmer/atoms 0.210.0 → 0.212.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.
- package/dist/array/sort.d.mts +1 -1
- package/dist/color/models.d.mts +11 -11
- package/dist/herald.d.mts +2 -1
- package/dist/index.d.mts +142 -78
- package/dist/index.mjs +90 -52
- package/dist/internal/aborter.d.mts +1 -1
- package/dist/internal/herald.d.mts +2 -38
- package/dist/internal/herald.mjs +4 -14
- package/dist/internal/models/herald.model.d.mts +60 -0
- package/dist/internal/models/herald.model.mjs +15 -0
- package/dist/internal/models/plan.model.d.mts +27 -10
- package/dist/internal/models/result.model.d.mts +2 -2
- package/dist/internal/plan.d.mts +4 -4
- package/dist/internal/plan.mjs +2 -0
- package/dist/internal/subscription.d.mts +2 -2
- package/dist/internal/value/handlers.d.mts +3 -3
- package/dist/internal/value/set.mjs +1 -1
- package/dist/models.d.mts +3 -3
- package/dist/plan/generate.d.mts +4 -0
- package/dist/plan/generate.mjs +50 -0
- package/dist/plan/index.d.mts +7 -32
- package/dist/plan/index.mjs +7 -59
- package/dist/plan/result.d.mts +41 -0
- package/dist/plan/result.mjs +24 -0
- package/dist/plan/run.d.mts +41 -0
- package/dist/plan/run.mjs +26 -0
- package/dist/promise/models.d.mts +2 -2
- package/package.json +1 -1
package/dist/array/sort.d.mts
CHANGED
package/dist/color/models.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subscription } from "../internal/subscription.mjs";
|
|
2
|
-
import { Herald, HeraldEvents } from "../internal/herald.mjs";
|
|
2
|
+
import { Herald, HeraldEvents } from "../internal/models/herald.model.mjs";
|
|
3
3
|
import { COLOR_SYMBOL } from "./constants.mjs";
|
|
4
4
|
//#region src/color/models.d.ts
|
|
5
5
|
export type Alpha = {
|
|
@@ -187,16 +187,16 @@ export type Color = {
|
|
|
187
187
|
unsubscribe(): void;
|
|
188
188
|
};
|
|
189
189
|
export type ColorChanges = {
|
|
190
|
-
"*"
|
|
191
|
-
alpha
|
|
192
|
-
hex
|
|
193
|
-
hexa
|
|
194
|
-
hsl
|
|
195
|
-
hsla
|
|
196
|
-
hwb
|
|
197
|
-
hwba
|
|
198
|
-
rgb
|
|
199
|
-
rgba
|
|
190
|
+
"*"(value: Color): void;
|
|
191
|
+
alpha(value: number): void;
|
|
192
|
+
hex(value: string): void;
|
|
193
|
+
hexa(value: string): void;
|
|
194
|
+
hsl(value: HSLColor): void;
|
|
195
|
+
hsla(value: HSLAColor): void;
|
|
196
|
+
hwb(value: HWBColor): void;
|
|
197
|
+
hwba(value: HWBAColor): void;
|
|
198
|
+
rgb(value: RGBColor): void;
|
|
199
|
+
rgba(value: RGBAColor): void;
|
|
200
200
|
};
|
|
201
201
|
export type ColorDefaults = {
|
|
202
202
|
alpha: Alpha;
|
package/dist/herald.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Herald, HeraldEvents } from "./internal/models/herald.model.mjs";
|
|
1
2
|
import { herald, isHerald, isHeraldEvents, isHeraldSubscription } from "./internal/herald.mjs";
|
|
2
|
-
export { herald, isHerald, isHeraldEvents, isHeraldSubscription };
|
|
3
|
+
export { type Herald, type HeraldEvents, herald, isHerald, isHeraldEvents, isHeraldSubscription };
|
package/dist/index.d.mts
CHANGED
|
@@ -90,7 +90,7 @@ export type OnceAsync<Callback extends GenericAsyncCallback> = {
|
|
|
90
90
|
* @param parameters Callback parameters
|
|
91
91
|
* @returns Call result
|
|
92
92
|
*/
|
|
93
|
-
run
|
|
93
|
+
run(...parameters: Parameters<Callback>): ReturnType<Callback>;
|
|
94
94
|
} & OnceProperties;
|
|
95
95
|
/**
|
|
96
96
|
* A callback function that can only be called once, returning the same value on subsequent calls
|
|
@@ -102,7 +102,7 @@ export type Once<Callback extends GenericCallback> = {
|
|
|
102
102
|
* @param parameters Callback parameters
|
|
103
103
|
* @returns Call result
|
|
104
104
|
*/
|
|
105
|
-
run
|
|
105
|
+
run(...parameters: Parameters<Callback>): ReturnType<Callback>;
|
|
106
106
|
} & OnceProperties;
|
|
107
107
|
type OnceProperties = {
|
|
108
108
|
/**
|
|
@@ -116,7 +116,7 @@ type OnceProperties = {
|
|
|
116
116
|
/**
|
|
117
117
|
* Clear the callback's cached value
|
|
118
118
|
*/
|
|
119
|
-
clear
|
|
119
|
+
clear(): void;
|
|
120
120
|
};
|
|
121
121
|
/**
|
|
122
122
|
* A generic object
|
|
@@ -2615,7 +2615,7 @@ export type ArrayValueSorter<Item> = {
|
|
|
2615
2615
|
/**
|
|
2616
2616
|
* Value to sort by
|
|
2617
2617
|
*/
|
|
2618
|
-
value
|
|
2618
|
+
value(item: Item): unknown;
|
|
2619
2619
|
};
|
|
2620
2620
|
/**
|
|
2621
2621
|
* Comparator to use when comparing items and values
|
|
@@ -3711,14 +3711,14 @@ export type ResultMatch<Value, Returned, E = Error> = {
|
|
|
3711
3711
|
* @param original Original error, if available
|
|
3712
3712
|
* @returns Value to return
|
|
3713
3713
|
*/
|
|
3714
|
-
error
|
|
3714
|
+
error(error: E, original?: Error): Returned;
|
|
3715
3715
|
/**
|
|
3716
3716
|
* Callback for ok result
|
|
3717
3717
|
*
|
|
3718
3718
|
* @param value Ok value
|
|
3719
3719
|
* @returns Value to return
|
|
3720
3720
|
*/
|
|
3721
|
-
ok
|
|
3721
|
+
ok(value: Value): Returned;
|
|
3722
3722
|
};
|
|
3723
3723
|
/**
|
|
3724
3724
|
* Unwrap a result value
|
|
@@ -4257,9 +4257,9 @@ type BaseHandler = {
|
|
|
4257
4257
|
handlers: WeakMap<WeakKey, string | GenericCallback>;
|
|
4258
4258
|
options: BaseHandlerOptions;
|
|
4259
4259
|
owner: GenericCallback;
|
|
4260
|
-
deregister
|
|
4261
|
-
get
|
|
4262
|
-
register
|
|
4260
|
+
deregister(constructor: Constructor): void;
|
|
4261
|
+
get(first: unknown, second: unknown): string | GenericCallback | undefined;
|
|
4262
|
+
register(constructor: Constructor, handler?: string | GenericCallback): void;
|
|
4263
4263
|
};
|
|
4264
4264
|
type BaseHandlerOptions = {
|
|
4265
4265
|
callback: GenericCallback;
|
|
@@ -4591,86 +4591,148 @@ export declare function setValue<Data extends PlainObject>(data: Data, path: str
|
|
|
4591
4591
|
/**
|
|
4592
4592
|
* An asynchronous plan of execution that can yield intermediate results and eventually return a result
|
|
4593
4593
|
*/
|
|
4594
|
-
type AsyncPlan<Yielded, Returned> = {
|
|
4594
|
+
type AsyncPlan<Yielded, Returned, Parameters extends unknown[]> = {
|
|
4595
4595
|
/**
|
|
4596
4596
|
* Get the asynchronous generator for the plan
|
|
4597
4597
|
*
|
|
4598
4598
|
* @returns Asynchronous generator
|
|
4599
4599
|
*/
|
|
4600
4600
|
[Symbol.asyncIterator]: () => AsyncGenerator<Yielded, Returned, unknown>;
|
|
4601
|
+
/**
|
|
4602
|
+
* Attempt to run the plan to completion
|
|
4603
|
+
*
|
|
4604
|
+
* _Returns a promised {@link Result} instead of a raw value or throwing an error_
|
|
4605
|
+
*
|
|
4606
|
+
* @returns Promised result
|
|
4607
|
+
*/
|
|
4608
|
+
attempt(...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
|
|
4601
4609
|
/**
|
|
4602
4610
|
* Run the plan to completion
|
|
4603
4611
|
*
|
|
4604
4612
|
* @throws {PlanError<Yielded, Returned>}
|
|
4605
4613
|
* @returns Result
|
|
4606
4614
|
*/
|
|
4607
|
-
run:
|
|
4615
|
+
run(...parameters: Parameters): Promise<PlanResult<Returned>>;
|
|
4608
4616
|
};
|
|
4609
4617
|
/**
|
|
4610
4618
|
* A plan of execution that can yield intermediate results and eventually return a result
|
|
4611
4619
|
*/
|
|
4612
|
-
type Plan<Yielded, Returned> = {
|
|
4620
|
+
type Plan<Yielded, Returned, Parameters extends unknown[]> = {
|
|
4613
4621
|
/**
|
|
4614
4622
|
* Get the generator for the plan
|
|
4615
4623
|
*
|
|
4616
4624
|
* @returns Generator
|
|
4617
4625
|
*/
|
|
4618
4626
|
[Symbol.iterator]: () => Generator<Yielded, Returned, unknown>;
|
|
4627
|
+
/**
|
|
4628
|
+
* Attempt to run the plan to completion
|
|
4629
|
+
*
|
|
4630
|
+
* _Returns a {@link Result} instead of a raw value or throwing an error_
|
|
4631
|
+
*
|
|
4632
|
+
* @returns Result
|
|
4633
|
+
*/
|
|
4634
|
+
attempt(...parameters: Parameters): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
|
|
4619
4635
|
/**
|
|
4620
4636
|
* Run the plan to completion
|
|
4621
4637
|
*
|
|
4622
4638
|
* @throws {PlanError<Yielded, Returned>}
|
|
4623
4639
|
* @returns Result
|
|
4624
4640
|
*/
|
|
4625
|
-
run:
|
|
4641
|
+
run(...parameters: Parameters): PlanResult<Returned>;
|
|
4626
4642
|
};
|
|
4627
|
-
type PlanErrorValues<Original> = Original extends Error ? Original : never;
|
|
4643
|
+
type PlanErrorValues<Original> = Original extends Error ? Original : Original extends Err<infer Error> ? Error : Original extends Result<infer _, infer Error> ? Error : never;
|
|
4628
4644
|
type PlanError<Yielded, Returned> = PlanErrorValues<Yielded> | PlanErrorValues<Returned> | Error;
|
|
4629
|
-
type PlanResult<Returned> = Returned extends Error ? never : Returned;
|
|
4645
|
+
type PlanResult<Returned> = Returned extends Error ? never : Returned extends Err<infer _> ? never : Returned extends Ok<infer Value> ? Value : Returned extends Result<infer Value, infer _> ? Value : Returned;
|
|
4630
4646
|
//#endregion
|
|
4631
|
-
//#region src/plan/
|
|
4647
|
+
//#region src/plan/result.d.ts
|
|
4632
4648
|
/**
|
|
4633
|
-
*
|
|
4649
|
+
* Attempt to run the generator to completion
|
|
4634
4650
|
*
|
|
4635
|
-
* @
|
|
4636
|
-
*
|
|
4651
|
+
* _Returns a promised {@link Result} instead of a raw value or throwing an error_
|
|
4652
|
+
*
|
|
4653
|
+
* @returns Promised result
|
|
4637
4654
|
*/
|
|
4638
|
-
export declare function
|
|
4655
|
+
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned, unknown>, ...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
|
|
4639
4656
|
/**
|
|
4640
|
-
*
|
|
4657
|
+
* Attempt to run the plan to completion
|
|
4641
4658
|
*
|
|
4642
|
-
* @
|
|
4643
|
-
*
|
|
4659
|
+
* _Returns a promised {@link Result} instead of a raw value or throwing an error_
|
|
4660
|
+
*
|
|
4661
|
+
* @returns Promised result
|
|
4644
4662
|
*/
|
|
4645
|
-
export declare function
|
|
4663
|
+
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<Result<PlanResult<Returned>, PlanError<Yielded, Returned>>>;
|
|
4664
|
+
/**
|
|
4665
|
+
* Attempt to run the generator to completion
|
|
4666
|
+
*
|
|
4667
|
+
* _Returns a {@link Result} instead of a raw value or throwing an error_
|
|
4668
|
+
*
|
|
4669
|
+
* @returns Result
|
|
4670
|
+
*/
|
|
4671
|
+
export declare function attemptRun<Yielded, Returned>(generator: () => Generator<Yielded, Returned, unknown>, ...parameters: Parameters<typeof generator>): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
|
|
4672
|
+
/**
|
|
4673
|
+
* Attempt to run the plan to completion
|
|
4674
|
+
*
|
|
4675
|
+
* _Returns a {@link Result} instead of a raw value or throwing an error_
|
|
4676
|
+
*
|
|
4677
|
+
* @returns Result
|
|
4678
|
+
*/
|
|
4679
|
+
export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlanResult<Returned>, PlanError<Yielded, Returned>>;
|
|
4680
|
+
export declare namespace attemptRun {
|
|
4681
|
+
export var async: typeof asyncAttemptRun;
|
|
4682
|
+
}
|
|
4683
|
+
//#endregion
|
|
4684
|
+
//#region src/plan/run.d.ts
|
|
4646
4685
|
/**
|
|
4647
4686
|
* Run an asynchronous generator to completion
|
|
4648
4687
|
*
|
|
4649
4688
|
* @param generator Generator to run
|
|
4650
4689
|
* @returns Result
|
|
4651
4690
|
*/
|
|
4652
|
-
export declare function
|
|
4691
|
+
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned, unknown>, ...parameters: Parameters): Promise<PlanResult<Returned>>;
|
|
4653
4692
|
/**
|
|
4654
4693
|
* Run an asynchronous plan to completion
|
|
4655
4694
|
*
|
|
4656
4695
|
* @param plan Plan to run
|
|
4657
4696
|
* @returns Result
|
|
4658
4697
|
*/
|
|
4659
|
-
export declare function
|
|
4698
|
+
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, ...parameters: Parameters): Promise<PlanResult<Returned>>;
|
|
4660
4699
|
/**
|
|
4661
4700
|
* Run a generator to completion
|
|
4662
4701
|
*
|
|
4663
4702
|
* @param generator Generator to run
|
|
4664
4703
|
* @returns Result
|
|
4665
4704
|
*/
|
|
4666
|
-
export declare function run<Yielded, Returned>(generator: () => Generator<Yielded, Returned
|
|
4705
|
+
export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned, unknown>, ...parameters: Parameters): PlanResult<Returned> | PlanError<Yielded, Returned>;
|
|
4667
4706
|
/**
|
|
4668
4707
|
* Run a plan to completion
|
|
4669
4708
|
*
|
|
4670
4709
|
* @param plan Plan to run
|
|
4671
4710
|
* @returns Result
|
|
4672
4711
|
*/
|
|
4673
|
-
export declare function run<Yielded, Returned>(plan: Plan<Yielded, Returned
|
|
4712
|
+
export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlanResult<Returned> | PlanError<Yielded, Returned>;
|
|
4713
|
+
export declare namespace asyncRun {
|
|
4714
|
+
export var attempt: typeof asyncAttemptRun;
|
|
4715
|
+
}
|
|
4716
|
+
export declare namespace run {
|
|
4717
|
+
export var async: typeof asyncRun;
|
|
4718
|
+
export var attempt: typeof attemptRun;
|
|
4719
|
+
}
|
|
4720
|
+
//#endregion
|
|
4721
|
+
//#region src/plan/index.d.ts
|
|
4722
|
+
/**
|
|
4723
|
+
* Create a plan for an asynchronous generator function
|
|
4724
|
+
*
|
|
4725
|
+
* @param generator Generator to plan for
|
|
4726
|
+
* @returns Generator plan
|
|
4727
|
+
*/
|
|
4728
|
+
export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>): AsyncPlan<Yielded, Returned, Parameters>;
|
|
4729
|
+
/**
|
|
4730
|
+
* Create a plan for a generator function
|
|
4731
|
+
*
|
|
4732
|
+
* @param generator Generator to plan for
|
|
4733
|
+
* @returns Generator plan
|
|
4734
|
+
*/
|
|
4735
|
+
export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
|
|
4674
4736
|
//#endregion
|
|
4675
4737
|
//#region src/internal/plan.d.ts
|
|
4676
4738
|
/**
|
|
@@ -4679,7 +4741,7 @@ export declare function run<Yielded, Returned>(plan: Plan<Yielded, Returned>): P
|
|
|
4679
4741
|
* @param reason Failure reason
|
|
4680
4742
|
* @returns Failing generator
|
|
4681
4743
|
*/
|
|
4682
|
-
export declare function fail<Reason>(reason: Reason): Generator<
|
|
4744
|
+
export declare function fail<Reason>(reason: Reason): Generator<unknown, never>;
|
|
4683
4745
|
/**
|
|
4684
4746
|
* Is the value an asynchronous generator function?
|
|
4685
4747
|
*
|
|
@@ -4693,7 +4755,7 @@ export declare function isAsyncGenerator(value: unknown): value is () => AsyncGe
|
|
|
4693
4755
|
* @param value Value to check
|
|
4694
4756
|
* @returns `true` if the value is an asynchronous plan, otherwise `false`
|
|
4695
4757
|
*/
|
|
4696
|
-
export declare function isAsyncPlan<Yielded = unknown, Returned = unknown>(value: unknown): value is AsyncPlan<Yielded, Returned>;
|
|
4758
|
+
export declare function isAsyncPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is AsyncPlan<Yielded, Returned, Parameters>;
|
|
4697
4759
|
/**
|
|
4698
4760
|
* Is the value a generator function?
|
|
4699
4761
|
*
|
|
@@ -4707,20 +4769,20 @@ export declare function isGenerator(value: unknown): value is () => Generator;
|
|
|
4707
4769
|
* @param value Value to check
|
|
4708
4770
|
* @returns `true` if the value is a plan, otherwise `false`
|
|
4709
4771
|
*/
|
|
4710
|
-
export declare function isPlan<Yielded = unknown, Returned = unknown>(value: unknown): value is Plan<Yielded, Returned>;
|
|
4772
|
+
export declare function isPlan<Yielded = unknown, Returned = unknown, Parameters extends unknown[] = unknown[]>(value: unknown): value is Plan<Yielded, Returned, Parameters>;
|
|
4711
4773
|
/**
|
|
4712
4774
|
* Create an immediately succeeding generator
|
|
4713
4775
|
*
|
|
4714
4776
|
* @param value Success value
|
|
4715
4777
|
* @returns Succeeding generator
|
|
4716
4778
|
*/
|
|
4717
|
-
export declare function succeed<Value>(value: Value): Generator<
|
|
4779
|
+
export declare function succeed<Value>(value: Value): Generator<unknown, Value>;
|
|
4718
4780
|
//#endregion
|
|
4719
4781
|
//#region src/internal/aborter.d.ts
|
|
4720
4782
|
type Aborter = {
|
|
4721
4783
|
callback: GenericCallback;
|
|
4784
|
+
cancel(): void;
|
|
4722
4785
|
signal: AbortSignal;
|
|
4723
|
-
cancel: () => void;
|
|
4724
4786
|
};
|
|
4725
4787
|
//#endregion
|
|
4726
4788
|
//#region src/promise/constants.d.ts
|
|
@@ -4759,8 +4821,8 @@ export type PromiseData = {
|
|
|
4759
4821
|
result: ArrayOrPlainObject;
|
|
4760
4822
|
};
|
|
4761
4823
|
export type PromiseHandlers = {
|
|
4762
|
-
resolve
|
|
4763
|
-
reject
|
|
4824
|
+
resolve(value: unknown[]): void;
|
|
4825
|
+
reject(reason: unknown): void;
|
|
4764
4826
|
};
|
|
4765
4827
|
/**
|
|
4766
4828
|
* Options for a _Promise_-handling function
|
|
@@ -6556,14 +6618,14 @@ type Subscriptions<Value = unknown> = {
|
|
|
6556
6618
|
/**
|
|
6557
6619
|
* Clear all subscriptions
|
|
6558
6620
|
*/
|
|
6559
|
-
clear
|
|
6621
|
+
clear(): void;
|
|
6560
6622
|
/**
|
|
6561
6623
|
* Create _(or retrieve)_ a subscription
|
|
6562
6624
|
*
|
|
6563
6625
|
* @param parameters Subscription parameters
|
|
6564
6626
|
* @returns Tuple holding subsccription and existing boolean
|
|
6565
6627
|
*/
|
|
6566
|
-
create
|
|
6628
|
+
create(parameters: SubscriptionParameters): [Subscription, boolean];
|
|
6567
6629
|
};
|
|
6568
6630
|
/**
|
|
6569
6631
|
* Parameters for creating a subscription store
|
|
@@ -6733,7 +6795,7 @@ export declare function isBeaconSubscription(value: unknown): value is Subscript
|
|
|
6733
6795
|
*/
|
|
6734
6796
|
export declare function isObservable<Value = unknown>(value: unknown): value is Observable<Value>;
|
|
6735
6797
|
//#endregion
|
|
6736
|
-
//#region src/internal/herald.d.ts
|
|
6798
|
+
//#region src/internal/models/herald.model.d.ts
|
|
6737
6799
|
type Herald<Events extends Record<string, GenericCallback>> = {
|
|
6738
6800
|
readonly events: HeraldEvents<Events>;
|
|
6739
6801
|
/**
|
|
@@ -6771,35 +6833,6 @@ type HeraldOptions<Events extends Record<string, GenericCallback>> = {
|
|
|
6771
6833
|
property?: SubscriptionProperty;
|
|
6772
6834
|
onCreate?: HeraldOnCreate<Events>;
|
|
6773
6835
|
};
|
|
6774
|
-
/**
|
|
6775
|
-
* Create a _Herald_ for announcing named events
|
|
6776
|
-
*
|
|
6777
|
-
* @param names Event names
|
|
6778
|
-
* @param property Optional property for subscription identification _(defaults to `$herald`)_
|
|
6779
|
-
* @returns _Herald_ instance
|
|
6780
|
-
*/
|
|
6781
|
-
export declare function herald<Events extends Record<string, GenericCallback>>(options: HeraldOptions<Events>): Herald<Events>;
|
|
6782
|
-
/**
|
|
6783
|
-
* Is the value a herald?
|
|
6784
|
-
*
|
|
6785
|
-
* @param value Value to check
|
|
6786
|
-
* @returns `true` if the value is a herald, otherwise `false`
|
|
6787
|
-
*/
|
|
6788
|
-
export declare function isHerald<Events extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is Herald<Events>;
|
|
6789
|
-
/**
|
|
6790
|
-
* Is the value events for a herald?
|
|
6791
|
-
*
|
|
6792
|
-
* @param value Value to check
|
|
6793
|
-
* @returns `true` if the value is events for a herald, otherwise `false`
|
|
6794
|
-
*/
|
|
6795
|
-
export declare function isHeraldEvents<Events extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is HeraldEvents<Events>;
|
|
6796
|
-
/**
|
|
6797
|
-
* Is the value a herald subscription?
|
|
6798
|
-
*
|
|
6799
|
-
* @param value Value to check
|
|
6800
|
-
* @returns `true` if the value is a herald subscription, otherwise `false`
|
|
6801
|
-
*/
|
|
6802
|
-
export declare function isHeraldSubscription(value: unknown): value is Subscription;
|
|
6803
6836
|
//#endregion
|
|
6804
6837
|
//#region src/color/models.d.ts
|
|
6805
6838
|
/**
|
|
@@ -6983,16 +7016,16 @@ type Color = {
|
|
|
6983
7016
|
unsubscribe(): void;
|
|
6984
7017
|
};
|
|
6985
7018
|
type ColorChanges = {
|
|
6986
|
-
"*"
|
|
6987
|
-
alpha
|
|
6988
|
-
hex
|
|
6989
|
-
hexa
|
|
6990
|
-
hsl
|
|
6991
|
-
hsla
|
|
6992
|
-
hwb
|
|
6993
|
-
hwba
|
|
6994
|
-
rgb
|
|
6995
|
-
rgba
|
|
7019
|
+
"*"(value: Color): void;
|
|
7020
|
+
alpha(value: number): void;
|
|
7021
|
+
hex(value: string): void;
|
|
7022
|
+
hexa(value: string): void;
|
|
7023
|
+
hsl(value: HSLColor): void;
|
|
7024
|
+
hsla(value: HSLAColor): void;
|
|
7025
|
+
hwb(value: HWBColor): void;
|
|
7026
|
+
hwba(value: HWBAColor): void;
|
|
7027
|
+
rgb(value: RGBColor): void;
|
|
7028
|
+
rgba(value: RGBAColor): void;
|
|
6996
7029
|
};
|
|
6997
7030
|
type ColorWithAlpha = {
|
|
6998
7031
|
/**
|
|
@@ -7477,6 +7510,37 @@ export declare function rgbToHwba(rgb: RGBAColor | RGBColor): HWBAColor;
|
|
|
7477
7510
|
*/
|
|
7478
7511
|
export declare function getColor(value: unknown): Color;
|
|
7479
7512
|
//#endregion
|
|
7513
|
+
//#region src/internal/herald.d.ts
|
|
7514
|
+
/**
|
|
7515
|
+
* Create a _Herald_ for announcing named events
|
|
7516
|
+
*
|
|
7517
|
+
* @param names Event names
|
|
7518
|
+
* @param property Optional property for subscription identification _(defaults to `$herald`)_
|
|
7519
|
+
* @returns _Herald_ instance
|
|
7520
|
+
*/
|
|
7521
|
+
export declare function herald<Events extends Record<string, GenericCallback>>(options: HeraldOptions<Events>): Herald<Events>;
|
|
7522
|
+
/**
|
|
7523
|
+
* Is the value a herald?
|
|
7524
|
+
*
|
|
7525
|
+
* @param value Value to check
|
|
7526
|
+
* @returns `true` if the value is a herald, otherwise `false`
|
|
7527
|
+
*/
|
|
7528
|
+
export declare function isHerald<Events extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is Herald<Events>;
|
|
7529
|
+
/**
|
|
7530
|
+
* Is the value events for a herald?
|
|
7531
|
+
*
|
|
7532
|
+
* @param value Value to check
|
|
7533
|
+
* @returns `true` if the value is events for a herald, otherwise `false`
|
|
7534
|
+
*/
|
|
7535
|
+
export declare function isHeraldEvents<Events extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is HeraldEvents<Events>;
|
|
7536
|
+
/**
|
|
7537
|
+
* Is the value a herald subscription?
|
|
7538
|
+
*
|
|
7539
|
+
* @param value Value to check
|
|
7540
|
+
* @returns `true` if the value is a herald subscription, otherwise `false`
|
|
7541
|
+
*/
|
|
7542
|
+
export declare function isHeraldSubscription(value: unknown): value is Subscription;
|
|
7543
|
+
//#endregion
|
|
7480
7544
|
//#region src/internal/is.d.ts
|
|
7481
7545
|
/**
|
|
7482
7546
|
* Is the value an array or a plain object?
|
|
@@ -8446,4 +8510,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
8446
8510
|
get(value: Value, update?: boolean): Value | undefined;
|
|
8447
8511
|
}
|
|
8448
8512
|
//#endregion
|
|
8449
|
-
export { type AsyncLimiter, type AsyncPlan, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, Key$1 as Key, type Limiter, Logger, type Plan, type RGBAColor, type RGBColor, type Shaken, type Smushed, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type TimeLogger, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };
|
|
8513
|
+
export { type AsyncLimiter, type AsyncPlan, type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, type HeraldEvents, Key$1 as Key, type Limiter, Logger, type Plan, type RGBAColor, type RGBColor, type Shaken, type Smushed, type Subscription, type SubscriptionParameters, type SubscriptionProperty, type Subscriptions, type SubscriptionsParameters, type TimeLogger, type Unsmushed, push as append, filterAndMap as select, toPromise as fromResult, getRandomFloatingNumber as getRandomFloat, isLogger, isTimeLogger, mapAndFilter as reverseSelect };
|