@aitronos/freddy-plugins 0.1.36 → 0.1.37

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/index.d.ts CHANGED
@@ -113,38 +113,121 @@ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
113
113
 
114
114
  export declare const AdvancedModal: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
115
115
 
116
+ /**
117
+ * Calculates the percentage of a partial value relative to a total value.
118
+ * @param partialValue - The part of the total value.
119
+ * @param totalValue - The total value.
120
+ * @returns The percentage as a string with one decimal place.
121
+ */
116
122
  export declare const calculatePercentage: (partialValue: number, totalValue: number) => string;
117
123
 
124
+ /**
125
+ * Creates a deep clone of the provided value, handling circular references.
126
+ * This function is similar to Lodash's `cloneDeep`.
127
+ *
128
+ * @template T - The type of the value being cloned.
129
+ * @param {T} value - The value to deeply clone.
130
+ * @returns {T} - Returns the deeply cloned value.
131
+ */
132
+ export declare function cloneDeepSafe<T>(value: T): T;
133
+
134
+ /**
135
+ * Copies the provided text to the clipboard and shows a toast notification.
136
+ * @param textToCopy - The text to copy to the clipboard.
137
+ */
118
138
  export declare const copyToClipboard: (textToCopy: string) => Promise<void>;
119
139
 
120
140
  export declare const daysInMonth: number;
121
141
 
142
+ /**
143
+ * Performs a deep comparison between two values to determine if they are equivalent.
144
+ * This function is similar to Lodash's `isEqual`.
145
+ *
146
+ * @template T - The type of the values being compared.
147
+ * @param {T} a - The first value to compare.
148
+ * @param {T} b - The second value to compare.
149
+ * @returns {boolean} - Returns `true` if the values are deeply equal, otherwise `false`.
150
+ */
122
151
  export declare function deepEqual<T>(a: T, b: T): boolean;
123
152
 
124
153
  export declare const defaultImageSrc = "https://img.freepik.com/premium-vector/default-image-icon-vector-missing-picture-page-website-design-mobile-app-no-photo-available_87543-11093.jpg";
125
154
 
155
+ /**
156
+ * Formats a file size in bytes into a human-readable string.
157
+ * @param bytes - The file size in bytes.
158
+ * @param decimals - The number of decimal places to include.
159
+ * @returns The formatted file size string.
160
+ */
126
161
  export declare const fileSizeFormatter: (bytes: number, decimals?: number) => string;
127
162
 
163
+ /**
164
+ * Fills missing days in a month's data with a default value of 0.
165
+ * @param month - The month number (1-12).
166
+ * @param dayData - An array of objects containing day-value pairs.
167
+ * @returns An object with all days of the month filled.
168
+ */
128
169
  export declare const fillMissingDays: (month: number, dayData: Array<{
129
170
  [key: number]: number;
130
171
  }>) => {
131
172
  [k: string]: number;
132
173
  };
133
174
 
175
+ /**
176
+ * Formats a date to a relative format (e.g., "Yesterday" or "DD MMM YYYY").
177
+ * @param inputDate - The date string or Date object to format.
178
+ * @returns The formatted date string.
179
+ */
134
180
  export declare function formatDate(inputDate: Date | string): string;
135
181
 
182
+ /**
183
+ * Formats a date string or Date object to a locale string.
184
+ * @param dateString - The date string or Date object to format.
185
+ * @returns The formatted date string.
186
+ */
136
187
  export declare function formatDateToLocaleString(dateString: Date | string): string;
137
188
 
189
+ /**
190
+ * Formats the last used date, defaulting to the created date if not provided.
191
+ * @param inputDate - The last used date string or Date object.
192
+ * @param createdOnDate - The created date string or Date object.
193
+ * @returns The formatted date string.
194
+ */
138
195
  export declare function formatLastUsedDate(inputDate: Date | string, createdOnDate?: Date | string): string;
139
196
 
197
+ /**
198
+ * Generates an array of dates for a given month in "day month_name" format.
199
+ * @param monthNumber - The month number (1-12).
200
+ * @returns An array of formatted date strings.
201
+ */
140
202
  export declare const getDatesForMonth: (monthNumber: number) => string[];
141
203
 
204
+ /**
205
+ * Gets the number of days in a given month and year.
206
+ * @param month - The month number (1-12).
207
+ * @param year - The year.
208
+ * @returns The number of days in the month.
209
+ */
142
210
  export declare function getDaysInMonth(month: number, year: number): number;
143
211
 
212
+ /**
213
+ * Extracts the file name from a given URL.
214
+ * @param url - The URL containing the file name.
215
+ * @returns The extracted file name, or null if not found.
216
+ */
144
217
  export declare function getFileNameFromUrl(url: string): string | null;
145
218
 
219
+ /**
220
+ * Gets the short name of a month by its number.
221
+ * @param monthNumber - The month number (1-12).
222
+ * @returns The short month name (e.g., "Jan").
223
+ */
146
224
  export declare const getShortMonthName: (monthNumber: number) => string;
147
225
 
226
+ /**
227
+ * Checks if an element has overflow content.
228
+ * @param el - The HTML element to check.
229
+ * @returns True if the element has overflow, otherwise false.
230
+ */
148
231
  export declare function hasOverflow(el: HTMLElement): boolean;
149
232
 
150
233
  export declare const IconAitronos: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
@@ -375,6 +458,13 @@ export declare interface IMenuListItem {
375
458
  path: string;
376
459
  }
377
460
 
461
+ /**
462
+ * Generates a series of interpolated colors between two colors.
463
+ * @param start - The starting color in hex format.
464
+ * @param end - The ending color in hex format.
465
+ * @param steps - The number of colors to generate in the series.
466
+ * @returns An array of interpolated colors in hex format.
467
+ */
378
468
  export declare const interpolateColor: (start: string, end: string, steps: number) => string[];
379
469
 
380
470
  export declare interface ITabList {
@@ -382,11 +472,6 @@ export declare interface ITabList {
382
472
  currentTab?: number;
383
473
  }
384
474
 
385
- export declare const lineChartExternalTooltipWithCircularDots: (context: {
386
- chart: any;
387
- tooltip: any;
388
- }, currentMonth: string) => void;
389
-
390
475
  export declare const ModalBox: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
391
476
 
392
477
  export declare const ModalOverlay: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
@@ -423,8 +508,17 @@ required: true;
423
508
  "onUpdate:currentPage"?: ((...args: any[]) => any) | undefined;
424
509
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
425
510
 
511
+ /**
512
+ * Converts a date to a human-readable format (e.g., "12 Dec 2023 at 12:34").
513
+ * @param date - The date string or Date object to format.
514
+ * @returns The formatted date string.
515
+ */
426
516
  export declare function readableDateFormat(date: Date | string): string;
427
517
 
518
+ /**
519
+ * Smoothly scrolls to a target element by its ID.
520
+ * @param targetElement - The ID of the target element.
521
+ */
428
522
  export declare const scrollToElement: (targetElement: string) => void;
429
523
 
430
524
  export declare const SearchInput: DefineComponent<ExtractPropTypes< {