typetify 2.1.0 → 2.4.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 (225) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +108 -0
  3. package/dist/async/index.js +1 -49
  4. package/dist/async/index.mjs +1 -4
  5. package/dist/chunk-272Z3AXV.js +1 -0
  6. package/dist/chunk-2YRFWQ6M.mjs +1 -0
  7. package/dist/chunk-35CB7HNN.js +1 -0
  8. package/dist/chunk-4JG7CFRK.js +1 -0
  9. package/dist/chunk-5FBZYPQM.mjs +1 -0
  10. package/dist/chunk-5XQRYI2Q.mjs +1 -0
  11. package/dist/chunk-6HA2SN23.js +1 -0
  12. package/dist/chunk-6NWIIOHH.js +1 -0
  13. package/dist/chunk-6WGRWYAD.js +1 -0
  14. package/dist/chunk-7LBL6CYT.js +1 -0
  15. package/dist/chunk-7UMXGQE4.mjs +1 -0
  16. package/dist/chunk-7XHBEA63.js +1 -0
  17. package/dist/chunk-B3R73UK5.mjs +1 -0
  18. package/dist/chunk-BLUG7TSP.js +1 -0
  19. package/dist/chunk-EAHFED6V.mjs +1 -0
  20. package/dist/chunk-EKSHS4DL.mjs +1 -0
  21. package/dist/chunk-F76ECQKE.js +1 -0
  22. package/dist/chunk-FHCBXSNA.js +1 -0
  23. package/dist/chunk-GKOA3XGQ.js +1 -0
  24. package/dist/chunk-GQIJLGEZ.mjs +1 -0
  25. package/dist/chunk-I4YSQ4HB.js +1 -0
  26. package/dist/chunk-JZXLCA2E.mjs +1 -0
  27. package/dist/chunk-M5OMYDI7.mjs +1 -0
  28. package/dist/chunk-MB77QAOC.mjs +1 -0
  29. package/dist/chunk-MPY3WRLG.mjs +1 -0
  30. package/dist/chunk-NENRAPOL.mjs +1 -0
  31. package/dist/chunk-NOW4Q26G.mjs +1 -0
  32. package/dist/chunk-P4UNM7SF.js +1 -0
  33. package/dist/chunk-P5E2JDCX.mjs +1 -0
  34. package/dist/chunk-Q7SUL7MD.js +1 -0
  35. package/dist/chunk-QKNZICUO.mjs +1 -0
  36. package/dist/chunk-RHMANSTA.mjs +1 -0
  37. package/dist/chunk-SF64HETW.js +1 -0
  38. package/dist/chunk-T66YO63J.js +1 -0
  39. package/dist/chunk-TNK6EVQK.mjs +1 -0
  40. package/dist/chunk-TSJFKV3R.js +1 -0
  41. package/dist/chunk-TVCWWECJ.mjs +1 -0
  42. package/dist/chunk-U7MK5AR5.mjs +1 -0
  43. package/dist/chunk-W5I352FJ.js +1 -0
  44. package/dist/chunk-WAT4QJB2.js +1 -0
  45. package/dist/chunk-WCG5ODRX.mjs +1 -0
  46. package/dist/chunk-WDFIRO2J.js +1 -0
  47. package/dist/chunk-WOT6VMZA.js +1 -0
  48. package/dist/chunk-WS743BFA.js +1 -0
  49. package/dist/chunk-WWU7P2L2.mjs +1 -0
  50. package/dist/chunk-XPY5CWKZ.mjs +1 -0
  51. package/dist/collection/index.d.mts +125 -1
  52. package/dist/collection/index.d.ts +125 -1
  53. package/dist/collection/index.js +1 -125
  54. package/dist/collection/index.mjs +1 -4
  55. package/dist/color/index.d.mts +274 -0
  56. package/dist/color/index.d.ts +274 -0
  57. package/dist/color/index.js +1 -0
  58. package/dist/color/index.mjs +1 -0
  59. package/dist/core/index.js +1 -41
  60. package/dist/core/index.mjs +1 -4
  61. package/dist/decorator/index.js +1 -57
  62. package/dist/decorator/index.mjs +1 -4
  63. package/dist/dom/index.d.mts +353 -0
  64. package/dist/dom/index.d.ts +353 -0
  65. package/dist/dom/index.js +1 -0
  66. package/dist/dom/index.mjs +1 -0
  67. package/dist/dx/index.js +1 -53
  68. package/dist/dx/index.mjs +1 -4
  69. package/dist/flow/index.js +1 -50
  70. package/dist/flow/index.mjs +1 -5
  71. package/dist/fn/index.js +1 -37
  72. package/dist/fn/index.mjs +1 -4
  73. package/dist/guards/index.js +1 -233
  74. package/dist/guards/index.mjs +1 -4
  75. package/dist/index.d.mts +482 -410
  76. package/dist/index.d.ts +482 -410
  77. package/dist/index.js +3 -2507
  78. package/dist/index.mjs +3 -1546
  79. package/dist/input/index.js +1 -74
  80. package/dist/input/index.mjs +1 -5
  81. package/dist/iterator/index.js +1 -85
  82. package/dist/iterator/index.mjs +1 -4
  83. package/dist/logic/index.js +1 -201
  84. package/dist/logic/index.mjs +1 -4
  85. package/dist/math/index.js +1 -45
  86. package/dist/math/index.mjs +1 -4
  87. package/dist/narrowing/index.js +1 -141
  88. package/dist/narrowing/index.mjs +1 -4
  89. package/dist/object/index.d.mts +137 -1
  90. package/dist/object/index.d.ts +137 -1
  91. package/dist/object/index.js +1 -113
  92. package/dist/object/index.mjs +1 -4
  93. package/dist/result/index.js +1 -86
  94. package/dist/result/index.mjs +1 -5
  95. package/dist/schema/index.js +1 -110
  96. package/dist/schema/index.mjs +1 -5
  97. package/dist/storage/index.d.mts +197 -0
  98. package/dist/storage/index.d.ts +197 -0
  99. package/dist/storage/index.js +1 -0
  100. package/dist/storage/index.mjs +1 -0
  101. package/dist/string/index.d.mts +201 -1
  102. package/dist/string/index.d.ts +201 -1
  103. package/dist/string/index.js +1 -49
  104. package/dist/string/index.mjs +1 -4
  105. package/dist/typed/index.js +1 -193
  106. package/dist/typed/index.mjs +1 -4
  107. package/package.json +23 -3
  108. package/dist/async/index.js.map +0 -1
  109. package/dist/async/index.mjs.map +0 -1
  110. package/dist/chunk-2LJ6NZ6K.js +0 -108
  111. package/dist/chunk-2LJ6NZ6K.js.map +0 -1
  112. package/dist/chunk-4NXETABV.mjs +0 -116
  113. package/dist/chunk-4NXETABV.mjs.map +0 -1
  114. package/dist/chunk-6ZBTL74K.js +0 -129
  115. package/dist/chunk-6ZBTL74K.js.map +0 -1
  116. package/dist/chunk-7G4ZSMQX.js +0 -470
  117. package/dist/chunk-7G4ZSMQX.js.map +0 -1
  118. package/dist/chunk-CN3GYRJN.mjs +0 -137
  119. package/dist/chunk-CN3GYRJN.mjs.map +0 -1
  120. package/dist/chunk-CNTE6ZVH.js +0 -359
  121. package/dist/chunk-CNTE6ZVH.js.map +0 -1
  122. package/dist/chunk-CWHYQWNU.mjs +0 -224
  123. package/dist/chunk-CWHYQWNU.mjs.map +0 -1
  124. package/dist/chunk-DBENOSTA.js +0 -156
  125. package/dist/chunk-DBENOSTA.js.map +0 -1
  126. package/dist/chunk-DWIG5GF2.js +0 -135
  127. package/dist/chunk-DWIG5GF2.js.map +0 -1
  128. package/dist/chunk-EAUTTWTQ.mjs +0 -231
  129. package/dist/chunk-EAUTTWTQ.mjs.map +0 -1
  130. package/dist/chunk-FEX5C4OH.mjs +0 -1007
  131. package/dist/chunk-FEX5C4OH.mjs.map +0 -1
  132. package/dist/chunk-FN553YPU.js +0 -441
  133. package/dist/chunk-FN553YPU.js.map +0 -1
  134. package/dist/chunk-FT2EK4AM.mjs +0 -420
  135. package/dist/chunk-FT2EK4AM.mjs.map +0 -1
  136. package/dist/chunk-FXWYPHA3.mjs +0 -13
  137. package/dist/chunk-FXWYPHA3.mjs.map +0 -1
  138. package/dist/chunk-GS3PP67B.js +0 -200
  139. package/dist/chunk-GS3PP67B.js.map +0 -1
  140. package/dist/chunk-IGA3VEZM.mjs +0 -503
  141. package/dist/chunk-IGA3VEZM.mjs.map +0 -1
  142. package/dist/chunk-J5LGTIGS.mjs +0 -9
  143. package/dist/chunk-J5LGTIGS.mjs.map +0 -1
  144. package/dist/chunk-JB6UXRKD.mjs +0 -97
  145. package/dist/chunk-JB6UXRKD.mjs.map +0 -1
  146. package/dist/chunk-JQAQV75V.js +0 -561
  147. package/dist/chunk-JQAQV75V.js.map +0 -1
  148. package/dist/chunk-JQHUBZ4M.js +0 -88
  149. package/dist/chunk-JQHUBZ4M.js.map +0 -1
  150. package/dist/chunk-LT7JK7RJ.js +0 -87
  151. package/dist/chunk-LT7JK7RJ.js.map +0 -1
  152. package/dist/chunk-N6IUADIP.mjs +0 -414
  153. package/dist/chunk-N6IUADIP.mjs.map +0 -1
  154. package/dist/chunk-OEJK37LO.mjs +0 -328
  155. package/dist/chunk-OEJK37LO.mjs.map +0 -1
  156. package/dist/chunk-OKB3MS5F.js +0 -547
  157. package/dist/chunk-OKB3MS5F.js.map +0 -1
  158. package/dist/chunk-OPVES6W2.js +0 -16
  159. package/dist/chunk-OPVES6W2.js.map +0 -1
  160. package/dist/chunk-OWNUKWXV.js +0 -291
  161. package/dist/chunk-OWNUKWXV.js.map +0 -1
  162. package/dist/chunk-POD52NJ3.mjs +0 -526
  163. package/dist/chunk-POD52NJ3.mjs.map +0 -1
  164. package/dist/chunk-PQTXSQ4P.js +0 -369
  165. package/dist/chunk-PQTXSQ4P.js.map +0 -1
  166. package/dist/chunk-PZ5AY32C.js +0 -11
  167. package/dist/chunk-PZ5AY32C.js.map +0 -1
  168. package/dist/chunk-QFR7DVAJ.mjs +0 -63
  169. package/dist/chunk-QFR7DVAJ.mjs.map +0 -1
  170. package/dist/chunk-S535LAXW.js +0 -1054
  171. package/dist/chunk-S535LAXW.js.map +0 -1
  172. package/dist/chunk-SGQNLTRK.js +0 -73
  173. package/dist/chunk-SGQNLTRK.js.map +0 -1
  174. package/dist/chunk-SRDWUHDY.mjs +0 -188
  175. package/dist/chunk-SRDWUHDY.mjs.map +0 -1
  176. package/dist/chunk-TXU7NTT4.js +0 -249
  177. package/dist/chunk-TXU7NTT4.js.map +0 -1
  178. package/dist/chunk-TZEWREAC.mjs +0 -277
  179. package/dist/chunk-TZEWREAC.mjs.map +0 -1
  180. package/dist/chunk-V6CWFDIJ.mjs +0 -123
  181. package/dist/chunk-V6CWFDIJ.mjs.map +0 -1
  182. package/dist/chunk-X55EORNF.js +0 -259
  183. package/dist/chunk-X55EORNF.js.map +0 -1
  184. package/dist/chunk-YBJC5WMX.mjs +0 -341
  185. package/dist/chunk-YBJC5WMX.mjs.map +0 -1
  186. package/dist/chunk-YOPAXITF.mjs +0 -75
  187. package/dist/chunk-YOPAXITF.mjs.map +0 -1
  188. package/dist/chunk-ZE4FDBRI.mjs +0 -79
  189. package/dist/chunk-ZE4FDBRI.mjs.map +0 -1
  190. package/dist/collection/index.js.map +0 -1
  191. package/dist/collection/index.mjs.map +0 -1
  192. package/dist/core/index.js.map +0 -1
  193. package/dist/core/index.mjs.map +0 -1
  194. package/dist/decorator/index.js.map +0 -1
  195. package/dist/decorator/index.mjs.map +0 -1
  196. package/dist/dx/index.js.map +0 -1
  197. package/dist/dx/index.mjs.map +0 -1
  198. package/dist/flow/index.js.map +0 -1
  199. package/dist/flow/index.mjs.map +0 -1
  200. package/dist/fn/index.js.map +0 -1
  201. package/dist/fn/index.mjs.map +0 -1
  202. package/dist/guards/index.js.map +0 -1
  203. package/dist/guards/index.mjs.map +0 -1
  204. package/dist/index.js.map +0 -1
  205. package/dist/index.mjs.map +0 -1
  206. package/dist/input/index.js.map +0 -1
  207. package/dist/input/index.mjs.map +0 -1
  208. package/dist/iterator/index.js.map +0 -1
  209. package/dist/iterator/index.mjs.map +0 -1
  210. package/dist/logic/index.js.map +0 -1
  211. package/dist/logic/index.mjs.map +0 -1
  212. package/dist/math/index.js.map +0 -1
  213. package/dist/math/index.mjs.map +0 -1
  214. package/dist/narrowing/index.js.map +0 -1
  215. package/dist/narrowing/index.mjs.map +0 -1
  216. package/dist/object/index.js.map +0 -1
  217. package/dist/object/index.mjs.map +0 -1
  218. package/dist/result/index.js.map +0 -1
  219. package/dist/result/index.mjs.map +0 -1
  220. package/dist/schema/index.js.map +0 -1
  221. package/dist/schema/index.mjs.map +0 -1
  222. package/dist/string/index.js.map +0 -1
  223. package/dist/string/index.mjs.map +0 -1
  224. package/dist/typed/index.js.map +0 -1
  225. package/dist/typed/index.mjs.map +0 -1
