@dxtmisha/functional-basic 1.8.10 → 1.10.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 (199) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/ai-description.md +7 -3
  3. package/ai-mcp-resources.json +14 -2
  4. package/ai-resources/design-config.md +104 -0
  5. package/ai-resources/error-center.md +150 -0
  6. package/ai-types.md +1 -3233
  7. package/dist/library.d.ts +9991 -189
  8. package/dist/library.js +851 -835
  9. package/package.json +7 -2
  10. package/dist/classes/Api.d.ts +0 -209
  11. package/dist/classes/ApiCache.d.ts +0 -152
  12. package/dist/classes/ApiDataReturn.d.ts +0 -79
  13. package/dist/classes/ApiDefault.d.ts +0 -49
  14. package/dist/classes/ApiError.d.ts +0 -39
  15. package/dist/classes/ApiErrorItem.d.ts +0 -70
  16. package/dist/classes/ApiErrorStorage.d.ts +0 -92
  17. package/dist/classes/ApiHeaders.d.ts +0 -37
  18. package/dist/classes/ApiHydration.d.ts +0 -40
  19. package/dist/classes/ApiInstance.d.ts +0 -299
  20. package/dist/classes/ApiPreparation.d.ts +0 -58
  21. package/dist/classes/ApiResponse.d.ts +0 -154
  22. package/dist/classes/ApiStatus.d.ts +0 -131
  23. package/dist/classes/BroadcastMessage.d.ts +0 -76
  24. package/dist/classes/Cache.d.ts +0 -39
  25. package/dist/classes/CacheItem.d.ts +0 -65
  26. package/dist/classes/CacheStatic.d.ts +0 -36
  27. package/dist/classes/Cookie.d.ts +0 -54
  28. package/dist/classes/CookieBlock.d.ts +0 -30
  29. package/dist/classes/CookieBlockInstance.d.ts +0 -24
  30. package/dist/classes/CookieStorage.d.ts +0 -175
  31. package/dist/classes/DataStorage.d.ts +0 -107
  32. package/dist/classes/Datetime.d.ts +0 -571
  33. package/dist/classes/ErrorCenter.d.ts +0 -86
  34. package/dist/classes/ErrorCenterHandler.d.ts +0 -85
  35. package/dist/classes/ErrorCenterInstance.d.ts +0 -101
  36. package/dist/classes/EventItem.d.ts +0 -230
  37. package/dist/classes/Formatters.d.ts +0 -157
  38. package/dist/classes/Geo.d.ts +0 -172
  39. package/dist/classes/GeoFlag.d.ts +0 -135
  40. package/dist/classes/GeoInstance.d.ts +0 -264
  41. package/dist/classes/GeoIntl.d.ts +0 -291
  42. package/dist/classes/GeoPhone.d.ts +0 -110
  43. package/dist/classes/GeoUnit.d.ts +0 -207
  44. package/dist/classes/Global.d.ts +0 -29
  45. package/dist/classes/Hash.d.ts +0 -57
  46. package/dist/classes/HashInstance.d.ts +0 -29
  47. package/dist/classes/Icons.d.ts +0 -128
  48. package/dist/classes/Loading.d.ts +0 -62
  49. package/dist/classes/LoadingInstance.d.ts +0 -87
  50. package/dist/classes/Meta.d.ts +0 -189
  51. package/dist/classes/MetaManager.d.ts +0 -123
  52. package/dist/classes/MetaOg.d.ts +0 -120
  53. package/dist/classes/MetaStatic.d.ts +0 -179
  54. package/dist/classes/MetaTwitter.d.ts +0 -120
  55. package/dist/classes/Query.d.ts +0 -57
  56. package/dist/classes/QueryInstance.d.ts +0 -29
  57. package/dist/classes/ResumableTimer.d.ts +0 -85
  58. package/dist/classes/ScrollbarWidth.d.ts +0 -52
  59. package/dist/classes/SearchList.d.ts +0 -132
  60. package/dist/classes/SearchListData.d.ts +0 -144
  61. package/dist/classes/SearchListItem.d.ts +0 -49
  62. package/dist/classes/SearchListMatcher.d.ts +0 -58
  63. package/dist/classes/SearchListOptions.d.ts +0 -66
  64. package/dist/classes/ServerStorage.d.ts +0 -110
  65. package/dist/classes/StorageCallback.d.ts +0 -86
  66. package/dist/classes/Translate.d.ts +0 -117
  67. package/dist/classes/TranslateFile.d.ts +0 -81
  68. package/dist/classes/TranslateInstance.d.ts +0 -203
  69. package/dist/classes/UrlInstanceAbstract.d.ts +0 -98
  70. package/dist/classes/UrlItem.d.ts +0 -119
  71. package/dist/functions/addTagHighlightMatch.d.ts +0 -11
  72. package/dist/functions/anyToString.d.ts +0 -10
  73. package/dist/functions/applyTemplate.d.ts +0 -10
  74. package/dist/functions/arrFill.d.ts +0 -9
  75. package/dist/functions/blobToBase64.d.ts +0 -9
  76. package/dist/functions/capitalize.d.ts +0 -9
  77. package/dist/functions/copyObject.d.ts +0 -10
  78. package/dist/functions/copyObjectLite.d.ts +0 -9
  79. package/dist/functions/createElement.d.ts +0 -21
  80. package/dist/functions/domContentLoaded.d.ts +0 -13
  81. package/dist/functions/domQuerySelector.d.ts +0 -8
  82. package/dist/functions/domQuerySelectorAll.d.ts +0 -8
  83. package/dist/functions/encodeAttribute.d.ts +0 -8
  84. package/dist/functions/encodeLiteAttribute.d.ts +0 -8
  85. package/dist/functions/ensureMaxSize.d.ts +0 -10
  86. package/dist/functions/escapeExp.d.ts +0 -7
  87. package/dist/functions/eventStopPropagation.d.ts +0 -7
  88. package/dist/functions/executeFunction.d.ts +0 -12
  89. package/dist/functions/executePromise.d.ts +0 -11
  90. package/dist/functions/forEach.d.ts +0 -14
  91. package/dist/functions/frame.d.ts +0 -10
  92. package/dist/functions/getArrayHighlightMatch.d.ts +0 -10
  93. package/dist/functions/getAttributes.d.ts +0 -9
  94. package/dist/functions/getClipboardData.d.ts +0 -9
  95. package/dist/functions/getColumn.d.ts +0 -10
  96. package/dist/functions/getCurrentDate.d.ts +0 -19
  97. package/dist/functions/getCurrentTime.d.ts +0 -15
  98. package/dist/functions/getElement.d.ts +0 -9
  99. package/dist/functions/getElementId.d.ts +0 -26
  100. package/dist/functions/getElementImage.d.ts +0 -8
  101. package/dist/functions/getElementItem.d.ts +0 -12
  102. package/dist/functions/getElementOrWindow.d.ts +0 -8
  103. package/dist/functions/getElementSafeScript.d.ts +0 -9
  104. package/dist/functions/getExactSearchExp.d.ts +0 -8
  105. package/dist/functions/getExp.d.ts +0 -14
  106. package/dist/functions/getFirst.d.ts +0 -8
  107. package/dist/functions/getHydrationData.d.ts +0 -10
  108. package/dist/functions/getItemByPath.d.ts +0 -9
  109. package/dist/functions/getKey.d.ts +0 -8
  110. package/dist/functions/getLast.d.ts +0 -8
  111. package/dist/functions/getLength.d.ts +0 -10
  112. package/dist/functions/getLengthOfAllArray.d.ts +0 -8
  113. package/dist/functions/getMaxLengthAllArray.d.ts +0 -9
  114. package/dist/functions/getMinLengthAllArray.d.ts +0 -8
  115. package/dist/functions/getMouseClient.d.ts +0 -9
  116. package/dist/functions/getMouseClientX.d.ts +0 -8
  117. package/dist/functions/getMouseClientY.d.ts +0 -8
  118. package/dist/functions/getObjectByKeys.d.ts +0 -8
  119. package/dist/functions/getObjectNoUndefined.d.ts +0 -9
  120. package/dist/functions/getObjectOrNone.d.ts +0 -8
  121. package/dist/functions/getOnlyText.d.ts +0 -8
  122. package/dist/functions/getRandomItem.d.ts +0 -10
  123. package/dist/functions/getRandomText.d.ts +0 -12
  124. package/dist/functions/getRequestString.d.ts +0 -11
  125. package/dist/functions/getSearchExp.d.ts +0 -12
  126. package/dist/functions/getSeparatingSearchExp.d.ts +0 -9
  127. package/dist/functions/getStepPercent.d.ts +0 -9
  128. package/dist/functions/getStepValue.d.ts +0 -9
  129. package/dist/functions/goScroll.d.ts +0 -10
  130. package/dist/functions/goScrollSmooth.d.ts +0 -10
  131. package/dist/functions/goScrollTo.d.ts +0 -10
  132. package/dist/functions/handleShare.d.ts +0 -10
  133. package/dist/functions/inArray.d.ts +0 -9
  134. package/dist/functions/initScrollbarOffset.d.ts +0 -7
  135. package/dist/functions/intersectKey.d.ts +0 -9
  136. package/dist/functions/isApiSuccess.d.ts +0 -9
  137. package/dist/functions/isArray.d.ts +0 -8
  138. package/dist/functions/isDifferent.d.ts +0 -10
  139. package/dist/functions/isDomData.d.ts +0 -7
  140. package/dist/functions/isDomRuntime.d.ts +0 -10
  141. package/dist/functions/isElementVisible.d.ts +0 -11
  142. package/dist/functions/isEnter.d.ts +0 -9
  143. package/dist/functions/isFilled.d.ts +0 -10
  144. package/dist/functions/isFloat.d.ts +0 -8
  145. package/dist/functions/isFunction.d.ts +0 -9
  146. package/dist/functions/isInDom.d.ts +0 -9
  147. package/dist/functions/isInput.d.ts +0 -8
  148. package/dist/functions/isIntegerBetween.d.ts +0 -9
  149. package/dist/functions/isMetaKey.d.ts +0 -8
  150. package/dist/functions/isNull.d.ts +0 -9
  151. package/dist/functions/isNumber.d.ts +0 -8
  152. package/dist/functions/isObject.d.ts +0 -8
  153. package/dist/functions/isObjectNotArray.d.ts +0 -8
  154. package/dist/functions/isOnLine.d.ts +0 -7
  155. package/dist/functions/isSelected.d.ts +0 -9
  156. package/dist/functions/isSelectedByList.d.ts +0 -9
  157. package/dist/functions/isShare.d.ts +0 -7
  158. package/dist/functions/isString.d.ts +0 -8
  159. package/dist/functions/isTab.d.ts +0 -8
  160. package/dist/functions/isWindow.d.ts +0 -7
  161. package/dist/functions/random.d.ts +0 -9
  162. package/dist/functions/removeCommonPrefix.d.ts +0 -9
  163. package/dist/functions/replaceComponentName.d.ts +0 -9
  164. package/dist/functions/replaceRecursive.d.ts +0 -11
  165. package/dist/functions/replaceTemplate.d.ts +0 -10
  166. package/dist/functions/resizeImageByMax.d.ts +0 -19
  167. package/dist/functions/secondToTime.d.ts +0 -9
  168. package/dist/functions/setElementItem.d.ts +0 -11
  169. package/dist/functions/setValues.d.ts +0 -18
  170. package/dist/functions/sleep.d.ts +0 -8
  171. package/dist/functions/sortList.d.ts +0 -11
  172. package/dist/functions/splice.d.ts +0 -13
  173. package/dist/functions/strFill.d.ts +0 -9
  174. package/dist/functions/strSplit.d.ts +0 -12
  175. package/dist/functions/toArray.d.ts +0 -17
  176. package/dist/functions/toCamelCase.d.ts +0 -8
  177. package/dist/functions/toCamelCaseFirst.d.ts +0 -8
  178. package/dist/functions/toDate.d.ts +0 -8
  179. package/dist/functions/toKebabCase.d.ts +0 -15
  180. package/dist/functions/toNumber.d.ts +0 -19
  181. package/dist/functions/toNumberByMax.d.ts +0 -11
  182. package/dist/functions/toNumberPositive.d.ts +0 -9
  183. package/dist/functions/toPercent.d.ts +0 -9
  184. package/dist/functions/toPercentBy100.d.ts +0 -9
  185. package/dist/functions/toString.d.ts +0 -8
  186. package/dist/functions/transformation.d.ts +0 -21
  187. package/dist/functions/uint8ArrayToBase64.d.ts +0 -8
  188. package/dist/functions/uniqueArray.d.ts +0 -8
  189. package/dist/functions/writeClipboardData.d.ts +0 -8
  190. package/dist/media/errorCauseList.d.ts +0 -2
  191. package/dist/types/apiTypes.d.ts +0 -259
  192. package/dist/types/basicTypes.d.ts +0 -131
  193. package/dist/types/errorCenterTypes.d.ts +0 -50
  194. package/dist/types/formattersTypes.d.ts +0 -224
  195. package/dist/types/geoTypes.d.ts +0 -142
  196. package/dist/types/metaTypes.d.ts +0 -586
  197. package/dist/types/searchTypes.d.ts +0 -53
  198. package/dist/types/sortTypes.d.ts +0 -20
  199. package/dist/types/translateTypes.d.ts +0 -54
