@cloudparker/moldex.js 4.1.7 → 4.1.8

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 (220) hide show
  1. package/dist/actions/badge.d.ts +12 -0
  2. package/dist/actions/badge.js +22 -0
  3. package/dist/actions/index.d.ts +3 -0
  4. package/dist/actions/index.js +3 -0
  5. package/dist/actions/no-context-menu.d.ts +3 -0
  6. package/dist/actions/no-context-menu.js +11 -0
  7. package/dist/actions/ripple.css +29 -0
  8. package/dist/actions/ripple.d.ts +7 -0
  9. package/dist/actions/ripple.js +74 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/services/date/date-service.d.ts +52 -0
  13. package/dist/services/date/date-service.js +206 -0
  14. package/dist/services/dialog/dialog-service.d.ts +96 -0
  15. package/dist/services/dialog/dialog-service.js +350 -0
  16. package/dist/services/index.d.ts +12 -0
  17. package/dist/services/index.js +12 -0
  18. package/dist/services/navigation/navigation-service.d.ts +39 -0
  19. package/dist/services/navigation/navigation-service.js +100 -0
  20. package/dist/services/screen/screen-service.d.ts +17 -0
  21. package/dist/services/screen/screen-service.js +39 -0
  22. package/dist/services/toast/toast-service.d.ts +5 -0
  23. package/dist/services/toast/toast-service.js +26 -0
  24. package/dist/services/utils/color-service.d.ts +46 -0
  25. package/dist/services/utils/color-service.js +73 -0
  26. package/dist/services/utils/currency-service.d.ts +91 -0
  27. package/dist/services/utils/currency-service.js +140 -0
  28. package/dist/services/utils/download-service.d.ts +91 -0
  29. package/dist/services/utils/download-service.js +159 -0
  30. package/dist/services/utils/file-service.d.ts +140 -0
  31. package/dist/services/utils/file-service.js +301 -0
  32. package/dist/services/utils/http-service.d.ts +77 -0
  33. package/dist/services/utils/http-service.js +158 -0
  34. package/dist/services/utils/image-service.d.ts +107 -0
  35. package/dist/services/utils/image-service.js +260 -0
  36. package/dist/services/utils/melody-service.d.ts +5 -0
  37. package/dist/services/utils/melody-service.js +41 -0
  38. package/dist/services/utils/utils-service.d.ts +260 -0
  39. package/dist/services/utils/utils-service.js +413 -0
  40. package/dist/stores/referrer-store/referrer-store.svelte.d.ts +3 -0
  41. package/dist/stores/referrer-store/referrer-store.svelte.js +11 -0
  42. package/dist/stores/screen-size/screen-size-store.svelte.d.ts +18 -0
  43. package/dist/stores/screen-size/screen-size-store.svelte.js +41 -0
  44. package/dist/types.d.ts +6 -0
  45. package/dist/types.js +7 -0
  46. package/dist/views/core/button/components/button/button.svelte +161 -0
  47. package/dist/views/core/button/components/button/button.svelte.d.ts +4 -0
  48. package/dist/views/core/button/components/button-back/button-back.svelte +46 -0
  49. package/dist/views/core/button/components/button-back/button-back.svelte.d.ts +11 -0
  50. package/dist/views/core/button/components/button-close/button-close.svelte +8 -0
  51. package/dist/views/core/button/components/button-close/button-close.svelte.d.ts +4 -0
  52. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +47 -0
  53. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte.d.ts +11 -0
  54. package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte +149 -0
  55. package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte.d.ts +24 -0
  56. package/dist/views/core/button/components/button-list-item/button-list-item.svelte +136 -0
  57. package/dist/views/core/button/components/button-list-item/button-list-item.svelte.d.ts +4 -0
  58. package/dist/views/core/button/components/button-menu/button-menu.svelte +105 -0
  59. package/dist/views/core/button/components/button-menu/button-menu.svelte.d.ts +21 -0
  60. package/dist/views/core/button/components/button-ok/button-ok.svelte +9 -0
  61. package/dist/views/core/button/components/button-ok/button-ok.svelte.d.ts +4 -0
  62. package/dist/views/core/button/components/button-search/button-search.svelte +72 -0
  63. package/dist/views/core/button/components/button-search/button-search.svelte.d.ts +21 -0
  64. package/dist/views/core/button/components/switch/switch.svelte +62 -0
  65. package/dist/views/core/button/components/switch/switch.svelte.d.ts +4 -0
  66. package/dist/views/core/button/index.d.ts +12 -0
  67. package/dist/views/core/button/index.js +12 -0
  68. package/dist/views/core/button/types.d.ts +100 -0
  69. package/dist/views/core/button/types.js +1 -0
  70. package/dist/views/core/common/components/content-area/content-area.svelte +47 -0
  71. package/dist/views/core/common/components/content-area/content-area.svelte.d.ts +12 -0
  72. package/dist/views/core/common/components/loading/loading.svelte +14 -0
  73. package/dist/views/core/common/components/loading/loading.svelte.d.ts +7 -0
  74. package/dist/views/core/common/components/virtual-scrolling/virtual-scrolling-list.svelte +60 -0
  75. package/dist/views/core/common/components/virtual-scrolling/virtual-scrolling-list.svelte.d.ts +11 -0
  76. package/dist/views/core/common/index.js +9 -0
  77. package/dist/views/core/dialog/components/cropper-dialog/cropper-dialog.svelte +51 -0
  78. package/dist/views/core/dialog/components/cropper-dialog/cropper-dialog.svelte.d.ts +5 -0
  79. package/dist/views/core/dialog/components/dialog/dialog.svelte +370 -0
  80. package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +19 -0
  81. package/dist/views/core/dialog/components/loading-dialog/loading-dialog.svelte +42 -0
  82. package/dist/views/core/dialog/components/loading-dialog/loading-dialog.svelte.d.ts +12 -0
  83. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +22 -0
  84. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte.d.ts +9 -0
  85. package/dist/views/core/dialog/components/number-field-dialog/number-field-dialog.svelte +57 -0
  86. package/dist/views/core/dialog/components/number-field-dialog/number-field-dialog.svelte.d.ts +14 -0
  87. package/dist/views/core/dialog/components/picker-dialog/picker-dialog.svelte +181 -0
  88. package/dist/views/core/dialog/components/picker-dialog/picker-dialog.svelte.d.ts +5 -0
  89. package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte +56 -0
  90. package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte.d.ts +15 -0
  91. package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte +56 -0
  92. package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte.d.ts +15 -0
  93. package/dist/views/core/dialog/index.d.ts +9 -0
  94. package/dist/views/core/dialog/index.js +9 -0
  95. package/dist/views/core/dialog/types.d.ts +105 -0
  96. package/dist/views/core/dialog/types.js +1 -0
  97. package/dist/views/core/drawer/components/drawer/drawer.svelte +110 -0
  98. package/dist/views/core/drawer/components/drawer/drawer.svelte.d.ts +19 -0
  99. package/dist/views/core/drawer/index.d.ts +2 -0
  100. package/dist/views/core/drawer/index.js +2 -0
  101. package/dist/views/core/icon/components/icon/icon.svelte +27 -0
  102. package/dist/views/core/icon/components/icon/icon.svelte.d.ts +12 -0
  103. package/dist/views/core/icon/components/icon-circle/icon-circle.svelte +17 -0
  104. package/dist/views/core/icon/components/icon-circle/icon-circle.svelte.d.ts +8 -0
  105. package/dist/views/core/icon/index.d.ts +4 -0
  106. package/dist/views/core/icon/index.js +4 -0
  107. package/dist/views/core/icon/services/icon-path-service.d.ts +23 -0
  108. package/dist/views/core/icon/services/icon-path-service.js +24 -0
  109. package/dist/views/core/index.d.ts +16 -0
  110. package/dist/views/core/index.js +16 -0
  111. package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +83 -0
  112. package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte.d.ts +19 -0
  113. package/dist/views/core/input/components/color-field/color-field.svelte +135 -0
  114. package/dist/views/core/input/components/color-field/color-field.svelte.d.ts +11 -0
  115. package/dist/views/core/input/components/combobox-field/combobox-field.svelte +492 -0
  116. package/dist/views/core/input/components/combobox-field/combobox-field.svelte.d.ts +7 -0
  117. package/dist/views/core/input/components/date-field/date-field.svelte +40 -0
  118. package/dist/views/core/input/components/date-field/date-field.svelte.d.ts +11 -0
  119. package/dist/views/core/input/components/datetime-field/datetime-field.svelte +22 -0
  120. package/dist/views/core/input/components/datetime-field/datetime-field.svelte.d.ts +8 -0
  121. package/dist/views/core/input/components/email-field/email-field.svelte +27 -0
  122. package/dist/views/core/input/components/email-field/email-field.svelte.d.ts +8 -0
  123. package/dist/views/core/input/components/file-field/file-field.svelte +106 -0
  124. package/dist/views/core/input/components/file-field/file-field.svelte.d.ts +13 -0
  125. package/dist/views/core/input/components/input-field/input-field.svelte +336 -0
  126. package/dist/views/core/input/components/input-field/input-field.svelte.d.ts +9 -0
  127. package/dist/views/core/input/components/label/label.svelte +48 -0
  128. package/dist/views/core/input/components/label/label.svelte.d.ts +14 -0
  129. package/dist/views/core/input/components/number-field/number-field.svelte +22 -0
  130. package/dist/views/core/input/components/number-field/number-field.svelte.d.ts +8 -0
  131. package/dist/views/core/input/components/password-field/password-field.svelte +100 -0
  132. package/dist/views/core/input/components/password-field/password-field.svelte.d.ts +12 -0
  133. package/dist/views/core/input/components/phone-field/phone-field.svelte +187 -0
  134. package/dist/views/core/input/components/phone-field/phone-field.svelte.d.ts +12 -0
  135. package/dist/views/core/input/components/radio-field/radio-field.svelte +127 -0
  136. package/dist/views/core/input/components/radio-field/radio-field.svelte.d.ts +4 -0
  137. package/dist/views/core/input/components/range-field/range-field.svelte +120 -0
  138. package/dist/views/core/input/components/range-field/range-field.svelte.d.ts +23 -0
  139. package/dist/views/core/input/components/search-field/search-field.svelte +80 -0
  140. package/dist/views/core/input/components/search-field/search-field.svelte.d.ts +12 -0
  141. package/dist/views/core/input/components/text-field/text-field.svelte +31 -0
  142. package/dist/views/core/input/components/text-field/text-field.svelte.d.ts +11 -0
  143. package/dist/views/core/input/components/textarea-field/textarea-field.svelte +27 -0
  144. package/dist/views/core/input/components/textarea-field/textarea-field.svelte.d.ts +8 -0
  145. package/dist/views/core/input/components/time-field/time-field.svelte +21 -0
  146. package/dist/views/core/input/components/time-field/time-field.svelte.d.ts +8 -0
  147. package/dist/views/core/input/index.d.ts +20 -0
  148. package/dist/views/core/input/index.js +20 -0
  149. package/dist/views/core/input/types.d.ts +159 -0
  150. package/dist/views/core/input/types.js +1 -0
  151. package/dist/views/core/navbar/components/navbar/navbar.svelte +133 -0
  152. package/dist/views/core/navbar/components/navbar/navbar.svelte.d.ts +4 -0
  153. package/dist/views/core/navbar/index.d.ts +2 -0
  154. package/dist/views/core/navbar/index.js +2 -0
  155. package/dist/views/core/navbar/types.d.ts +35 -0
  156. package/dist/views/core/navbar/types.js +1 -0
  157. package/dist/views/core/no-data/components/no-data/no-data.svelte +47 -0
  158. package/dist/views/core/no-data/components/no-data/no-data.svelte.d.ts +13 -0
  159. package/dist/views/core/no-data/index.d.ts +2 -0
  160. package/dist/views/core/no-data/index.js +2 -0
  161. package/dist/views/core/pagination/components/pagination/pagination.svelte +151 -0
  162. package/dist/views/core/pagination/components/pagination/pagination.svelte.d.ts +16 -0
  163. package/dist/views/core/pagination/index.d.ts +2 -0
  164. package/dist/views/core/pagination/index.js +2 -0
  165. package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +55 -0
  166. package/dist/views/core/progressbar/components/progressbar/progressbar.svelte.d.ts +11 -0
  167. package/dist/views/core/progressbar/index.d.ts +2 -0
  168. package/dist/views/core/progressbar/index.js +2 -0
  169. package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +8 -0
  170. package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte.d.ts +6 -0
  171. package/dist/views/core/ruler/index.d.ts +2 -0
  172. package/dist/views/core/ruler/index.js +2 -0
  173. package/dist/views/core/screen-detector/components/screen-detector.svelte +17 -0
  174. package/dist/views/core/screen-detector/components/screen-detector.svelte.d.ts +3 -0
  175. package/dist/views/core/screen-detector/index.d.ts +2 -0
  176. package/dist/views/core/screen-detector/index.js +2 -0
  177. package/dist/views/core/sidebar/components/sidebar.svelte +49 -0
  178. package/dist/views/core/sidebar/components/sidebar.svelte.d.ts +12 -0
  179. package/dist/views/core/sidebar/index.js +5 -0
  180. package/dist/views/core/spinner/components/spinner/spinner.svelte +21 -0
  181. package/dist/views/core/spinner/components/spinner/spinner.svelte.d.ts +6 -0
  182. package/dist/views/core/spinner/index.d.ts +2 -0
  183. package/dist/views/core/spinner/index.js +2 -0
  184. package/dist/views/core/text/components/text-await/text-await.svelte +23 -0
  185. package/dist/views/core/text/components/text-await/text-await.svelte.d.ts +10 -0
  186. package/dist/views/core/text/components/text-copy/text-copy.svelte +40 -0
  187. package/dist/views/core/text/components/text-copy/text-copy.svelte.d.ts +10 -0
  188. package/dist/views/core/text/components/text-currency/text-currency.svelte +24 -0
  189. package/dist/views/core/text/components/text-currency/text-currency.svelte.d.ts +11 -0
  190. package/dist/views/core/text/components/text-date/text-date.svelte +40 -0
  191. package/dist/views/core/text/components/text-date/text-date.svelte.d.ts +10 -0
  192. package/dist/views/core/text/components/text-email/text-email.svelte +22 -0
  193. package/dist/views/core/text/components/text-email/text-email.svelte.d.ts +9 -0
  194. package/dist/views/core/text/components/text-html/text-html.svelte +7 -0
  195. package/dist/views/core/text/components/text-html/text-html.svelte.d.ts +6 -0
  196. package/dist/views/core/text/components/text-phone/text-phone.svelte +25 -0
  197. package/dist/views/core/text/components/text-phone/text-phone.svelte.d.ts +9 -0
  198. package/dist/views/core/text/index.d.ts +8 -0
  199. package/dist/views/core/text/index.js +8 -0
  200. package/dist/views/core/toast/components/toast/toast.svelte +46 -0
  201. package/dist/views/core/toast/components/toast/toast.svelte.d.ts +7 -0
  202. package/dist/views/core/toast/index.d.ts +3 -0
  203. package/dist/views/core/toast/index.js +3 -0
  204. package/dist/views/core/toast/types.d.ts +8 -0
  205. package/dist/views/core/toast/types.js +1 -0
  206. package/dist/views/extra/fields/country-combobox-field.svelte +42 -0
  207. package/dist/views/extra/fields/country-combobox-field.svelte.d.ts +8 -0
  208. package/dist/views/extra/index.d.ts +6 -0
  209. package/dist/views/extra/index.js +6 -0
  210. package/dist/views/extra/loaders/country-loader.svelte +38 -0
  211. package/dist/views/extra/loaders/country-loader.svelte.d.ts +12 -0
  212. package/dist/views/extra/texts/text-country-state.svelte +48 -0
  213. package/dist/views/extra/texts/text-country-state.svelte.d.ts +6 -0
  214. package/dist/views/extra/texts/text-country.svelte +22 -0
  215. package/dist/views/extra/texts/text-country.svelte.d.ts +6 -0
  216. package/dist/views/extra/types.d.ts +5 -0
  217. package/dist/views/extra/types.js +1 -0
  218. package/dist/views/index.d.ts +2 -0
  219. package/dist/views/index.js +2 -0
  220. package/package.json +2 -1
