@oscarpalmer/atoms 0.204.0 → 0.205.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/filter.d.mts +1 -1
- package/dist/array/find.d.mts +3 -3
- package/dist/array/first.d.mts +3 -4
- package/dist/array/first.mjs +1 -1
- package/dist/array/group-by.d.mts +3 -3
- package/dist/array/index.d.mts +2 -5
- package/dist/array/index.mjs +2 -5
- package/dist/array/last.d.mts +3 -4
- package/dist/array/last.mjs +1 -1
- package/dist/array/move.d.mts +4 -4
- package/dist/array/push.d.mts +2 -1
- package/dist/array/push.mjs +1 -1
- package/dist/array/select.d.mts +95 -84
- package/dist/array/select.mjs +6 -6
- package/dist/array/sort.d.mts +6 -6
- package/dist/array/swap.d.mts +3 -3
- package/dist/array/swap.mjs +1 -1
- package/dist/array/to-map.d.mts +3 -3
- package/dist/array/to-record.d.mts +3 -3
- package/dist/beacon.mjs +2 -2
- package/dist/color/constants.d.mts +14 -41
- package/dist/color/instance.d.mts +0 -1
- package/dist/color/misc/state.d.mts +2 -29
- package/dist/color/models.d.mts +18 -4
- package/dist/function/limit.d.mts +4 -4
- package/dist/function/once.d.mts +6 -8
- package/dist/function/retry.d.mts +2 -2
- package/dist/index.d.mts +1011 -1020
- package/dist/index.mjs +113 -102
- package/dist/internal/array/compact.d.mts +1 -1
- package/dist/internal/array/find.d.mts +4 -4
- package/dist/internal/array/index-of.d.mts +3 -3
- package/dist/internal/array/insert.d.mts +1 -1
- package/dist/internal/array/match.d.mts +1 -1
- package/dist/internal/array/sets.d.mts +1 -1
- package/dist/internal/function/assert.d.mts +7 -7
- package/dist/internal/function/limit.d.mts +1 -1
- package/dist/internal/function/work.d.mts +4 -4
- package/dist/internal/herald.d.mts +1 -1
- package/dist/internal/math/aggregate.d.mts +2 -2
- package/dist/internal/result/misc.d.mts +6 -6
- package/dist/internal/sized/map.d.mts +2 -2
- package/dist/internal/value/compare.d.mts +7 -19
- package/dist/internal/value/equal.d.mts +8 -31
- package/dist/internal/value/handlers.d.mts +2 -5
- package/dist/internal/value/has.d.mts +3 -3
- package/dist/is.d.mts +6 -6
- package/dist/is.mjs +2 -2
- package/dist/promise/helpers.d.mts +2 -2
- package/dist/promise/index.d.mts +7 -7
- package/dist/promise/models.d.mts +1 -1
- package/dist/promise/timed.d.mts +1 -1
- package/dist/queue.d.mts +1 -1
- package/dist/result/index.d.mts +1 -1
- package/dist/result/index.mjs +3 -1
- package/dist/result/match.d.mts +3 -3
- package/dist/result/work/flow.d.mts +1 -1
- package/dist/result/work/pipe.d.mts +1 -1
- package/dist/sized/set.d.mts +1 -1
- package/dist/string/fuzzy.d.mts +4 -4
- package/dist/string/normalize.d.mts +1 -1
- package/dist/string/template.d.mts +1 -2
- package/dist/value/clone.d.mts +8 -20
- package/dist/value/diff.d.mts +1 -1
- package/dist/value/freeze.d.mts +4 -4
- package/dist/value/merge.d.mts +5 -5
- package/dist/value/transform.d.mts +1 -1
- package/package.json +25 -10
- package/plugin/index.js +1 -1
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { ColorState, ColorType, InternalColor } from "../models.mjs";
|
|
1
|
+
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../models.mjs";
|
|
2
2
|
//#region src/color/misc/state.d.ts
|
|
3
3
|
export declare function getColorFromState<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
|
|
4
4
|
export declare function getColorState(value: unknown): ColorState;
|
|
5
|
-
export declare function getStateValue(instance: InternalColor, type: ColorType, alpha: boolean): string |
|
|
6
|
-
alpha: number;
|
|
7
|
-
hue: number;
|
|
8
|
-
lightness: number;
|
|
9
|
-
saturation: number;
|
|
10
|
-
} | {
|
|
11
|
-
alpha: number;
|
|
12
|
-
blackness: number;
|
|
13
|
-
hue: number;
|
|
14
|
-
whiteness: number;
|
|
15
|
-
} | {
|
|
16
|
-
alpha: number;
|
|
17
|
-
blue: number;
|
|
18
|
-
green: number;
|
|
19
|
-
red: number;
|
|
20
|
-
} | {
|
|
21
|
-
hue: number;
|
|
22
|
-
lightness: number;
|
|
23
|
-
saturation: number;
|
|
24
|
-
} | {
|
|
25
|
-
blackness: number;
|
|
26
|
-
hue: number;
|
|
27
|
-
whiteness: number;
|
|
28
|
-
} | {
|
|
29
|
-
blue: number;
|
|
30
|
-
green: number;
|
|
31
|
-
red: number;
|
|
32
|
-
};
|
|
5
|
+
export declare function getStateValue(instance: InternalColor, type: ColorType, alpha: boolean): string | HSLAColor | HSLColor | HWBAColor | HWBColor | RGBAColor | RGBColor;
|
|
33
6
|
export declare function setStateValue<Type extends ColorType>(instance: InternalColor, type: Type, value: ColorState[Type], alpha?: number | string): void;
|
|
34
7
|
//#endregion
|
package/dist/color/models.d.mts
CHANGED
|
@@ -187,7 +187,7 @@ export type Color = {
|
|
|
187
187
|
unsubscribe(): void;
|
|
188
188
|
};
|
|
189
189
|
export type ColorChanges = {
|
|
190
|
-
|
|
190
|
+
"*": (value: Color) => void;
|
|
191
191
|
alpha: (value: number) => void;
|
|
192
192
|
hex: (value: string) => void;
|
|
193
193
|
hexa: (value: string) => void;
|
|
@@ -198,6 +198,20 @@ export type ColorChanges = {
|
|
|
198
198
|
rgb: (value: RGBColor) => void;
|
|
199
199
|
rgba: (value: RGBAColor) => void;
|
|
200
200
|
};
|
|
201
|
+
export type ColorDefaults = {
|
|
202
|
+
alpha: Alpha;
|
|
203
|
+
hexBlack: string;
|
|
204
|
+
hexWhite: string;
|
|
205
|
+
hsl: HSLColor;
|
|
206
|
+
hwb: HWBColor;
|
|
207
|
+
rgb: RGBColor;
|
|
208
|
+
};
|
|
209
|
+
export type ColorExpressions = {
|
|
210
|
+
alphaHex: RegExp;
|
|
211
|
+
hexLong: RegExp;
|
|
212
|
+
hexShort: RegExp;
|
|
213
|
+
prefix: RegExp;
|
|
214
|
+
};
|
|
201
215
|
type ColorWithAlpha = {
|
|
202
216
|
/**
|
|
203
217
|
* Alpha channel _(opacity)_ of the color _(in percentage; 0-100)_
|
|
@@ -268,7 +282,7 @@ export type RGBColor = {
|
|
|
268
282
|
*/
|
|
269
283
|
red: number;
|
|
270
284
|
};
|
|
271
|
-
export type ColorProperty =
|
|
285
|
+
export type ColorProperty = "alpha" | keyof HSLColor | keyof HWBColor | keyof RGBColor;
|
|
272
286
|
export type ColorState = {
|
|
273
287
|
alpha: Alpha;
|
|
274
288
|
hex?: string;
|
|
@@ -280,11 +294,11 @@ export type ColorState = {
|
|
|
280
294
|
/**
|
|
281
295
|
* Base color types
|
|
282
296
|
*/
|
|
283
|
-
export type ColorType =
|
|
297
|
+
export type ColorType = "hex" | "hsl" | "hwb" | "rgb";
|
|
284
298
|
/**
|
|
285
299
|
* Extended color types
|
|
286
300
|
*/
|
|
287
|
-
export type ColorTypeExtended = ColorType |
|
|
301
|
+
export type ColorTypeExtended = ColorType | "hsla" | "hwba" | "rgba";
|
|
288
302
|
/**
|
|
289
303
|
* Base color values
|
|
290
304
|
*/
|
|
@@ -37,9 +37,6 @@ export declare function asyncThrottle<Callback extends GenericAsyncCallback | Ge
|
|
|
37
37
|
* @returns Debounced callback handler with a `cancel` method
|
|
38
38
|
*/
|
|
39
39
|
export declare function debounce<Callback extends GenericCallback>(callback: Callback, time?: number): Limiter<Callback>;
|
|
40
|
-
export declare namespace debounce {
|
|
41
|
-
var async: typeof asyncDebounce;
|
|
42
|
-
}
|
|
43
40
|
/**
|
|
44
41
|
* Throttle a function, ensuring it is only called once every `time` milliseconds
|
|
45
42
|
*
|
|
@@ -48,8 +45,11 @@ export declare namespace debounce {
|
|
|
48
45
|
* @returns Throttled callback handler with a `cancel` method
|
|
49
46
|
*/
|
|
50
47
|
export declare function throttle<Callback extends GenericCallback>(callback: Callback, time?: number): Limiter<Callback>;
|
|
48
|
+
export declare namespace debounce {
|
|
49
|
+
export var async: typeof asyncDebounce;
|
|
50
|
+
}
|
|
51
51
|
export declare namespace throttle {
|
|
52
|
-
var async: typeof asyncThrottle;
|
|
52
|
+
export var async: typeof asyncThrottle;
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
export type { AsyncLimiter, Limiter };
|
package/dist/function/once.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback, Once, OnceAsync } from "../models.mjs";
|
|
2
2
|
//#region src/function/once.d.ts
|
|
3
|
-
declare function OnceAsync(this: any, callback: GenericAsyncCallback): void;
|
|
4
|
-
declare function Once(this: any, callback: GenericCallback): void;
|
|
5
3
|
/**
|
|
6
4
|
* Create an asynchronous function that can only be called once, rejecting or resolving the same result on subsequent calls
|
|
7
5
|
*
|
|
@@ -11,9 +9,6 @@ declare function Once(this: any, callback: GenericCallback): void;
|
|
|
11
9
|
* @returns _Once_ callback
|
|
12
10
|
*/
|
|
13
11
|
export declare function asyncOnce<Callback extends GenericAsyncCallback>(callback: Callback): OnceAsync<Callback>;
|
|
14
|
-
export declare namespace asyncOnce {
|
|
15
|
-
var is: typeof isAsyncOnce;
|
|
16
|
-
}
|
|
17
12
|
/**
|
|
18
13
|
* Is the value an asynchronous once callback?
|
|
19
14
|
*
|
|
@@ -35,9 +30,12 @@ export declare function isOnce(value: unknown): boolean;
|
|
|
35
30
|
* @returns _Once_ callback
|
|
36
31
|
*/
|
|
37
32
|
export declare function once<Callback extends GenericCallback>(callback: Callback): Once<Callback>;
|
|
33
|
+
export declare namespace asyncOnce {
|
|
34
|
+
export var is: typeof isAsyncOnce;
|
|
35
|
+
}
|
|
38
36
|
export declare namespace once {
|
|
39
|
-
var async: typeof asyncOnce;
|
|
40
|
-
var is: typeof isOnce;
|
|
41
|
-
var isAsync: typeof isAsyncOnce;
|
|
37
|
+
export var async: typeof asyncOnce;
|
|
38
|
+
export var is: typeof isOnce;
|
|
39
|
+
export var isAsync: typeof isAsyncOnce;
|
|
42
40
|
}
|
|
43
41
|
//#endregion
|
|
@@ -39,8 +39,8 @@ declare function asyncRetry<Callback extends GenericCallback>(callback: Callback
|
|
|
39
39
|
* @param options Retry options
|
|
40
40
|
* @returns Callback result
|
|
41
41
|
*/
|
|
42
|
-
export declare function retry<Callback extends GenericCallback>(callback: Callback, options?: Omit<RetryOptions,
|
|
42
|
+
export declare function retry<Callback extends GenericCallback>(callback: Callback, options?: Omit<RetryOptions, "delay">): ReturnType<Callback>;
|
|
43
43
|
export declare namespace retry {
|
|
44
|
-
var async: typeof asyncRetry;
|
|
44
|
+
export var async: typeof asyncRetry;
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|