@@ -1,15 +0,0 @@
1
- /**
2
- * Преобразует строку в формат kebab-case.
3
- * Преобразует все заглавные буквы в строчные, заменяет пробелы и другие символы на дефисы.
4
- *
5
- * Converts a string to kebab-case.
6
- * It converts uppercase letters to lowercase, replaces spaces and other characters with dashes.
7
- *
8
- * @param value - Строка, которую необходимо преобразовать.
9
- *
10
- * The string to be converted.
11
- * @returns Строка в формате kebab-case.
12
- *
13
- * The string in kebab-case format.
14
- */
15
- export declare function toKebabCase(value: string): string;
@@ -1,19 +0,0 @@
1
- import { NumberOrString } from '../types/basicTypes';
2
- /**
3
- * Converts a string or number to a finite floating-point number.
4
- * Handles various separators (spaces, commas, dots) and strips non-numeric characters.
5
- * Safe for use in SSR (Server-Side Rendering) environments.
6
- *
7
- * Преобразует строку или число в конечное число с плавающей точкой.
8
- * Обрабатывает различные разделители (пробелы, запятые, точки) и удаляет нечисловые символы.
9
- * Безопасно для использования в SSR (Server-Side Rendering) средах.
10
- *
11
- * @param value - The input value to convert / Входное значение для преобразования
12
- * @returns The parsed number or 0 if conversion fails / Распарсенное число или 0, если конвертация не удалась
13
- *
14
- * @example
15
- * toNumber("1 234,56") // 1234.56
16
- * toNumber("1,234.56") // 1234.56
17
- * toNumber("1,234") // 1.234
18
- */
19
- export declare function toNumber(value?: NumberOrString): number;
@@ -1,11 +0,0 @@
1
- /**
2
- * Converts the data into a number, taking into account the maximum permissible value.
3
- *
4
- * Преобразует данные в число с учетом максимально допустимого значения.
5
- * @param value input value / входное значение
6
- * @param max maximum achievable value / максимально достижимое значение
7
- * @param formatting format the number / форматировать число
8
- * @param language formatting language / язык форматирования
9
- * @returns formatted number string or number/ форматированная строка числа или число
10
- */
11
- export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
@@ -1,9 +0,0 @@
1
- /**
2
- * Converts a value to a positive finite number (> 0), or returns default value (0) if invalid.
3
- *
4
- * Преобразует значение в конечное положительное число (> 0) или возвращает значение по умолчанию (0), если невалидно.
5
- * @param value input value / входное значение
6
- * @param defaultValue default fallback value if invalid / значение по умолчанию, если невалидно
7
- * @returns parsed positive number or defaultValue / распарсенное положительное число или defaultValue
8
- */
9
- export declare function toNumberPositive(value?: number | string | null, defaultValue?: number): number;
@@ -1,9 +0,0 @@
1
- /**
2
- * Converts values to percentages
3
- *
4
- * Преобразует значения в проценты
5
- * @param maxValue maximum value/ максимальное значение
6
- * @param value current value/ текущее значение
7
- * @returns percentage value / значение в процентах
8
- */
9
- export declare function toPercent(maxValue: number, value: number): number;
@@ -1,9 +0,0 @@
1
- /**
2
- * Converts values to percentages (three-digit)
3
- *
4
- * Преобразует значения в проценты (трёхзначный)
5
- * @param maxValue maximum value/ максимальное значение
6
- * @param value current value/ текущее значение
7
- * @returns percentage value * 100 / значение в процентах * 100
8
- */
9
- export declare function toPercentBy100(maxValue: number, value: number): number;
@@ -1,8 +0,0 @@
1
- /**
2
- * Converts the given value to a string. Returns an empty string if the value is null or undefined.
3
- *
4
- * Преобразование значения в строку. Возвращает пустую строку, если значение равно null или undefined.
5
- * @param value value for conversion / значение для преобразования
6
- * @returns string representation of the value / строковое представление значения
7
- */
8
- export declare function toString<T>(value: T): string;
@@ -1,21 +0,0 @@
1
- /**
2
- * Преобразует строку в соответствующий тип данных.
3
- * В зависимости от содержания строки, она может быть преобразована в
4
- * `undefined`, `null`, `true`, `false`, объект, число или функцию.
5
- *
6
- * Transforms a string into the corresponding data type.
7
- * Based on the string content, it may be transformed into `undefined`,
8
- * `null`, `true`, `false`, object, number, or function.
9
- *
10
- * @param value - Значение, которое необходимо преобразовать
11
- *
12
- * The value to be transformed
13
- * @param isFunction - Флаг, который указывает, необходимо ли проверять функцию
14
- * в глобальном объекте window
15
- *
16
- * A flag that indicates whether to check for a function in the global window object
17
- * @returns Преобразованное значение
18
- *
19
- * The transformed value
20
- */
21
- export declare function transformation(value: any, isFunction?: boolean): any;
@@ -1,8 +0,0 @@
1
- /**
2
- * Converts a Uint8Array to a base64 encoded string.
3
- *
4
- * Преобразует Uint8Array в строку, закодированную в base64.
5
- * @param bytes binary data as Uint8Array / бинарные данные в виде Uint8Array
6
- * @returns base64 encoded string / строка, закодированная в base64
7
- */
8
- export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
@@ -1,8 +0,0 @@
1
- /**
2
- * Removes duplicate entries in an array.
3
- *
4
- * Удаляет повторяющиеся записи в массиве.
5
- * @param value input value/ входное значение
6
- * @returns array without duplicates / массив без дубликатов
7
- */
8
- export declare function uniqueArray<T>(value: T[]): T[];
@@ -1,8 +0,0 @@
1
- /**
2
- * Writes data to the buffer.
3
- *
4
- * Записывает данные в буфер.
5
- * @param text text for recording/ текст для записи
6
- * @returns promise without return value / промис без возвращаемого значения
7
- */
8
- export declare function writeClipboardData(text: string): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { ErrorCenterCauseList } from '../types/errorCenterTypes';
2
- export declare const errorCauseList: ErrorCenterCauseList;
@@ -1,259 +0,0 @@
1
- import { ApiErrorItem } from '../classes/ApiErrorItem';
2
- /**
3
- * Supported HTTP methods for API requests.
4
- * Поддерживаемые HTTP-методы для API-запросов.
5
- */
6
- export declare enum ApiMethodItem {
7
- /**
8
- * HTTP DELETE — used to delete resources.
9
- * HTTP DELETE — используется для удаления ресурсов.
10
- */
11
- delete = "DELETE",
12
- /**
13
- * HTTP GET — used to retrieve resources (no request body).
14
- * HTTP GET — используется для получения ресурсов (без тела запроса).
15
- */
16
- get = "GET",
17
- /**
18
- * HTTP POST — used to create resources or send data.
19
- * HTTP POST — используется для создания ресурсов или отправки данных.
20
- */
21
- post = "POST",
22
- /**
23
- * HTTP PUT — used to update/replace resources.
24
- * HTTP PUT — используется для обновления/замены ресурсов.
25
- */
26
- put = "PUT",
27
- /**
28
- * HTTP PATCH — used to partially update resources.
29
- * HTTP PATCH — используется для частичного обновления ресурсов.
30
- */
31
- patch = "PATCH"
32
- }
33
- /**
34
- * Saved value in cache/ Сохраненное значение в кэше
35
- */
36
- export type ApiCacheItem<T = any> = {
37
- /** Saved value / Сохраненное значение */
38
- value: T;
39
- /** Age of the cache / Возраст кэша */
40
- age?: number;
41
- /** Cache age in seconds / Возраст кэша в секундах */
42
- cacheAge: number;
43
- };
44
- /**
45
- * List of saved values in cache/ Список сохраненных значений в кэше
46
- */
47
- export type ApiCacheList = Record<string, ApiCacheItem>;
48
- /**
49
- * API configuration/ Конфигурация API
50
- */
51
- export type ApiConfig = {
52
- /** Base URL for API requests/ Базовый URL для API-запросов */
53
- urlRoot?: string;
54
- /** Base origin for API requests (protocol and domain)/ Базовый источник для API-запросов (протокол и домен) */
55
- origin?: string;
56
- /** Default headers for API requests/ Заголовки по умолчанию для API-запросов */
57
- headers?: ApiHeadersValue;
58
- /** Default request data for API requests/ Данные запроса по умолчанию для API-запросов */
59
- requestDefault?: ApiDefaultValue;
60
- /** Function to call before request/ Функция для вызова перед запросом */
61
- preparation?: (apiFetch: ApiFetch) => Promise<void>;
62
- /** Function to call after request/ Функция для вызова после запроса */
63
- end?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
64
- /** Timeout for the request in milliseconds/ Таймаут запроса в миллисекундах */
65
- timeout?: number;
66
- /** Enable development logging/ Включить логирование разработки */
67
- devMode?: boolean;
68
- /** Wrapper function for requests / Функция-обертка для запросов */
69
- wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
70
- };
71
- /**
72
- * Shape of API response data wrapper/ Структура обёртки данных ответа API
73
- */
74
- export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
75
- /**
76
- * API response validation result/ Результат валидации ответа API
77
- */
78
- export type ApiDataValidation = {
79
- /** Status/ Статус */
80
- status?: ApiStatusType;
81
- /** Code / Код */
82
- code?: string | number;
83
- /** Message/ Сообщение */
84
- message?: string;
85
- /** Error/ Ошибка */
86
- error?: {
87
- /** Code / Код */
88
- code?: string | number;
89
- /** Message/ Сообщение */
90
- message?: string;
91
- };
92
- };
93
- /**
94
- * Type of API response data item/ Тип элемента данных ответа API
95
- */
96
- export type ApiDataItem<T = any> = T & ApiDataValidation & {
97
- /** Primary payload (optional)/ Основная полезная нагрузка (опционально) */
98
- data?: T;
99
- /** Success flag/ Флаг успешности */
100
- success?: boolean;
101
- /** Status object/ Объект статуса */
102
- statusObject?: ApiStatusItem;
103
- /** Error object/ Объект ошибки */
104
- errorObject?: ApiErrorItem;
105
- };
106
- /**
107
- * Type for API request headers / Тип для заголовков запроса API
108
- */
109
- export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
110
- /**
111
- * Default API request data type/ Тип данных запроса API по умолчанию
112
- */
113
- export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
114
- /**
115
- * Options for making API requests/ Опции для выполнения API-запросов
116
- */
117
- export type ApiFetch = {
118
- /** Use base API URL/ Использовать базовый URL API */
119
- api?: boolean;
120
- /** Endpoint path relative to base URL/ Путь endpoint относительно базового URL */
121
- path?: string;
122
- /** Complete URL (overrides api + path)/ Полный URL (переопределяет api + path) */
123
- pathFull?: string;
124
- /** HTTP method/ HTTP метод */
125
- method?: ApiMethod;
126
- /** Request body data or query parameters/ Данные тела запроса или параметры запроса */
127
- request?: FormData | Record<string, any> | string;
128
- /** Include authentication headers/ Включить заголовки аутентификации */
129
- auth?: boolean;
130
- /** Custom headers (null = no headers)/ Пользовательские заголовки (null = без заголовков) */
131
- headers?: Record<string, string> | null;
132
- /** Content-Type header value/ Значение заголовка Content-Type */
133
- type?: string;
134
- /** Extract 'data' field from response/ Извлечь поле 'data' из ответа */
135
- toData?: boolean;
136
- /** Use global response cache/ Использовать глобальный кеш ответов */
137
- global?: boolean;
138
- /** Enable development logging/ Включить логирование разработки */
139
- devMode?: boolean;
140
- /** Suppress error logging/ Подавить логирование ошибок */
141
- hideError?: boolean;
142
- /** Suppress loading/ Подавить загрузку */
143
- hideLoading?: boolean;
144
- /** Retry count/ Количество повторов */
145
- retry?: number;
146
- /** Retry delay in milliseconds/ Задержка повтора в миллисекундах */
147
- retryDelay?: number;
148
- /** Custom response processor/ Пользовательский процессор ответа */
149
- queryReturn?: (query: Response) => Promise<any | ApiDataValidation>;
150
- /** Run global preparation hooks/ Запускать глобальные хуки подготовки */
151
- globalPreparation?: boolean;
152
- /** Run global end hooks/ Запускать глобальные хуки завершения */
153
- globalEnd?: boolean;
154
- /** Additional fetch() options/ Дополнительные опции fetch() */
155
- init?: RequestInit;
156
- initError?: boolean;
157
- /** Timeout for the request in milliseconds/ Таймаут запроса в миллисекундах */
158
- timeout?: number;
159
- /** AbortController for canceling the request/ AbortController для отмены запроса */
160
- controller?: AbortController;
161
- /** Cache age in seconds/ Возраст кэша в секундах */
162
- cache?: number;
163
- enableClientCache?: boolean;
164
- /** Cache ID for grouping/ ID кэша для группировки */
165
- cacheId?: number | string;
166
- /** Limit of end reset/ Лимит сброса end */
167
- endResetLimit?: number;
168
- /** Wrapper function for requests / Функция-обертка для запросов */
169
- wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
170
- };
171
- /**
172
- * Type of API hydration item/ Тип элемента гидратации API
173
- */
174
- export type ApiHydrationItem = {
175
- /** Path string or RegExp to match request URL/ Путь или RegExp для сопоставления URL */
176
- path: string;
177
- /** Expected HTTP method/ Ожидаемый HTTP метод */
178
- method: ApiMethod;
179
- /** Expected request payload or special marker '*any'/ Ожидаемая нагрузка запроса или маркер '*any' */
180
- request?: ApiFetch['request'];
181
- /** Static response or factory function/ Статический ответ или функция, возвращающая ответ */
182
- response: any;
183
- };
184
- /**
185
- * List of API hydration items/ Список элементов гидратации API
186
- */
187
- export type ApiHydrationList = ApiHydrationItem[];
188
- /**
189
- * Item for API error storage/ Элемент для хранилища ошибок API
190
- */
191
- export type ApiErrorStorageItem = Record<string, any> & {
192
- /** URL string or RegExp to match request URL/ Строка URL или RegExp для сопоставления URL */
193
- url: string | RegExp;
194
- /** HTTP method/ HTTP метод */
195
- method: ApiMethodItem;
196
- /** Error code/ Код ошибки */
197
- code?: string;
198
- /** HTTP status code/ Код статуса HTTP */
199
- status?: number;
200
- /** Validation function/ Функция валидации */
201
- validation?: (response: Response) => boolean;
202
- /** Error message or function that returns message/ Сообщение об ошибке или функция, возвращающая сообщение */
203
- message?: string | ((response?: Response) => string);
204
- };
205
- /**
206
- * List of API error storage items/ Список элементов хранилища ошибок API
207
- */
208
- export type ApiErrorStorageList = ApiErrorStorageItem[];
209
- /**
210
- * Supported HTTP methods type/ Тип HTTP-методов
211
- * (derived from ApiMethodItem enum)/ (получен из перечисления ApiMethodItem)
212
- */
213
- export type ApiMethod = string | ApiMethodItem;
214
- /**
215
- * Result of global preparation/end hooks/ Результат глобальных хуков
216
- */
217
- export type ApiPreparationEnd = {
218
- /** Reset flag to indicate state reset/ Флаг сброса состояния */
219
- reset?: boolean;
220
- /** Arbitrary data returned by hook/ Произвольные данные, возвращаемые хуком */
221
- data?: any;
222
- };
223
- /**
224
- * Mock API response descriptor/ Описание мок-ответа API
225
- */
226
- export type ApiResponseItem = {
227
- /** Path string or RegExp to match request URL/ Путь или RegExp для сопоставления URL */
228
- path: string | RegExp;
229
- /** Expected HTTP method/ Ожидаемый HTTP метод */
230
- method: ApiMethod;
231
- /** Expected request payload or special marker '*any'/ Ожидаемая нагрузка запроса или маркер '*any' */
232
- request?: ApiFetch['request'] | '*any';
233
- /** Static response or factory function/ Статический ответ или функция, возвращающая ответ */
234
- response: any | ((request?: ApiFetch['request']) => any);
235
- /** Disable this mock/ Отключить этот мок */
236
- disable?: any;
237
- /** Mark as global mock/ Мок для глобального использования */
238
- isForGlobal?: boolean;
239
- /** Simulate network lag/ Имитировать задержку */
240
- lag?: any;
241
- };
242
- export type ApiStatusItem = {
243
- /** HTTP status code/ Код статуса HTTP */
244
- status?: number;
245
- /** HTTP status text/ Текст статуса HTTP */
246
- statusText?: string;
247
- /** Error message/ Сообщение об ошибке */
248
- error?: string;
249
- /** Last response/ Последний ответ */
250
- lastResponse?: any;
251
- /** Last status/ Последний статус */
252
- lastStatus?: ApiStatusType;
253
- /** Last code / Последний код */
254
- lastCode?: string;
255
- /** Last message/ Последнее сообщение */
256
- lastMessage?: string;
257
- };
258
- /** API status type/ Тип статуса API */
259
- export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
@@ -1,131 +0,0 @@
1
- /** Union type for undefined and null values/ Объединенный тип для undefined и null значений */
2
- export type Undefined = undefined | null;
3
- /**
4
- * Union type for all "empty" values including falsy primitives and string representations/
5
- * Объединенный тип для всех "пустых" значений включая ложные примитивы и строковые представления
6
- */
7
- export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
8
- /** Union type for numeric and string values/ Объединенный тип для числовых и строковых значений */
9
- export type NumberOrString = number | string;
10
- /**
11
- * Union type for numeric, string, and boolean values/
12
- * Объединенный тип для числовых, строковых и булевых значений
13
- */
14
- export type NumberOrStringOrBoolean = number | string | boolean;
15
- /**
16
- * Union type for numeric, string, and Date values/
17
- * Объединенный тип для числовых, строковых значений и Date
18
- */
19
- export type NumberOrStringOrDate = NumberOrString | Date;
20
- /**
21
- * Generic type that can be either a single value or an array of values/
22
- * Дженерик тип для одиночного значения или массива значений
23
- */
24
- export type NormalOrArray<T = NumberOrString> = T | T[];
25
- /**
26
- * Generic type that can be either a direct value or a Promise resolving to that value/
27
- * Дженерик тип для прямого значения или Promise
28
- */
29
- export type NormalOrPromise<T> = T | Promise<T>;
30
- /**
31
- * Generic record/object type with string keys/
32
- * Дженерик тип записи/объекта со строковыми ключами
33
- */
34
- export type ObjectItem<T = any> = Record<string, T>;
35
- /** Generic type that can be either an array or an object/ Дженерик тип для массива или объекта */
36
- export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
37
- /**
38
- * Converts an array type to an item type (extracts the item type from an array)/
39
- * Преобразует тип массива в тип элемента (извлекает тип элемента из массива)
40
- */
41
- export type ArrayToItem<T> = T extends any[] ? T[number] : T;
42
- /**
43
- * Function type that returns a value of type R/
44
- * Тип функции, возвращающей значение типа R
45
- */
46
- export type FunctionReturn<R = any> = () => R;
47
- /** Function type that returns void/ Тип функции, возвращающей void */
48
- export type FunctionVoid = () => void;
49
- /**
50
- * Function type that accepts multiple arguments of type T and returns type R/
51
- * Тип функции с переменными аргументами
52
- */
53
- export type FunctionArgs<T, R> = (...args: T[]) => R;
54
- /**
55
- * Most generic function type that accepts any arguments and returns any value/
56
- * Наиболее общий тип функции
57
- */
58
- export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
59
- /**
60
- * Generic record type for lists with string keys/
61
- * Дженерик тип записи для списков со строковыми ключами
62
- */
63
- export type ItemList<T = any> = Record<string, T>;
64
- /**
65
- * Generic item type with index and value properties/
66
- * Дженерик тип элемента со свойствами index и value
67
- */
68
- export type Item<V> = {
69
- /** Unique string identifier for the item/ Уникальный строковый идентификатор элемента */
70
- index: string;
71
- /** The actual value of the item/ Фактическое значение элемента */
72
- value: V;
73
- };
74
- /**
75
- * Generic item type with label and value properties/
76
- * Дженерик тип элемента со свойствами label и value
77
- */
78
- export type ItemValue<V> = {
79
- /** Display text for the item/ Отображаемый текст для элемента */
80
- label: string;
81
- /** The actual value of the item/ Фактическое значение элемента */
82
- value: V;
83
- };
84
- /**
85
- * Generic item type with name and value properties/
86
- * Дженерик тип элемента со свойствами name и value
87
- */
88
- export type ItemName<V> = {
89
- /** Name identifier (string or number)/ Идентификатор имени (строка или число) */
90
- name: string | number;
91
- /** The actual value of the item/ Фактическое значение элемента */
92
- value: V;
93
- };
94
- /**
95
- * Union type for HTML elements and Window object/
96
- * Объединенный тип для HTML элементов и объекта Window
97
- */
98
- export type ElementOrWindow = HTMLElement | Window;
99
- /**
100
- * Generic type that can be either an element or a string selector/
101
- * Дженерик тип для элемента или строкового селектора
102
- */
103
- export type ElementOrString<E extends ElementOrWindow> = E | string;
104
- /** Type for event listener options/ Тип для опций обработчика событий */
105
- export type EventOptions = AddEventListenerOptions | boolean | undefined;
106
- /**
107
- * Generic event listener function type with additional detail parameter/
108
- * Дженерик тип функции обработчика событий с дополнительным параметром detail
109
- */
110
- export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
111
- /**
112
- * Type for tracking active event listeners and observers/
113
- * Тип для отслеживания активных обработчиков событий и наблюдателей
114
- */
115
- export type EventActivityItem<E extends ElementOrWindow> = {
116
- /** The target element for the event/ Целевой элемент для события */
117
- element: E | undefined;
118
- /** The event type name/ Название типа события */
119
- type: string;
120
- /** Optional custom event listener/ Опциональный пользовательский обработчик событий */
121
- listener?: (event: any | Event) => void;
122
- /** Optional ResizeObserver instance/ Опциональный экземпляр ResizeObserver */
123
- observer?: ResizeObserver;
124
- };
125
- /** Type for 2D coordinates/ Тип для 2D координат */
126
- export type ImageCoordinator = {
127
- /** X-axis coordinate/ Координата по оси X */
128
- x: number;
129
- /** Y-axis coordinate/ Координата по оси Y */
130
- y: number;
131
- };
@@ -1,50 +0,0 @@
1
- /**
2
- * Error group identifier / Идентификатор группы ошибок
3
- */
4
- export type ErrorCenterGroup = string | undefined;
5
- /**
6
- * Interface for an error item / Интерфейс для элемента ошибки
7
- */
8
- export type ErrorCenterCauseItem<D = any> = {
9
- /** Error group / Группа ошибки */
10
- group?: ErrorCenterGroup;
11
- /** Error code / Код ошибки */
12
- code: string;
13
- /** Priority / Приоритет */
14
- priority?: number;
15
- /** Error label / Название ошибки */
16
- label?: string;
17
- /** Error message / Сообщение ошибки */
18
- message?: string;
19
- /** Additional details / Дополнительные детали */
20
- details?: D;
21
- };
22
- /**
23
- * List of error items / Список элементов ошибок
24
- */
25
- export type ErrorCenterCauseList = ErrorCenterCauseItem[];
26
- /**
27
- * Callback function for error handling / Функция обратного вызова для обработки ошибок
28
- */
29
- export type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
30
- /**
31
- * Interface for error handler storage / Интерфейс для хранения обработчика ошибок
32
- */
33
- export type ErrorCenterHandlerItem = {
34
- /** Targeted error group / Целевая группа ошибок */
35
- group?: ErrorCenterGroup;
36
- /** List of handlers / Список обработчиков */
37
- handlers: ErrorCenterHandlerCallback[];
38
- };
39
- /**
40
- * List of error handlers / Список обработчиков ошибок
41
- */
42
- export type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
43
- /**
44
- * Callback function to check whether to log error to console / Функция обратного вызова для проверки вывода ошибки в консоль
45
- */
46
- export type ErrorCenterHandlerIsConsoleCallback = (cause: ErrorCenterCauseItem) => boolean;
47
- /**
48
- * Type for console logging configuration / Тип для конфигурации вывода в консоль
49
- */
50
- export type ErrorCenterHandlerIsConsole = boolean | ErrorCenterHandlerIsConsoleCallback;