@@ -0,0 +1,107 @@
1
+ import { DialogSizeEnum } from "../dialog/dialog-service.js";
2
+ export type ImageCaptures = ImageCaptureEnum.USER | ImageCaptureEnum.ENVIRONMENT;
3
+ export declare enum ImageCaptureEnum {
4
+ USER = "user",
5
+ ENVIRONMENT = "environment"
6
+ }
7
+ export type OutputImageFormats = OutputImageFormatEnum.JPG | OutputImageFormatEnum.WEBP | OutputImageFormatEnum.PNG;
8
+ export declare enum OutputImageFormatEnum {
9
+ WEBP = "image/webp",
10
+ JPG = "image/jpeg",
11
+ PNG = "image/png"
12
+ }
13
+ export declare class FilePickerAccepts {
14
+ static image: string;
15
+ static document: string;
16
+ static video: string;
17
+ static audio: string;
18
+ static text: string;
19
+ }
20
+ /**
21
+ * Processes an image file by resizing, reducing file size, and converting it to a specified format based on the provided options.
22
+ * @param file - The original image file.
23
+ * @param options - Options for resizing, compressing, and converting the image.
24
+ * @returns A promise that resolves to a processed File object with the correct filename and extension.
25
+ */
26
+ export declare function processImageFile(file: File, options?: {
27
+ maxWidth?: number;
28
+ maxHeight?: number;
29
+ maxSizeInBytes?: number;
30
+ outputFormat?: OutputImageFormats;
31
+ quality?: number;
32
+ }): Promise<File>;
33
+ /**
34
+ * Generates a new filename based on the original filename and output format.
35
+ * @param originalName - The original filename.
36
+ * @param outputFormat - The desired output format (e.g., 'image/jpeg', 'image/png').
37
+ * @returns A new filename with the correct extension.
38
+ */
39
+ export declare function generateNewFileName(originalName: string, outputFormat: string): string;
40
+ /**
41
+ * Calculates the new dimensions for resizing the image while maintaining aspect ratio.
42
+ * @param img - The original image.
43
+ * @param maxWidth - The maximum width for the new image.
44
+ * @param maxHeight - The maximum height for the new image.
45
+ * @returns An object with the new width and height.
46
+ */
47
+ export declare function calculateNewDimensions(img: HTMLImageElement, maxWidth?: number, maxHeight?: number): {
48
+ width: number;
49
+ height: number;
50
+ };
51
+ /**
52
+ * Compresses an image to reduce its file size to be under the specified max size.
53
+ * @param canvas - The canvas element with the image drawn on it.
54
+ * @param maxSizeInBytes - The maximum allowed size in bytes.
55
+ * @param format - The output format of the image (e.g., 'image/webp', 'image/jpeg').
56
+ * @param initialQuality - The initial image quality (0 to 1).
57
+ * @returns A promise that resolves to a compressed Blob object.
58
+ */
59
+ export declare function compressImage(canvas: HTMLCanvasElement, maxSizeInBytes: number, format: string, initialQuality: number): Promise<Blob>;
60
+ /**
61
+ * Reads the contents of a given File object as an HTMLImageElement.
62
+ *
63
+ * This function uses the FileReader API to read the file content and returns it as an HTMLImageElement.
64
+ * It is useful for loading images for display or further processing.
65
+ *
66
+ * @param file - The File object to be read and converted into an HTMLImageElement.
67
+ * @returns A promise that resolves to an HTMLImageElement representing the image content of the file.
68
+ *
69
+ * @throws An error if the file could not be read or if the image could not be loaded.
70
+ *
71
+ * @example
72
+ * // Create an image file and read it as an HTMLImageElement
73
+ * const imageFile = new File([ binary data here , 'example.png', { type: 'image/png' });
74
+ * readFileAsImage(imageFile).then((img) => {
75
+ * document.body.appendChild(img); // Display the image on the page
76
+ * });
77
+ */
78
+ export declare function readFileAsImage(file: File): Promise<HTMLImageElement>;
79
+ /**
80
+ * Converts a Base64 or Data URL string into an HTMLImageElement.
81
+ *
82
+ * This function creates an HTMLImageElement from a given Base64 or Data URL string.
83
+ * It is useful for displaying images on the page or performing further image processing.
84
+ *
85
+ * @param dataUrl - The Base64 or Data URL string representing the image.
86
+ * @returns A promise that resolves to an HTMLImageElement when the image is successfully loaded.
87
+ *
88
+ * @throws An error if the image cannot be loaded.
89
+ *
90
+ * @example
91
+ * // Convert a Base64 string to an image element and append it to the document
92
+ * const base64String = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...';
93
+ * dataUrlToImage(base64String).then((img) => {
94
+ * document.body.appendChild(img); // Display the image on the page
95
+ * }).catch((error) => {
96
+ * console.error('Failed to load image:', error.message);
97
+ * });
98
+ */
99
+ export declare function dataUrlToImage(dataUrl: string): Promise<HTMLImageElement>;
100
+ export declare function cropImageFile({ inputImageFile, outputFormat, outputWidth, outputQuality, outputAspectRatio, dialogSize, }: {
101
+ inputImageFile: File;
102
+ outputFormat?: OutputImageFormats;
103
+ outputWidth?: number;
104
+ outputQuality?: number;
105
+ outputAspectRatio?: number;
106
+ dialogSize?: DialogSizeEnum;
107
+ }): Promise<File | null>;
@@ -0,0 +1,260 @@
1
+ import { DialogSizeEnum, openCropperDialog } from "../dialog/dialog-service.js";
2
+ import { getExtFromFileType, readFileAsDataURL } from "./file-service.js";
3
+ import { nanoid } from "nanoid";
4
+ export var ImageCaptureEnum;
5
+ (function (ImageCaptureEnum) {
6
+ ImageCaptureEnum["USER"] = "user";
7
+ ImageCaptureEnum["ENVIRONMENT"] = "environment";
8
+ })(ImageCaptureEnum || (ImageCaptureEnum = {}));
9
+ export var OutputImageFormatEnum;
10
+ (function (OutputImageFormatEnum) {
11
+ OutputImageFormatEnum["WEBP"] = "image/webp";
12
+ OutputImageFormatEnum["JPG"] = "image/jpeg";
13
+ OutputImageFormatEnum["PNG"] = "image/png";
14
+ })(OutputImageFormatEnum || (OutputImageFormatEnum = {}));
15
+ export class FilePickerAccepts {
16
+ static image = '.png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.webp,.WEBP';
17
+ static document = '.pdf,.PDF,.doc,.DOC,.docx,.DOCX,.xls,.XLS,.xlsx,.XLSX,.ppt,.PPT,.pptx,.PPTX,.txt,.TXT,';
18
+ static video = '.mp4,.MP4,.mov,.MOV,.avi,.AVI,.wmv,.WMV,.flv,.FLV,.mkv,.MKV,.webm,.WEBM,';
19
+ static audio = '.mp3,.MP3,.wav,.WAV,.aac,.AAC,.flac,.FLAC,.ogg,.OGG,.wma,.WMA,';
20
+ static text = '.txt,.TXT,';
21
+ }
22
+ /**
23
+ * Processes an image file by resizing, reducing file size, and converting it to a specified format based on the provided options.
24
+ * @param file - The original image file.
25
+ * @param options - Options for resizing, compressing, and converting the image.
26
+ * @returns A promise that resolves to a processed File object with the correct filename and extension.
27
+ */
28
+ export async function processImageFile(file, options = {}) {
29
+ // // Return the original file if no processing is needed
30
+ // if (!options?.maxWidth && !options?.maxHeight && !options?.maxSizeInBytes && !options?.outputFormat) {
31
+ // return file;
32
+ // }
33
+ options = options || {};
34
+ if (!options.maxWidth) {
35
+ options.maxWidth = 1920;
36
+ }
37
+ if (!options.maxHeight) {
38
+ options.maxHeight = options.maxWidth;
39
+ }
40
+ if (!options.quality || options.quality < 0) {
41
+ options.quality = 0.8;
42
+ }
43
+ if (options.quality > 1) {
44
+ options.quality = options.quality / 100;
45
+ }
46
+ if (options.outputFormat) {
47
+ options.outputFormat = OutputImageFormatEnum.WEBP;
48
+ }
49
+ // Read the image as a data URL
50
+ const imageDataUrl = await readFileAsDataURL(file);
51
+ const img = new Image();
52
+ return new Promise((resolve, reject) => {
53
+ img.onload = async () => {
54
+ // Create a canvas to resize/compress/convert the image
55
+ const canvas = document.createElement('canvas');
56
+ const context = canvas.getContext('2d');
57
+ // Calculate the new dimensions
58
+ const { width, height } = calculateNewDimensions(img, options.maxWidth, options.maxHeight);
59
+ canvas.width = width;
60
+ canvas.height = height;
61
+ // Draw the image on the canvas
62
+ context?.drawImage(img, 0, 0, width, height);
63
+ // Determine the output format and quality
64
+ const outputFormat = options?.outputFormat || file.type;
65
+ const quality = options?.quality !== undefined ? options.quality : 0.8; // Default quality 80%
66
+ // Convert canvas to Blob (compressed image in specified format)
67
+ canvas.toBlob(async (blob) => {
68
+ if (!blob) {
69
+ reject(new Error('Canvas conversion to Blob failed.'));
70
+ return;
71
+ }
72
+ // Check the file size and reduce quality if necessary
73
+ let compressedBlob = blob;
74
+ if (options.maxSizeInBytes && blob.size > options.maxSizeInBytes) {
75
+ compressedBlob = await compressImage(canvas, options.maxSizeInBytes, outputFormat, quality);
76
+ }
77
+ // Create a new File from the compressed Blob with the correct filename and extension
78
+ const newFileName = generateNewFileName(file.name, outputFormat);
79
+ const processedFile = new File([compressedBlob], newFileName, { type: outputFormat });
80
+ resolve(processedFile);
81
+ }, outputFormat, quality // Use the specified quality
82
+ );
83
+ };
84
+ img.onerror = (error) => reject(error);
85
+ img.src = imageDataUrl; // Set the image source
86
+ });
87
+ }
88
+ /**
89
+ * Generates a new filename based on the original filename and output format.
90
+ * @param originalName - The original filename.
91
+ * @param outputFormat - The desired output format (e.g., 'image/jpeg', 'image/png').
92
+ * @returns A new filename with the correct extension.
93
+ */
94
+ export function generateNewFileName(originalName, outputFormat) {
95
+ // Get the file extension based on the output format
96
+ const formatExtensionMap = {
97
+ 'image/jpeg': '.jpeg',
98
+ 'image/png': '.png',
99
+ 'image/webp': '.webp',
100
+ };
101
+ // Extract the base name without the extension
102
+ const baseName = originalName.replace(/\.[^/.]+$/, ''); // Remove existing extension
103
+ const newExtension = formatExtensionMap[outputFormat] || ''; // Get the new extension
104
+ return `${baseName}${newExtension}`;
105
+ }
106
+ /**
107
+ * Calculates the new dimensions for resizing the image while maintaining aspect ratio.
108
+ * @param img - The original image.
109
+ * @param maxWidth - The maximum width for the new image.
110
+ * @param maxHeight - The maximum height for the new image.
111
+ * @returns An object with the new width and height.
112
+ */
113
+ export function calculateNewDimensions(img, maxWidth, maxHeight) {
114
+ let width = img.width;
115
+ let height = img.height;
116
+ // Maintain aspect ratio while resizing
117
+ if (maxWidth && width > maxWidth) {
118
+ height = (maxWidth / width) * height;
119
+ width = maxWidth;
120
+ }
121
+ if (maxHeight && height > maxHeight) {
122
+ width = (maxHeight / height) * width;
123
+ height = maxHeight;
124
+ }
125
+ return { width, height };
126
+ }
127
+ /**
128
+ * Compresses an image to reduce its file size to be under the specified max size.
129
+ * @param canvas - The canvas element with the image drawn on it.
130
+ * @param maxSizeInBytes - The maximum allowed size in bytes.
131
+ * @param format - The output format of the image (e.g., 'image/webp', 'image/jpeg').
132
+ * @param initialQuality - The initial image quality (0 to 1).
133
+ * @returns A promise that resolves to a compressed Blob object.
134
+ */
135
+ export function compressImage(canvas, maxSizeInBytes, format, initialQuality) {
136
+ return new Promise((resolve) => {
137
+ let quality = initialQuality; // Start with the specified quality
138
+ let compressedBlob = null;
139
+ // Reduce quality iteratively until the Blob size is below the max size
140
+ const compressIteration = () => {
141
+ canvas.toBlob((blob) => {
142
+ if (!blob)
143
+ return;
144
+ if (blob.size <= maxSizeInBytes || quality <= 0.1) {
145
+ resolve(blob);
146
+ }
147
+ else {
148
+ quality -= 0.1; // Reduce quality
149
+ compressIteration(); // Recurse
150
+ }
151
+ }, format, quality);
152
+ };
153
+ compressIteration();
154
+ });
155
+ }
156
+ /**
157
+ * Reads the contents of a given File object as an HTMLImageElement.
158
+ *
159
+ * This function uses the FileReader API to read the file content and returns it as an HTMLImageElement.
160
+ * It is useful for loading images for display or further processing.
161
+ *
162
+ * @param file - The File object to be read and converted into an HTMLImageElement.
163
+ * @returns A promise that resolves to an HTMLImageElement representing the image content of the file.
164
+ *
165
+ * @throws An error if the file could not be read or if the image could not be loaded.
166
+ *
167
+ * @example
168
+ * // Create an image file and read it as an HTMLImageElement
169
+ * const imageFile = new File([ binary data here , 'example.png', { type: 'image/png' });
170
+ * readFileAsImage(imageFile).then((img) => {
171
+ * document.body.appendChild(img); // Display the image on the page
172
+ * });
173
+ */
174
+ export async function readFileAsImage(file) {
175
+ return new Promise((resolve, reject) => {
176
+ const reader = new FileReader();
177
+ // Event handler executed when the file reading operation is completed
178
+ reader.onloadend = () => {
179
+ if (reader.readyState === FileReader.DONE) {
180
+ const img = new Image();
181
+ img.src = reader.result;
182
+ // Resolve the promise when the image is successfully loaded
183
+ img.onload = () => resolve(img);
184
+ // Reject the promise if an error occurs while loading the image
185
+ img.onerror = () => reject(new Error('Failed to load image from file.'));
186
+ }
187
+ else {
188
+ reject(new Error('Failed to read file as Image.'));
189
+ }
190
+ };
191
+ // Event handler executed when an error occurs while reading the file
192
+ reader.onerror = () => {
193
+ reject(new Error(`Error reading file as Image: ${reader.error?.message || 'Unknown error'}`));
194
+ };
195
+ // Read the file content as a data URL for image loading
196
+ reader.readAsDataURL(file);
197
+ });
198
+ }
199
+ /**
200
+ * Converts a Base64 or Data URL string into an HTMLImageElement.
201
+ *
202
+ * This function creates an HTMLImageElement from a given Base64 or Data URL string.
203
+ * It is useful for displaying images on the page or performing further image processing.
204
+ *
205
+ * @param dataUrl - The Base64 or Data URL string representing the image.
206
+ * @returns A promise that resolves to an HTMLImageElement when the image is successfully loaded.
207
+ *
208
+ * @throws An error if the image cannot be loaded.
209
+ *
210
+ * @example
211
+ * // Convert a Base64 string to an image element and append it to the document
212
+ * const base64String = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...';
213
+ * dataUrlToImage(base64String).then((img) => {
214
+ * document.body.appendChild(img); // Display the image on the page
215
+ * }).catch((error) => {
216
+ * console.error('Failed to load image:', error.message);
217
+ * });
218
+ */
219
+ export async function dataUrlToImage(dataUrl) {
220
+ return new Promise((resolve, reject) => {
221
+ const img = new Image();
222
+ // Resolve the promise when the image loads successfully
223
+ img.onload = () => resolve(img);
224
+ // Reject the promise if an error occurs while loading the image
225
+ img.onerror = () => reject(new Error('Failed to load image from the provided Data URL or Base64 string.'));
226
+ // Set the source of the image to the provided Data URL
227
+ img.src = dataUrl;
228
+ });
229
+ }
230
+ export async function cropImageFile({ inputImageFile, outputFormat = OutputImageFormatEnum.WEBP, outputWidth = 600, outputQuality = 0.6, outputAspectRatio = 1, dialogSize = DialogSizeEnum.MD, }) {
231
+ let imageFile = null;
232
+ let fileName = '';
233
+ if (inputImageFile) {
234
+ imageFile = (await openCropperDialog({
235
+ inputImageFile,
236
+ outputFormat,
237
+ outputWidth,
238
+ outputQuality,
239
+ outputAspectRatio,
240
+ size: dialogSize,
241
+ }));
242
+ if (imageFile) {
243
+ try {
244
+ // console.log('imageFile', imageFile);
245
+ let filenameNanoid = nanoid(10);
246
+ fileName = (imageFile.name || '').toLocaleLowerCase().trim().replace(/ /g, '_').substring(0, 4);
247
+ fileName = (fileName ? fileName + '-' + filenameNanoid : filenameNanoid) + `.${getExtFromFileType(outputFormat)}`;
248
+ }
249
+ catch (e) {
250
+ console.error(e);
251
+ }
252
+ }
253
+ }
254
+ let newFile = null;
255
+ if (imageFile && fileName) {
256
+ // Add the file name to the file object, so that it can be used in the form.
257
+ newFile = new File([imageFile], fileName, { type: imageFile.type || 'image/webp' });
258
+ }
259
+ return newFile;
260
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Play a melody given as an array of note names and durations.
3
+ * @param melody - Array of note-duration pairs, e.g., [['C4', 500], ['D4', 500]].
4
+ */
5
+ export declare function playMelody(melody: [string, number][]): Promise<void>;
@@ -0,0 +1,41 @@
1
+ const noteFrequencies = {
2
+ A0: 27.5, B0: 30.87, C1: 32.7, D1: 36.71, E1: 41.2, F1: 43.65, G1: 49.0,
3
+ A1: 55.0, B1: 61.74, C2: 65.41, D2: 73.42, E2: 82.41, F2: 87.31, G2: 98.0,
4
+ A2: 110.0, B2: 123.47, C3: 130.81, D3: 146.83, E3: 164.81, F3: 174.61, G3: 196.0,
5
+ A3: 220.0, B3: 246.94, C4: 261.63, D4: 293.66, E4: 329.63, F4: 349.23, G4: 392.0,
6
+ A4: 440.0, B4: 493.88, C5: 523.25, D5: 587.33, E5: 659.25, F5: 698.46, G5: 783.99,
7
+ A5: 880.0, B5: 987.77, C6: 1046.5, D6: 1174.66, E6: 1318.51, F6: 1396.91, G6: 1567.98,
8
+ A6: 1760.0, B6: 1975.53, C7: 2093.0, D7: 2349.32, E7: 2637.02, F7: 2793.83, G7: 3135.96,
9
+ A7: 3520.0, B7: 3951.07, C8: 4186.01,
10
+ };
11
+ /**
12
+ * Play a melody given as an array of note names and durations.
13
+ * @param melody - Array of note-duration pairs, e.g., [['C4', 500], ['D4', 500]].
14
+ */
15
+ export async function playMelody(melody) {
16
+ try {
17
+ const audioContext = new (window.AudioContext || window.webkitAudioContext)();
18
+ for (const [note, duration] of melody) {
19
+ const frequency = noteFrequencies[note];
20
+ if (!frequency)
21
+ continue; // Skip invalid notes
22
+ const oscillator = audioContext.createOscillator();
23
+ const gainNode = audioContext.createGain();
24
+ oscillator.type = 'sine'; // You can use 'square', 'triangle', 'sawtooth', etc.
25
+ oscillator.frequency.setValueAtTime(frequency, audioContext.currentTime);
26
+ oscillator.connect(gainNode);
27
+ gainNode.connect(audioContext.destination);
28
+ oscillator.start();
29
+ await new Promise((resolve) => {
30
+ setTimeout(() => {
31
+ oscillator.stop();
32
+ resolve(null);
33
+ }, duration);
34
+ });
35
+ }
36
+ audioContext.close();
37
+ }
38
+ catch (error) {
39
+ console.error('Error playing melody:', error);
40
+ }
41
+ }
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Generates a random number between the specified minimum and maximum values (inclusive of the minimum and exclusive of the maximum).
3
+ *
4
+ * @param min - The minimum value (inclusive) of the random number range.
5
+ * @param max - The maximum value (exclusive) of the random number range.
6
+ * @returns A random number between `min` (inclusive) and `max` (exclusive).
7
+ *
8
+ * @example
9
+ * // Generate a random number between 1 (inclusive) and 5 (exclusive)
10
+ * const randomNumber = random(1, 5); // Possible values: 1.0, 2.4, 3.6, etc.
11
+ *
12
+ * @example
13
+ * // Generate a random number between 10 (inclusive) and 20 (exclusive)
14
+ * const randomNumber = random(10, 20); // Possible values: 10.0, 15.3, 19.8, etc.
15
+ */
16
+ export declare function random(min: number, max: number): number;
17
+ /**
18
+ * Strips the Base64 content from a Data URL string.
19
+ *
20
+ * This function removes the `data:[<mediatype>][;base64],` prefix from a Data URL string,
21
+ * leaving only the Base64 content. If the input is not a valid Data URL, the original input is returned.
22
+ *
23
+ * @param dataUrl - The Data URL string to be stripped.
24
+ * @returns The stripped Base64 content, or the original string if it is not a valid Data URL.
25
+ *
26
+ * @example
27
+ * // Remove the prefix from a Data URL string
28
+ * const dataUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...';
29
+ * const base64Content = stripDataUrl(dataUrl);
30
+ * console.log(base64Content); // Output: "iVBORw0KGgoAAAANSUhEUgAA..."
31
+ */
32
+ export declare function stripDataUrl(dataUrl: string): string;
33
+ /**
34
+ * Function to download content from a given URL and convert it to a Base64-encoded string.
35
+ * @param url - The URL to download the content from.
36
+ * @returns A promise that resolves to the Base64-encoded string of the downloaded content.
37
+ */
38
+ export declare function readUrlAsBase64(url: string): Promise<string>;
39
+ /**
40
+ * Validates if a given string is a valid email address.
41
+ *
42
+ * This function uses a regular expression to validate email addresses based on common patterns.
43
+ *
44
+ * @param email - The email address string to validate.
45
+ * @returns A boolean indicating whether the email is valid.
46
+ *
47
+ * @example
48
+ * const isValid = isValidEmailAddress('test@example.com');
49
+ * console.log(isValid); // Output: true
50
+ */
51
+ export declare function isValidEmailAddress(email: string): boolean;
52
+ /**
53
+ * Validates if a given string is a valid URL.
54
+ *
55
+ * This function uses a regular expression to validate URLs based on common URL patterns.
56
+ *
57
+ * @param url - The URL string to validate.
58
+ * @returns A boolean indicating whether the URL is valid.
59
+ *
60
+ * @example
61
+ * const isValid = isValidUrl('https://www.example.com');
62
+ * console.log(isValid); // Output: true
63
+ */
64
+ export declare function isValidUrl(url: string): boolean;
65
+ /**
66
+ * Creates a mailto URI and opens it in the user's default email client.
67
+ *
68
+ * This function constructs a mailto URI based on the provided email details and opens it using `window.open`.
69
+ * It supports specifying the recipient, subject, and body of the email.
70
+ *
71
+ * @param param - An object containing the email details:
72
+ * - `to`: The recipient email address.
73
+ * - `body`: Optional. The body content of the email.
74
+ * - `subject`: Optional. The subject of the email.
75
+ *
76
+ * @example
77
+ * // Create a mailto link with recipient, subject, and body
78
+ * createMailtoLink({
79
+ * to: 'recipient@example.com',
80
+ * subject: 'Hello',
81
+ * body: 'This is a sample email message.'
82
+ * });
83
+ */
84
+ export declare function createMailtoLink({ to, body, subject }: {
85
+ to: string;
86
+ body?: string;
87
+ subject?: string;
88
+ }): void;
89
+ /**
90
+ * Copies the provided text or HTML content to the clipboard.
91
+ *
92
+ * This function handles copying both plain text and rich text (HTML) content.
93
+ * It uses the Clipboard API where available and falls back to older methods for unsupported browsers.
94
+ *
95
+ * @param content - The content to be copied to the clipboard. It can be either a string (plain text) or an HTMLElement (rich text).
96
+ * @returns A promise that resolves to `true` if the copy operation is successful, or `false` otherwise.
97
+ *
98
+ * @example
99
+ * // Copy plain text to clipboard
100
+ * copyToClipboard('Hello, World!').then((success) => {
101
+ * console.log(success ? 'Copied successfully!' : 'Failed to copy.');
102
+ * });
103
+ *
104
+ * @example
105
+ * // Copy rich text (HTML element) to clipboard
106
+ * const element = document.getElementById('myElement');
107
+ * if (element) {
108
+ * copyToClipboard(element).then((success) => {
109
+ * console.log(success ? 'Copied successfully!' : 'Failed to copy.');
110
+ * });
111
+ * }
112
+ */
113
+ export declare function copyToClipboard(content: string | HTMLElement): Promise<boolean>;
114
+ /**
115
+ * Formats a string by replacing placeholders `{index}` with corresponding arguments.
116
+ *
117
+ * This function replaces placeholders in the format `{0}`, `{1}`, etc., in the provided string
118
+ * with the corresponding values from the `args` array.
119
+ *
120
+ * @param str - The string containing placeholders.
121
+ * @param args - The values to replace the placeholders with.
122
+ * @returns A formatted string with the placeholders replaced by the corresponding arguments.
123
+ *
124
+ * @example
125
+ * const formatted = formatString('Hello, {0}!', 'World');
126
+ * console.log(formatted); // Output: "Hello, World!"
127
+ */
128
+ export declare function formatString(str: string, ...args: any[]): string;
129
+ /**
130
+ * Delays the execution of code for a specified number of milliseconds.
131
+ *
132
+ * This function returns a promise that resolves after the specified delay.
133
+ *
134
+ * @param milliseconds - The number of milliseconds to wait before resolving the promise. Default is 0.
135
+ * @returns A promise that resolves after the specified delay.
136
+ *
137
+ * @example
138
+ * delay(1000).then(() => console.log('1 second later'));
139
+ */
140
+ export declare function delay(milliseconds?: number): Promise<void>;
141
+ /**
142
+ * Sorts an array of objects or values based on a specified field or value.
143
+ *
144
+ * This function sorts an array of objects based on a specified field or directly sorts an array of values.
145
+ * It supports both ascending and descending orders and can handle date values.
146
+ *
147
+ * @typeParam T - The type of elements in the array.
148
+ * @param param - An object containing the array to sort, the field to sort by (optional),
149
+ * whether to sort in descending order, and whether to sort as date values.
150
+ * @param param.array - The array of objects or values to sort.
151
+ * @param param.field - Optional. The field of the objects to sort by.
152
+ * @param param.desc - Optional. If true, sorts in descending order. Default is false (ascending).
153
+ * @param param.isDate - Optional. If true, sorts the values as dates.
154
+ * @returns The sorted array.
155
+ *
156
+ * @example
157
+ * const arr = [{ name: 'Alice' }, { name: 'Bob' }];
158
+ * const sortedArr = sort({ array: arr, field: 'name', desc: true });
159
+ * console.log(sortedArr); // Output: [{ name: 'Bob' }, { name: 'Alice' }]
160
+ */
161
+ export declare function sort<T>({ array, field, desc, isDate }: {
162
+ array: T[];
163
+ field?: keyof T;
164
+ desc?: boolean;
165
+ isDate?: boolean;
166
+ }): T[];
167
+ /**
168
+ * Triggers a vibration effect on supported devices.
169
+ *
170
+ * This function uses the Vibration API to trigger a vibration effect. If the Vibration API is not
171
+ * supported or if permissions are not granted, the function will have no effect.
172
+ *
173
+ * @param value - A single number representing the duration of the vibration in milliseconds, or
174
+ * an array of numbers representing vibration patterns.
175
+ *
176
+ * @example
177
+ * // Single vibration for 200 milliseconds
178
+ * vibrate(200);
179
+ *
180
+ * @example
181
+ * // Vibration pattern: 200ms on, 100ms off, 200ms on
182
+ * vibrate([200, 100, 200]);
183
+ */
184
+ export declare function vibrate(value?: number | number[]): void;
185
+ /**
186
+ * Plays a simple click effect using the vibration API (if supported).
187
+ *
188
+ * This function triggers a short vibration effect to simulate a click or feedback action on devices
189
+ * that support the Vibration API.
190
+ *
191
+ * @example
192
+ * playClickEffect(); // Triggers a short vibration effect.
193
+ */
194
+ export declare function playClickEffect(): void;
195
+ /**
196
+ * Converts an object into an array of its values, attaching a specified key to each value.
197
+ *
198
+ * This function takes an object and converts it into an array of its values, where each value is
199
+ * augmented with a new property specified by the `key` parameter. The property is set to the key
200
+ * of the original object.
201
+ *
202
+ * @param key - The property name to attach to each value.
203
+ * @param obj - The object to be converted to an array.
204
+ * @returns An array of values with the specified key attached.
205
+ *
206
+ * @example
207
+ * const obj = { a: { name: 'Alice' }, b: { name: 'Bob' } };
208
+ * const array = toArrayByKey('id', obj);
209
+ * console.log(array); // Output: [{ name: 'Alice', id: 'a' }, { name: 'Bob', id: 'b' }]
210
+ */
211
+ export declare function toArrayByKey(key: string, obj?: Record<string, any>): any[];
212
+ /**
213
+ * Converts a numeric string into its corresponding alphabets (0-9 => a-j).
214
+ *
215
+ * This function maps each digit in the provided number to its corresponding alphabet:
216
+ * - 0 => a, 1 => b, 2 => c, ... , 9 => j.
217
+ *
218
+ * @param num - The number to be converted to a string of alphabets.
219
+ * @returns A string representing the number converted to alphabets.
220
+ *
221
+ * @example
222
+ * const result = convertNumToAlphabets(123); // "bcd"
223
+ * console.log(result); // Output: "bcd"
224
+ */
225
+ export declare function convertNumToAlphabets(num: number): string;
226
+ /**
227
+ * Converts a length in inches to pixels based on a DPI of 96.
228
+ *
229
+ * This function converts inches to pixels assuming a screen DPI (Dots Per Inch) of 96.
230
+ * It is useful for calculating dimensions in pixels when working with different units of measurement.
231
+ *
232
+ * @param inches - The length in inches to be converted to pixels.
233
+ * @returns The length in pixels corresponding to the provided inches.
234
+ *
235
+ * @throws An error if the input is not a valid number or is negative.
236
+ *
237
+ * @example
238
+ * const pixels = inchToPixel(1); // 1 inch to pixels
239
+ * console.log(pixels); // Output: 96
240
+ */
241
+ export declare function inchToPixel(inches: number): number;
242
+ /**
243
+ * Converts a length in pixels to inches based on a DPI of 96.
244
+ *
245
+ * This function converts pixels to inches assuming a screen DPI (Dots Per Inch) of 96.
246
+ * It is useful for converting pixel measurements to physical dimensions.
247
+ *
248
+ * @param pixels - The length in pixels to be converted to inches.
249
+ * @returns The length in inches corresponding to the provided pixels.
250
+ *
251
+ * @throws An error if the input is not a valid number or is negative.
252
+ *
253
+ * @example
254
+ * const inches = pixelToInch(96); // 96 pixels to inches
255
+ * console.log(inches); // Output: 1
256
+ */
257
+ export declare function pixelToInch(pixels: number): number;
258
+ export declare function alphabetNanoid(length?: number, lowercase?: boolean): string;
259
+ export declare function sanitizePhoneNumber(input: string): string;
260
+ export declare function isChrome(): boolean;