@dxtmisha/functional-basic 1.1.0 → 1.1.6

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 (178) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/ai-description.txt +1 -0
  3. package/ai-types.txt +1062 -951
  4. package/dist/classes/Api.d.ts +201 -0
  5. package/dist/classes/ApiCache.d.ts +152 -0
  6. package/dist/classes/ApiDataReturn.d.ts +76 -0
  7. package/dist/classes/ApiDefault.d.ts +49 -0
  8. package/dist/classes/ApiHeaders.d.ts +37 -0
  9. package/dist/classes/ApiHydration.d.ts +39 -0
  10. package/dist/classes/ApiInstance.d.ts +283 -0
  11. package/dist/classes/ApiPreparation.d.ts +58 -0
  12. package/dist/classes/ApiResponse.d.ts +154 -0
  13. package/dist/classes/ApiStatus.d.ts +130 -0
  14. package/dist/classes/BroadcastMessage.d.ts +75 -0
  15. package/dist/classes/Cache.d.ts +38 -0
  16. package/dist/classes/CacheItem.d.ts +62 -0
  17. package/dist/classes/CacheStatic.d.ts +36 -0
  18. package/dist/classes/Cookie.d.ts +54 -0
  19. package/dist/classes/CookieBlock.d.ts +30 -0
  20. package/dist/classes/CookieBlockInstance.d.ts +23 -0
  21. package/dist/classes/CookieStorage.d.ts +174 -0
  22. package/dist/classes/DataStorage.d.ts +107 -0
  23. package/dist/classes/Datetime.d.ts +570 -0
  24. package/dist/classes/ErrorCenter.d.ts +72 -0
  25. package/dist/classes/ErrorCenterHandler.d.ts +64 -0
  26. package/dist/classes/ErrorCenterInstance.d.ts +85 -0
  27. package/dist/classes/EventItem.d.ts +251 -0
  28. package/dist/classes/Formatters.d.ts +161 -0
  29. package/dist/classes/Geo.d.ts +151 -0
  30. package/dist/classes/GeoFlag.d.ts +98 -0
  31. package/dist/classes/GeoInstance.d.ts +215 -0
  32. package/dist/classes/GeoIntl.d.ts +304 -0
  33. package/dist/classes/GeoPhone.d.ts +108 -0
  34. package/dist/classes/Global.d.ts +29 -0
  35. package/dist/classes/Hash.d.ts +57 -0
  36. package/dist/classes/HashInstance.d.ts +95 -0
  37. package/dist/classes/Icons.d.ts +128 -0
  38. package/dist/classes/Loading.d.ts +66 -0
  39. package/dist/classes/LoadingInstance.d.ts +99 -0
  40. package/dist/classes/Meta.d.ts +186 -0
  41. package/dist/classes/MetaManager.d.ts +121 -0
  42. package/dist/classes/MetaOg.d.ts +115 -0
  43. package/dist/classes/MetaStatic.d.ts +179 -0
  44. package/dist/classes/MetaTwitter.d.ts +115 -0
  45. package/dist/classes/ResumableTimer.d.ts +81 -0
  46. package/dist/classes/ScrollbarWidth.d.ts +51 -0
  47. package/dist/classes/SearchList.d.ts +128 -0
  48. package/dist/classes/SearchListData.d.ts +143 -0
  49. package/dist/classes/SearchListItem.d.ts +49 -0
  50. package/dist/classes/SearchListMatcher.d.ts +57 -0
  51. package/dist/classes/SearchListOptions.d.ts +66 -0
  52. package/dist/classes/ServerStorage.d.ts +106 -0
  53. package/dist/classes/StorageCallback.d.ts +84 -0
  54. package/dist/classes/Translate.d.ts +119 -0
  55. package/dist/classes/TranslateFile.d.ts +81 -0
  56. package/dist/classes/TranslateInstance.d.ts +206 -0
  57. package/dist/functions/addTagHighlightMatch.d.ts +11 -0
  58. package/dist/functions/anyToString.d.ts +10 -0
  59. package/dist/functions/applyTemplate.d.ts +10 -0
  60. package/dist/functions/arrFill.d.ts +9 -0
  61. package/dist/functions/blobToBase64.d.ts +9 -0
  62. package/dist/functions/capitalize.d.ts +9 -0
  63. package/dist/functions/copyObject.d.ts +10 -0
  64. package/dist/functions/copyObjectLite.d.ts +9 -0
  65. package/dist/functions/createElement.d.ts +21 -0
  66. package/dist/functions/domQuerySelector.d.ts +8 -0
  67. package/dist/functions/domQuerySelectorAll.d.ts +8 -0
  68. package/dist/functions/encodeAttribute.d.ts +8 -0
  69. package/dist/functions/encodeLiteAttribute.d.ts +8 -0
  70. package/dist/functions/ensureMaxSize.d.ts +10 -0
  71. package/dist/functions/escapeExp.d.ts +7 -0
  72. package/dist/functions/eventStopPropagation.d.ts +7 -0
  73. package/dist/functions/executeFunction.d.ts +12 -0
  74. package/dist/functions/executePromise.d.ts +11 -0
  75. package/dist/functions/forEach.d.ts +14 -0
  76. package/dist/functions/frame.d.ts +10 -0
  77. package/dist/functions/getArrayHighlightMatch.d.ts +10 -0
  78. package/dist/functions/getAttributes.d.ts +9 -0
  79. package/dist/functions/getClipboardData.d.ts +9 -0
  80. package/dist/functions/getColumn.d.ts +10 -0
  81. package/dist/functions/getCurrentDate.d.ts +19 -0
  82. package/dist/functions/getCurrentTime.d.ts +15 -0
  83. package/dist/functions/getElement.d.ts +9 -0
  84. package/dist/functions/getElementId.d.ts +26 -0
  85. package/dist/functions/getElementImage.d.ts +8 -0
  86. package/dist/functions/getElementItem.d.ts +12 -0
  87. package/dist/functions/getElementOrWindow.d.ts +8 -0
  88. package/dist/functions/getElementSafeScript.d.ts +9 -0
  89. package/dist/functions/getExactSearchExp.d.ts +8 -0
  90. package/dist/functions/getExp.d.ts +14 -0
  91. package/dist/functions/getHydrationData.d.ts +10 -0
  92. package/dist/functions/getItemByPath.d.ts +9 -0
  93. package/dist/functions/getKey.d.ts +8 -0
  94. package/dist/functions/getLengthOfAllArray.d.ts +8 -0
  95. package/dist/functions/getMaxLengthAllArray.d.ts +9 -0
  96. package/dist/functions/getMinLengthAllArray.d.ts +8 -0
  97. package/dist/functions/getMouseClient.d.ts +9 -0
  98. package/dist/functions/getMouseClientX.d.ts +8 -0
  99. package/dist/functions/getMouseClientY.d.ts +8 -0
  100. package/dist/functions/getObjectByKeys.d.ts +8 -0
  101. package/dist/functions/getObjectNoUndefined.d.ts +9 -0
  102. package/dist/functions/getObjectOrNone.d.ts +8 -0
  103. package/dist/functions/getOnlyText.d.ts +8 -0
  104. package/dist/functions/getRandomText.d.ts +12 -0
  105. package/dist/functions/getRequestString.d.ts +11 -0
  106. package/dist/functions/getSearchExp.d.ts +12 -0
  107. package/dist/functions/getSeparatingSearchExp.d.ts +9 -0
  108. package/dist/functions/getStepPercent.d.ts +9 -0
  109. package/dist/functions/getStepValue.d.ts +9 -0
  110. package/dist/functions/goScroll.d.ts +10 -0
  111. package/dist/functions/goScrollSmooth.d.ts +10 -0
  112. package/dist/functions/goScrollTo.d.ts +10 -0
  113. package/dist/functions/handleShare.d.ts +10 -0
  114. package/dist/functions/inArray.d.ts +9 -0
  115. package/dist/functions/initScrollbarOffset.d.ts +7 -0
  116. package/dist/functions/intersectKey.d.ts +9 -0
  117. package/dist/functions/isApiSuccess.d.ts +9 -0
  118. package/dist/functions/isArray.d.ts +8 -0
  119. package/dist/functions/isDifferent.d.ts +10 -0
  120. package/dist/functions/isDomData.d.ts +7 -0
  121. package/dist/functions/isDomRuntime.d.ts +10 -0
  122. package/dist/functions/isElementVisible.d.ts +11 -0
  123. package/dist/functions/isEnter.d.ts +9 -0
  124. package/dist/functions/isFilled.d.ts +10 -0
  125. package/dist/functions/isFloat.d.ts +8 -0
  126. package/dist/functions/isFunction.d.ts +9 -0
  127. package/dist/functions/isInDom.d.ts +9 -0
  128. package/dist/functions/isInput.d.ts +8 -0
  129. package/dist/functions/isIntegerBetween.d.ts +9 -0
  130. package/dist/functions/isNull.d.ts +9 -0
  131. package/dist/functions/isNumber.d.ts +8 -0
  132. package/dist/functions/isObject.d.ts +8 -0
  133. package/dist/functions/isObjectNotArray.d.ts +8 -0
  134. package/dist/functions/isOnLine.d.ts +7 -0
  135. package/dist/functions/isSelected.d.ts +9 -0
  136. package/dist/functions/isSelectedByList.d.ts +9 -0
  137. package/dist/functions/isShare.d.ts +7 -0
  138. package/dist/functions/isString.d.ts +8 -0
  139. package/dist/functions/isWindow.d.ts +7 -0
  140. package/dist/functions/random.d.ts +9 -0
  141. package/dist/functions/removeCommonPrefix.d.ts +9 -0
  142. package/dist/functions/replaceComponentName.d.ts +9 -0
  143. package/dist/functions/replaceRecursive.d.ts +11 -0
  144. package/dist/functions/replaceTemplate.d.ts +10 -0
  145. package/dist/functions/resizeImageByMax.d.ts +19 -0
  146. package/dist/functions/secondToTime.d.ts +9 -0
  147. package/dist/functions/setElementItem.d.ts +11 -0
  148. package/dist/functions/setValues.d.ts +18 -0
  149. package/dist/functions/sleep.d.ts +8 -0
  150. package/dist/functions/splice.d.ts +13 -0
  151. package/dist/functions/strFill.d.ts +9 -0
  152. package/dist/functions/strSplit.d.ts +12 -0
  153. package/dist/functions/toArray.d.ts +17 -0
  154. package/dist/functions/toCamelCase.d.ts +8 -0
  155. package/dist/functions/toCamelCaseFirst.d.ts +8 -0
  156. package/dist/functions/toDate.d.ts +8 -0
  157. package/dist/functions/toKebabCase.d.ts +15 -0
  158. package/dist/functions/toNumber.d.ts +19 -0
  159. package/dist/functions/toNumberByMax.d.ts +11 -0
  160. package/dist/functions/toPercent.d.ts +9 -0
  161. package/dist/functions/toPercentBy100.d.ts +9 -0
  162. package/dist/functions/toString.d.ts +8 -0
  163. package/dist/functions/transformation.d.ts +21 -0
  164. package/dist/functions/uint8ArrayToBase64.d.ts +8 -0
  165. package/dist/functions/uniqueArray.d.ts +8 -0
  166. package/dist/functions/writeClipboardData.d.ts +8 -0
  167. package/dist/library.d.ts +171 -8722
  168. package/dist/library.js +416 -338
  169. package/dist/media/errorCauseList.d.ts +2 -0
  170. package/dist/types/apiTypes.d.ts +217 -0
  171. package/dist/types/basicTypes.d.ts +131 -0
  172. package/dist/types/errorCenter.d.ts +42 -0
  173. package/dist/types/formattersTypes.d.ts +224 -0
  174. package/dist/types/geoTypes.d.ts +86 -0
  175. package/dist/types/metaTypes.d.ts +586 -0
  176. package/dist/types/searchTypes.d.ts +53 -0
  177. package/dist/types/translateTypes.d.ts +54 -0
  178. package/package.json +7 -5
