@oscarpalmer/atoms 0.188.1 → 0.189.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/difference.d.mts +0 -1
- package/dist/array/exists.d.mts +0 -1
- package/dist/array/filter.d.mts +0 -1
- package/dist/array/find.d.mts +0 -1
- package/dist/array/first.d.mts +0 -1
- package/dist/array/flatten.d.mts +0 -1
- package/dist/array/get.d.mts +0 -1
- package/dist/array/group-by.d.mts +0 -1
- package/dist/array/last.d.mts +0 -1
- package/dist/array/match.d.mts +0 -1
- package/dist/array/match.mjs +3 -3
- package/dist/array/move.d.mts +0 -1
- package/dist/array/partition.d.mts +0 -1
- package/dist/array/select.d.mts +0 -1
- package/dist/array/select.mjs +2 -1
- package/dist/array/single.d.mts +0 -1
- package/dist/array/slice.d.mts +0 -1
- package/dist/array/sort.d.mts +1 -2
- package/dist/array/sort.mjs +0 -1
- package/dist/array/swap.d.mts +0 -1
- package/dist/array/to-map.d.mts +0 -1
- package/dist/array/to-record.d.mts +0 -1
- package/dist/array/to-set.d.mts +0 -1
- package/dist/array/toggle.d.mts +0 -1
- package/dist/array/unique.d.mts +0 -1
- package/dist/array/update.d.mts +0 -1
- package/dist/color/constants.d.mts +9 -10
- package/dist/color/constants.mjs +15 -7
- package/dist/color/index.d.mts +9 -9
- package/dist/color/index.mjs +8 -7
- package/dist/color/instance.d.mts +35 -8
- package/dist/color/instance.mjs +53 -13
- package/dist/color/misc/alpha.d.mts +0 -1
- package/dist/color/misc/alpha.mjs +5 -5
- package/dist/color/misc/get.d.mts +42 -13
- package/dist/color/misc/get.mjs +45 -24
- package/dist/color/misc/index.d.mts +4 -4
- package/dist/color/misc/index.mjs +12 -12
- package/dist/color/misc/is.d.mts +56 -3
- package/dist/color/misc/is.mjs +72 -4
- package/dist/color/misc/state.d.mts +2 -2
- package/dist/color/misc/state.mjs +79 -43
- package/dist/color/models.d.mts +18 -2
- package/dist/color/space/hex.d.mts +38 -5
- package/dist/color/space/hex.mjs +57 -9
- package/dist/color/space/hsl.d.mts +33 -7
- package/dist/color/space/hsl.mjs +65 -14
- package/dist/color/space/hwb.d.mts +52 -0
- package/dist/color/space/hwb.mjs +99 -0
- package/dist/color/space/rgb.d.mts +26 -5
- package/dist/color/space/rgb.mjs +82 -28
- package/dist/function/assert.d.mts +1 -2
- package/dist/function/limit.d.mts +0 -1
- package/dist/function/memoize.d.mts +0 -1
- package/dist/function/once.d.mts +0 -1
- package/dist/function/retry.d.mts +0 -1
- package/dist/function/work.d.mts +0 -1
- package/dist/herald.d.mts +0 -1
- package/dist/index.d.mts +296 -51
- package/dist/index.mjs +657 -259
- package/dist/internal/array/callbacks.d.mts +0 -1
- package/dist/internal/array/callbacks.mjs +0 -1
- package/dist/internal/array/group.d.mts +0 -1
- package/dist/internal/array/index-of.d.mts +0 -1
- package/dist/internal/function/timer.d.mts +0 -1
- package/dist/internal/is.d.mts +0 -1
- package/dist/internal/is.mjs +1 -1
- package/dist/internal/math/aggregate.d.mts +0 -1
- package/dist/internal/math/misc.d.mts +12 -0
- package/dist/internal/math/misc.mjs +19 -0
- package/dist/internal/result.d.mts +0 -1
- package/dist/internal/value/compare.d.mts +0 -1
- package/dist/internal/value/equal.d.mts +0 -1
- package/dist/internal/value/get.d.mts +0 -1
- package/dist/internal/value/handlers.d.mts +0 -1
- package/dist/internal/value/has.d.mts +0 -1
- package/dist/internal/value/misc.d.mts +0 -1
- package/dist/internal/value/set.d.mts +0 -1
- package/dist/is.d.mts +0 -1
- package/dist/math.d.mts +1 -9
- package/dist/math.mjs +1 -16
- package/dist/models.d.mts +6 -6
- package/dist/promise/delay.d.mts +0 -1
- package/dist/promise/helpers.d.mts +0 -1
- package/dist/promise/index.d.mts +0 -1
- package/dist/promise/misc.d.mts +0 -1
- package/dist/promise/models.d.mts +4 -5
- package/dist/promise/models.mjs +1 -1
- package/dist/promise/timed.d.mts +0 -1
- package/dist/query.d.mts +0 -1
- package/dist/query.mjs +1 -1
- package/dist/queue.d.mts +0 -1
- package/dist/random.d.mts +0 -1
- package/dist/result/index.d.mts +0 -1
- package/dist/result/index.mjs +2 -1
- package/dist/result/match.d.mts +0 -1
- package/dist/result/misc.d.mts +0 -1
- package/dist/result/models.d.mts +0 -1
- package/dist/result/work/flow.d.mts +0 -1
- package/dist/result/work/pipe.d.mts +0 -1
- package/dist/string/fuzzy.d.mts +0 -1
- package/dist/string/index.d.mts +0 -1
- package/dist/string/index.mjs +1 -1
- package/dist/string/template.d.mts +0 -1
- package/dist/value/clone.d.mts +0 -1
- package/dist/value/freeze.d.mts +1 -2
- package/dist/value/merge.d.mts +0 -1
- package/dist/value/omit.d.mts +0 -1
- package/dist/value/pick.d.mts +0 -1
- package/dist/value/shake.d.mts +1 -2
- package/dist/value/smush.d.mts +1 -2
- package/dist/value/transform.d.mts +1 -2
- package/dist/value/unsmush.d.mts +1 -2
- package/package.json +5 -5
- package/src/color/constants.ts +17 -13
- package/src/color/index.ts +21 -6
- package/src/color/instance.ts +67 -14
- package/src/color/misc/alpha.ts +6 -10
- package/src/color/misc/get.ts +70 -16
- package/src/color/misc/index.ts +18 -17
- package/src/color/misc/is.ts +86 -3
- package/src/color/misc/state.ts +126 -40
- package/src/color/models.ts +19 -1
- package/src/color/space/hex.ts +55 -8
- package/src/color/space/hsl.ts +80 -14
- package/src/color/space/hwb.ts +123 -0
- package/src/color/space/rgb.ts +108 -27
- package/src/internal/math/misc.ts +28 -0
- package/src/math.ts +2 -29
package/dist/index.d.mts
CHANGED
|
@@ -59,11 +59,11 @@ type NestedArray<Value> = Value extends Array<infer NestedValue> ? NestedArray<N
|
|
|
59
59
|
* All nested keys of an object as dot notation strings _(up to 5 levels deep)_
|
|
60
60
|
*/
|
|
61
61
|
type NestedKeys<Value extends PlainObject> = _NestedKeys<Value>;
|
|
62
|
-
type _NestedKeys<Value, Depth extends number = 5> = Depth extends 0 ? never : Value extends readonly any[] ? Value extends readonly [any, ...any] ? { [ItemKey in keyof Value]-?: ItemKey extends `${number}` ? NonNullable<Value[ItemKey]> extends readonly any[] | PlainObject ? `${ItemKey}` | `${ItemKey}.${_NestedKeys<NonNullable<Value[ItemKey]>, SubtractDepth<Depth>>}` : `${ItemKey}` : never }[number] : never : Value extends PlainObject ? { [ItemKey in keyof Value]-?: ItemKey extends number | string ? NonNullable<Value[ItemKey]> extends readonly any[] | PlainObject ? `${ItemKey}` | `${ItemKey}.${_NestedKeys<NonNullable<Value[ItemKey]>, SubtractDepth<Depth>>}` : `${ItemKey}` : never }[keyof Value] : never;
|
|
62
|
+
type _NestedKeys<Value, Depth extends number = 5> = Depth extends 0 ? never : Value extends readonly any[] ? Value extends readonly [any, ...any] ? { [ItemKey in keyof Value]-?: ItemKey extends `${number}` ? NonNullable<Value[ItemKey]> extends readonly any[] | PlainObject ? `${ItemKey}` | `${ItemKey}.${_NestedKeys<NonNullable<Value[ItemKey]>, SubtractDepth<Depth>>}` : `${ItemKey}` : never; }[number] : never : Value extends PlainObject ? { [ItemKey in keyof Value]-?: ItemKey extends number | string ? NonNullable<Value[ItemKey]> extends readonly any[] | PlainObject ? `${ItemKey}` | `${ItemKey}.${_NestedKeys<NonNullable<Value[ItemKey]>, SubtractDepth<Depth>>}` : `${ItemKey}` : never; }[keyof Value] : never;
|
|
63
63
|
/**
|
|
64
64
|
* An extended version of `Partial` that allows for nested properties to be optional
|
|
65
65
|
*/
|
|
66
|
-
type NestedPartial<Value> = { [ItemKey in keyof Value]?: Value[ItemKey] extends object ? NestedPartial<Value[ItemKey]> : Value[ItemKey] };
|
|
66
|
+
type NestedPartial<Value> = { [ItemKey in keyof Value]?: Value[ItemKey] extends object ? NestedPartial<Value[ItemKey]> : Value[ItemKey]; };
|
|
67
67
|
/**
|
|
68
68
|
* The value for a nested key of an object
|
|
69
69
|
*/
|
|
@@ -72,15 +72,15 @@ type _NestedValue<Value, Path extends string> = Path extends `${infer ItemKey}.$
|
|
|
72
72
|
/**
|
|
73
73
|
* The nested _(keyed)_ values of an object _(up to 5 levels deep)_
|
|
74
74
|
*/
|
|
75
|
-
type NestedValues<Value extends PlainObject> = { [Path in NestedKeys<Value>]: NestedValue<Value, Path
|
|
75
|
+
type NestedValues<Value extends PlainObject> = { [Path in NestedKeys<Value>]: NestedValue<Value, Path>; };
|
|
76
76
|
/**
|
|
77
77
|
* The numerical keys of an object
|
|
78
78
|
*/
|
|
79
|
-
type NumericalKeys<Value> = { [ItemKey in keyof Value]: ItemKey extends number ? ItemKey : ItemKey extends `${number}` ? ItemKey : never }[keyof Value];
|
|
79
|
+
type NumericalKeys<Value> = { [ItemKey in keyof Value]: ItemKey extends number ? ItemKey : ItemKey extends `${number}` ? ItemKey : never; }[keyof Value];
|
|
80
80
|
/**
|
|
81
81
|
* The numerical values of an object
|
|
82
82
|
*/
|
|
83
|
-
type NumericalValues<Item extends PlainObject> = { [ItemKey in keyof Item as Item[ItemKey] extends number ? ItemKey : never]: Item[ItemKey] };
|
|
83
|
+
type NumericalValues<Item extends PlainObject> = { [ItemKey in keyof Item as Item[ItemKey] extends number ? ItemKey : never]: Item[ItemKey]; };
|
|
84
84
|
/**
|
|
85
85
|
* An asynchronous function that can only be called once, returning the same value on subsequent calls
|
|
86
86
|
*/
|
|
@@ -131,7 +131,7 @@ type RequiredKeys<Model extends object, Keys extends keyof Model> = Required<Pic
|
|
|
131
131
|
*
|
|
132
132
|
* _(Thanks, type-fest!)_
|
|
133
133
|
*/
|
|
134
|
-
type Simplify<Value> = { [ValueKey in keyof Value]: Value[ValueKey] } & {};
|
|
134
|
+
type Simplify<Value> = { [ValueKey in keyof Value]: Value[ValueKey]; } & {};
|
|
135
135
|
type SubtractDepth<Value extends number> = Value extends 5 ? 4 : Value extends 4 ? 3 : Value extends 3 ? 2 : Value extends 2 ? 1 : Value extends 1 ? 0 : never;
|
|
136
136
|
/**
|
|
137
137
|
* Get the value's type as a string
|
|
@@ -2881,7 +2881,7 @@ type ArrayKeySorter<Item extends PlainObject, ItemKey extends keyof Item> = {
|
|
|
2881
2881
|
/**
|
|
2882
2882
|
* Sorters based on keys in an object
|
|
2883
2883
|
*/
|
|
2884
|
-
type ArrayKeySorters<Item extends PlainObject> = { [ItemKey in keyof Item]: ArrayKeySorter<Item, ItemKey
|
|
2884
|
+
type ArrayKeySorters<Item extends PlainObject> = { [ItemKey in keyof Item]: ArrayKeySorter<Item, ItemKey>; }[keyof Item];
|
|
2885
2885
|
/**
|
|
2886
2886
|
* Sorter to use for sorting
|
|
2887
2887
|
*/
|
|
@@ -3787,7 +3787,7 @@ type AssertProperty<Value extends PlainObject, Path extends NestedKeys<Value>, A
|
|
|
3787
3787
|
* A function that asserts a value is of a specific type, throwing an error if it is not
|
|
3788
3788
|
*/
|
|
3789
3789
|
type Asserter<Value> = (value: unknown) => asserts value is Value;
|
|
3790
|
-
type NestedPick<Value, Path extends string> = Value extends PlainObject ? Path extends `${infer Head}.${infer Rest}` ? Head extends keyof Value ? { [Key in Head]: NestedPick<Value[Key], Rest
|
|
3790
|
+
type NestedPick<Value, Path extends string> = Value extends PlainObject ? Path extends `${infer Head}.${infer Rest}` ? Head extends keyof Value ? { [Key in Head]: NestedPick<Value[Key], Rest>; } : never : Path extends keyof Value ? { [Key in Path]: Value[Key]; } : never : never;
|
|
3791
3791
|
/**
|
|
3792
3792
|
* Asserts that a condition is true, throwing an error if it is not
|
|
3793
3793
|
*
|
|
@@ -5482,7 +5482,7 @@ declare function diff<First, Second = First>(first: First, second: Second, optio
|
|
|
5482
5482
|
/**
|
|
5483
5483
|
* A frozen value with readonly properties _(going as deep as possible)_
|
|
5484
5484
|
*/
|
|
5485
|
-
type Frozen<Value> = Value extends unknown[] ? Readonly<Value> : Value extends PlainObject ? { readonly [Key in keyof Value]: Frozen<Value[Key]
|
|
5485
|
+
type Frozen<Value> = Value extends unknown[] ? Readonly<Value> : Value extends PlainObject ? { readonly [Key in keyof Value]: Frozen<Value[Key]>; } : Value extends Map<infer Key, infer Value> ? ReadonlyMap<Key, Frozen<Value>> : Value extends Set<infer Item> ? ReadonlySet<Frozen<Item>> : Readonly<Value>;
|
|
5486
5486
|
/**
|
|
5487
5487
|
* Freeze an array and its indiced values, but not any nested values
|
|
5488
5488
|
*
|
|
@@ -5643,7 +5643,7 @@ declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(v
|
|
|
5643
5643
|
/**
|
|
5644
5644
|
* A shaken object, without any `undefined` values
|
|
5645
5645
|
*/
|
|
5646
|
-
type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] extends undefined ? never : Value[Key] };
|
|
5646
|
+
type Shaken<Value extends PlainObject> = { [Key in keyof Value]: Value[Key] extends undefined ? never : Value[Key]; };
|
|
5647
5647
|
/**
|
|
5648
5648
|
* Shake an object, removing all keys with `undefined` values
|
|
5649
5649
|
*
|
|
@@ -5656,7 +5656,7 @@ declare function shake<Value extends PlainObject>(value: Value): Shaken<Value>;
|
|
|
5656
5656
|
/**
|
|
5657
5657
|
* A smushed object, with all nested objects flattened into a single level, using dot notation keys
|
|
5658
5658
|
*/
|
|
5659
|
-
type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey
|
|
5659
|
+
type Smushed<Value extends PlainObject> = Simplify<{ [NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>>; }>;
|
|
5660
5660
|
/**
|
|
5661
5661
|
* Smush an object into a flat object that uses dot notation keys
|
|
5662
5662
|
*
|
|
@@ -5673,7 +5673,7 @@ type KeysOfUnion<ObjectType> = keyof UnionToIntersection<ObjectType extends unkn
|
|
|
5673
5673
|
/**
|
|
5674
5674
|
* An unsmushed object, with all dot notation keys turned into nested keys
|
|
5675
5675
|
*/
|
|
5676
|
-
type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey] }, `${string}.${string}`>>;
|
|
5676
|
+
type Unsmushed<Value extends PlainObject> = Simplify<Omit<{ [UnionKey in KeysOfUnion<Value>]: Value[UnionKey]; }, `${string}.${string}`>>;
|
|
5677
5677
|
/**
|
|
5678
5678
|
* Unsmush a smushed object _(turning dot notation keys into nested keys)_
|
|
5679
5679
|
*
|
|
@@ -5795,7 +5795,7 @@ type TransformCallback<Value extends PlainObject, Key extends keyof Value> = (ke
|
|
|
5795
5795
|
/**
|
|
5796
5796
|
* A collection of keyed callbacks to transform an object's properties
|
|
5797
5797
|
*/
|
|
5798
|
-
type TransformCallbacks<Value extends PlainObject> = Partial<{ [Key in keyof Value]: (value: Value[Key]) => Value[Key] }>;
|
|
5798
|
+
type TransformCallbacks<Value extends PlainObject> = Partial<{ [Key in keyof Value]: (value: Value[Key]) => Value[Key]; }>;
|
|
5799
5799
|
/**
|
|
5800
5800
|
* A transformer function for an object, with predefined callbacks for transforming its properties
|
|
5801
5801
|
*/
|
|
@@ -6001,6 +6001,21 @@ type HSLColor = {
|
|
|
6001
6001
|
*/
|
|
6002
6002
|
saturation: number;
|
|
6003
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;
|
|
6004
6019
|
/**
|
|
6005
6020
|
* An _RGB_ color with an alpha channel _(opacity)_
|
|
6006
6021
|
*/
|
|
@@ -6036,16 +6051,13 @@ declare class Color {
|
|
|
6036
6051
|
*/
|
|
6037
6052
|
private readonly $color;
|
|
6038
6053
|
/**
|
|
6039
|
-
* Get the alpha channel _(opacity)_ of the color
|
|
6054
|
+
* Get the alpha channel _(opacity)_ of the color as a percentage between `0` and `100`
|
|
6040
6055
|
*
|
|
6041
|
-
* @returns Current alpha channel value
|
|
6056
|
+
* @returns Current alpha channel value
|
|
6042
6057
|
*/
|
|
6043
6058
|
get alpha(): number;
|
|
6044
6059
|
/**
|
|
6045
|
-
* Set the alpha channel _(opacity)_ of the color
|
|
6046
|
-
*
|
|
6047
|
-
* - A number between `0` and `1`, where `0` is fully transparent and `1` is fully opaque
|
|
6048
|
-
* - A number between `0` and `100`, where `0` is fully transparent and `100` is fully opaque
|
|
6060
|
+
* Set the alpha channel _(opacity)_ of the color as a percentage between `0` and `100`
|
|
6049
6061
|
*
|
|
6050
6062
|
* @param value New alpha channel value
|
|
6051
6063
|
*/
|
|
@@ -6108,6 +6120,30 @@ declare class Color {
|
|
|
6108
6120
|
* @param value New _HSLA_ color
|
|
6109
6121
|
*/
|
|
6110
6122
|
set hsla(value: HSLAColor);
|
|
6123
|
+
/**
|
|
6124
|
+
* Get the color as an _HWB_ color
|
|
6125
|
+
*
|
|
6126
|
+
* @returns Current color as an _HWB_ color
|
|
6127
|
+
*/
|
|
6128
|
+
get hwb(): HWBColor;
|
|
6129
|
+
/**
|
|
6130
|
+
* Set colors from an _HWB_ color
|
|
6131
|
+
*
|
|
6132
|
+
* @param value New _HWB_ color
|
|
6133
|
+
*/
|
|
6134
|
+
set hwb(value: HWBColor);
|
|
6135
|
+
/**
|
|
6136
|
+
* Get the color as an _HWBA_ color
|
|
6137
|
+
*
|
|
6138
|
+
* @returns Current color as an _HWBA_ color
|
|
6139
|
+
*/
|
|
6140
|
+
get hwba(): HWBAColor;
|
|
6141
|
+
/**
|
|
6142
|
+
* Set colors and alpha from an _HWBA_ color
|
|
6143
|
+
*
|
|
6144
|
+
* @param value New _HWBA_ color
|
|
6145
|
+
*/
|
|
6146
|
+
set hwba(value: HWBAColor);
|
|
6111
6147
|
/**
|
|
6112
6148
|
* Get the color as an _RGB_ color
|
|
6113
6149
|
*
|
|
@@ -6147,6 +6183,13 @@ declare class Color {
|
|
|
6147
6183
|
* @returns _HSL(A)_ color string
|
|
6148
6184
|
*/
|
|
6149
6185
|
toHslString(alpha?: boolean): string;
|
|
6186
|
+
/**
|
|
6187
|
+
* Get the color as an _HWB(A)_ string
|
|
6188
|
+
*
|
|
6189
|
+
* @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_
|
|
6190
|
+
* @returns _HWB(A)_ color string
|
|
6191
|
+
*/
|
|
6192
|
+
toHwbString(alpha?: boolean): string;
|
|
6150
6193
|
/**
|
|
6151
6194
|
* Get the color as an _RGB(A)_ string
|
|
6152
6195
|
*
|
|
@@ -6163,10 +6206,20 @@ declare class Color {
|
|
|
6163
6206
|
}
|
|
6164
6207
|
//#endregion
|
|
6165
6208
|
//#region src/color/misc/get.d.ts
|
|
6209
|
+
/**
|
|
6210
|
+
* Get a foreground color _(usually text)_ based on a background color's luminance as an unprefixed hex color string
|
|
6211
|
+
*
|
|
6212
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6213
|
+
* - If the value cannot be parsed, a white foreground color will be returned
|
|
6214
|
+
*
|
|
6215
|
+
* @param value Original value
|
|
6216
|
+
* @returns Foreground color
|
|
6217
|
+
*/
|
|
6218
|
+
declare function getForegroundColor(value: unknown, hex: true): string;
|
|
6166
6219
|
/**
|
|
6167
6220
|
* Get a foreground color _(usually text)_ based on a background color's luminance
|
|
6168
6221
|
*
|
|
6169
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6222
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6170
6223
|
* - If the value cannot be parsed, a white foreground color will be returned
|
|
6171
6224
|
*
|
|
6172
6225
|
* @param value Original value
|
|
@@ -6176,8 +6229,8 @@ declare function getForegroundColor(value: unknown): Color;
|
|
|
6176
6229
|
/**
|
|
6177
6230
|
* Get the hex color _(with alpha channel, i.e., opacity)_ from any kind of value
|
|
6178
6231
|
*
|
|
6179
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6180
|
-
* - If the value cannot be parsed, a black hex color
|
|
6232
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6233
|
+
* - If the value cannot be parsed, a black hex color will be returned
|
|
6181
6234
|
*
|
|
6182
6235
|
* @param value Original value
|
|
6183
6236
|
* @returns Hex color string
|
|
@@ -6186,7 +6239,7 @@ declare function getHexaColor(value: unknown): string;
|
|
|
6186
6239
|
/**
|
|
6187
6240
|
* Get the hex color from any kind of value
|
|
6188
6241
|
*
|
|
6189
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6242
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6190
6243
|
* - If the value cannot be parsed, a black hex color will be returned
|
|
6191
6244
|
*
|
|
6192
6245
|
* @param value Original value
|
|
@@ -6196,17 +6249,37 @@ declare function getHexColor(value: unknown): string;
|
|
|
6196
6249
|
/**
|
|
6197
6250
|
* Get the _HSLA_ color from any kind of value
|
|
6198
6251
|
*
|
|
6199
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6200
|
-
* - If the value cannot be parsed, a black _HSLA_ color
|
|
6252
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6253
|
+
* - If the value cannot be parsed, a black _HSLA_ color will be returned
|
|
6201
6254
|
*
|
|
6202
6255
|
* @param value Original value
|
|
6203
6256
|
* @returns _HSLA_ color
|
|
6204
6257
|
*/
|
|
6205
6258
|
declare function getHslaColor(value: unknown): HSLAColor;
|
|
6259
|
+
/**
|
|
6260
|
+
* Get the _HWB_ color from any kind of value
|
|
6261
|
+
*
|
|
6262
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6263
|
+
* - If the value cannot be parsed, a black _HWB_ color will be returned
|
|
6264
|
+
*
|
|
6265
|
+
* @param value Original value
|
|
6266
|
+
* @returns _HWB_ color
|
|
6267
|
+
*/
|
|
6268
|
+
declare function getHwbColor(value: unknown): HWBColor;
|
|
6269
|
+
/**
|
|
6270
|
+
* Get the _HWBA_ color from any kind of value
|
|
6271
|
+
*
|
|
6272
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6273
|
+
* - If the value cannot be parsed, a black _HWBA_ color will be returned
|
|
6274
|
+
*
|
|
6275
|
+
* @param value Original value
|
|
6276
|
+
* @returns _HWBA_ color
|
|
6277
|
+
*/
|
|
6278
|
+
declare function getHwbaColor(value: unknown): HWBAColor;
|
|
6206
6279
|
/**
|
|
6207
6280
|
* Get the _HSL_ color from any kind of value
|
|
6208
6281
|
*
|
|
6209
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6282
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6210
6283
|
* - If the value cannot be parsed, a black _HSL_ color will be returned
|
|
6211
6284
|
*
|
|
6212
6285
|
* @param value Original value
|
|
@@ -6216,8 +6289,8 @@ declare function getHslColor(value: unknown): HSLColor;
|
|
|
6216
6289
|
/**
|
|
6217
6290
|
* Get the _RGBA_ color from any kind of value
|
|
6218
6291
|
*
|
|
6219
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6220
|
-
* - If the value cannot be parsed, a black _RGBA_ color
|
|
6292
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6293
|
+
* - If the value cannot be parsed, a black _RGBA_ color will be returned
|
|
6221
6294
|
*
|
|
6222
6295
|
* @param value Original value
|
|
6223
6296
|
* @returns _RGBA_ color
|
|
@@ -6226,7 +6299,7 @@ declare function getRgbaColor(value: unknown): RGBAColor;
|
|
|
6226
6299
|
/**
|
|
6227
6300
|
* Get the _RGB_ color from any kind of value
|
|
6228
6301
|
*
|
|
6229
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6302
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6230
6303
|
* - If the value cannot be parsed, a black _RGB_ color will be returned
|
|
6231
6304
|
*
|
|
6232
6305
|
* @param value Original value
|
|
@@ -6273,7 +6346,41 @@ declare function isHslaColor(value: unknown): value is HSLAColor;
|
|
|
6273
6346
|
* @returns `true` if the value is an _HSL_ color, otherwise `false`
|
|
6274
6347
|
*/
|
|
6275
6348
|
declare function isHslColor(value: unknown): value is HSLColor;
|
|
6349
|
+
/**
|
|
6350
|
+
* Is the value like an _HSL_ color?
|
|
6351
|
+
*
|
|
6352
|
+
* @param value Value to check
|
|
6353
|
+
* @returns `true` if the value is like an _HSL_ color, otherwise `false`
|
|
6354
|
+
*/
|
|
6276
6355
|
declare function isHslLike(value: unknown): value is Record<keyof HSLColor, unknown>;
|
|
6356
|
+
/**
|
|
6357
|
+
* Is the value an _HWBA_ color?
|
|
6358
|
+
*
|
|
6359
|
+
* @param value Value to check
|
|
6360
|
+
* @returns `true` if the value is an _HWBA_ color, otherwise `false`
|
|
6361
|
+
*/
|
|
6362
|
+
declare function isHwbaColor(value: unknown): value is HWBAColor;
|
|
6363
|
+
/**
|
|
6364
|
+
* Is the value like an _HWBA_ color?
|
|
6365
|
+
*
|
|
6366
|
+
* @param value Value to check
|
|
6367
|
+
* @returns `true` if the value is like an _HWBA_ color, otherwise `false`
|
|
6368
|
+
*/
|
|
6369
|
+
declare function isHwbaLike(value: unknown): value is Record<keyof HWBAColor, unknown>;
|
|
6370
|
+
/**
|
|
6371
|
+
* Is the value an _HWB_ color?
|
|
6372
|
+
*
|
|
6373
|
+
* @param value Value to check
|
|
6374
|
+
* @returns `true` if the value is an _HWB_ color, otherwise `false`
|
|
6375
|
+
*/
|
|
6376
|
+
declare function isHwbColor(value: unknown): value is HWBColor;
|
|
6377
|
+
/**
|
|
6378
|
+
* Is the value like an _HWB_ color?
|
|
6379
|
+
*
|
|
6380
|
+
* @param value Value to check
|
|
6381
|
+
* @returns `true` if the value is like an _HWB_ color, otherwise `false`
|
|
6382
|
+
*/
|
|
6383
|
+
declare function isHwbLike(value: unknown): value is Record<keyof HWBColor, unknown>;
|
|
6277
6384
|
/**
|
|
6278
6385
|
* Is the value an _RGBA_ color?
|
|
6279
6386
|
*
|
|
@@ -6288,6 +6395,12 @@ declare function isRgbaColor(value: unknown): value is RGBAColor;
|
|
|
6288
6395
|
* @returns `true` if the value is an _RGB_ color, otherwise `false`
|
|
6289
6396
|
*/
|
|
6290
6397
|
declare function isRgbColor(value: unknown): value is RGBColor;
|
|
6398
|
+
/**
|
|
6399
|
+
* Is the value like an _RGB_ color?
|
|
6400
|
+
*
|
|
6401
|
+
* @param value Value to check
|
|
6402
|
+
* @returns `true` if the value is like an _RGB_ color, otherwise `false`
|
|
6403
|
+
*/
|
|
6291
6404
|
declare function isRgbLike(value: unknown): value is Record<keyof RGBColor, unknown>;
|
|
6292
6405
|
//#endregion
|
|
6293
6406
|
//#region src/color/space/hex.d.ts
|
|
@@ -6301,12 +6414,46 @@ declare function isRgbLike(value: unknown): value is Record<keyof RGBColor, unkn
|
|
|
6301
6414
|
* @returns Normalized hex color
|
|
6302
6415
|
*/
|
|
6303
6416
|
declare function getNormalizedHex(value: unknown, alpha?: boolean): string;
|
|
6417
|
+
/**
|
|
6418
|
+
* Convert a hex color string to a _HSL_ color
|
|
6419
|
+
*
|
|
6420
|
+
* _If the value is unable to be converted, a black _HSL_ color will be returned_
|
|
6421
|
+
*
|
|
6422
|
+
* @param value Hex color string
|
|
6423
|
+
* @returns _HSL_ color
|
|
6424
|
+
*/
|
|
6304
6425
|
declare function hexToHsl(value: string): HSLColor;
|
|
6426
|
+
/**
|
|
6427
|
+
* Convert a hex color string to a _HSLA_ color
|
|
6428
|
+
*
|
|
6429
|
+
* _If the value is unable to be converted, a black _HSLA_ color will be returned_
|
|
6430
|
+
*
|
|
6431
|
+
* @param value Hex color string
|
|
6432
|
+
* @returns _HSLA_ color
|
|
6433
|
+
*/
|
|
6305
6434
|
declare function hexToHsla(value: string): HSLAColor;
|
|
6435
|
+
/**
|
|
6436
|
+
* Convert a hex color string to a _HWB_ color
|
|
6437
|
+
*
|
|
6438
|
+
* _If the value is unable to be converted, a black _HWB_ color will be returned_
|
|
6439
|
+
*
|
|
6440
|
+
* @param value Hex color string
|
|
6441
|
+
* @returns _HWB_ color
|
|
6442
|
+
*/
|
|
6443
|
+
declare function hexToHwb(value: string): HWBColor;
|
|
6444
|
+
/**
|
|
6445
|
+
* Convert a hex color string to a _HWBA_ color
|
|
6446
|
+
*
|
|
6447
|
+
* _If the value is unable to be converted, a black _HWBA_ color will be returned_
|
|
6448
|
+
*
|
|
6449
|
+
* @param value Hex color string
|
|
6450
|
+
* @returns _HWBA_ color
|
|
6451
|
+
*/
|
|
6452
|
+
declare function hexToHwba(value: string): HWBAColor;
|
|
6306
6453
|
/**
|
|
6307
6454
|
* Convert a hex color to an _RGB_ color
|
|
6308
6455
|
*
|
|
6309
|
-
* _If the value is unable to be converted, a black
|
|
6456
|
+
* _If the value is unable to be converted, a black _RGB_ color will be returned_
|
|
6310
6457
|
*
|
|
6311
6458
|
* @param value Original value
|
|
6312
6459
|
* @returns _RGB_ color
|
|
@@ -6315,7 +6462,7 @@ declare function hexToRgb(value: string): RGBColor;
|
|
|
6315
6462
|
/**
|
|
6316
6463
|
* Convert a hex color to an _RGBA_ color
|
|
6317
6464
|
*
|
|
6318
|
-
* _If the value is unable to be converted, a black
|
|
6465
|
+
* _If the value is unable to be converted, a black _RGBA_ color will be returned_
|
|
6319
6466
|
*
|
|
6320
6467
|
* @param value Original value
|
|
6321
6468
|
* @returns _RGBA_ color
|
|
@@ -6323,30 +6470,105 @@ declare function hexToRgb(value: string): RGBColor;
|
|
|
6323
6470
|
declare function hexToRgba(value: string): RGBAColor;
|
|
6324
6471
|
//#endregion
|
|
6325
6472
|
//#region src/color/space/hsl.d.ts
|
|
6473
|
+
/**
|
|
6474
|
+
* Convert an _HSL(A)_ color to a hex color _(with optional alpha channel, i.e., opacity)_
|
|
6475
|
+
*
|
|
6476
|
+
* _If the value is unable to be converted, a black hex color will be returned_
|
|
6477
|
+
*
|
|
6478
|
+
* @param hsl _HSL(A)_ color
|
|
6479
|
+
* @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_
|
|
6480
|
+
* @returns Hex color string
|
|
6481
|
+
*/
|
|
6326
6482
|
declare function hslToHex(hsl: HSLAColor | HSLColor, alpha?: boolean): string;
|
|
6483
|
+
/**
|
|
6484
|
+
* Convert an _HSL(A)_ color to an _HWB_ color
|
|
6485
|
+
*
|
|
6486
|
+
* _If the value is unable to be converted, a black _HWB_ color will be returned_
|
|
6487
|
+
*
|
|
6488
|
+
* @param hsl HSL(A) color
|
|
6489
|
+
* @returns _HWB_ color
|
|
6490
|
+
*/
|
|
6491
|
+
declare function hslToHwb(hsl: HSLAColor | HSLColor): HWBColor;
|
|
6492
|
+
/**
|
|
6493
|
+
* Convert an _HSL(A)_ color to an _HWBA_ color
|
|
6494
|
+
*
|
|
6495
|
+
* _If the value is unable to be converted, a black _HWBA_ color will be returned_
|
|
6496
|
+
*
|
|
6497
|
+
* @param hsl HSL(A) color
|
|
6498
|
+
* @returns _HWBA_ color
|
|
6499
|
+
*/
|
|
6500
|
+
declare function hslToHwba(hsl: HSLAColor | HSLColor): HWBAColor;
|
|
6327
6501
|
/**
|
|
6328
6502
|
* Convert an _HSL(A)_ color to an _RGB_ color
|
|
6329
6503
|
*
|
|
6330
|
-
* _If the value is unable to be converted, a black
|
|
6504
|
+
* _If the value is unable to be converted, a black _RGB_ color will be returned_
|
|
6331
6505
|
*
|
|
6332
6506
|
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L61_
|
|
6333
6507
|
*
|
|
6334
6508
|
* @param hsl HSL(A) color
|
|
6335
|
-
* @returns
|
|
6509
|
+
* @returns _RGB_ color
|
|
6336
6510
|
*/
|
|
6337
6511
|
declare function hslToRgb(hsl: HSLAColor | HSLColor): RGBColor;
|
|
6338
6512
|
/**
|
|
6339
6513
|
* Convert an _HSL(A)_ color to an _RGBA_ color
|
|
6340
6514
|
*
|
|
6341
|
-
* _If the value is unable to be converted, a black
|
|
6515
|
+
* _If the value is unable to be converted, a black _RGBA_ color will be returned_
|
|
6342
6516
|
*
|
|
6343
6517
|
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L61_
|
|
6344
6518
|
*
|
|
6345
6519
|
* @param hsl HSL(A) color
|
|
6346
|
-
* @returns
|
|
6520
|
+
* @returns _RGBA_ color
|
|
6347
6521
|
*/
|
|
6348
6522
|
declare function hslToRgba(hsl: HSLAColor | HSLColor): RGBAColor;
|
|
6349
6523
|
//#endregion
|
|
6524
|
+
//#region src/color/space/hwb.d.ts
|
|
6525
|
+
/**
|
|
6526
|
+
* Convert an _HWB(A)_ color to a hex color _(with optional alpha channel, i.e., opacity)_
|
|
6527
|
+
*
|
|
6528
|
+
* _If the value is unable to be converted, a black hex color will be returned_
|
|
6529
|
+
*
|
|
6530
|
+
* @param hwb _HWB(A)_ color
|
|
6531
|
+
* @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_
|
|
6532
|
+
* @returns Hex color string
|
|
6533
|
+
*/
|
|
6534
|
+
declare function hwbToHex(hwb: HWBAColor | HWBColor, alpha?: boolean): string;
|
|
6535
|
+
/**
|
|
6536
|
+
* Convert an _HWB(A)_ color to an _RGB_ color
|
|
6537
|
+
*
|
|
6538
|
+
* _If the value is unable to be converted, a black _RGB_ color will be returned_
|
|
6539
|
+
*
|
|
6540
|
+
* @param hwb _HWB(A)_ color
|
|
6541
|
+
* @returns _RGB_ color
|
|
6542
|
+
*/
|
|
6543
|
+
declare function hwbToHsl(hwb: HWBAColor | HWBColor): HSLColor;
|
|
6544
|
+
/**
|
|
6545
|
+
* Convert an _HWB(A)_ color to an _HSLA_ color
|
|
6546
|
+
*
|
|
6547
|
+
* _If the value is unable to be converted, a black _HSLA_ color will be returned_
|
|
6548
|
+
*
|
|
6549
|
+
* @param hwb _HWB(A)_ color
|
|
6550
|
+
* @returns _HSLA_ color
|
|
6551
|
+
*/
|
|
6552
|
+
declare function hwbToHsla(hwb: HWBAColor | HWBColor): HSLAColor;
|
|
6553
|
+
/**
|
|
6554
|
+
* Convert an _HWB(A)_ color to an _RGB_ color
|
|
6555
|
+
*
|
|
6556
|
+
* _If the value is unable to be converted, a black _RGB_ color will be returned_
|
|
6557
|
+
*
|
|
6558
|
+
* @param hwb _HWB(A)_ color
|
|
6559
|
+
* @returns _RGB_ color
|
|
6560
|
+
*/
|
|
6561
|
+
declare function hwbToRgb(hwb: HWBAColor | HWBColor): RGBColor;
|
|
6562
|
+
/**
|
|
6563
|
+
* Convert an _HWB(A)_ color to an _RGBA_ color
|
|
6564
|
+
*
|
|
6565
|
+
* _If the value is unable to be converted, a black _RGBA_ color will be returned_
|
|
6566
|
+
*
|
|
6567
|
+
* @param hwb _HWB(A)_ color
|
|
6568
|
+
* @returns _RGBA_ color
|
|
6569
|
+
*/
|
|
6570
|
+
declare function hwbToRgba(hwb: HWBAColor | HWBColor): RGBAColor;
|
|
6571
|
+
//#endregion
|
|
6350
6572
|
//#region src/color/space/rgb.d.ts
|
|
6351
6573
|
/**
|
|
6352
6574
|
* Convert an _RGB(A)_ color to a hex color _(with optional alpha channel, i.e., opacity)_
|
|
@@ -6361,7 +6583,7 @@ declare function rgbToHex(rgb: RGBAColor | RGBColor, alpha?: boolean): string;
|
|
|
6361
6583
|
/**
|
|
6362
6584
|
* Convert an _RGB(A)_ color to an _HSL_ color
|
|
6363
6585
|
*
|
|
6364
|
-
* _If the value is unable to be converted, a black
|
|
6586
|
+
* _If the value is unable to be converted, a black _HSL_ color will be returned_
|
|
6365
6587
|
*
|
|
6366
6588
|
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
|
|
6367
6589
|
*
|
|
@@ -6372,7 +6594,7 @@ declare function rgbToHsl(rgb: RGBAColor | RGBColor): HSLColor;
|
|
|
6372
6594
|
/**
|
|
6373
6595
|
* Convert an _RGB(A)_ color to an _HSLA_ color
|
|
6374
6596
|
*
|
|
6375
|
-
* _If the value is unable to be converted, a black _HSLA_ color
|
|
6597
|
+
* _If the value is unable to be converted, a black _HSLA_ color will be returned_
|
|
6376
6598
|
*
|
|
6377
6599
|
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
|
|
6378
6600
|
*
|
|
@@ -6380,12 +6602,33 @@ declare function rgbToHsl(rgb: RGBAColor | RGBColor): HSLColor;
|
|
|
6380
6602
|
* @returns _HSLA_ color
|
|
6381
6603
|
*/
|
|
6382
6604
|
declare function rgbToHsla(rgb: RGBAColor | RGBColor): HSLAColor;
|
|
6605
|
+
/**
|
|
6606
|
+
* Convert an _RGB(A)_ color to an _HWB_ color
|
|
6607
|
+
*
|
|
6608
|
+
* _If the value is unable to be converted, a black _HWB_ color will be returned_
|
|
6609
|
+
*
|
|
6610
|
+
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
|
|
6611
|
+
*
|
|
6612
|
+
* @param rgb _RGB(A)_ color
|
|
6613
|
+
* @returns _HWB_ color
|
|
6614
|
+
*/
|
|
6615
|
+
declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
|
|
6616
|
+
/**
|
|
6617
|
+
* Convert an _RGB(A)_ color to an _HWBA_ color
|
|
6618
|
+
* _If the value is unable to be converted, a black _HWBA_ color will be returned_
|
|
6619
|
+
*
|
|
6620
|
+
* _Thanks, https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js#L26_
|
|
6621
|
+
*
|
|
6622
|
+
* @param rgb _RGB(A)_ color
|
|
6623
|
+
* @returns _HWBA_ color
|
|
6624
|
+
*/
|
|
6625
|
+
declare function rgbToHwba(rgb: RGBAColor | RGBColor): HWBAColor;
|
|
6383
6626
|
//#endregion
|
|
6384
6627
|
//#region src/color/index.d.ts
|
|
6385
6628
|
/**
|
|
6386
6629
|
* Get a _Color_ from any kind of value
|
|
6387
6630
|
*
|
|
6388
|
-
* - Values that can be parsed are: hex(a) color strings, _HSL(A)_
|
|
6631
|
+
* - Values that can be parsed are: hex(a) color strings, as well as _HSL(A)_, _HWB(A)_, and _RGB(A)_ color objects
|
|
6389
6632
|
* - If the value is unable to be parsed, a black _Color_ will be returned
|
|
6390
6633
|
*
|
|
6391
6634
|
* @param value Original value
|
|
@@ -6724,6 +6967,16 @@ declare function max<Item extends PlainObject, ItemKey extends keyof NumericalVa
|
|
|
6724
6967
|
*/
|
|
6725
6968
|
declare function max(values: number[]): number;
|
|
6726
6969
|
//#endregion
|
|
6970
|
+
//#region src/internal/math/misc.d.ts
|
|
6971
|
+
/**
|
|
6972
|
+
* Round a number
|
|
6973
|
+
*
|
|
6974
|
+
* @param value Number to round
|
|
6975
|
+
* @param decimals Number of decimal places to round to _(defaults to `0`)_
|
|
6976
|
+
* @returns Rounded number, or `Number.NaN` if the value if unable to be rounded
|
|
6977
|
+
*/
|
|
6978
|
+
declare function round(value: number, decimals?: number): number;
|
|
6979
|
+
//#endregion
|
|
6727
6980
|
//#region src/math.d.ts
|
|
6728
6981
|
/**
|
|
6729
6982
|
* Get the average value from a list of items
|
|
@@ -6835,14 +7088,6 @@ declare function min<Item extends PlainObject>(items: Item[], key: keyof Numeric
|
|
|
6835
7088
|
* @returns Minimum value, or `Number.NaN` if no minimum can be found
|
|
6836
7089
|
*/
|
|
6837
7090
|
declare function min(values: number[]): number;
|
|
6838
|
-
/**
|
|
6839
|
-
* Round a number
|
|
6840
|
-
*
|
|
6841
|
-
* @param value Number to round
|
|
6842
|
-
* @param decimals Number of decimal places to round to _(defaults to `0`)_
|
|
6843
|
-
* @returns Rounded number, or `Number.NaN` if the value if unable to be rounded
|
|
6844
|
-
*/
|
|
6845
|
-
declare function round(value: number, decimals?: number): number;
|
|
6846
7091
|
/**
|
|
6847
7092
|
* Get the sum of a list of items
|
|
6848
7093
|
*
|
|
@@ -6973,7 +7218,7 @@ type PromiseStrategy = 'complete' | 'first';
|
|
|
6973
7218
|
declare class PromiseTimeoutError extends Error {
|
|
6974
7219
|
constructor();
|
|
6975
7220
|
}
|
|
6976
|
-
type PromisesItems<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Promise<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Promise<Value> : Promise<Items[ItemsKey]
|
|
7221
|
+
type PromisesItems<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Promise<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Promise<Value> : Promise<Items[ItemsKey]>; };
|
|
6977
7222
|
/**
|
|
6978
7223
|
* Options for handling multiple _Promises_
|
|
6979
7224
|
*/
|
|
@@ -6987,10 +7232,10 @@ type PromisesOptions = {
|
|
|
6987
7232
|
*/
|
|
6988
7233
|
strategy?: PromiseStrategy;
|
|
6989
7234
|
};
|
|
6990
|
-
type PromisesResult<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never };
|
|
6991
|
-
type PromisesUnwrapped<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Awaited<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Awaited<Value> : never };
|
|
7235
|
+
type PromisesResult<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends Promise<infer Value> ? Result<Awaited<Value>> : never; };
|
|
7236
|
+
type PromisesUnwrapped<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? Awaited<Value> : never : Items[ItemsKey] extends Promise<infer Value> ? Awaited<Value> : never; };
|
|
6992
7237
|
type PromisesValue<Value> = FulfilledPromise<Value> | RejectedPromise;
|
|
6993
|
-
type PromisesValues<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never : Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never };
|
|
7238
|
+
type PromisesValues<Items extends unknown[]> = { [ItemsKey in keyof Items]: Items[ItemsKey] extends GenericCallback ? ReturnType<Items[ItemsKey]> extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never : Items[ItemsKey] extends Promise<infer Value> ? PromisesValue<Awaited<Value>> : never; };
|
|
6994
7239
|
/**
|
|
6995
7240
|
* A _Promise_ that was rejected
|
|
6996
7241
|
*/
|
|
@@ -8186,4 +8431,4 @@ declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
8186
8431
|
get(value: Value, update?: boolean): Value | undefined;
|
|
8187
8432
|
}
|
|
8188
8433
|
//#endregion
|
|
8189
|
-
export { AnyResult, ArrayComparison, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayValueSorter, AssertProperty, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise, type Beacon, type BeaconOptions, BuiltIns, CancelableCallback, CancelablePromise, type Color, Constructor, DiffOptions, DiffResult, DiffValue, EqualOptions, Err, EventPosition, type Events, ExtendedErr, ExtendedResult, Flow, FlowPromise, Frozen, FulfilledPromise, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzySearchOptions, GenericAsyncCallback, GenericCallback, type HSLAColor, type HSLColor, type Herald, Key$1 as Key, type KeyedQueue, KeyedValue, Logger, type Memoized, type MemoizedOptions, MergeOptions, Merger, NestedArray, NestedKeys, NestedPartial, NestedValue, NestedValues, NormalizeOptions, Normalizer, NumericalKeys, NumericalValues, type Observable, type Observer, Ok, OnceAsyncCallback, OnceCallback, PROMISE_ABORT_EVENT, PROMISE_ABORT_OPTIONS, PROMISE_ERROR_NAME, PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_RESULT, PROMISE_MESSAGE_EXPECTATION_TIMED, PROMISE_MESSAGE_TIMEOUT, PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED, PlainObject, Primitive, PromiseData, PromiseHandlers, PromiseOptions, PromiseParameters, PromiseStrategy, PromiseTimeoutError, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValue, PromisesValues, type Queue, type QueueError, type QueueOptions, type Queued, type QueuedResult, type RGBAColor, type RGBColor, RejectedPromise, RequiredKeys, Result, ResultMatch, RetryError, RetryOptions, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, type Shaken, Simplify, SizedMap, SizedSet, type Smushed, SortDirection, Sorter, type 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, 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, hexToRgb, hexToRgba, hslToHex, hslToRgb, hslToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, interpolate, intersection, isArrayOrPlainObject, isColor, isConstructor, isEmpty, isError, isFrozen, isFulfilled, isHexColor, isHslColor, isHslLike, isHslaColor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isOk, isPlainObject, isPrimitive, isRejected, isResult, isRgbColor, isRgbLike, isRgbaColor, isSorted, isTypedArray, join, 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, 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 };
|
|
8434
|
+
export { AnyResult, ArrayComparison, ArrayComparisonSorter, ArrayKeySorter, ArrayOrPlainObject, ArrayValueSorter, AssertProperty, Asserter, AssignOptions, Assigner, AsyncCancelableCallback, AttemptFlow, AttemptFlowPromise, type Beacon, type BeaconOptions, BuiltIns, CancelableCallback, CancelablePromise, type Color, Constructor, DiffOptions, DiffResult, DiffValue, EqualOptions, Err, EventPosition, type Events, ExtendedErr, ExtendedResult, Flow, FlowPromise, Frozen, FulfilledPromise, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzySearchOptions, GenericAsyncCallback, GenericCallback, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type Herald, Key$1 as Key, type KeyedQueue, KeyedValue, Logger, type Memoized, type MemoizedOptions, MergeOptions, Merger, NestedArray, NestedKeys, NestedPartial, NestedValue, NestedValues, NormalizeOptions, Normalizer, NumericalKeys, NumericalValues, type Observable, type Observer, Ok, OnceAsyncCallback, OnceCallback, PROMISE_ABORT_EVENT, PROMISE_ABORT_OPTIONS, PROMISE_ERROR_NAME, PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_RESULT, PROMISE_MESSAGE_EXPECTATION_TIMED, PROMISE_MESSAGE_TIMEOUT, PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED, PlainObject, Primitive, PromiseData, PromiseHandlers, PromiseOptions, PromiseParameters, PromiseStrategy, PromiseTimeoutError, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValue, PromisesValues, type Queue, type QueueError, type QueueOptions, type Queued, type QueuedResult, type RGBAColor, type RGBColor, RejectedPromise, RequiredKeys, Result, ResultMatch, RetryError, RetryOptions, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, type Shaken, Simplify, SizedMap, SizedSet, type Smushed, SortDirection, Sorter, type 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, isColor, isConstructor, isEmpty, isError, isFrozen, isFulfilled, isHexColor, isHslColor, isHslLike, isHslaColor, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isOk, isPlainObject, isPrimitive, isRejected, isResult, isRgbColor, isRgbLike, isRgbaColor, isSorted, isTypedArray, join, 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 };
|