@oscarpalmer/atoms 0.189.0 → 0.190.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/beacon.d.mts +51 -31
- package/dist/beacon.mjs +163 -141
- package/dist/color/index.d.mts +1 -2
- package/dist/color/index.mjs +2 -2
- package/dist/color/instance.d.mts +3 -167
- package/dist/color/instance.mjs +58 -217
- package/dist/color/misc/get.d.mts +1 -2
- package/dist/color/misc/get.mjs +3 -3
- package/dist/color/misc/index.d.mts +4 -4
- package/dist/color/misc/index.mjs +9 -9
- package/dist/color/misc/is.d.mts +1 -2
- package/dist/color/misc/is.mjs +5 -2
- package/dist/color/models.d.mts +158 -2
- package/dist/function/memoize.d.mts +3 -9
- package/dist/function/memoize.mjs +43 -90
- package/dist/function/once.mjs +16 -4
- package/dist/herald.d.mts +19 -15
- package/dist/herald.mjs +79 -89
- package/dist/index.d.mts +173 -162
- package/dist/index.mjs +754 -996
- package/dist/internal/result.d.mts +6 -6
- package/dist/internal/result.mjs +1 -1
- package/dist/internal/value/has.d.mts +2 -2
- package/dist/logger.d.mts +7 -7
- package/dist/logger.mjs +72 -51
- package/dist/promise/helpers.d.mts +2 -2
- package/dist/promise/helpers.mjs +2 -2
- package/dist/queue.d.mts +24 -12
- package/dist/queue.mjs +288 -346
- package/dist/string/fuzzy.d.mts +4 -13
- package/dist/string/fuzzy.mjs +15 -41
- package/package.json +2 -2
- package/src/beacon.ts +262 -160
- package/src/color/index.ts +8 -8
- package/src/color/instance.ts +82 -258
- package/src/color/misc/get.ts +4 -4
- package/src/color/misc/index.ts +10 -11
- package/src/color/misc/is.ts +4 -1
- package/src/color/models.ts +180 -2
- package/src/function/memoize.ts +74 -65
- package/src/function/once.ts +4 -0
- package/src/herald.ts +136 -94
- package/src/internal/result.ts +6 -6
- package/src/internal/value/has.ts +2 -2
- package/src/logger.ts +93 -42
- package/src/promise/helpers.ts +2 -2
- package/src/queue.ts +480 -375
- package/src/string/fuzzy.ts +36 -31
package/dist/index.d.mts
CHANGED
|
@@ -3869,8 +3869,7 @@ declare function noop(): void;
|
|
|
3869
3869
|
/**
|
|
3870
3870
|
* A _Memoized_ function instance, caching and retrieving results based on the its parameters _(or a custom cache key)_
|
|
3871
3871
|
*/
|
|
3872
|
-
|
|
3873
|
-
#private;
|
|
3872
|
+
type Memoized<Callback extends GenericCallback> = {
|
|
3874
3873
|
/**
|
|
3875
3874
|
* Maximum cache size
|
|
3876
3875
|
*
|
|
@@ -3883,7 +3882,6 @@ declare class Memoized<Callback extends GenericCallback> {
|
|
|
3883
3882
|
* @returns Current cache size _(or `Number.NaN` if the instance has been destroyed)_
|
|
3884
3883
|
*/
|
|
3885
3884
|
get size(): number;
|
|
3886
|
-
constructor(callback: Callback, options: Options);
|
|
3887
3885
|
/**
|
|
3888
3886
|
* Clear the cache
|
|
3889
3887
|
*/
|
|
@@ -3922,7 +3920,7 @@ declare class Memoized<Callback extends GenericCallback> {
|
|
|
3922
3920
|
* @returns Cached or computed _(then cached)_ result
|
|
3923
3921
|
*/
|
|
3924
3922
|
run(...parameters: Parameters<Callback>): ReturnType<Callback>;
|
|
3925
|
-
}
|
|
3923
|
+
};
|
|
3926
3924
|
/**
|
|
3927
3925
|
* Options for a _Memoized_ function
|
|
3928
3926
|
*/
|
|
@@ -3936,10 +3934,6 @@ type MemoizedOptions<Callback extends GenericCallback> = {
|
|
|
3936
3934
|
*/
|
|
3937
3935
|
cacheSize?: number;
|
|
3938
3936
|
};
|
|
3939
|
-
type Options = {
|
|
3940
|
-
cacheKey?: GenericCallback;
|
|
3941
|
-
cacheSize: number;
|
|
3942
|
-
};
|
|
3943
3937
|
/**
|
|
3944
3938
|
* Memoize a function, caching and retrieving results based on the first parameter
|
|
3945
3939
|
*
|
|
@@ -4506,9 +4500,7 @@ declare namespace pipe {
|
|
|
4506
4500
|
}
|
|
4507
4501
|
//#endregion
|
|
4508
4502
|
//#region src/herald.d.ts
|
|
4509
|
-
|
|
4510
|
-
#private;
|
|
4511
|
-
constructor(herald: Herald<Map>);
|
|
4503
|
+
type Events<Map extends Record<string, GenericCallback>> = {
|
|
4512
4504
|
/**
|
|
4513
4505
|
* Subscribe to an event with a callback
|
|
4514
4506
|
*
|
|
@@ -4525,17 +4517,9 @@ declare class Events<Map extends Record<string, GenericCallback>> {
|
|
|
4525
4517
|
* @returns Unsubscriber function
|
|
4526
4518
|
*/
|
|
4527
4519
|
unsubscribe<Event extends keyof Map>(event: Event, callback?: Map[Event]): void;
|
|
4528
|
-
}
|
|
4529
|
-
|
|
4530
|
-
* A _Herald_ is an announcer for named events, allowing emission, subscription, and unsubscription of events
|
|
4531
|
-
*/
|
|
4532
|
-
declare class Herald<Map extends Record<string, GenericCallback>> {
|
|
4533
|
-
#private;
|
|
4534
|
-
/**
|
|
4535
|
-
* Events interface for subscribing to and unsubscribing from events
|
|
4536
|
-
*/
|
|
4520
|
+
};
|
|
4521
|
+
type Herald<Map extends Record<string, GenericCallback>> = {
|
|
4537
4522
|
readonly events: Events<Map>;
|
|
4538
|
-
constructor(names: (keyof Map)[]);
|
|
4539
4523
|
/**
|
|
4540
4524
|
* Remove all event subscribers
|
|
4541
4525
|
*/
|
|
@@ -4562,7 +4546,7 @@ declare class Herald<Map extends Record<string, GenericCallback>> {
|
|
|
4562
4546
|
* @param callback Callback function
|
|
4563
4547
|
*/
|
|
4564
4548
|
unsubscribe<Event extends keyof Map>(event: Event, callback?: Map[Event]): void;
|
|
4565
|
-
}
|
|
4549
|
+
};
|
|
4566
4550
|
type Unsubscriber = () => void;
|
|
4567
4551
|
/**
|
|
4568
4552
|
* Create a _Herald_ for announcing named events
|
|
@@ -4571,6 +4555,20 @@ type Unsubscriber = () => void;
|
|
|
4571
4555
|
* @returns _Herald_ instance
|
|
4572
4556
|
*/
|
|
4573
4557
|
declare function herald<Events extends Record<string, GenericCallback>>(names: (keyof Events)[]): Herald<Events>;
|
|
4558
|
+
/**
|
|
4559
|
+
* Is the value events for a herald?
|
|
4560
|
+
*
|
|
4561
|
+
* @param value Value to check
|
|
4562
|
+
* @returns `true` if the value is events for a herald, otherwise `false`
|
|
4563
|
+
*/
|
|
4564
|
+
declare function isEvents<Map extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is Events<Map>;
|
|
4565
|
+
/**
|
|
4566
|
+
* Is the value a herald?
|
|
4567
|
+
*
|
|
4568
|
+
* @param value Value to check
|
|
4569
|
+
* @returns `true` if the value is a herald, otherwise `false`
|
|
4570
|
+
*/
|
|
4571
|
+
declare function isHerald<Events extends Record<string, GenericCallback> = Record<string, GenericCallback>>(value: unknown): value is Herald<Events>;
|
|
4574
4572
|
//#endregion
|
|
4575
4573
|
//#region src/internal/string.d.ts
|
|
4576
4574
|
/**
|
|
@@ -4805,7 +4803,7 @@ declare function getValue<Data extends PlainObject>(data: Data, path: string, ig
|
|
|
4805
4803
|
*
|
|
4806
4804
|
* @param data Object to check in
|
|
4807
4805
|
* @param path Path for property, e.g., `foo.bar.baz`
|
|
4808
|
-
* @returns `true` if the property exists, `false`
|
|
4806
|
+
* @returns `true` if the property exists, otherwise `false`
|
|
4809
4807
|
*
|
|
4810
4808
|
* @example
|
|
4811
4809
|
* ```typescript
|
|
@@ -4824,7 +4822,7 @@ declare function hasValue<Data extends PlainObject, Path extends NestedKeys<Data
|
|
|
4824
4822
|
* @param data Object to check in
|
|
4825
4823
|
* @param path Path for property, e.g., `foo.bar.baz`
|
|
4826
4824
|
* @param ignoreCase If `true`, the path matching is case-insensitive
|
|
4827
|
-
* @returns `true` if the property exists, `false`
|
|
4825
|
+
* @returns `true` if the property exists, otherwise `false`
|
|
4828
4826
|
*
|
|
4829
4827
|
* @example
|
|
4830
4828
|
* ```typescript
|
|
@@ -4996,8 +4994,7 @@ declare function upperCase(value: string): string;
|
|
|
4996
4994
|
/**
|
|
4997
4995
|
* Fuzzy searcher for an array of items
|
|
4998
4996
|
*/
|
|
4999
|
-
|
|
5000
|
-
#private;
|
|
4997
|
+
type Fuzzy<Item> = {
|
|
5001
4998
|
/**
|
|
5002
4999
|
* Get items currently being searched through
|
|
5003
5000
|
*
|
|
@@ -5016,7 +5013,6 @@ declare class Fuzzy<Item> {
|
|
|
5016
5013
|
* @returns Stringified items
|
|
5017
5014
|
*/
|
|
5018
5015
|
get strings(): string[];
|
|
5019
|
-
constructor(state: FuzzyState<Item>);
|
|
5020
5016
|
/**
|
|
5021
5017
|
* Search for items matching the given value
|
|
5022
5018
|
*
|
|
@@ -5033,7 +5029,7 @@ declare class Fuzzy<Item> {
|
|
|
5033
5029
|
* @returns Search results, with exact matches _(ordered)_ and similar matches _(ordered by relevance)_
|
|
5034
5030
|
*/
|
|
5035
5031
|
search(value: string, limit: number): FuzzyResult<Item>;
|
|
5036
|
-
}
|
|
5032
|
+
};
|
|
5037
5033
|
type FuzzyConfiguration<Item> = {
|
|
5038
5034
|
/**
|
|
5039
5035
|
* Handler to stringify items
|
|
@@ -5080,13 +5076,6 @@ type FuzzyResult<Item> = {
|
|
|
5080
5076
|
* Options for fuzzy searching
|
|
5081
5077
|
*/
|
|
5082
5078
|
type FuzzySearchOptions = FuzzyOptions;
|
|
5083
|
-
type FuzzyState<Item> = {
|
|
5084
|
-
handler: (item: Item) => string;
|
|
5085
|
-
items: Item[];
|
|
5086
|
-
limit?: number;
|
|
5087
|
-
strings: string[];
|
|
5088
|
-
tolerance: number;
|
|
5089
|
-
};
|
|
5090
5079
|
/**
|
|
5091
5080
|
* Create a fuzzy searcher for an array of items
|
|
5092
5081
|
*
|
|
@@ -5119,7 +5108,7 @@ declare namespace fuzzy {
|
|
|
5119
5108
|
*
|
|
5120
5109
|
* @param haystack Haystack to search through
|
|
5121
5110
|
* @param needle Needle to search for
|
|
5122
|
-
* @returns `true` if the needle matches the haystack in a fuzzy way, `false`
|
|
5111
|
+
* @returns `true` if the needle matches the haystack in a fuzzy way, otherwise `false`
|
|
5123
5112
|
*/
|
|
5124
5113
|
declare function fuzzyMatch(haystack: string, needle: string): boolean;
|
|
5125
5114
|
//#endregion
|
|
@@ -5844,12 +5833,15 @@ declare namespace transform {
|
|
|
5844
5833
|
/**
|
|
5845
5834
|
* A beacon is a lighthouse, holding an observable value that can be subscribed to and emitted from
|
|
5846
5835
|
*/
|
|
5847
|
-
|
|
5848
|
-
#private;
|
|
5836
|
+
type Beacon<Value> = {
|
|
5849
5837
|
/**
|
|
5850
5838
|
* Is the beacon active?
|
|
5851
5839
|
*/
|
|
5852
5840
|
get active(): boolean;
|
|
5841
|
+
/**
|
|
5842
|
+
* Is the beacon closed?
|
|
5843
|
+
*/
|
|
5844
|
+
get closed(): boolean;
|
|
5853
5845
|
/**
|
|
5854
5846
|
* The observable that can be subscribed to
|
|
5855
5847
|
*/
|
|
@@ -5858,11 +5850,10 @@ declare class Beacon<Value> {
|
|
|
5858
5850
|
* The current value
|
|
5859
5851
|
*/
|
|
5860
5852
|
get value(): Value;
|
|
5861
|
-
constructor(value: Value, options?: BeaconOptions<Value>);
|
|
5862
5853
|
/**
|
|
5863
|
-
*
|
|
5854
|
+
* Close the beacon
|
|
5864
5855
|
*/
|
|
5865
|
-
|
|
5856
|
+
close(): void;
|
|
5866
5857
|
/**
|
|
5867
5858
|
* Emit a new value
|
|
5868
5859
|
*
|
|
@@ -5881,7 +5872,7 @@ declare class Beacon<Value> {
|
|
|
5881
5872
|
* Finish the beacon
|
|
5882
5873
|
*/
|
|
5883
5874
|
finish(): void;
|
|
5884
|
-
}
|
|
5875
|
+
};
|
|
5885
5876
|
/**
|
|
5886
5877
|
* Options for Beacon
|
|
5887
5878
|
*/
|
|
@@ -5896,16 +5887,19 @@ type BeaconOptions<Value> = {
|
|
|
5896
5887
|
*/
|
|
5897
5888
|
equal?: (first: Value, second: Value) => boolean;
|
|
5898
5889
|
};
|
|
5899
|
-
|
|
5900
|
-
* An observable holds a value and allows observers to subscribe to changes in that value
|
|
5901
|
-
*/
|
|
5902
|
-
declare class Observable<Value> {
|
|
5903
|
-
#private;
|
|
5904
|
-
constructor(instance: Beacon<Value>, observers: Map<Subscription<Value>, Observer<Value>>);
|
|
5890
|
+
type Observable<Value> = {
|
|
5905
5891
|
/**
|
|
5906
|
-
*
|
|
5892
|
+
* Is the observable active?
|
|
5907
5893
|
*/
|
|
5908
|
-
|
|
5894
|
+
get active(): boolean;
|
|
5895
|
+
/**
|
|
5896
|
+
* Is the observable closed?
|
|
5897
|
+
*/
|
|
5898
|
+
get closed(): boolean;
|
|
5899
|
+
/**
|
|
5900
|
+
* Close the observable
|
|
5901
|
+
*/
|
|
5902
|
+
close(): void;
|
|
5909
5903
|
/**
|
|
5910
5904
|
* Subscribe to value changes
|
|
5911
5905
|
*
|
|
@@ -5914,19 +5908,14 @@ declare class Observable<Value> {
|
|
|
5914
5908
|
* @param onComplete Callback for when the observable is completed
|
|
5915
5909
|
* @returns Subscription to the observable
|
|
5916
5910
|
*/
|
|
5917
|
-
subscribe(onNext: (value: Value) => void, onError?: (error: Error) => void, onComplete?: () => void): Subscription
|
|
5911
|
+
subscribe(onNext: (value: Value) => void, onError?: (error: Error) => void, onComplete?: () => void): Subscription;
|
|
5918
5912
|
/**
|
|
5919
5913
|
* Subscribe to value changes
|
|
5920
5914
|
*
|
|
5921
5915
|
* @param observer Observer for changes
|
|
5922
5916
|
* @returns Subscription to the observable
|
|
5923
5917
|
*/
|
|
5924
|
-
subscribe(observer: Observer<Value>): Subscription
|
|
5925
|
-
}
|
|
5926
|
-
type ObservableState<Value> = {
|
|
5927
|
-
beacon: Beacon<Value>;
|
|
5928
|
-
closed: boolean;
|
|
5929
|
-
observers: Map<Subscription<Value>, Observer<Value>>;
|
|
5918
|
+
subscribe(observer: Observer<Value>): Subscription;
|
|
5930
5919
|
};
|
|
5931
5920
|
/**
|
|
5932
5921
|
* An observer receives notifications from an observable
|
|
@@ -5945,25 +5934,24 @@ type Observer<Value> = {
|
|
|
5945
5934
|
*/
|
|
5946
5935
|
next?: (value: Value) => void;
|
|
5947
5936
|
};
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
constructor(state: ObservableState<Value>);
|
|
5937
|
+
type Subscription = {
|
|
5938
|
+
/**
|
|
5939
|
+
* Is the subscription active?
|
|
5940
|
+
*/
|
|
5941
|
+
get active(): boolean;
|
|
5954
5942
|
/**
|
|
5955
5943
|
* Is the subscription closed?
|
|
5956
5944
|
*/
|
|
5957
5945
|
get closed(): boolean;
|
|
5958
5946
|
/**
|
|
5959
|
-
*
|
|
5947
|
+
* Close the subscription
|
|
5960
5948
|
*/
|
|
5961
|
-
|
|
5949
|
+
close(): void;
|
|
5962
5950
|
/**
|
|
5963
5951
|
* Unsubscribe from its observable
|
|
5964
5952
|
*/
|
|
5965
5953
|
unsubscribe(): void;
|
|
5966
|
-
}
|
|
5954
|
+
};
|
|
5967
5955
|
/**
|
|
5968
5956
|
* Create a new beacon
|
|
5969
5957
|
*
|
|
@@ -5972,84 +5960,33 @@ declare class Subscription<Value> {
|
|
|
5972
5960
|
* @returns Beacon instance
|
|
5973
5961
|
*/
|
|
5974
5962
|
declare function beacon<Value>(value: Value, options?: BeaconOptions<Value>): Beacon<Value>;
|
|
5975
|
-
//#endregion
|
|
5976
|
-
//#region src/color/models.d.ts
|
|
5977
|
-
type ColorWithAlpha = {
|
|
5978
|
-
/**
|
|
5979
|
-
* Alpha channel _(opacity)_ of the color _(in percentage; 0-100)_
|
|
5980
|
-
*/
|
|
5981
|
-
alpha: number;
|
|
5982
|
-
};
|
|
5983
|
-
/**
|
|
5984
|
-
* An _HSL_ color with an alpha channel _(opacity)_
|
|
5985
|
-
*/
|
|
5986
|
-
type HSLAColor = HSLColor & ColorWithAlpha;
|
|
5987
5963
|
/**
|
|
5988
|
-
*
|
|
5964
|
+
* Is the value a beacon?
|
|
5965
|
+
*
|
|
5966
|
+
* @param value Value to check
|
|
5967
|
+
* @returns `true` if the value is a beacon, otherwise `false`
|
|
5989
5968
|
*/
|
|
5990
|
-
|
|
5991
|
-
/**
|
|
5992
|
-
* Hue of the color _(in degrees; 0-360)_
|
|
5993
|
-
*/
|
|
5994
|
-
hue: number;
|
|
5995
|
-
/**
|
|
5996
|
-
* Lightness of the color _(in percentage; 0-100)_
|
|
5997
|
-
*/
|
|
5998
|
-
lightness: number;
|
|
5999
|
-
/**
|
|
6000
|
-
* Saturation of the color _(in percentage; 0-100)_
|
|
6001
|
-
*/
|
|
6002
|
-
saturation: number;
|
|
6003
|
-
};
|
|
6004
|
-
type HWBColor = {
|
|
6005
|
-
/**
|
|
6006
|
-
* Blackness of the color _(in percentage; 0-100)_
|
|
6007
|
-
*/
|
|
6008
|
-
blackness: number;
|
|
6009
|
-
/**
|
|
6010
|
-
* Hue of the color _(in degrees; 0-360)_
|
|
6011
|
-
*/
|
|
6012
|
-
hue: number;
|
|
6013
|
-
/**
|
|
6014
|
-
* Whiteness of the color _(in percentage; 0-100)_
|
|
6015
|
-
*/
|
|
6016
|
-
whiteness: number;
|
|
6017
|
-
};
|
|
6018
|
-
type HWBAColor = HWBColor & ColorWithAlpha;
|
|
5969
|
+
declare function isBeacon<Value = unknown>(value: unknown): value is Beacon<Value>;
|
|
6019
5970
|
/**
|
|
6020
|
-
*
|
|
5971
|
+
* Is the value an observable?
|
|
5972
|
+
*
|
|
5973
|
+
* @param value Value to check
|
|
5974
|
+
* @returns `true` if the value is an observable, otherwise `false`
|
|
6021
5975
|
*/
|
|
6022
|
-
|
|
5976
|
+
declare function isObservable<Value = unknown>(value: unknown): value is Observable<Value>;
|
|
6023
5977
|
/**
|
|
6024
|
-
*
|
|
5978
|
+
* Is the value a subscription?
|
|
5979
|
+
*
|
|
5980
|
+
* @param value Value to check
|
|
5981
|
+
* @returns `true` if the value is a subscription, otherwise `false`
|
|
6025
5982
|
*/
|
|
6026
|
-
|
|
6027
|
-
/**
|
|
6028
|
-
* Blue channel of the color _(in hexadecimal; 0-255)_
|
|
6029
|
-
*/
|
|
6030
|
-
blue: number;
|
|
6031
|
-
/**
|
|
6032
|
-
* Green channel of the color _(in hexadecimal; 0-255)_
|
|
6033
|
-
*/
|
|
6034
|
-
green: number;
|
|
6035
|
-
/**
|
|
6036
|
-
* Red channel of the color _(in hexadecimal; 0-255)_
|
|
6037
|
-
*/
|
|
6038
|
-
red: number;
|
|
6039
|
-
};
|
|
5983
|
+
declare function isSubscription(value: unknown): value is Subscription;
|
|
6040
5984
|
//#endregion
|
|
6041
|
-
//#region src/color/
|
|
5985
|
+
//#region src/color/models.d.ts
|
|
6042
5986
|
/**
|
|
6043
5987
|
* A color that is represented in multiple color formats
|
|
6044
5988
|
*/
|
|
6045
|
-
|
|
6046
|
-
#private;
|
|
6047
|
-
/**
|
|
6048
|
-
* A property to identify this as a Color instance, used for type checking
|
|
6049
|
-
*
|
|
6050
|
-
* @internal
|
|
6051
|
-
*/
|
|
6052
|
-
private readonly $color;
|
|
5989
|
+
type Color = {
|
|
6053
5990
|
/**
|
|
6054
5991
|
* Get the alpha channel _(opacity)_ of the color as a percentage between `0` and `100`
|
|
6055
5992
|
*
|
|
@@ -6168,7 +6105,6 @@ declare class Color {
|
|
|
6168
6105
|
* @param value New _RGBA_ color
|
|
6169
6106
|
*/
|
|
6170
6107
|
set rgba(value: RGBAColor);
|
|
6171
|
-
constructor(value: unknown);
|
|
6172
6108
|
/**
|
|
6173
6109
|
* Get the color as a hex string
|
|
6174
6110
|
*
|
|
@@ -6203,7 +6139,70 @@ declare class Color {
|
|
|
6203
6139
|
* @returns Hex color string
|
|
6204
6140
|
*/
|
|
6205
6141
|
toString(): string;
|
|
6206
|
-
}
|
|
6142
|
+
};
|
|
6143
|
+
type ColorWithAlpha = {
|
|
6144
|
+
/**
|
|
6145
|
+
* Alpha channel _(opacity)_ of the color _(in percentage; 0-100)_
|
|
6146
|
+
*/
|
|
6147
|
+
alpha: number;
|
|
6148
|
+
};
|
|
6149
|
+
/**
|
|
6150
|
+
* An _HSL_ color with an alpha channel _(opacity)_
|
|
6151
|
+
*/
|
|
6152
|
+
type HSLAColor = HSLColor & ColorWithAlpha;
|
|
6153
|
+
/**
|
|
6154
|
+
* An _HSL_ color
|
|
6155
|
+
*/
|
|
6156
|
+
type HSLColor = {
|
|
6157
|
+
/**
|
|
6158
|
+
* Hue of the color _(in degrees; 0-360)_
|
|
6159
|
+
*/
|
|
6160
|
+
hue: number;
|
|
6161
|
+
/**
|
|
6162
|
+
* Lightness of the color _(in percentage; 0-100)_
|
|
6163
|
+
*/
|
|
6164
|
+
lightness: number;
|
|
6165
|
+
/**
|
|
6166
|
+
* Saturation of the color _(in percentage; 0-100)_
|
|
6167
|
+
*/
|
|
6168
|
+
saturation: number;
|
|
6169
|
+
};
|
|
6170
|
+
type HWBColor = {
|
|
6171
|
+
/**
|
|
6172
|
+
* Blackness of the color _(in percentage; 0-100)_
|
|
6173
|
+
*/
|
|
6174
|
+
blackness: number;
|
|
6175
|
+
/**
|
|
6176
|
+
* Hue of the color _(in degrees; 0-360)_
|
|
6177
|
+
*/
|
|
6178
|
+
hue: number;
|
|
6179
|
+
/**
|
|
6180
|
+
* Whiteness of the color _(in percentage; 0-100)_
|
|
6181
|
+
*/
|
|
6182
|
+
whiteness: number;
|
|
6183
|
+
};
|
|
6184
|
+
type HWBAColor = HWBColor & ColorWithAlpha;
|
|
6185
|
+
/**
|
|
6186
|
+
* An _RGB_ color with an alpha channel _(opacity)_
|
|
6187
|
+
*/
|
|
6188
|
+
type RGBAColor = RGBColor & ColorWithAlpha;
|
|
6189
|
+
/**
|
|
6190
|
+
* An _RGB_ color
|
|
6191
|
+
*/
|
|
6192
|
+
type RGBColor = {
|
|
6193
|
+
/**
|
|
6194
|
+
* Blue channel of the color _(in hexadecimal; 0-255)_
|
|
6195
|
+
*/
|
|
6196
|
+
blue: number;
|
|
6197
|
+
/**
|
|
6198
|
+
* Green channel of the color _(in hexadecimal; 0-255)_
|
|
6199
|
+
*/
|
|
6200
|
+
green: number;
|
|
6201
|
+
/**
|
|
6202
|
+
* Red channel of the color _(in hexadecimal; 0-255)_
|
|
6203
|
+
*/
|
|
6204
|
+
red: number;
|
|
6205
|
+
};
|
|
6207
6206
|
//#endregion
|
|
6208
6207
|
//#region src/color/misc/get.d.ts
|
|
6209
6208
|
/**
|
|
@@ -6839,7 +6838,7 @@ declare function isNumerical(value: unknown): value is number | `${number}`;
|
|
|
6839
6838
|
declare function isObject(value: unknown): value is object;
|
|
6840
6839
|
//#endregion
|
|
6841
6840
|
//#region src/logger.d.ts
|
|
6842
|
-
type
|
|
6841
|
+
type Logger = {
|
|
6843
6842
|
/**
|
|
6844
6843
|
* Log any number of values at the "debug" log level
|
|
6845
6844
|
*/
|
|
@@ -6891,8 +6890,7 @@ type LoggerInstance = {
|
|
|
6891
6890
|
/**
|
|
6892
6891
|
* A named timer that can be used to log durations to the console
|
|
6893
6892
|
*/
|
|
6894
|
-
|
|
6895
|
-
#private;
|
|
6893
|
+
type TimedLogger = {
|
|
6896
6894
|
/**
|
|
6897
6895
|
* Is the timer active? _(i.e. has it been started and not stopped, and is logging enabled?)_
|
|
6898
6896
|
*/
|
|
@@ -6907,14 +6905,15 @@ declare class TimedLogger {
|
|
|
6907
6905
|
* _(Will always log the total duration, even if logging is disabled)_
|
|
6908
6906
|
*/
|
|
6909
6907
|
get stop(): () => void;
|
|
6910
|
-
|
|
6911
|
-
|
|
6908
|
+
};
|
|
6909
|
+
declare function isLogger(value: unknown): value is Logger;
|
|
6910
|
+
declare function isTimedLogger(value: unknown): value is TimedLogger;
|
|
6912
6911
|
/**
|
|
6913
6912
|
* A logger that can be used to log messages to the console
|
|
6914
6913
|
*
|
|
6915
6914
|
* _(Logging can be enabled or disabled by setting the `enabled` property)_
|
|
6916
6915
|
*/
|
|
6917
|
-
declare const Logger:
|
|
6916
|
+
declare const Logger: Logger;
|
|
6918
6917
|
//#endregion
|
|
6919
6918
|
//#region src/internal/math/aggregate.d.ts
|
|
6920
6919
|
/**
|
|
@@ -7393,42 +7392,42 @@ declare function resultPromises<Value>(items: Promise<Value>[], signal?: AbortSi
|
|
|
7393
7392
|
* Is the _Result_ an extended error?
|
|
7394
7393
|
*
|
|
7395
7394
|
* @param result _Result_ to check
|
|
7396
|
-
* @returns `true` if the _Result_ is an extended error, `false`
|
|
7395
|
+
* @returns `true` if the _Result_ is an extended error, otherwise `false`
|
|
7397
7396
|
*/
|
|
7398
7397
|
declare function isError<Value, E = Error>(result: ExtendedErr<E> | Result<Value, E>, extended: true): result is ExtendedErr<E>;
|
|
7399
7398
|
/**
|
|
7400
7399
|
* Is the _Result_ an error?
|
|
7401
7400
|
*
|
|
7402
7401
|
* @param result _Result_ to check
|
|
7403
|
-
* @returns `true` if the _Result_ is an error, `false`
|
|
7402
|
+
* @returns `true` if the _Result_ is an error, otherwise `false`
|
|
7404
7403
|
*/
|
|
7405
7404
|
declare function isError<Value, E = Error>(result: Result<Value, E>): result is Err<E>;
|
|
7406
7405
|
/**
|
|
7407
7406
|
* Is the value an error?
|
|
7408
7407
|
*
|
|
7409
7408
|
* @param value Value to check
|
|
7410
|
-
* @returns `true` if the value is an error, `false`
|
|
7409
|
+
* @returns `true` if the value is an error, otherwise `false`
|
|
7411
7410
|
*/
|
|
7412
7411
|
declare function isError(value: unknown): value is Err<unknown> | ExtendedErr<unknown>;
|
|
7413
7412
|
/**
|
|
7414
7413
|
* Is the _Result_ ok?
|
|
7415
7414
|
*
|
|
7416
7415
|
* @param value _Result_ to check
|
|
7417
|
-
* @returns `true` if the _Result_ is ok, `false`
|
|
7416
|
+
* @returns `true` if the _Result_ is ok, otherwise `false`
|
|
7418
7417
|
*/
|
|
7419
7418
|
declare function isOk<Value, E = Error>(value: Result<Value, E>): value is Ok<Value>;
|
|
7420
7419
|
/**
|
|
7421
7420
|
* Is the value ok?
|
|
7422
7421
|
*
|
|
7423
7422
|
* @param value Value to check
|
|
7424
|
-
* @returns `true` if the value is ok, `false`
|
|
7423
|
+
* @returns `true` if the value is ok, otherwise `false`
|
|
7425
7424
|
*/
|
|
7426
7425
|
declare function isOk(value: unknown): value is Ok<unknown>;
|
|
7427
7426
|
/**
|
|
7428
7427
|
* Is the value a _Result_?
|
|
7429
7428
|
*
|
|
7430
7429
|
* @param value Value to check
|
|
7431
|
-
* @returns `true` if the value is a _Result_, `false`
|
|
7430
|
+
* @returns `true` if the value is a _Result_, otherwise `false`
|
|
7432
7431
|
*/
|
|
7433
7432
|
declare function isResult(value: unknown): value is ExtendedErr<unknown> | Result<unknown, unknown>;
|
|
7434
7433
|
//#endregion
|
|
@@ -7496,14 +7495,14 @@ declare function unwrap(value: unknown, defaultValue: unknown): unknown;
|
|
|
7496
7495
|
* Is the value a fulfilled _Promise_ result?
|
|
7497
7496
|
*
|
|
7498
7497
|
* @param value Value to check
|
|
7499
|
-
* @returns `true` if the value is a fulfilled _Promise_ result, `false`
|
|
7498
|
+
* @returns `true` if the value is a fulfilled _Promise_ result, otherwise `false`
|
|
7500
7499
|
*/
|
|
7501
7500
|
declare function isFulfilled<Value>(value: unknown): value is FulfilledPromise<Value>;
|
|
7502
7501
|
/**
|
|
7503
7502
|
* Is the value a rejected _Promise_ result?
|
|
7504
7503
|
*
|
|
7505
7504
|
* @param value Value to check
|
|
7506
|
-
* @returns `true` if the value is a rejected _Promise_ result, `false`
|
|
7505
|
+
* @returns `true` if the value is a rejected _Promise_ result, otherwise `false`
|
|
7507
7506
|
*/
|
|
7508
7507
|
declare function isRejected(value: unknown): value is RejectedPromise;
|
|
7509
7508
|
//#endregion
|
|
@@ -7571,8 +7570,7 @@ declare function toQuery(parameters: PlainObject): string;
|
|
|
7571
7570
|
/**
|
|
7572
7571
|
* A queue that can be used to manage (a)synchronous tasks with a specific key
|
|
7573
7572
|
*/
|
|
7574
|
-
|
|
7575
|
-
#private;
|
|
7573
|
+
type KeyedQueue<CallbackParameters extends Parameters<GenericAsyncCallback>, CallbackResult> = {
|
|
7576
7574
|
/**
|
|
7577
7575
|
* Get keys of all active queues
|
|
7578
7576
|
*/
|
|
@@ -7613,7 +7611,6 @@ declare class KeyedQueue<CallbackParameters extends Parameters<GenericAsyncCallb
|
|
|
7613
7611
|
* Number of queues
|
|
7614
7612
|
*/
|
|
7615
7613
|
get queues(): number;
|
|
7616
|
-
constructor(callback: GenericAsyncCallback, options: Required<QueueOptions>);
|
|
7617
7614
|
/**
|
|
7618
7615
|
* Queue an item for a specific key
|
|
7619
7616
|
*
|
|
@@ -7667,12 +7664,11 @@ declare class KeyedQueue<CallbackParameters extends Parameters<GenericAsyncCallb
|
|
|
7667
7664
|
* @param key Optional key to resume the queue for
|
|
7668
7665
|
*/
|
|
7669
7666
|
resume(key?: string): void;
|
|
7670
|
-
}
|
|
7667
|
+
};
|
|
7671
7668
|
/**
|
|
7672
7669
|
* A queue that can be used to manage (a)synchronous tasks
|
|
7673
7670
|
*/
|
|
7674
|
-
|
|
7675
|
-
#private;
|
|
7671
|
+
type Queue<CallbackParameters extends Parameters<GenericAsyncCallback>, CallbackResult> = {
|
|
7676
7672
|
/**
|
|
7677
7673
|
* Is the queue active?
|
|
7678
7674
|
*/
|
|
@@ -7705,7 +7701,6 @@ declare class Queue<CallbackParameters extends Parameters<GenericAsyncCallback>,
|
|
|
7705
7701
|
* Number of items in the queue
|
|
7706
7702
|
*/
|
|
7707
7703
|
get size(): number;
|
|
7708
|
-
constructor(callback: GenericAsyncCallback, options: Required<QueueOptions>, key?: string);
|
|
7709
7704
|
/**
|
|
7710
7705
|
* Add an item to the queue
|
|
7711
7706
|
*
|
|
@@ -7735,7 +7730,7 @@ declare class Queue<CallbackParameters extends Parameters<GenericAsyncCallback>,
|
|
|
7735
7730
|
* Resume the queue
|
|
7736
7731
|
*/
|
|
7737
7732
|
resume(): void;
|
|
7738
|
-
}
|
|
7733
|
+
};
|
|
7739
7734
|
/**
|
|
7740
7735
|
* An error thrown by the Queue when an operation fails
|
|
7741
7736
|
*/
|
|
@@ -7777,10 +7772,26 @@ type QueuedResult<Value> = {
|
|
|
7777
7772
|
/**
|
|
7778
7773
|
* Result for the queued promise
|
|
7779
7774
|
*/
|
|
7780
|
-
value: Value;
|
|
7775
|
+
value: Value extends Promise<infer Result> ? Result : Value;
|
|
7781
7776
|
};
|
|
7782
7777
|
type Tail<Values extends any[]> = Values extends [infer _, ...infer Rest] ? Rest : never;
|
|
7783
|
-
|
|
7778
|
+
/**
|
|
7779
|
+
* Is the value keyed queue?
|
|
7780
|
+
*
|
|
7781
|
+
* @param value Value to check
|
|
7782
|
+
* @returns `true` if the value is a keyed queue, otherwise `false`
|
|
7783
|
+
*/
|
|
7784
|
+
declare function isKeyedQueue(value: unknown): value is KeyedQueue<unknown[], unknown>;
|
|
7785
|
+
/**
|
|
7786
|
+
* Is the value a queue?
|
|
7787
|
+
*
|
|
7788
|
+
* @param value Value to check
|
|
7789
|
+
* @returns `true` if the value is a queue, otherwise `false`
|
|
7790
|
+
*/
|
|
7791
|
+
declare function isQueue(value: unknown): value is Queue<unknown[], unknown>;
|
|
7792
|
+
declare function isQueueInstance<Instance>(name: string, value: unknown): value is Instance;
|
|
7793
|
+
declare function keyedQueue<Callback extends (key: string, ...parameters: any[]) => Promise<void>>(callback: Callback, options?: QueueOptions): KeyedQueue<Parameters<Callback>, Awaited<ReturnType<Callback>>>;
|
|
7794
|
+
declare function keyedQueue<Callback extends (key: string, ...parameters: any[]) => void>(callback: Callback, options?: QueueOptions): KeyedQueue<Parameters<Callback>, ReturnType<Callback>>;
|
|
7784
7795
|
/**
|
|
7785
7796
|
* Create a queue for an asynchronous callback function
|
|
7786
7797
|
*
|
|
@@ -7788,7 +7799,7 @@ declare function keyedQueue<Callback extends GenericAsyncCallback>(callback: Cal
|
|
|
7788
7799
|
* @param options Queue options
|
|
7789
7800
|
* @returns Queue instance
|
|
7790
7801
|
*/
|
|
7791
|
-
declare function queue<Callback extends (
|
|
7802
|
+
declare function queue<Callback extends GenericAsyncCallback>(callback: Callback, options?: QueueOptions): Queue<Parameters<Callback>, Awaited<ReturnType<Callback>>>;
|
|
7792
7803
|
/**
|
|
7793
7804
|
* Create a queue for a synchronous callback function
|
|
7794
7805
|
*
|
|
@@ -8431,4 +8442,4 @@ declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
8431
8442
|
get(value: Value, update?: boolean): Value | undefined;
|
|
8432
8443
|
}
|
|
8433
8444
|
//#endregion
|
|
8434
|
-
export { AnyResult, ArrayComparison, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayValueSorter, AssertProperty, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise,
|
|
8445
|
+
export { AnyResult, ArrayComparison, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayValueSorter, AssertProperty, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise, Beacon, BeaconOptions, BuiltIns, CancelableCallback, CancelablePromise, type Color, Constructor, DiffOptions, DiffResult, DiffValue, EqualOptions, Err, EventPosition, Events, ExtendedErr, ExtendedResult, Flow, FlowPromise, Frozen, FulfilledPromise, Fuzzy, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzySearchOptions, GenericAsyncCallback, GenericCallback, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, Herald, Key$1 as Key, KeyedQueue, KeyedValue, Logger, type Memoized, type MemoizedOptions, MergeOptions, Merger, NestedArray, NestedKeys, NestedPartial, NestedValue, NestedValues, NormalizeOptions, Normalizer, NumericalKeys, NumericalValues, Observable, Ok, OnceAsyncCallback, OnceCallback, PROMISE_ABORT_EVENT, PROMISE_ABORT_OPTIONS, PROMISE_ERROR_NAME, PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_RESULT, PROMISE_MESSAGE_EXPECTATION_TIMED, PROMISE_MESSAGE_TIMEOUT, PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED, PlainObject, Primitive, PromiseData, PromiseHandlers, PromiseOptions, PromiseParameters, PromiseStrategy, PromiseTimeoutError, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValue, PromisesValues, Queue, QueueError, QueueOptions, Queued, QueuedResult, type RGBAColor, type RGBColor, RejectedPromise, RequiredKeys, Result, ResultMatch, RetryError, RetryOptions, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, type Shaken, Simplify, SizedMap, SizedSet, type Smushed, SortDirection, Sorter, Subscription, TemplateOptions, type TimedLogger, ToString, Transformer, TypedArray, UnionToIntersection, type Unsmushed, Unsubscriber, UnwrapValue, assert, assertCondition, assertDefined, assertInstanceOf, assertIs, assertProperty, assign, asyncAttempt, asyncDebounce, asyncFlow, asyncMatchResult, asyncOnce, asyncPipe, asyncThrottle, attempt, attemptAsyncFlow, attemptAsyncPipe, attemptFlow, attemptPipe, attemptPromise, average, beacon, between, camelCase, cancelable, capitalize, ceil, chunk, clamp, clone, compact, compare, copy, count, debounce, deburr, dedent, delay, deregisterCloner, deregisterComparator, deregisterEqualizer, diff, difference, drop, endsWith, endsWithArray, equal, error, exclude, exists, filter, find, findLast, first, firstOrDefault, flatFreeze, flatten, floor, flow, freeze, fromQuery, toPromise as fromResult, toPromise, fuzzy, fuzzyMatch, getArray, getArrayComparison, getColor, getError, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getNormalizedHex, getNumber, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloatingNumber as getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems, getRgbColor, getRgbaColor, getSortedIndex, getString, getTimedPromise, getUuid, getValue, groupArraysBy, groupBy, handleResult, hasValue, hasValueResult, herald, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, interpolate, intersection, isArrayOrPlainObject, isBeacon, isColor, isConstructor, isEmpty, isError, isEvents, isFrozen, isFulfilled, isHerald, isHexColor, isHslColor, isHslLike, isHslaColor, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isInstanceOf, isKey, isKeyedQueue, isLogger, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isObservable, isOk, isPlainObject, isPrimitive, isQueue, isQueueInstance, isRejected, isResult, isRgbColor, isRgbLike, isRgbaColor, isSorted, isSubscription, isTimedLogger, isTypedArray, join, kebabCase, keyedQueue, last, lastIndexOf, lastOrDefault, lowerCase, matchResult, max, median, memoize, merge, min, move, moveIndices, moveToIndex, noop, normalize, ok, omit, once, parse, partition, pascalCase, pick, pipe, promises, push, queue, range, registerCloner, registerComparator, registerEqualizer, resultPromises, retry, reverse, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba, round, select, setValue, settlePromise, shake, shuffle, single, slice, smush, snakeCase, sort, splice, startsWith, startsWithArray, sum, swap, take, template, throttle, timed, times, titleCase, toMap, toMapArrays, toQuery, toRecord, toRecordArrays, toResult, toSet, toggle, transform, trim, truncate, tryDecode, tryEncode, union, unique, unsmush, unwrap, update, upperCase, words };
|