@@ -0,0 +1,53 @@
1
+ /** Search item type/ Тип элемента поиска */
2
+ export type SearchItem = Record<string, any>;
3
+ /** Type for generating a column path / Тип для генерации пути к колонке */
4
+ export type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
5
+ /** Type for getting a column / Тип для получения колонки */
6
+ export type SearchColumn<T extends SearchItem> = {
7
+ [K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
8
+ }[keyof T];
9
+ /** Type for a list of columns / Тип для списка колонок */
10
+ export type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
11
+ /** Type for formatting the key / Тип для форматирования ключа */
12
+ export type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
13
+ /** Type for generating a search key / Тип для генерации ключа поиска */
14
+ export type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
15
+ /** Type for a formatted search item / Тип для отформатированного элемента поиска */
16
+ export type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
17
+ [K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
18
+ } & {
19
+ searchActive?: boolean;
20
+ };
21
+ /** Type for a list of formatted search items / Тип для списка отформатированных элементов поиска */
22
+ export type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
23
+ /** Search list value / Значение списка поиска */
24
+ export type SearchListValue<T extends SearchItem> = T[] | undefined;
25
+ /** Search options / Опции поиска */
26
+ export type SearchOptions = {
27
+ /** Limit of output values / Лимит выводимых значений */
28
+ limit?: number;
29
+ /** Whether to return all items even if no match / Возвращать ли все элементы, даже если совпадений нет */
30
+ returnEverything?: boolean;
31
+ /** Delay before searching / Задержка перед поиском */
32
+ delay?: number;
33
+ /** Find exact match / Найти точное совпадение */
34
+ findExactMatch?: boolean;
35
+ /** CSS class for matches / CSS класс для совпадений */
36
+ classSearchName?: string;
37
+ };
38
+ /** Search cache item / Элемент кэша поиска */
39
+ export type SearchCacheItem<T extends SearchItem> = {
40
+ /** Original item / Исходный элемент */
41
+ item: T;
42
+ /** Search string value / Строковое значение для поиска */
43
+ value: string;
44
+ };
45
+ /** Search cache list / Список кэша поиска */
46
+ export type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
47
+ /** Highlight match item type / Тип элемента подсветки совпадения */
48
+ export type HighlightMatchItem = {
49
+ /** Text segment / Текстовый сегмент */
50
+ text: string;
51
+ /** Whether the segment matches the search query / Соответствует ли сегмент поисковому запросу */
52
+ isMatch: boolean;
53
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Interface for the functional plugin options /
3
+ * Интерфейс для опций функционального плагина
4
+ */
5
+ export type TranslateConfig = {
6
+ /** URL to the translations script / URL к скрипту переводов */
7
+ url?: string;
8
+ /** Property name for translations / Имя свойства для переводов */
9
+ propsName?: string;
10
+ /** Read translations from API / Читать переводы из API */
11
+ readApi?: boolean;
12
+ };
13
+ /**
14
+ * Translation code or a list of translation codes for template replacement/
15
+ * Код перевода или список кодов для замены шаблона
16
+ */
17
+ export type TranslateCode = string | string[];
18
+ /**
19
+ * Object with translated strings, where the keys are the names of the translation codes/
20
+ * Объект с переведенными строками, где ключи — имена кодов переводов
21
+ */
22
+ export type TranslateList<T extends TranslateCode[]> = {
23
+ [K in T[number] as K extends readonly string[] ? K[0] : K]: string;
24
+ };
25
+ /**
26
+ * Return type for translation retrieval: an object if a list was requested, or a string for a single key/
27
+ * Тип возвращаемого значения для получения перевода: объект, если был запрошен список, или строка для одного ключа
28
+ */
29
+ export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
30
+ /**
31
+ * A simple key-value record of translations from a file/
32
+ * Простой рекорд «ключ-значение» с переводами из файла
33
+ */
34
+ export type TranslateDataFileList = Record<string, string>;
35
+ /**
36
+ * Asynchronous loader function for a translation file/
37
+ * Асинхронная функция-загрузчик для файла перевода
38
+ */
39
+ export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
40
+ /**
41
+ * A mapping of locale strings to their respective translation file loaders/
42
+ * Сопоставление строк локалей и соответствующих им загрузчиков файлов перевода
43
+ */
44
+ export type TranslateDataFile = Record<string, TranslateDataFileItem>;
45
+ /**
46
+ * Prefix for global translations/
47
+ * Префикс для глобальных переводов
48
+ */
49
+ export declare const TRANSLATE_GLOBAL_PREFIX = "global";
50
+ /**
51
+ * Request timeout for batch loading (ms)/
52
+ * Таймаут запроса для пакетной загрузки (мс)
53
+ */
54
+ export declare const TRANSLATE_TIME_OUT = 160;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional-basic",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.1.6",
5
5
  "type": "module",
6
6
  "description": "Foundational utility library for modern web development — HTTP client, geolocation, i18n, SEO meta tags, caching, storage, DOM utilities, and more. Framework-agnostic, zero dependencies, TypeScript-first.",
7
7
  "keywords": [
@@ -53,16 +53,18 @@
53
53
  "preview": "vite preview",
54
54
  "test": "vitest",
55
55
  "library": "dxt-library",
56
- "dxt-types": "dxt-types",
56
+ "types": "dxt-types",
57
57
  "prepublishOnly": "npm run library && npm run build",
58
58
  "publish-to-npm": "npm publish --access public"
59
59
  },
60
60
  "files": [
61
61
  "dist",
62
+ "ai-description.txt",
62
63
  "ai-types.txt",
63
- "README.md",
64
+ "CHANGELOG.md",
65
+ "LICENSE",
64
66
  "package.json",
65
- "LICENSE"
67
+ "README.md"
66
68
  ],
67
69
  "main": "dist/library.js",
68
70
  "module": "dist/library.js",
@@ -85,4 +87,4 @@
85
87
  "@types/node": "^25.6.0"
86
88
  },
87
89
  "sideEffects": false
88
- }
90
+ }