@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.
Files changed (69) hide show
  1. package/dist/array/filter.d.mts +1 -1
  2. package/dist/array/find.d.mts +3 -3
  3. package/dist/array/first.d.mts +3 -4
  4. package/dist/array/first.mjs +1 -1
  5. package/dist/array/group-by.d.mts +3 -3
  6. package/dist/array/index.d.mts +2 -5
  7. package/dist/array/index.mjs +2 -5
  8. package/dist/array/last.d.mts +3 -4
  9. package/dist/array/last.mjs +1 -1
  10. package/dist/array/move.d.mts +4 -4
  11. package/dist/array/push.d.mts +2 -1
  12. package/dist/array/push.mjs +1 -1
  13. package/dist/array/select.d.mts +95 -84
  14. package/dist/array/select.mjs +6 -6
  15. package/dist/array/sort.d.mts +6 -6
  16. package/dist/array/swap.d.mts +3 -3
  17. package/dist/array/swap.mjs +1 -1
  18. package/dist/array/to-map.d.mts +3 -3
  19. package/dist/array/to-record.d.mts +3 -3
  20. package/dist/beacon.mjs +2 -2
  21. package/dist/color/constants.d.mts +14 -41
  22. package/dist/color/instance.d.mts +0 -1
  23. package/dist/color/misc/state.d.mts +2 -29
  24. package/dist/color/models.d.mts +18 -4
  25. package/dist/function/limit.d.mts +4 -4
  26. package/dist/function/once.d.mts +6 -8
  27. package/dist/function/retry.d.mts +2 -2
  28. package/dist/index.d.mts +1011 -1020
  29. package/dist/index.mjs +113 -102
  30. package/dist/internal/array/compact.d.mts +1 -1
  31. package/dist/internal/array/find.d.mts +4 -4
  32. package/dist/internal/array/index-of.d.mts +3 -3
  33. package/dist/internal/array/insert.d.mts +1 -1
  34. package/dist/internal/array/match.d.mts +1 -1
  35. package/dist/internal/array/sets.d.mts +1 -1
  36. package/dist/internal/function/assert.d.mts +7 -7
  37. package/dist/internal/function/limit.d.mts +1 -1
  38. package/dist/internal/function/work.d.mts +4 -4
  39. package/dist/internal/herald.d.mts +1 -1
  40. package/dist/internal/math/aggregate.d.mts +2 -2
  41. package/dist/internal/result/misc.d.mts +6 -6
  42. package/dist/internal/sized/map.d.mts +2 -2
  43. package/dist/internal/value/compare.d.mts +7 -19
  44. package/dist/internal/value/equal.d.mts +8 -31
  45. package/dist/internal/value/handlers.d.mts +2 -5
  46. package/dist/internal/value/has.d.mts +3 -3
  47. package/dist/is.d.mts +6 -6
  48. package/dist/is.mjs +2 -2
  49. package/dist/promise/helpers.d.mts +2 -2
  50. package/dist/promise/index.d.mts +7 -7
  51. package/dist/promise/models.d.mts +1 -1
  52. package/dist/promise/timed.d.mts +1 -1
  53. package/dist/queue.d.mts +1 -1
  54. package/dist/result/index.d.mts +1 -1
  55. package/dist/result/index.mjs +3 -1
  56. package/dist/result/match.d.mts +3 -3
  57. package/dist/result/work/flow.d.mts +1 -1
  58. package/dist/result/work/pipe.d.mts +1 -1
  59. package/dist/sized/set.d.mts +1 -1
  60. package/dist/string/fuzzy.d.mts +4 -4
  61. package/dist/string/normalize.d.mts +1 -1
  62. package/dist/string/template.d.mts +1 -2
  63. package/dist/value/clone.d.mts +8 -20
  64. package/dist/value/diff.d.mts +1 -1
  65. package/dist/value/freeze.d.mts +4 -4
  66. package/dist/value/merge.d.mts +5 -5
  67. package/dist/value/transform.d.mts +1 -1
  68. package/package.json +25 -10
  69. 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
@@ -187,7 +187,7 @@ export type Color = {
187
187
  unsubscribe(): void;
188
188
  };
189
189
  export type ColorChanges = {
190
- '*': (value: Color) => void;
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 = 'alpha' | keyof HSLColor | keyof HWBColor | keyof RGBColor;
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 = 'hex' | 'hsl' | 'hwb' | 'rgb';
297
+ export type ColorType = "hex" | "hsl" | "hwb" | "rgb";
284
298
  /**
285
299
  * Extended color types
286
300
  */
287
- export type ColorTypeExtended = ColorType | 'hsla' | 'hwba' | 'rgba';
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 };
@@ -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, 'delay'>): ReturnType<Callback>;
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