@@ -0,0 +1,274 @@
1
+ /**
2
+ * RGB color representation.
3
+ */
4
+ interface RGB {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ }
9
+ /**
10
+ * HSL color representation.
11
+ */
12
+ interface HSL {
13
+ h: number;
14
+ s: number;
15
+ l: number;
16
+ }
17
+ /**
18
+ * Converts hex color to RGB.
19
+ *
20
+ * @example
21
+ * hexToRgb('#ff5733');
22
+ * // => { r: 255, g: 87, b: 51 }
23
+ *
24
+ * @example
25
+ * hexToRgb('#f57'); // Short format
26
+ * // => { r: 255, g: 85, b: 119 }
27
+ *
28
+ * @example
29
+ * hexToRgb('ff5733'); // Without #
30
+ * // => { r: 255, g: 87, b: 51 }
31
+ */
32
+ declare function hexToRgb(hex: string): RGB | null;
33
+ /**
34
+ * Converts RGB to hex color.
35
+ *
36
+ * @example
37
+ * rgbToHex({ r: 255, g: 87, b: 51 });
38
+ * // => '#ff5733'
39
+ *
40
+ * @example
41
+ * rgbToHex({ r: 0, g: 0, b: 0 });
42
+ * // => '#000000'
43
+ */
44
+ declare function rgbToHex(rgb: RGB): string;
45
+ /**
46
+ * Converts RGB to HSL.
47
+ *
48
+ * @example
49
+ * rgbToHsl({ r: 255, g: 87, b: 51 });
50
+ * // => { h: 11, s: 100, l: 60 }
51
+ */
52
+ declare function rgbToHsl(rgb: RGB): HSL;
53
+ /**
54
+ * Converts HSL to RGB.
55
+ *
56
+ * @example
57
+ * hslToRgb({ h: 11, s: 100, l: 60 });
58
+ * // => { r: 255, g: 87, b: 51 }
59
+ */
60
+ declare function hslToRgb(hsl: HSL): RGB;
61
+ /**
62
+ * Parses a color string to RGB.
63
+ *
64
+ * @example
65
+ * parseColor('#ff5733');
66
+ * // => { r: 255, g: 87, b: 51 }
67
+ *
68
+ * @example
69
+ * parseColor('rgb(255, 87, 51)');
70
+ * // => { r: 255, g: 87, b: 51 }
71
+ */
72
+ declare function parseColor(color: string): RGB | null;
73
+ /**
74
+ * Formats RGB to CSS rgb() string.
75
+ *
76
+ * @example
77
+ * formatRgb({ r: 255, g: 87, b: 51 });
78
+ * // => 'rgb(255, 87, 51)'
79
+ */
80
+ declare function formatRgb(rgb: RGB): string;
81
+ /**
82
+ * Formats HSL to CSS hsl() string.
83
+ *
84
+ * @example
85
+ * formatHsl({ h: 11, s: 100, l: 60 });
86
+ * // => 'hsl(11, 100%, 60%)'
87
+ */
88
+ declare function formatHsl(hsl: HSL): string;
89
+
90
+ /**
91
+ * Lightens a color by a percentage.
92
+ *
93
+ * @example
94
+ * lighten('#ff5733', 20);
95
+ * // => '#ff8566' (20% lighter)
96
+ *
97
+ * @example
98
+ * // Lighten red
99
+ * lighten('#ff0000', 50);
100
+ * // => '#ff8080'
101
+ */
102
+ declare function lighten(color: string, amount: number): string;
103
+ /**
104
+ * Darkens a color by a percentage.
105
+ *
106
+ * @example
107
+ * darken('#ff5733', 20);
108
+ * // => '#cc2900' (20% darker)
109
+ *
110
+ * @example
111
+ * // Darken blue
112
+ * darken('#0000ff', 30);
113
+ * // => '#000099'
114
+ */
115
+ declare function darken(color: string, amount: number): string;
116
+ /**
117
+ * Saturates a color by a percentage.
118
+ *
119
+ * @example
120
+ * saturate('#ff5733', 20);
121
+ * // => More vibrant color
122
+ */
123
+ declare function saturate(color: string, amount: number): string;
124
+ /**
125
+ * Desaturates a color by a percentage.
126
+ *
127
+ * @example
128
+ * desaturate('#ff5733', 50);
129
+ * // => More gray color
130
+ */
131
+ declare function desaturate(color: string, amount: number): string;
132
+ /**
133
+ * Adjusts the opacity of a color.
134
+ *
135
+ * @example
136
+ * opacity('#ff5733', 0.5);
137
+ * // => 'rgba(255, 87, 51, 0.5)'
138
+ *
139
+ * @example
140
+ * // Create semi-transparent overlay
141
+ * const overlay = opacity('#000000', 0.3);
142
+ */
143
+ declare function opacity(color: string, alpha: number): string;
144
+ /**
145
+ * Mixes two colors together.
146
+ *
147
+ * @example
148
+ * mix('#ff0000', '#0000ff', 0.5);
149
+ * // => '#800080' (purple - 50% mix)
150
+ *
151
+ * @example
152
+ * // More red
153
+ * mix('#ff0000', '#0000ff', 0.75);
154
+ * // => '#bf0040'
155
+ */
156
+ declare function mix(color1: string, color2: string, weight?: number): string;
157
+ /**
158
+ * Inverts a color.
159
+ *
160
+ * @example
161
+ * invert('#ff5733');
162
+ * // => '#00a8cc' (inverted)
163
+ *
164
+ * @example
165
+ * invert('#000000');
166
+ * // => '#ffffff'
167
+ */
168
+ declare function invert(color: string): string;
169
+ /**
170
+ * Converts color to grayscale.
171
+ *
172
+ * @example
173
+ * grayscale('#ff5733');
174
+ * // => '#8c8c8c' (gray version)
175
+ */
176
+ declare function grayscale(color: string): string;
177
+
178
+ /**
179
+ * Calculates the relative luminance of a color.
180
+ *
181
+ * @example
182
+ * luminance('#ffffff'); // => 1 (white)
183
+ * luminance('#000000'); // => 0 (black)
184
+ * luminance('#ff5733'); // => ~0.3
185
+ */
186
+ declare function luminance(color: string): number;
187
+ /**
188
+ * Calculates the contrast ratio between two colors.
189
+ *
190
+ * @example
191
+ * contrast('#000000', '#ffffff');
192
+ * // => 21 (maximum contrast)
193
+ *
194
+ * @example
195
+ * // Check WCAG AA compliance (4.5:1 for normal text)
196
+ * const ratio = contrast('#333333', '#ffffff');
197
+ * const isAccessible = ratio >= 4.5;
198
+ */
199
+ declare function contrast(color1: string, color2: string): number;
200
+ /**
201
+ * Checks if a color is light.
202
+ *
203
+ * @example
204
+ * isLight('#ffffff'); // => true
205
+ * isLight('#000000'); // => false
206
+ * isLight('#ff5733'); // => false
207
+ *
208
+ * @example
209
+ * // Choose text color based on background
210
+ * const textColor = isLight(bgColor) ? '#000000' : '#ffffff';
211
+ */
212
+ declare function isLight(color: string): boolean;
213
+ /**
214
+ * Checks if a color is dark.
215
+ *
216
+ * @example
217
+ * isDark('#000000'); // => true
218
+ * isDark('#ffffff'); // => false
219
+ */
220
+ declare function isDark(color: string): boolean;
221
+ /**
222
+ * Gets the best contrasting color (black or white).
223
+ *
224
+ * @example
225
+ * getContrastColor('#ff5733');
226
+ * // => '#ffffff' (white text on orange background)
227
+ *
228
+ * @example
229
+ * getContrastColor('#ffff00');
230
+ * // => '#000000' (black text on yellow background)
231
+ *
232
+ * @example
233
+ * // Dynamic text color for buttons
234
+ * button.style.color = getContrastColor(button.style.backgroundColor);
235
+ */
236
+ declare function getContrastColor(color: string): string;
237
+ /**
238
+ * Checks if two colors are similar.
239
+ *
240
+ * @example
241
+ * isSimilar('#ff5733', '#ff5734', 1);
242
+ * // => true (very similar)
243
+ *
244
+ * @example
245
+ * isSimilar('#ff0000', '#00ff00', 50);
246
+ * // => false (very different)
247
+ */
248
+ declare function isSimilar(color1: string, color2: string, threshold?: number): boolean;
249
+ /**
250
+ * Gets the dominant color component.
251
+ *
252
+ * @example
253
+ * getDominant('#ff5733');
254
+ * // => 'red'
255
+ *
256
+ * @example
257
+ * getDominant('#00ff00');
258
+ * // => 'green'
259
+ */
260
+ declare function getDominant(color: string): 'red' | 'green' | 'blue' | null;
261
+ /**
262
+ * Gets the temperature of a color (warm or cool).
263
+ *
264
+ * @example
265
+ * getTemperature('#ff5733');
266
+ * // => 'warm' (orange/red)
267
+ *
268
+ * @example
269
+ * getTemperature('#3366ff');
270
+ * // => 'cool' (blue)
271
+ */
272
+ declare function getTemperature(color: string): 'warm' | 'cool' | 'neutral';
273
+
274
+ export { type HSL, type RGB, contrast, darken, desaturate, formatHsl, formatRgb, getContrastColor, getDominant, getTemperature, grayscale, hexToRgb, hslToRgb, invert, isDark, isLight, isSimilar, lighten, luminance, mix, opacity, parseColor, rgbToHex, rgbToHsl, saturate };
@@ -0,0 +1,274 @@
1
+ /**
2
+ * RGB color representation.
3
+ */
4
+ interface RGB {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ }
9
+ /**
10
+ * HSL color representation.
11
+ */
12
+ interface HSL {
13
+ h: number;
14
+ s: number;
15
+ l: number;
16
+ }
17
+ /**
18
+ * Converts hex color to RGB.
19
+ *
20
+ * @example
21
+ * hexToRgb('#ff5733');
22
+ * // => { r: 255, g: 87, b: 51 }
23
+ *
24
+ * @example
25
+ * hexToRgb('#f57'); // Short format
26
+ * // => { r: 255, g: 85, b: 119 }
27
+ *
28
+ * @example
29
+ * hexToRgb('ff5733'); // Without #
30
+ * // => { r: 255, g: 87, b: 51 }
31
+ */
32
+ declare function hexToRgb(hex: string): RGB | null;
33
+ /**
34
+ * Converts RGB to hex color.
35
+ *
36
+ * @example
37
+ * rgbToHex({ r: 255, g: 87, b: 51 });
38
+ * // => '#ff5733'
39
+ *
40
+ * @example
41
+ * rgbToHex({ r: 0, g: 0, b: 0 });
42
+ * // => '#000000'
43
+ */
44
+ declare function rgbToHex(rgb: RGB): string;
45
+ /**
46
+ * Converts RGB to HSL.
47
+ *
48
+ * @example
49
+ * rgbToHsl({ r: 255, g: 87, b: 51 });
50
+ * // => { h: 11, s: 100, l: 60 }
51
+ */
52
+ declare function rgbToHsl(rgb: RGB): HSL;
53
+ /**
54
+ * Converts HSL to RGB.
55
+ *
56
+ * @example
57
+ * hslToRgb({ h: 11, s: 100, l: 60 });
58
+ * // => { r: 255, g: 87, b: 51 }
59
+ */
60
+ declare function hslToRgb(hsl: HSL): RGB;
61
+ /**
62
+ * Parses a color string to RGB.
63
+ *
64
+ * @example
65
+ * parseColor('#ff5733');
66
+ * // => { r: 255, g: 87, b: 51 }
67
+ *
68
+ * @example
69
+ * parseColor('rgb(255, 87, 51)');
70
+ * // => { r: 255, g: 87, b: 51 }
71
+ */
72
+ declare function parseColor(color: string): RGB | null;
73
+ /**
74
+ * Formats RGB to CSS rgb() string.
75
+ *
76
+ * @example
77
+ * formatRgb({ r: 255, g: 87, b: 51 });
78
+ * // => 'rgb(255, 87, 51)'
79
+ */
80
+ declare function formatRgb(rgb: RGB): string;
81
+ /**
82
+ * Formats HSL to CSS hsl() string.
83
+ *
84
+ * @example
85
+ * formatHsl({ h: 11, s: 100, l: 60 });
86
+ * // => 'hsl(11, 100%, 60%)'
87
+ */
88
+ declare function formatHsl(hsl: HSL): string;
89
+
90
+ /**
91
+ * Lightens a color by a percentage.
92
+ *
93
+ * @example
94
+ * lighten('#ff5733', 20);
95
+ * // => '#ff8566' (20% lighter)
96
+ *
97
+ * @example
98
+ * // Lighten red
99
+ * lighten('#ff0000', 50);
100
+ * // => '#ff8080'
101
+ */
102
+ declare function lighten(color: string, amount: number): string;
103
+ /**
104
+ * Darkens a color by a percentage.
105
+ *
106
+ * @example
107
+ * darken('#ff5733', 20);
108
+ * // => '#cc2900' (20% darker)
109
+ *
110
+ * @example
111
+ * // Darken blue
112
+ * darken('#0000ff', 30);
113
+ * // => '#000099'
114
+ */
115
+ declare function darken(color: string, amount: number): string;
116
+ /**
117
+ * Saturates a color by a percentage.
118
+ *
119
+ * @example
120
+ * saturate('#ff5733', 20);
121
+ * // => More vibrant color
122
+ */
123
+ declare function saturate(color: string, amount: number): string;
124
+ /**
125
+ * Desaturates a color by a percentage.
126
+ *
127
+ * @example
128
+ * desaturate('#ff5733', 50);
129
+ * // => More gray color
130
+ */
131
+ declare function desaturate(color: string, amount: number): string;
132
+ /**
133
+ * Adjusts the opacity of a color.
134
+ *
135
+ * @example
136
+ * opacity('#ff5733', 0.5);
137
+ * // => 'rgba(255, 87, 51, 0.5)'
138
+ *
139
+ * @example
140
+ * // Create semi-transparent overlay
141
+ * const overlay = opacity('#000000', 0.3);
142
+ */
143
+ declare function opacity(color: string, alpha: number): string;
144
+ /**
145
+ * Mixes two colors together.
146
+ *
147
+ * @example
148
+ * mix('#ff0000', '#0000ff', 0.5);
149
+ * // => '#800080' (purple - 50% mix)
150
+ *
151
+ * @example
152
+ * // More red
153
+ * mix('#ff0000', '#0000ff', 0.75);
154
+ * // => '#bf0040'
155
+ */
156
+ declare function mix(color1: string, color2: string, weight?: number): string;
157
+ /**
158
+ * Inverts a color.
159
+ *
160
+ * @example
161
+ * invert('#ff5733');
162
+ * // => '#00a8cc' (inverted)
163
+ *
164
+ * @example
165
+ * invert('#000000');
166
+ * // => '#ffffff'
167
+ */
168
+ declare function invert(color: string): string;
169
+ /**
170
+ * Converts color to grayscale.
171
+ *
172
+ * @example
173
+ * grayscale('#ff5733');
174
+ * // => '#8c8c8c' (gray version)
175
+ */
176
+ declare function grayscale(color: string): string;
177
+
178
+ /**
179
+ * Calculates the relative luminance of a color.
180
+ *
181
+ * @example
182
+ * luminance('#ffffff'); // => 1 (white)
183
+ * luminance('#000000'); // => 0 (black)
184
+ * luminance('#ff5733'); // => ~0.3
185
+ */
186
+ declare function luminance(color: string): number;
187
+ /**
188
+ * Calculates the contrast ratio between two colors.
189
+ *
190
+ * @example
191
+ * contrast('#000000', '#ffffff');
192
+ * // => 21 (maximum contrast)
193
+ *
194
+ * @example
195
+ * // Check WCAG AA compliance (4.5:1 for normal text)
196
+ * const ratio = contrast('#333333', '#ffffff');
197
+ * const isAccessible = ratio >= 4.5;
198
+ */
199
+ declare function contrast(color1: string, color2: string): number;
200
+ /**
201
+ * Checks if a color is light.
202
+ *
203
+ * @example
204
+ * isLight('#ffffff'); // => true
205
+ * isLight('#000000'); // => false
206
+ * isLight('#ff5733'); // => false
207
+ *
208
+ * @example
209
+ * // Choose text color based on background
210
+ * const textColor = isLight(bgColor) ? '#000000' : '#ffffff';
211
+ */
212
+ declare function isLight(color: string): boolean;
213
+ /**
214
+ * Checks if a color is dark.
215
+ *
216
+ * @example
217
+ * isDark('#000000'); // => true
218
+ * isDark('#ffffff'); // => false
219
+ */
220
+ declare function isDark(color: string): boolean;
221
+ /**
222
+ * Gets the best contrasting color (black or white).
223
+ *
224
+ * @example
225
+ * getContrastColor('#ff5733');
226
+ * // => '#ffffff' (white text on orange background)
227
+ *
228
+ * @example
229
+ * getContrastColor('#ffff00');
230
+ * // => '#000000' (black text on yellow background)
231
+ *
232
+ * @example
233
+ * // Dynamic text color for buttons
234
+ * button.style.color = getContrastColor(button.style.backgroundColor);
235
+ */
236
+ declare function getContrastColor(color: string): string;
237
+ /**
238
+ * Checks if two colors are similar.
239
+ *
240
+ * @example
241
+ * isSimilar('#ff5733', '#ff5734', 1);
242
+ * // => true (very similar)
243
+ *
244
+ * @example
245
+ * isSimilar('#ff0000', '#00ff00', 50);
246
+ * // => false (very different)
247
+ */
248
+ declare function isSimilar(color1: string, color2: string, threshold?: number): boolean;
249
+ /**
250
+ * Gets the dominant color component.
251
+ *
252
+ * @example
253
+ * getDominant('#ff5733');
254
+ * // => 'red'
255
+ *
256
+ * @example
257
+ * getDominant('#00ff00');
258
+ * // => 'green'
259
+ */
260
+ declare function getDominant(color: string): 'red' | 'green' | 'blue' | null;
261
+ /**
262
+ * Gets the temperature of a color (warm or cool).
263
+ *
264
+ * @example
265
+ * getTemperature('#ff5733');
266
+ * // => 'warm' (orange/red)
267
+ *
268
+ * @example
269
+ * getTemperature('#3366ff');
270
+ * // => 'cool' (blue)
271
+ */
272
+ declare function getTemperature(color: string): 'warm' | 'cool' | 'neutral';
273
+
274
+ export { type HSL, type RGB, contrast, darken, desaturate, formatHsl, formatRgb, getContrastColor, getDominant, getTemperature, grayscale, hexToRgb, hslToRgb, invert, isDark, isLight, isSimilar, lighten, luminance, mix, opacity, parseColor, rgbToHex, rgbToHsl, saturate };
@@ -0,0 +1 @@
1
+ 'use strict';var chunkBLUG7TSP_js=require('../chunk-BLUG7TSP.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"contrast",{enumerable:true,get:function(){return chunkBLUG7TSP_js.q}});Object.defineProperty(exports,"darken",{enumerable:true,get:function(){return chunkBLUG7TSP_js.i}});Object.defineProperty(exports,"desaturate",{enumerable:true,get:function(){return chunkBLUG7TSP_js.k}});Object.defineProperty(exports,"formatHsl",{enumerable:true,get:function(){return chunkBLUG7TSP_js.g}});Object.defineProperty(exports,"formatRgb",{enumerable:true,get:function(){return chunkBLUG7TSP_js.f}});Object.defineProperty(exports,"getContrastColor",{enumerable:true,get:function(){return chunkBLUG7TSP_js.t}});Object.defineProperty(exports,"getDominant",{enumerable:true,get:function(){return chunkBLUG7TSP_js.v}});Object.defineProperty(exports,"getTemperature",{enumerable:true,get:function(){return chunkBLUG7TSP_js.w}});Object.defineProperty(exports,"grayscale",{enumerable:true,get:function(){return chunkBLUG7TSP_js.o}});Object.defineProperty(exports,"hexToRgb",{enumerable:true,get:function(){return chunkBLUG7TSP_js.a}});Object.defineProperty(exports,"hslToRgb",{enumerable:true,get:function(){return chunkBLUG7TSP_js.d}});Object.defineProperty(exports,"invert",{enumerable:true,get:function(){return chunkBLUG7TSP_js.n}});Object.defineProperty(exports,"isDark",{enumerable:true,get:function(){return chunkBLUG7TSP_js.s}});Object.defineProperty(exports,"isLight",{enumerable:true,get:function(){return chunkBLUG7TSP_js.r}});Object.defineProperty(exports,"isSimilar",{enumerable:true,get:function(){return chunkBLUG7TSP_js.u}});Object.defineProperty(exports,"lighten",{enumerable:true,get:function(){return chunkBLUG7TSP_js.h}});Object.defineProperty(exports,"luminance",{enumerable:true,get:function(){return chunkBLUG7TSP_js.p}});Object.defineProperty(exports,"mix",{enumerable:true,get:function(){return chunkBLUG7TSP_js.m}});Object.defineProperty(exports,"opacity",{enumerable:true,get:function(){return chunkBLUG7TSP_js.l}});Object.defineProperty(exports,"parseColor",{enumerable:true,get:function(){return chunkBLUG7TSP_js.e}});Object.defineProperty(exports,"rgbToHex",{enumerable:true,get:function(){return chunkBLUG7TSP_js.b}});Object.defineProperty(exports,"rgbToHsl",{enumerable:true,get:function(){return chunkBLUG7TSP_js.c}});Object.defineProperty(exports,"saturate",{enumerable:true,get:function(){return chunkBLUG7TSP_js.j}});
@@ -0,0 +1 @@
1
+ export{q as contrast,i as darken,k as desaturate,g as formatHsl,f as formatRgb,t as getContrastColor,v as getDominant,w as getTemperature,o as grayscale,a as hexToRgb,d as hslToRgb,n as invert,s as isDark,r as isLight,u as isSimilar,h as lighten,p as luminance,m as mix,l as opacity,e as parseColor,b as rgbToHex,c as rgbToHsl,j as saturate}from'../chunk-GQIJLGEZ.mjs';import'../chunk-JZXLCA2E.mjs';
@@ -1,41 +1 @@
1
- 'use strict';
2
-
3
- var chunkSGQNLTRK_js = require('../chunk-SGQNLTRK.js');
4
- require('../chunk-PZ5AY32C.js');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "assert", {
9
- enumerable: true,
10
- get: function () { return chunkSGQNLTRK_js.assert; }
11
- });
12
- Object.defineProperty(exports, "assertDefined", {
13
- enumerable: true,
14
- get: function () { return chunkSGQNLTRK_js.assertDefined; }
15
- });
16
- Object.defineProperty(exports, "fail", {
17
- enumerable: true,
18
- get: function () { return chunkSGQNLTRK_js.fail; }
19
- });
20
- Object.defineProperty(exports, "identity", {
21
- enumerable: true,
22
- get: function () { return chunkSGQNLTRK_js.identity; }
23
- });
24
- Object.defineProperty(exports, "isDefined", {
25
- enumerable: true,
26
- get: function () { return chunkSGQNLTRK_js.isDefined; }
27
- });
28
- Object.defineProperty(exports, "isNil", {
29
- enumerable: true,
30
- get: function () { return chunkSGQNLTRK_js.isNil; }
31
- });
32
- Object.defineProperty(exports, "noop", {
33
- enumerable: true,
34
- get: function () { return chunkSGQNLTRK_js.noop; }
35
- });
36
- Object.defineProperty(exports, "unreachable", {
37
- enumerable: true,
38
- get: function () { return chunkSGQNLTRK_js.unreachable; }
39
- });
40
- //# sourceMappingURL=index.js.map
41
- //# sourceMappingURL=index.js.map
1
+ 'use strict';var chunk6HA2SN23_js=require('../chunk-6HA2SN23.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"assert",{enumerable:true,get:function(){return chunk6HA2SN23_js.c}});Object.defineProperty(exports,"assertDefined",{enumerable:true,get:function(){return chunk6HA2SN23_js.d}});Object.defineProperty(exports,"fail",{enumerable:true,get:function(){return chunk6HA2SN23_js.e}});Object.defineProperty(exports,"identity",{enumerable:true,get:function(){return chunk6HA2SN23_js.g}});Object.defineProperty(exports,"isDefined",{enumerable:true,get:function(){return chunk6HA2SN23_js.a}});Object.defineProperty(exports,"isNil",{enumerable:true,get:function(){return chunk6HA2SN23_js.b}});Object.defineProperty(exports,"noop",{enumerable:true,get:function(){return chunk6HA2SN23_js.f}});Object.defineProperty(exports,"unreachable",{enumerable:true,get:function(){return chunk6HA2SN23_js.h}});
@@ -1,4 +1 @@
1
- export { assert, assertDefined, fail, identity, isDefined, isNil, noop, unreachable } from '../chunk-QFR7DVAJ.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
1
+ export{c as assert,d as assertDefined,e as fail,g as identity,a as isDefined,b as isNil,f as noop,h as unreachable}from'../chunk-EKSHS4DL.mjs';import'../chunk-JZXLCA2E.mjs';
@@ -1,57 +1 @@
1
- 'use strict';
2
-
3
- var chunkOWNUKWXV_js = require('../chunk-OWNUKWXV.js');
4
- require('../chunk-PZ5AY32C.js');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "Bind", {
9
- enumerable: true,
10
- get: function () { return chunkOWNUKWXV_js.Bind; }
11
- });
12
- Object.defineProperty(exports, "Debounce", {
13
- enumerable: true,
14
- get: function () { return chunkOWNUKWXV_js.Debounce; }
15
- });
16
- Object.defineProperty(exports, "Deprecated", {
17
- enumerable: true,
18
- get: function () { return chunkOWNUKWXV_js.Deprecated; }
19
- });
20
- Object.defineProperty(exports, "Frozen", {
21
- enumerable: true,
22
- get: function () { return chunkOWNUKWXV_js.Frozen; }
23
- });
24
- Object.defineProperty(exports, "Lazy", {
25
- enumerable: true,
26
- get: function () { return chunkOWNUKWXV_js.Lazy; }
27
- });
28
- Object.defineProperty(exports, "Log", {
29
- enumerable: true,
30
- get: function () { return chunkOWNUKWXV_js.Log; }
31
- });
32
- Object.defineProperty(exports, "Measure", {
33
- enumerable: true,
34
- get: function () { return chunkOWNUKWXV_js.Measure; }
35
- });
36
- Object.defineProperty(exports, "Memoize", {
37
- enumerable: true,
38
- get: function () { return chunkOWNUKWXV_js.Memoize; }
39
- });
40
- Object.defineProperty(exports, "Retry", {
41
- enumerable: true,
42
- get: function () { return chunkOWNUKWXV_js.Retry; }
43
- });
44
- Object.defineProperty(exports, "Sealed", {
45
- enumerable: true,
46
- get: function () { return chunkOWNUKWXV_js.Sealed; }
47
- });
48
- Object.defineProperty(exports, "Throttle", {
49
- enumerable: true,
50
- get: function () { return chunkOWNUKWXV_js.Throttle; }
51
- });
52
- Object.defineProperty(exports, "Validate", {
53
- enumerable: true,
54
- get: function () { return chunkOWNUKWXV_js.Validate; }
55
- });
56
- //# sourceMappingURL=index.js.map
57
- //# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkI4YSQ4HB_js=require('../chunk-I4YSQ4HB.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"Bind",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.d}});Object.defineProperty(exports,"Debounce",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.b}});Object.defineProperty(exports,"Deprecated",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.h}});Object.defineProperty(exports,"Frozen",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.j}});Object.defineProperty(exports,"Lazy",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.l}});Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.e}});Object.defineProperty(exports,"Measure",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.f}});Object.defineProperty(exports,"Memoize",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.a}});Object.defineProperty(exports,"Retry",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.g}});Object.defineProperty(exports,"Sealed",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.i}});Object.defineProperty(exports,"Throttle",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.c}});Object.defineProperty(exports,"Validate",{enumerable:true,get:function(){return chunkI4YSQ4HB_js.k}});
@@ -1,4 +1 @@
1
- export { Bind, Debounce, Deprecated, Frozen, Lazy, Log, Measure, Memoize, Retry, Sealed, Throttle, Validate } from '../chunk-TZEWREAC.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
1
+ export{d as Bind,b as Debounce,h as Deprecated,j as Frozen,l as Lazy,e as Log,f as Measure,a as Memoize,g as Retry,i as Sealed,c as Throttle,k as Validate}from'../chunk-NENRAPOL.mjs';import'../chunk-JZXLCA2E.mjs';