@dxtmisha/functional-basic 1.14.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +163 -0
- package/ai-description.md +3 -3
- package/ai-mcp-resources.json +1 -1
- package/ai-resources/api-reference.md +3 -0
- package/ai-types.md +547 -373
- package/dist/library.d.ts +1184 -393
- package/dist/library.js +1647 -1423
- package/package.json +2 -2
package/dist/library.d.ts
CHANGED
|
@@ -2,26 +2,74 @@
|
|
|
2
2
|
* Adds a tag to highlight the match in the string.
|
|
3
3
|
*
|
|
4
4
|
* Добавляет тег для выделения совпадения в строке.
|
|
5
|
-
* @param value initial
|
|
5
|
+
* @param value initial value / исходное значение
|
|
6
6
|
* @param search search string or RegExp / строка поиска или регулярное выражение
|
|
7
|
-
* @param
|
|
8
|
-
* @param shouldEscape should escape the string / нужно ли экранировать строку
|
|
7
|
+
* @param options configuration options / объект опций
|
|
9
8
|
* @returns string with highlighting / строка с выделением
|
|
10
9
|
*/
|
|
11
|
-
export declare function addTagHighlightMatch(value
|
|
10
|
+
export declare function addTagHighlightMatch(value?: string | number | null, search?: string | RegExp, options?: AddTagHighlightMatchOptions): string;
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
* Options for configuring match highlighting in addTagHighlightMatch /
|
|
14
|
+
* Опции для настройки выделения совпадений в addTagHighlightMatch
|
|
15
|
+
*/
|
|
16
|
+
export declare interface AddTagHighlightMatchOptions {
|
|
17
|
+
/** Highlighting CSS class / CSS-класс выделения */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Should escape the string / Нужно ли экранировать строку */
|
|
20
|
+
shouldEscape?: boolean;
|
|
21
|
+
/** Should remove existing HTML tags / Нужно ли удалять существующие HTML-теги */
|
|
22
|
+
shouldRemoveTag?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Safely converts any value to a string according to specific conversion rules:
|
|
27
|
+
* - **Strings**: Returned as is (trimmed if `trim = true`).
|
|
28
|
+
* - **Nullish values**: `null` and `undefined` return an empty string `''`.
|
|
29
|
+
* - **Arrays**: If `isArrayString = true` and the array contains no objects, elements are joined with commas. Otherwise serialized as JSON.
|
|
30
|
+
* - **Objects**: Converted to JSON via `JSON.stringify`. In case of circular references or serialization errors, falls back to `String()` or `Object.prototype.toString`.
|
|
31
|
+
* - **Booleans**: By default (`isBooleanString = false`), `true` converts to `'1'` and `false` converts to `'0'`. If `isBooleanString = true`, returns `'true'` or `'false'`.
|
|
32
|
+
* - **Other types**: Numbers, BigInt, Symbol, functions, etc. are converted via `.toString()`.
|
|
33
|
+
*
|
|
34
|
+
* Безопасно преобразует любое значение в строку в соответствии с правилами преобразования:
|
|
35
|
+
* - **Строки**: Возвращаются как есть (с обрезкой пробелов, если `trim = true`).
|
|
36
|
+
* - **Пустые значения**: `null` и `undefined` возвращают пустую строку `''`.
|
|
37
|
+
* - **Массивы**: Если `isArrayString = true` и массив не содержит объектов, элементы объединяются через запятую. В остальных случаях сериализуются в JSON.
|
|
38
|
+
* - **Объекты**: Преобразуются в JSON через `JSON.stringify`. При циклических ссылках или ошибках сериализации возвращается `String()` или `Object.prototype.toString`.
|
|
39
|
+
* - **Логические значения**: По умолчанию (`isBooleanString = false`) `true` преобразуется в `'1'`, `false` — в `'0'`. Если `isBooleanString = true`, возвращается `'true'` или `'false'`.
|
|
40
|
+
* - **Прочие типы**: Числа, BigInt, Symbol, функции и др. преобразуются через `.toString()`.
|
|
41
|
+
* @param value value for conversion / значение для преобразования
|
|
42
|
+
* @param options configuration options / объект опций
|
|
22
43
|
* @returns string representation of the passed value / строковое представление переданного значения
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* anyToString(' Hello ') // => 'Hello'
|
|
48
|
+
* anyToString(' Hello ', { trim: false }) // => ' Hello '
|
|
49
|
+
* anyToString([1, 2, 3]) // => '1,2,3'
|
|
50
|
+
* anyToString([1, 2, 3], { isArrayString: false }) // => '[1,2,3]'
|
|
51
|
+
* anyToString({ a: 1 }) // => '{"a":1}'
|
|
52
|
+
* anyToString(true) // => '1'
|
|
53
|
+
* anyToString(false) // => '0'
|
|
54
|
+
* anyToString(true, { isBooleanString: true }) // => 'true'
|
|
55
|
+
* anyToString(false, { isBooleanString: true }) // => 'false'
|
|
56
|
+
* anyToString(null) // => ''
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function anyToString<V = unknown>(value?: V, options?: AnyToStringOptions): string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Options for configuring string conversion in anyToString /
|
|
63
|
+
* Опции для настройки преобразования в строку в anyToString
|
|
23
64
|
*/
|
|
24
|
-
export declare
|
|
65
|
+
export declare interface AnyToStringOptions {
|
|
66
|
+
/** If true, flat arrays without objects are joined with commas; if false, serialized as JSON string / Если true, массивы без объектов склеиваются через запятую; если false, сериализуются в JSON-строку */
|
|
67
|
+
isArrayString?: boolean;
|
|
68
|
+
/** If true, boolean values are converted to 'true' or 'false'; if false, to '1' or '0' / Если true, логические значения преобразуются в 'true' или 'false'; если false — в '1' или '0' */
|
|
69
|
+
isBooleanString?: boolean;
|
|
70
|
+
/** If true, then the resulting string will be trimmed / Если true, то результирующая строка будет обрезана */
|
|
71
|
+
trim?: boolean;
|
|
72
|
+
}
|
|
25
73
|
|
|
26
74
|
/**
|
|
27
75
|
* Class for working with HTTP requests.
|
|
@@ -1754,7 +1802,7 @@ export declare type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
|
|
|
1754
1802
|
* @returns formatted string with applied template replacements /
|
|
1755
1803
|
* отформатированная строка с примененными заменами шаблона
|
|
1756
1804
|
*/
|
|
1757
|
-
export declare function applyTemplate(text:
|
|
1805
|
+
export declare function applyTemplate(text: unknown, replacement?: Record<string, unknown> | readonly unknown[]): string;
|
|
1758
1806
|
|
|
1759
1807
|
/**
|
|
1760
1808
|
* Converts an array type to an item type (extracts the item type from an array)/
|
|
@@ -1782,7 +1830,7 @@ export declare function arrFill<T>(value: T, count: number): T[];
|
|
|
1782
1830
|
* @param clean If true, removes the data URL prefix / Если true, удаляет префикс data URL
|
|
1783
1831
|
* @returns Promise with the base64 string or undefined if empty / Промис со строкой base64 или undefined, если Blob пустой
|
|
1784
1832
|
*/
|
|
1785
|
-
export declare function blobToBase64(blob
|
|
1833
|
+
export declare function blobToBase64(blob?: Blob | null, clean?: boolean): Promise<string | undefined>;
|
|
1786
1834
|
|
|
1787
1835
|
/**
|
|
1788
1836
|
* Class for working with BroadcastChannel messages.
|
|
@@ -2011,21 +2059,23 @@ export declare class CacheStatic {
|
|
|
2011
2059
|
* @param locale use locale or explicit locale tag / использовать локаль или явный код локали
|
|
2012
2060
|
* @returns capitalized string / капитализированная строка
|
|
2013
2061
|
*/
|
|
2014
|
-
export declare function capitalize<T
|
|
2062
|
+
export declare function capitalize<T = string>(value?: T, locale?: boolean | string): T extends string ? Capitalize<T> : string;
|
|
2015
2063
|
|
|
2016
2064
|
/**
|
|
2017
2065
|
* Class for working with cookies.
|
|
2018
2066
|
*
|
|
2019
2067
|
* Класс для управления Cookie.
|
|
2020
2068
|
*/
|
|
2021
|
-
export declare class Cookie<T> {
|
|
2022
|
-
private name;
|
|
2069
|
+
export declare class Cookie<T = unknown> {
|
|
2070
|
+
private readonly name;
|
|
2023
2071
|
/** Cookie value / Значение cookie */
|
|
2024
2072
|
private value?;
|
|
2025
2073
|
/** Cookie options / Параметры cookie */
|
|
2026
2074
|
private options;
|
|
2027
2075
|
/**
|
|
2028
|
-
* Constructor
|
|
2076
|
+
* Constructor.
|
|
2077
|
+
*
|
|
2078
|
+
* Конструктор.
|
|
2029
2079
|
* @param name cookie name / название cookie
|
|
2030
2080
|
*/
|
|
2031
2081
|
constructor(name: string);
|
|
@@ -2036,7 +2086,7 @@ export declare class Cookie<T> {
|
|
|
2036
2086
|
* @param name cookie name / название cookie
|
|
2037
2087
|
* @returns Cookie instance / экземпляр Cookie
|
|
2038
2088
|
*/
|
|
2039
|
-
static getInstance<T>(name: string): Cookie<T>;
|
|
2089
|
+
static getInstance<T = unknown>(name: string): Cookie<T>;
|
|
2040
2090
|
/**
|
|
2041
2091
|
* Get data or update if none.
|
|
2042
2092
|
*
|
|
@@ -2045,7 +2095,7 @@ export declare class Cookie<T> {
|
|
|
2045
2095
|
* @param options additional parameters / дополнительные параметры
|
|
2046
2096
|
* @returns cookie value / значение cookie
|
|
2047
2097
|
*/
|
|
2048
|
-
get
|
|
2098
|
+
get<D extends T | string | (() => (T | string)) | undefined = undefined>(defaultValue?: D, options?: CookieOptions): CookieGet<T, D>;
|
|
2049
2099
|
/**
|
|
2050
2100
|
* Updates cookie data.
|
|
2051
2101
|
*
|
|
@@ -2102,18 +2152,18 @@ export declare class CookieBlock {
|
|
|
2102
2152
|
}
|
|
2103
2153
|
|
|
2104
2154
|
/**
|
|
2105
|
-
* Class for
|
|
2155
|
+
* Class for managing cookie access and blocking status at the instance level.
|
|
2106
2156
|
*
|
|
2107
|
-
* Класс для
|
|
2157
|
+
* Класс для управления доступом и статусом блокировки cookie на уровне экземпляра.
|
|
2108
2158
|
*/
|
|
2109
2159
|
export declare class CookieBlockInstance {
|
|
2110
2160
|
/** Data storage for cookie block status / Хранилище данных для статуса блокировки куки */
|
|
2111
|
-
private storage;
|
|
2161
|
+
private readonly storage;
|
|
2112
2162
|
/**
|
|
2113
2163
|
* Obtaining status.
|
|
2114
2164
|
*
|
|
2115
2165
|
* Получение статуса.
|
|
2116
|
-
* @returns
|
|
2166
|
+
* @returns current block status / текущий статус блокировки
|
|
2117
2167
|
*/
|
|
2118
2168
|
get(): boolean;
|
|
2119
2169
|
/**
|
|
@@ -2123,12 +2173,13 @@ export declare class CookieBlockInstance {
|
|
|
2123
2173
|
* @param value value to be changed / значение, на которое будет изменен
|
|
2124
2174
|
* @returns void / ничего не возвращает
|
|
2125
2175
|
*/
|
|
2126
|
-
set(value
|
|
2176
|
+
set(value?: boolean): void;
|
|
2127
2177
|
}
|
|
2128
2178
|
|
|
2129
|
-
/**
|
|
2130
|
-
|
|
2131
|
-
|
|
2179
|
+
/** Return type of the Cookie.get method / Тип возвращаемого значения метода Cookie.get */
|
|
2180
|
+
export declare type CookieGet<T, D = undefined> = [D] extends [undefined] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : (T | (D extends () => infer R ? R : D));
|
|
2181
|
+
|
|
2182
|
+
/** Cookie options / Параметры cookie */
|
|
2132
2183
|
export declare type CookieOptions = {
|
|
2133
2184
|
/** Cache age / Время кэширования */
|
|
2134
2185
|
age?: number;
|
|
@@ -2145,13 +2196,11 @@ export declare type CookieOptions = {
|
|
|
2145
2196
|
/** Partitioned attribute / Атрибут Partitioned */
|
|
2146
2197
|
partitioned?: boolean;
|
|
2147
2198
|
/** Additional arguments / Дополнительные аргументы */
|
|
2148
|
-
arguments?: string[] | Record<string,
|
|
2199
|
+
arguments?: string[] | Record<string, unknown>;
|
|
2149
2200
|
};
|
|
2150
2201
|
|
|
2151
|
-
/**
|
|
2152
|
-
|
|
2153
|
-
*/
|
|
2154
|
-
declare type CookieSameSite_2 = 'strict' | 'lax';
|
|
2202
|
+
/** Cookie sameSite attribute / Атрибут sameSite cookie */
|
|
2203
|
+
declare type CookieSameSite_2 = 'strict' | 'lax' | 'none';
|
|
2155
2204
|
export { CookieSameSite_2 as CookieSameSite }
|
|
2156
2205
|
|
|
2157
2206
|
/**
|
|
@@ -2162,11 +2211,11 @@ export { CookieSameSite_2 as CookieSameSite }
|
|
|
2162
2211
|
* Полезен для консистентной работы с cookie в различных окружениях (DOM, SSR).
|
|
2163
2212
|
*/
|
|
2164
2213
|
export declare class CookieStorage {
|
|
2165
|
-
/** Storage mechanism for getting data /
|
|
2214
|
+
/** Storage mechanism for getting data / Механизм хранения для получения данных */
|
|
2166
2215
|
protected static getListener?: (key: string) => unknown;
|
|
2167
|
-
/** Storage mechanism for getting raw data /
|
|
2216
|
+
/** Storage mechanism for getting raw data / Механизм хранения для получения сырых данных */
|
|
2168
2217
|
protected static getListenerRaw?: () => string;
|
|
2169
|
-
/** Storage mechanism for setting data /
|
|
2218
|
+
/** Storage mechanism for setting data / Механизм хранения для сохранения данных */
|
|
2170
2219
|
protected static setListener?: (key: string, value: string, cookie: string, options?: CookieOptions) => void;
|
|
2171
2220
|
/**
|
|
2172
2221
|
* Getting data from storage.
|
|
@@ -2174,9 +2223,10 @@ export declare class CookieStorage {
|
|
|
2174
2223
|
* Получение данных из хранилища.
|
|
2175
2224
|
* @param name cookie name / имя cookie
|
|
2176
2225
|
* @param defaultValue default value / значение по умолчанию
|
|
2177
|
-
* @
|
|
2226
|
+
* @param options additional parameters / дополнительные параметры
|
|
2227
|
+
* @returns cookie value or default / значение cookie или значение по умолчанию
|
|
2178
2228
|
*/
|
|
2179
|
-
static get<T
|
|
2229
|
+
static get<T = unknown, D extends T | (() => T) | undefined = undefined>(name: string, defaultValue?: D, options?: CookieOptions): CookieStorageGet<T, D>;
|
|
2180
2230
|
/**
|
|
2181
2231
|
* Saving data to storage.
|
|
2182
2232
|
*
|
|
@@ -2186,15 +2236,16 @@ export declare class CookieStorage {
|
|
|
2186
2236
|
* @param options additional parameters / дополнительные параметры
|
|
2187
2237
|
* @returns stored value / сохраненное значение
|
|
2188
2238
|
*/
|
|
2189
|
-
static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
2239
|
+
static set<T = unknown>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
2190
2240
|
/**
|
|
2191
2241
|
* Removing data from storage.
|
|
2192
2242
|
*
|
|
2193
2243
|
* Удаление данных из хранилища.
|
|
2194
2244
|
* @param name cookie name / имя cookie
|
|
2245
|
+
* @param options additional parameters / дополнительные параметры
|
|
2195
2246
|
* @returns void / ничего не возвращает
|
|
2196
2247
|
*/
|
|
2197
|
-
static remove(name: string): void;
|
|
2248
|
+
static remove(name: string, options?: CookieOptions): void;
|
|
2198
2249
|
/**
|
|
2199
2250
|
* Update data from cookies.
|
|
2200
2251
|
*
|
|
@@ -2210,12 +2261,22 @@ export declare class CookieStorage {
|
|
|
2210
2261
|
*/
|
|
2211
2262
|
static reset(): void;
|
|
2212
2263
|
/**
|
|
2213
|
-
* Initializes the storage with listeners.
|
|
2264
|
+
* Initializes the storage with optional listeners and hooks.
|
|
2214
2265
|
*
|
|
2215
|
-
*
|
|
2216
|
-
*
|
|
2217
|
-
*
|
|
2218
|
-
*
|
|
2266
|
+
* Features when omitting parameters:
|
|
2267
|
+
* - `getListener`: If omitted (`undefined`), reads directly from internal parsed cookie items (`initItems()`). If provided, takes precedence over internal cache.
|
|
2268
|
+
* - `getListenerRaw`: If omitted in a non-DOM/SSR environment (`!isDomRuntime()`), the initial cookie dictionary starts empty (`Object.create(null)`). In browser/DOM runtime, `document.cookie` is used instead. If provided in SSR, parses the returned raw cookie string.
|
|
2269
|
+
* - `setListener`: If omitted in the browser/DOM runtime, changes are written directly to `document.cookie`. In a non-DOM/SSR environment without `setListener`, mutations are stored solely in memory for the duration of the current request without external persistence.
|
|
2270
|
+
*
|
|
2271
|
+
* Инициализирует хранилище опциональными слушателями и хуками.
|
|
2272
|
+
*
|
|
2273
|
+
* Особенности работы при неполной передаче параметров:
|
|
2274
|
+
* - `getListener`: Если не передан (`undefined`), чтение происходит напрямую из внутреннего кэша разобранных cookie (`initItems()`). Если передан, имеет приоритет над внутренним кэшем.
|
|
2275
|
+
* - `getListenerRaw`: Если не передан в non-DOM/SSR окружении (`!isDomRuntime()`), начальное хранилище cookie создаётся пустым (`Object.create(null)`). В браузере (DOM) вместо него используется `document.cookie`. Если передан в SSR, разбирает возвращённую сырую строку cookie.
|
|
2276
|
+
* - `setListener`: Если не передан в браузере (DOM), запись выполняется напрямую в `document.cookie`. В non-DOM/SSR окружении без `setListener` изменения сохраняются исключительно в оперативной памяти в рамках текущего запроса без внешней фиксации.
|
|
2277
|
+
* @param getListener storage mechanism for getting data / механизм хранения для получения данных
|
|
2278
|
+
* @param getListenerRaw storage mechanism for getting raw cookie string / механизм хранения для получения сырой строки cookie
|
|
2279
|
+
* @param setListener storage mechanism for setting data / механизм хранения для сохранения данных
|
|
2219
2280
|
* @returns void / ничего не возвращает
|
|
2220
2281
|
*/
|
|
2221
2282
|
static init(getListener?: (key: string) => unknown, getListenerRaw?: () => string, setListener?: (key: string, value: string, cookie: string, options?: CookieOptions) => void): void;
|
|
@@ -2223,9 +2284,28 @@ export declare class CookieStorage {
|
|
|
2223
2284
|
* Check if the current environment is a DOM environment.
|
|
2224
2285
|
*
|
|
2225
2286
|
* Проверяет, является ли текущее окружение DOM-окружением.
|
|
2226
|
-
* @returns
|
|
2287
|
+
* @returns true if the current environment is a DOM environment, false otherwise / true, если текущее окружение является DOM-окружением, иначе false
|
|
2227
2288
|
*/
|
|
2228
2289
|
protected static hasDom(): boolean;
|
|
2290
|
+
/**
|
|
2291
|
+
* Sets an item in storage and notifies listeners or DOM.
|
|
2292
|
+
*
|
|
2293
|
+
* Устанавливает элемент в хранилище и уведомляет слушателей или DOM.
|
|
2294
|
+
* @param name cookie name / имя cookie
|
|
2295
|
+
* @param value data to be stored / данные для хранения
|
|
2296
|
+
* @param options additional parameters / дополнительные параметры
|
|
2297
|
+
* @param isWriteEmpty whether to write and update storage if value is empty / записывать ли и обновлять хранилище, если значение пустое
|
|
2298
|
+
* @returns stored value / сохраненное значение
|
|
2299
|
+
*/
|
|
2300
|
+
protected static setItem<T = unknown>(name: string, value: T, options?: CookieOptions, isWriteEmpty?: boolean): T;
|
|
2301
|
+
/**
|
|
2302
|
+
* Safely decodes a URI-encoded cookie component.
|
|
2303
|
+
*
|
|
2304
|
+
* Безопасно декодирует URI-кодированный компонент cookie.
|
|
2305
|
+
* @param value string to decode / строка для декодирования
|
|
2306
|
+
* @returns decoded string or original value on error / декодированная строка или исходное значение при ошибке
|
|
2307
|
+
*/
|
|
2308
|
+
protected static decode(value: string): string;
|
|
2229
2309
|
/**
|
|
2230
2310
|
* Formats the cookie string for storage.
|
|
2231
2311
|
*
|
|
@@ -2248,7 +2328,7 @@ export declare class CookieStorage {
|
|
|
2248
2328
|
*
|
|
2249
2329
|
* Разбирает строку cookie в объект пар ключ-значение.
|
|
2250
2330
|
* @param cookie cookie string / строка cookie
|
|
2251
|
-
* @returns
|
|
2331
|
+
* @returns parsed items / разобранные элементы
|
|
2252
2332
|
*/
|
|
2253
2333
|
protected static parse(cookie: string): Record<string, unknown>;
|
|
2254
2334
|
/**
|
|
@@ -2263,7 +2343,7 @@ export declare class CookieStorage {
|
|
|
2263
2343
|
* Converts the value to a string for the domain attribute.
|
|
2264
2344
|
*
|
|
2265
2345
|
* Преобразует значение в строку для атрибута domain.
|
|
2266
|
-
* @param domain
|
|
2346
|
+
* @param domain domain / домен
|
|
2267
2347
|
* @returns formatted domain string or undefined / отформатированная строка domain или undefined
|
|
2268
2348
|
*/
|
|
2269
2349
|
protected static toDomain(domain?: CookieOptions['domain']): string | undefined;
|
|
@@ -2288,7 +2368,7 @@ export declare class CookieStorage {
|
|
|
2288
2368
|
* Converts the value to a string for the partitioned attribute.
|
|
2289
2369
|
*
|
|
2290
2370
|
* Преобразует значение в строку для атрибута partitioned.
|
|
2291
|
-
* @param partitioned
|
|
2371
|
+
* @param partitioned partitioned attribute / атрибут partitioned
|
|
2292
2372
|
* @returns formatted Partitioned string or undefined / отформатированная строка Partitioned или undefined
|
|
2293
2373
|
*/
|
|
2294
2374
|
protected static toPartitioned(partitioned?: CookieOptions['partitioned']): string | undefined;
|
|
@@ -2296,7 +2376,7 @@ export declare class CookieStorage {
|
|
|
2296
2376
|
* Converts the value to a string for the path attribute.
|
|
2297
2377
|
*
|
|
2298
2378
|
* Преобразует значение в строку для атрибута path.
|
|
2299
|
-
* @param path
|
|
2379
|
+
* @param path path / путь
|
|
2300
2380
|
* @returns formatted Path string / отформатированная строка Path
|
|
2301
2381
|
*/
|
|
2302
2382
|
protected static toPath(path?: CookieOptions['path']): string;
|
|
@@ -2310,20 +2390,28 @@ export declare class CookieStorage {
|
|
|
2310
2390
|
protected static toSameSite(sameSite?: CookieOptions['sameSite']): string;
|
|
2311
2391
|
/**
|
|
2312
2392
|
* Converts the value to a string for the secure attribute.
|
|
2393
|
+
* Automatically enables Secure when SameSite is 'none' or partitioned is true per RFC 6265bis.
|
|
2313
2394
|
*
|
|
2314
2395
|
* Преобразует значение в строку для атрибута secure.
|
|
2315
|
-
*
|
|
2396
|
+
* Автоматически включает Secure при SameSite 'none' или partitioned true согласно RFC 6265bis.
|
|
2397
|
+
* @param secure secure attribute / атрибут secure
|
|
2398
|
+
* @param sameSite SameSite attribute / атрибут SameSite
|
|
2399
|
+
* @param partitioned partitioned attribute / атрибут partitioned
|
|
2316
2400
|
* @returns formatted Secure string or undefined / отформатированная строка Secure или undefined
|
|
2317
2401
|
*/
|
|
2318
|
-
protected static toSecure(secure?: CookieOptions['secure']): string | undefined;
|
|
2402
|
+
protected static toSecure(secure?: CookieOptions['secure'], sameSite?: CookieOptions['sameSite'], partitioned?: CookieOptions['partitioned']): string | undefined;
|
|
2319
2403
|
}
|
|
2320
2404
|
|
|
2405
|
+
/** Return type of the CookieStorage.get method / Тип возвращаемого значения метода CookieStorage.get */
|
|
2406
|
+
export declare type CookieStorageGet<T, D = undefined> = [D] extends [undefined] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : T;
|
|
2407
|
+
|
|
2321
2408
|
/**
|
|
2322
2409
|
* Creates a deep copy of an object for independent data management.
|
|
2323
2410
|
* The goal of the method is to get a completely new separate instance of the object to avoid unwanted mutations.
|
|
2324
2411
|
*
|
|
2325
2412
|
* Создает глубокую копию объекта для независимого управления данными.
|
|
2326
2413
|
* Цель метода — получить полностью новый отдельный экземпляр объекта во избежание нежелательных мутаций.
|
|
2414
|
+
* @template T type of the object / тип объекта
|
|
2327
2415
|
* @param value object for copying / объект для копирования
|
|
2328
2416
|
* @returns returns a new copy of the object / возвращает новую копию объекта
|
|
2329
2417
|
*/
|
|
@@ -2333,18 +2421,21 @@ export declare function copyObject<T>(value: T): T;
|
|
|
2333
2421
|
* Copies a simple object.
|
|
2334
2422
|
*
|
|
2335
2423
|
* Копирует простой объект.
|
|
2424
|
+
* @template T type of the original object / тип исходного объекта
|
|
2425
|
+
* @template R return type of the copied object / тип возвращаемого скопированного объекта
|
|
2336
2426
|
* @param value object for copying / объект для копирования
|
|
2337
2427
|
* @param source additional properties for copying / дополнительные свойства для копирования
|
|
2338
2428
|
* @returns returns a new copy of the object / возвращает новую копию объекта
|
|
2339
2429
|
*/
|
|
2340
|
-
export declare function copyObjectLite<T, R = T>(value
|
|
2430
|
+
export declare function copyObjectLite<T = Record<PropertyKey, unknown>, R = T>(value?: T | null, source?: Record<PropertyKey, unknown> | null): R;
|
|
2341
2431
|
|
|
2342
2432
|
/**
|
|
2343
2433
|
* In HTML documents, creates an element with the tag that is specified in the argument.
|
|
2344
2434
|
*
|
|
2345
2435
|
* В HTML-документах создаёт элемент с тегом, который указан в аргументе.
|
|
2346
2436
|
*
|
|
2347
|
-
* @
|
|
2437
|
+
* @template T element type / тип элемента
|
|
2438
|
+
* @param parentElement the DOM parent node (Element, DocumentFragment, or null/undefined) / родительский узел DOM (Element, DocumentFragment или null/undefined)
|
|
2348
2439
|
* @param tagName a string that specifies the type of element to be created / строка, указывающая элемент какого типа должен быть создан
|
|
2349
2440
|
* @param options an object with attributes or a function for processing an element / объект с атрибутами или функция для обработки элемента
|
|
2350
2441
|
* @param referenceElement the node before which new element is inserted / узел, перед которым будет вставлен новый элемент
|
|
@@ -2357,6 +2448,7 @@ export declare function copyObjectLite<T, R = T>(value: T, source?: Record<Prope
|
|
|
2357
2448
|
* When running on the server, the function always returns `undefined`.
|
|
2358
2449
|
* If you use it within a component's rendering logic, it may lead to hydration mismatches.
|
|
2359
2450
|
* It is recommended to call this function only inside lifecycle hooks that run exclusively on the client (e.g., `onMounted` in Vue or `useEffect` in React).
|
|
2451
|
+
* When passing `innerHTML` through `options`, make sure the markup is trusted or properly sanitized to prevent XSS vulnerabilities.
|
|
2360
2452
|
*
|
|
2361
2453
|
* Функция предназначена для стандартных HTML-элементов через `document.createElement`.
|
|
2362
2454
|
* Для элементов SVG или MathML, требующих пространства имён, используйте `document.createElementNS`.
|
|
@@ -2364,8 +2456,9 @@ export declare function copyObjectLite<T, R = T>(value: T, source?: Record<Prope
|
|
|
2364
2456
|
* При выполнении на сервере функция всегда возвращает `undefined`.
|
|
2365
2457
|
* Если вы используете её внутри логики рендеринга компонента, это может привести к ошибкам гидратации.
|
|
2366
2458
|
* Рекомендуется вызывать эту функцию только в хуках жизненного цикла, которые выполняются на клиенте (например, `onMounted` в Vue или `useEffect` в React).
|
|
2459
|
+
* При передаче `innerHTML` через `options` убедитесь, что разметка доверенная или надлежащим образом санитизирована во избежание XSS-уязвимостей.
|
|
2367
2460
|
*/
|
|
2368
|
-
export declare function createElement<T extends HTMLElement>(parentElement?: Element | DocumentFragment, tagName?: string, options?: Partial<T> | Record<string, unknown> | ((element: T) => void), referenceElement?: Node | null): T | undefined;
|
|
2461
|
+
export declare function createElement<T extends HTMLElement = HTMLDivElement>(parentElement?: Element | DocumentFragment | null, tagName?: string, options?: Partial<T> | Record<string, unknown> | ((element: T) => void) | null, referenceElement?: Node | null): T | undefined;
|
|
2369
2462
|
|
|
2370
2463
|
/**
|
|
2371
2464
|
* Class for working with localStorage and sessionStorage.
|
|
@@ -2374,10 +2467,10 @@ export declare function createElement<T extends HTMLElement>(parentElement?: Ele
|
|
|
2374
2467
|
* Класс для работы с localStorage и sessionStorage.
|
|
2375
2468
|
* Включает поддержку префиксов, времени жизни данных и изоляцию запросов в SSR.
|
|
2376
2469
|
*/
|
|
2377
|
-
export declare class DataStorage<T> {
|
|
2378
|
-
private name;
|
|
2379
|
-
private isSession;
|
|
2380
|
-
private errorCenter;
|
|
2470
|
+
export declare class DataStorage<T = unknown> {
|
|
2471
|
+
private readonly name;
|
|
2472
|
+
private readonly isSession;
|
|
2473
|
+
private readonly errorCenter;
|
|
2381
2474
|
/**
|
|
2382
2475
|
* The current value stored in memory /
|
|
2383
2476
|
* Текущее значение, хранящееся в памяти
|
|
@@ -2405,7 +2498,7 @@ export declare class DataStorage<T> {
|
|
|
2405
2498
|
* @param cache cache time in seconds / время кэширования в секундах
|
|
2406
2499
|
* @returns stored value or default value / сохраненное значение или значение по умолчанию
|
|
2407
2500
|
*/
|
|
2408
|
-
get
|
|
2501
|
+
get<D extends T | (() => T) | undefined = undefined>(defaultValue?: D, cache?: number): DataStorageGet<T, D>;
|
|
2409
2502
|
/**
|
|
2410
2503
|
* Changing data in storage.
|
|
2411
2504
|
*
|
|
@@ -2415,9 +2508,20 @@ export declare class DataStorage<T> {
|
|
|
2415
2508
|
*/
|
|
2416
2509
|
set(value?: T | (() => T)): T | undefined;
|
|
2417
2510
|
/**
|
|
2418
|
-
*
|
|
2511
|
+
* Getting the storage key name with prefix.
|
|
2419
2512
|
*
|
|
2420
|
-
*
|
|
2513
|
+
* Получение имени ключа в хранилище с учетом префикса.
|
|
2514
|
+
* @returns key name / имя ключа
|
|
2515
|
+
*/
|
|
2516
|
+
getIndex(): string;
|
|
2517
|
+
/**
|
|
2518
|
+
* Changing the prefix in key names. Should be called once during application bootstrap.
|
|
2519
|
+
* Note: The prefix is intentionally stored at module scope as a shared process-wide setting,
|
|
2520
|
+
* so in SSR environments it applies globally to the entire runtime process rather than per-request.
|
|
2521
|
+
*
|
|
2522
|
+
* Изменение префикса в названиях ключей. Вызывать нужно один раз при инициализации приложения.
|
|
2523
|
+
* Примечание: Префикс намеренно хранится на уровне модуля как общая настройка для всего процесса,
|
|
2524
|
+
* поэтому в SSR-окружении он применяется глобально ко всему процессу рантайма, а не изолированно для каждого запроса.
|
|
2421
2525
|
* @param newPrefix new prefix / новый префикс
|
|
2422
2526
|
*/
|
|
2423
2527
|
static setPrefix(newPrefix: string): void;
|
|
@@ -2443,13 +2547,6 @@ export declare class DataStorage<T> {
|
|
|
2443
2547
|
* @returns true if data is valid / true, если данные актуальны
|
|
2444
2548
|
*/
|
|
2445
2549
|
private isCache;
|
|
2446
|
-
/**
|
|
2447
|
-
* Getting the storage key name with prefix.
|
|
2448
|
-
*
|
|
2449
|
-
* Получение имени ключа в хранилище с учетом префикса.
|
|
2450
|
-
* @returns key name / имя ключа
|
|
2451
|
-
*/
|
|
2452
|
-
private getIndex;
|
|
2453
2550
|
/**
|
|
2454
2551
|
* Returns an object for working with storage (localStorage or sessionStorage).
|
|
2455
2552
|
*
|
|
@@ -2473,6 +2570,9 @@ export declare class DataStorage<T> {
|
|
|
2473
2570
|
private make;
|
|
2474
2571
|
}
|
|
2475
2572
|
|
|
2573
|
+
/** Return type of the get method / Тип возвращаемого значения метода get */
|
|
2574
|
+
export declare type DataStorageGet<T, D = undefined> = [D] extends [undefined] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : T;
|
|
2575
|
+
|
|
2476
2576
|
/**
|
|
2477
2577
|
* A class for working with dates.
|
|
2478
2578
|
*
|
|
@@ -2496,8 +2596,12 @@ export declare class Datetime {
|
|
|
2496
2596
|
protected hour24: boolean;
|
|
2497
2597
|
/** Callback on date update / Колбэк при изменении даты */
|
|
2498
2598
|
protected watch?: (date: Date, type: GeoDate, hour24: boolean) => void;
|
|
2599
|
+
/** Flag for blocking watch callback execution / Флаг блокировки вызова функции обратного вызова watch */
|
|
2600
|
+
protected block: boolean;
|
|
2499
2601
|
/**
|
|
2500
|
-
* Constructor
|
|
2602
|
+
* Constructor.
|
|
2603
|
+
*
|
|
2604
|
+
* Конструктор.
|
|
2501
2605
|
* @param date date for processing / дата для обработки
|
|
2502
2606
|
* @param type type of date format for output / тип формата даты вывода
|
|
2503
2607
|
* @param code country and language code / код страны и языка
|
|
@@ -2538,6 +2642,13 @@ export declare class Datetime {
|
|
|
2538
2642
|
* @returns boolean 24-hour format flag / флаг 24-часового формата
|
|
2539
2643
|
*/
|
|
2540
2644
|
getHour24(): boolean;
|
|
2645
|
+
/**
|
|
2646
|
+
* Returns the country and language code.
|
|
2647
|
+
*
|
|
2648
|
+
* Возвращает код страны и языка.
|
|
2649
|
+
* @returns string country and language code / код страны и языка
|
|
2650
|
+
*/
|
|
2651
|
+
getCode(): string;
|
|
2541
2652
|
/**
|
|
2542
2653
|
* The method returns the difference, in minutes, between
|
|
2543
2654
|
* a date as evaluated in the UTC time zone, and the same date as evaluated
|
|
@@ -2582,10 +2693,17 @@ export declare class Datetime {
|
|
|
2582
2693
|
/**
|
|
2583
2694
|
* The method returns the day of the month for the specified date according to local time.
|
|
2584
2695
|
*
|
|
2585
|
-
* Метод возвращает день месяца указанной даты по местному
|
|
2696
|
+
* Метод возвращает день месяца указанной даты по местному времени.
|
|
2586
2697
|
* @returns day of month (1-31) / день месяца (1-31)
|
|
2587
2698
|
*/
|
|
2588
2699
|
getDay(): number;
|
|
2700
|
+
/**
|
|
2701
|
+
* The method returns the day of the week for the specified date according to local time.
|
|
2702
|
+
*
|
|
2703
|
+
* Метод возвращает день недели указанной даты по местному времени.
|
|
2704
|
+
* @returns day of week (0-6) / день недели (0-6)
|
|
2705
|
+
*/
|
|
2706
|
+
getWeekday(): number;
|
|
2589
2707
|
/**
|
|
2590
2708
|
* The method returns the hour for the specified date, according to local time.
|
|
2591
2709
|
*
|
|
@@ -2615,18 +2733,18 @@ export declare class Datetime {
|
|
|
2615
2733
|
*/
|
|
2616
2734
|
getMaxDay(): number;
|
|
2617
2735
|
/**
|
|
2618
|
-
*
|
|
2736
|
+
* Changes the date completely.
|
|
2619
2737
|
*
|
|
2620
|
-
*
|
|
2621
|
-
* @param value
|
|
2738
|
+
* Полностью изменяет дату.
|
|
2739
|
+
* @param value date for processing / дата для обработки
|
|
2622
2740
|
* @returns this instance / текущий экземпляр
|
|
2623
2741
|
*/
|
|
2624
|
-
setDate(value
|
|
2742
|
+
setDate(value?: NumberOrStringOrDate): this;
|
|
2625
2743
|
/**
|
|
2626
2744
|
* Change the type of data output.
|
|
2627
2745
|
*
|
|
2628
2746
|
* Изменить тип вывода данных.
|
|
2629
|
-
* @param value type of output / тип
|
|
2747
|
+
* @param value type of output / тип вывода
|
|
2630
2748
|
* @returns this instance / текущий экземпляр
|
|
2631
2749
|
*/
|
|
2632
2750
|
setType(value: GeoDate): this;
|
|
@@ -2639,33 +2757,37 @@ export declare class Datetime {
|
|
|
2639
2757
|
*/
|
|
2640
2758
|
setHour24(value: boolean): this;
|
|
2641
2759
|
/**
|
|
2642
|
-
*
|
|
2760
|
+
* Changes the location and notifies the watcher.
|
|
2643
2761
|
*
|
|
2644
|
-
*
|
|
2762
|
+
* Изменяет местоположение и уведомляет наблюдателя.
|
|
2645
2763
|
* @param code country and language code / код страны и языка
|
|
2646
2764
|
* @returns this instance / текущий экземпляр
|
|
2647
2765
|
*/
|
|
2648
|
-
setCode(code
|
|
2766
|
+
setCode(code?: string): this;
|
|
2649
2767
|
/**
|
|
2650
2768
|
* The function is called when the data is updated.
|
|
2651
2769
|
*
|
|
2652
2770
|
* Функция вызывается при обновлении данных.
|
|
2653
|
-
* @param watch
|
|
2771
|
+
* @param watch callback function on date update / функция обратного вызова при обновлении даты
|
|
2654
2772
|
* @returns this instance / текущий экземпляр
|
|
2655
2773
|
*/
|
|
2656
|
-
setWatch(watch
|
|
2774
|
+
setWatch(watch?: (date: Date, type: GeoDate, hour24: boolean) => void): this;
|
|
2657
2775
|
/**
|
|
2658
2776
|
* The method sets the full year for a specified date according to local time.
|
|
2777
|
+
* Clamps the day to the maximum number of days in the current month of the target year to prevent overflow.
|
|
2659
2778
|
*
|
|
2660
2779
|
* Метод устанавливает полный год указанной даты по местному времени.
|
|
2661
|
-
*
|
|
2780
|
+
* Ограничивает день максимальным количеством дней в текущем месяце целевого года для предотвращения переполнения.
|
|
2781
|
+
* @param value value / значение
|
|
2662
2782
|
* @returns this instance / текущий экземпляр
|
|
2663
2783
|
*/
|
|
2664
2784
|
setYear(value: number): this;
|
|
2665
2785
|
/**
|
|
2666
2786
|
* The method sets the month for a specified date according to the currently set year.
|
|
2787
|
+
* Clamps the day to the maximum number of days in the target month to prevent overflow.
|
|
2667
2788
|
*
|
|
2668
2789
|
* Метод устанавливает месяц указанной даты по местному времени.
|
|
2790
|
+
* Ограничивает день максимальным количеством дней в целевом месяце для предотвращения переполнения.
|
|
2669
2791
|
* @param value month (1-12) / месяц (1-12)
|
|
2670
2792
|
* @returns this instance / текущий экземпляр
|
|
2671
2793
|
*/
|
|
@@ -2674,7 +2796,7 @@ export declare class Datetime {
|
|
|
2674
2796
|
* The method changes the day of the month of a given Date instance, based on local time.
|
|
2675
2797
|
*
|
|
2676
2798
|
* Метод устанавливает день месяца указанной даты по местному времени.
|
|
2677
|
-
* @param value value /
|
|
2799
|
+
* @param value value / значение
|
|
2678
2800
|
* @returns this instance / текущий экземпляр
|
|
2679
2801
|
*/
|
|
2680
2802
|
setDay(value: number): this;
|
|
@@ -2682,15 +2804,15 @@ export declare class Datetime {
|
|
|
2682
2804
|
* The method sets the hours for a specified date according to local time.
|
|
2683
2805
|
*
|
|
2684
2806
|
* Метод устанавливает часы указанной даты по местному времени.
|
|
2685
|
-
* @param value value /
|
|
2807
|
+
* @param value value / значение
|
|
2686
2808
|
* @returns this instance / текущий экземпляр
|
|
2687
2809
|
*/
|
|
2688
2810
|
setHour(value: number): this;
|
|
2689
2811
|
/**
|
|
2690
|
-
* The method sets the minutes for a specified date according to local time
|
|
2812
|
+
* The method sets the minutes for a specified date according to local time.
|
|
2691
2813
|
*
|
|
2692
|
-
* Метод устанавливает минуты указанной даты по местному
|
|
2693
|
-
* @param value value /
|
|
2814
|
+
* Метод устанавливает минуты указанной даты по местному времени.
|
|
2815
|
+
* @param value value / значение
|
|
2694
2816
|
* @returns this instance / текущий экземпляр
|
|
2695
2817
|
*/
|
|
2696
2818
|
setMinute(value: number): this;
|
|
@@ -2698,16 +2820,16 @@ export declare class Datetime {
|
|
|
2698
2820
|
* The method sets the seconds for a specified date according to local time.
|
|
2699
2821
|
*
|
|
2700
2822
|
* Метод устанавливает секунды указанной даты по местному времени.
|
|
2701
|
-
* @param value value /
|
|
2823
|
+
* @param value value / значение
|
|
2702
2824
|
* @returns this instance / текущий экземпляр
|
|
2703
2825
|
*/
|
|
2704
2826
|
setSecond(value: number): this;
|
|
2705
2827
|
/**
|
|
2706
2828
|
* Enables language-sensitive date and time formatting.
|
|
2707
2829
|
*
|
|
2708
|
-
*
|
|
2830
|
+
* Включает форматирование даты и времени с учетом языка.
|
|
2709
2831
|
* @param type type of date format for output / тип формата даты вывода
|
|
2710
|
-
* @param styleOptions
|
|
2832
|
+
* @param styleOptions month representation or Intl formatting options / представление месяца или опции форматирования Intl
|
|
2711
2833
|
* @returns string formatted date string / отформатированная строка даты
|
|
2712
2834
|
*/
|
|
2713
2835
|
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
|
|
@@ -2830,86 +2952,86 @@ export declare class Datetime {
|
|
|
2830
2952
|
*/
|
|
2831
2953
|
moveMonthLast(): this;
|
|
2832
2954
|
/**
|
|
2833
|
-
*
|
|
2955
|
+
* Moves to the first day of the next month.
|
|
2834
2956
|
*
|
|
2835
|
-
*
|
|
2957
|
+
* Переводит на первый день следующего месяца.
|
|
2836
2958
|
* @returns this instance / текущий экземпляр
|
|
2837
2959
|
*/
|
|
2838
2960
|
moveMonthNext(): this;
|
|
2839
2961
|
/**
|
|
2840
|
-
*
|
|
2962
|
+
* Moves to the first day of the previous month.
|
|
2841
2963
|
*
|
|
2842
|
-
*
|
|
2964
|
+
* Переводит на первый день предыдущего месяца.
|
|
2843
2965
|
* @returns this instance / текущий экземпляр
|
|
2844
2966
|
*/
|
|
2845
2967
|
moveMonthPrevious(): this;
|
|
2846
2968
|
/**
|
|
2847
|
-
*
|
|
2969
|
+
* Moves to the first day of the week.
|
|
2848
2970
|
*
|
|
2849
|
-
*
|
|
2971
|
+
* Переводит на первый день недели.
|
|
2850
2972
|
* @returns this instance / текущий экземпляр
|
|
2851
2973
|
*/
|
|
2852
2974
|
moveWeekdayFirst(): this;
|
|
2853
2975
|
/**
|
|
2854
|
-
*
|
|
2976
|
+
* Moves to the last day of the week.
|
|
2855
2977
|
*
|
|
2856
|
-
*
|
|
2978
|
+
* Переводит на последний день недели.
|
|
2857
2979
|
* @returns this instance / текущий экземпляр
|
|
2858
2980
|
*/
|
|
2859
2981
|
moveWeekdayLast(): this;
|
|
2860
2982
|
/**
|
|
2861
|
-
*
|
|
2983
|
+
* Moves to the first day of the first week of the month.
|
|
2862
2984
|
*
|
|
2863
|
-
*
|
|
2985
|
+
* Переводит на первый день первой недели месяца.
|
|
2864
2986
|
* @returns this instance / текущий экземпляр
|
|
2865
2987
|
*/
|
|
2866
2988
|
moveWeekdayFirstByMonth(): this;
|
|
2867
2989
|
/**
|
|
2868
|
-
*
|
|
2990
|
+
* Moves to the last day of the last week of the month.
|
|
2869
2991
|
*
|
|
2870
|
-
*
|
|
2992
|
+
* Переводит на последний день последней недели месяца.
|
|
2871
2993
|
* @returns this instance / текущий экземпляр
|
|
2872
2994
|
*/
|
|
2873
2995
|
moveWeekdayLastByMonth(): this;
|
|
2874
2996
|
/**
|
|
2875
|
-
*
|
|
2997
|
+
* Moves to the next week.
|
|
2876
2998
|
*
|
|
2877
|
-
*
|
|
2999
|
+
* Переводит на следующую неделю.
|
|
2878
3000
|
* @returns this instance / текущий экземпляр
|
|
2879
3001
|
*/
|
|
2880
3002
|
moveWeekdayNext(): this;
|
|
2881
3003
|
/**
|
|
2882
|
-
*
|
|
3004
|
+
* Moves to the previous week.
|
|
2883
3005
|
*
|
|
2884
|
-
*
|
|
3006
|
+
* Переводит на предыдущую неделю.
|
|
2885
3007
|
* @returns this instance / текущий экземпляр
|
|
2886
3008
|
*/
|
|
2887
3009
|
moveWeekdayPrevious(): this;
|
|
2888
3010
|
/**
|
|
2889
|
-
*
|
|
3011
|
+
* Moves to the first day of the month.
|
|
2890
3012
|
*
|
|
2891
|
-
*
|
|
3013
|
+
* Переводит на первый день месяца.
|
|
2892
3014
|
* @returns this instance / текущий экземпляр
|
|
2893
3015
|
*/
|
|
2894
3016
|
moveDayFirst(): this;
|
|
2895
3017
|
/**
|
|
2896
|
-
*
|
|
3018
|
+
* Moves to the last day of the month.
|
|
2897
3019
|
*
|
|
2898
|
-
*
|
|
3020
|
+
* Переводит на последний день месяца.
|
|
2899
3021
|
* @returns this instance / текущий экземпляр
|
|
2900
3022
|
*/
|
|
2901
3023
|
moveDayLast(): this;
|
|
2902
3024
|
/**
|
|
2903
|
-
*
|
|
3025
|
+
* Moves to the next day.
|
|
2904
3026
|
*
|
|
2905
|
-
*
|
|
3027
|
+
* Переводит на следующий день.
|
|
2906
3028
|
* @returns this instance / текущий экземпляр
|
|
2907
3029
|
*/
|
|
2908
3030
|
moveDayNext(): this;
|
|
2909
3031
|
/**
|
|
2910
|
-
*
|
|
3032
|
+
* Moves to the previous day.
|
|
2911
3033
|
*
|
|
2912
|
-
*
|
|
3034
|
+
* Переводит на предыдущий день.
|
|
2913
3035
|
* @returns this instance / текущий экземпляр
|
|
2914
3036
|
*/
|
|
2915
3037
|
moveDayPrevious(): this;
|
|
@@ -2921,9 +3043,9 @@ export declare class Datetime {
|
|
|
2921
3043
|
*/
|
|
2922
3044
|
clone(): Date;
|
|
2923
3045
|
/**
|
|
2924
|
-
* Clone the
|
|
3046
|
+
* Clone the Datetime object.
|
|
2925
3047
|
*
|
|
2926
|
-
* Клонировать объект
|
|
3048
|
+
* Клонировать объект Datetime.
|
|
2927
3049
|
* @returns Datetime cloned Datetime object / клонированный объект Datetime
|
|
2928
3050
|
*/
|
|
2929
3051
|
cloneClass(): Datetime;
|
|
@@ -2935,23 +3057,23 @@ export declare class Datetime {
|
|
|
2935
3057
|
*/
|
|
2936
3058
|
cloneMonthFirst(): Datetime;
|
|
2937
3059
|
/**
|
|
2938
|
-
* Clone the
|
|
3060
|
+
* Clone the Datetime object and move the month to the end of the year.
|
|
2939
3061
|
*
|
|
2940
|
-
* Клонировать объект
|
|
3062
|
+
* Клонировать объект Datetime и перевести месяц на конец года.
|
|
2941
3063
|
* @returns Datetime cloned Datetime with December month / клонированный Datetime с декабрем
|
|
2942
3064
|
*/
|
|
2943
3065
|
cloneMonthLast(): Datetime;
|
|
2944
3066
|
/**
|
|
2945
|
-
* Clone the
|
|
3067
|
+
* Clone the Datetime object and transfer it one month ahead.
|
|
2946
3068
|
*
|
|
2947
|
-
* Клонировать объект
|
|
3069
|
+
* Клонировать объект Datetime и перевести на 1 месяц вперед.
|
|
2948
3070
|
* @returns Datetime cloned Datetime with next month / клонированный Datetime со следующим месяцем
|
|
2949
3071
|
*/
|
|
2950
3072
|
cloneMonthNext(): Datetime;
|
|
2951
3073
|
/**
|
|
2952
|
-
* Clone the
|
|
3074
|
+
* Clone the Datetime object and transfer it one month back.
|
|
2953
3075
|
*
|
|
2954
|
-
* Клонировать объект
|
|
3076
|
+
* Клонировать объект Datetime и перевести на 1 месяц назад.
|
|
2955
3077
|
* @returns Datetime cloned Datetime with previous month / клонированный Datetime с предыдущим месяцем
|
|
2956
3078
|
*/
|
|
2957
3079
|
cloneMonthPrevious(): Datetime;
|
|
@@ -2998,30 +3120,30 @@ export declare class Datetime {
|
|
|
2998
3120
|
*/
|
|
2999
3121
|
cloneWeekdayPrevious(): Datetime;
|
|
3000
3122
|
/**
|
|
3001
|
-
* Clone the
|
|
3123
|
+
* Clone the Datetime object and move the day to the beginning of the month.
|
|
3002
3124
|
*
|
|
3003
|
-
* Клонировать объект
|
|
3125
|
+
* Клонировать объект Datetime и перевести день на начало месяца.
|
|
3004
3126
|
* @returns Datetime cloned Datetime with first day of month / клонированный Datetime с первым днем месяца
|
|
3005
3127
|
*/
|
|
3006
3128
|
cloneDayFirst(): Datetime;
|
|
3007
3129
|
/**
|
|
3008
|
-
* Clone the
|
|
3130
|
+
* Clone the Datetime object and move the day to the end of the month.
|
|
3009
3131
|
*
|
|
3010
|
-
* Клонировать объект
|
|
3132
|
+
* Клонировать объект Datetime и перевести день на конец месяца.
|
|
3011
3133
|
* @returns Datetime cloned Datetime with last day of month / клонированный Datetime с последним днем месяца
|
|
3012
3134
|
*/
|
|
3013
3135
|
cloneDayLast(): Datetime;
|
|
3014
3136
|
/**
|
|
3015
|
-
* Clone the
|
|
3137
|
+
* Clone the Datetime object and move by 1 day.
|
|
3016
3138
|
*
|
|
3017
|
-
* Клонировать объект
|
|
3139
|
+
* Клонировать объект Datetime и перевести на 1 день.
|
|
3018
3140
|
* @returns Datetime cloned Datetime with next day / клонированный Datetime со следующим днем
|
|
3019
3141
|
*/
|
|
3020
3142
|
cloneDayNext(): Datetime;
|
|
3021
3143
|
/**
|
|
3022
|
-
* Clone the
|
|
3144
|
+
* Clone the Datetime object and go back by 1 day.
|
|
3023
3145
|
*
|
|
3024
|
-
* Клонировать объект
|
|
3146
|
+
* Клонировать объект Datetime и вернуться на 1 день.
|
|
3025
3147
|
* @returns Datetime cloned Datetime with previous day / клонированный Datetime с предыдущим днем
|
|
3026
3148
|
*/
|
|
3027
3149
|
cloneDayPrevious(): Datetime;
|
|
@@ -3051,6 +3173,7 @@ export declare class Datetime {
|
|
|
3051
3173
|
* Если DOM уже загружен (readyState равен 'interactive' или 'complete') или код выполняется вне браузера,
|
|
3052
3174
|
* функция обратного вызова выполняется немедленно. Может вызываться без аргументов для простого ожидания готовности DOM.
|
|
3053
3175
|
*
|
|
3176
|
+
* @template T return value type / тип возвращаемого значения
|
|
3054
3177
|
* @param callback optional function to execute when DOM is loaded / опциональная функция для выполнения при загрузке DOM
|
|
3055
3178
|
* @param isServer whether to execute the callback in non-DOM/SSR environments (defaults to true) / выполнять ли функцию обратного вызова в среде без DOM/SSR (по умолчанию true)
|
|
3056
3179
|
* @returns promise resolving to the callback result / промис, разрешающийся результатом выполнения функции
|
|
@@ -3060,12 +3183,29 @@ export declare class Datetime {
|
|
|
3060
3183
|
*
|
|
3061
3184
|
* В среде без DOM (SSR) выполнение можно отключить, передав `isServer: false`.
|
|
3062
3185
|
*/
|
|
3063
|
-
export declare function domContentLoaded<T = void>(callback?: () => T | Promise<T
|
|
3186
|
+
export declare function domContentLoaded<T = void>(callback?: (() => T | Promise<T>) | null, isServer?: boolean): Promise<T>;
|
|
3187
|
+
|
|
3188
|
+
/**
|
|
3189
|
+
* Returns an array of all elements at the specified coordinates.
|
|
3190
|
+
*
|
|
3191
|
+
* Возвращает массив всех элементов по указанным координатам.
|
|
3192
|
+
* @param coordinator coordinates object / объект координат
|
|
3193
|
+
* @returns array of elements / массив элементов
|
|
3194
|
+
*
|
|
3195
|
+
* @remarks
|
|
3196
|
+
* In non-DOM (SSR) environments or when `document.elementsFromPoint` is unsupported,
|
|
3197
|
+
* the function returns an empty array `[]`. Coordinates are evaluated relative to the viewport.
|
|
3198
|
+
*
|
|
3199
|
+
* В среде без DOM (SSR) или при отсутствии поддержки `document.elementsFromPoint`
|
|
3200
|
+
* функция возвращает пустой массив `[]`. Координаты вычисляются относительно области просмотра (viewport).
|
|
3201
|
+
*/
|
|
3202
|
+
export declare function domElementsFromPoint(coordinator?: ImageCoordinator | null): Element[];
|
|
3064
3203
|
|
|
3065
3204
|
/**
|
|
3066
3205
|
* Selects the first element that matches the specified selectors.
|
|
3067
3206
|
*
|
|
3068
3207
|
* Выбирает первый элемент, который соответствует указанным селекторам.
|
|
3208
|
+
* @template E type of the target element / тип целевого элемента
|
|
3069
3209
|
* @param selectors selectors / селекторы
|
|
3070
3210
|
* @returns first matched element or undefined / первый найденный элемент или undefined
|
|
3071
3211
|
*/
|
|
@@ -3075,6 +3215,7 @@ export declare function domQuerySelector<E extends Element = Element>(selectors:
|
|
|
3075
3215
|
* Selects all elements that match the specified selectors.
|
|
3076
3216
|
*
|
|
3077
3217
|
* Выбирает все элементы, которые соответствуют указанным селекторам.
|
|
3218
|
+
* @template E type of the elements / тип элементов
|
|
3078
3219
|
* @param selectors selectors / селекторы
|
|
3079
3220
|
* @returns list of matched elements or undefined / список найденных элементов или undefined
|
|
3080
3221
|
*/
|
|
@@ -3087,10 +3228,16 @@ export declare function domQuerySelectorAll<E extends Element = Element>(selecto
|
|
|
3087
3228
|
export declare type ElementOrString<E extends ElementOrWindow> = E | string;
|
|
3088
3229
|
|
|
3089
3230
|
/**
|
|
3090
|
-
* Union type for HTML elements and Window object/
|
|
3091
|
-
* Объединенный тип для HTML
|
|
3231
|
+
* Union type for HTML, SVG elements, Element and Window object/
|
|
3232
|
+
* Объединенный тип для HTML, SVG элементов, Element и объекта Window
|
|
3092
3233
|
*/
|
|
3093
|
-
export declare type ElementOrWindow = HTMLElement | Window;
|
|
3234
|
+
export declare type ElementOrWindow = HTMLElement | SVGElement | Element | Window;
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Generic type resolving ElementOrWindow to an Element (Window resolves to HTMLElement)/
|
|
3238
|
+
* Дженерик тип, разрешающий ElementOrWindow в Element (Window разрешается в HTMLElement)
|
|
3239
|
+
*/
|
|
3240
|
+
export declare type ElementResolved<E extends ElementOrWindow = HTMLElement> = E extends Window ? HTMLElement : Exclude<E, Window>;
|
|
3094
3241
|
|
|
3095
3242
|
/**
|
|
3096
3243
|
* Union type for all "empty" values including falsy primitives and string representations/
|
|
@@ -3104,8 +3251,14 @@ export declare type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'nul
|
|
|
3104
3251
|
* Кодирует специальные символы в строке для безопасного использования в HTML-атрибутах.
|
|
3105
3252
|
* @param text text to encode / текст для кодирования
|
|
3106
3253
|
* @returns encoded text / закодированный текст
|
|
3254
|
+
*
|
|
3255
|
+
* @example
|
|
3256
|
+
* ```ts
|
|
3257
|
+
* encodeAttribute('<div class="box">') // => '<div class="box">'
|
|
3258
|
+
* encodeAttribute(undefined) // => ''
|
|
3259
|
+
* ```
|
|
3107
3260
|
*/
|
|
3108
|
-
export declare function encodeAttribute(text
|
|
3261
|
+
export declare function encodeAttribute(text?: string | number | null): string;
|
|
3109
3262
|
|
|
3110
3263
|
/**
|
|
3111
3264
|
* Encodes basic HTML special characters (<, >, &) in a string while preserving quotes.
|
|
@@ -3117,6 +3270,13 @@ export declare function encodeAttribute(text: string): string;
|
|
|
3117
3270
|
* @param text text to encode / текст для кодирования
|
|
3118
3271
|
* @returns encoded text / закодированный текст
|
|
3119
3272
|
*
|
|
3273
|
+
* @example
|
|
3274
|
+
* ```ts
|
|
3275
|
+
* encodeLiteAttribute('Tom & Jerry') // => 'Tom & Jerry'
|
|
3276
|
+
* encodeLiteAttribute('<title> "Hello" </title>') // => '<title> "Hello" </title>'
|
|
3277
|
+
* encodeLiteAttribute(undefined) // => ''
|
|
3278
|
+
* ```
|
|
3279
|
+
*
|
|
3120
3280
|
* @remarks
|
|
3121
3281
|
* This function intentionally does NOT encode quotes (" and '). For encoding untrusted user input
|
|
3122
3282
|
* inside HTML attributes, use `encodeAttribute` instead to prevent attribute injection vulnerabilities.
|
|
@@ -3124,7 +3284,7 @@ export declare function encodeAttribute(text: string): string;
|
|
|
3124
3284
|
* Эта функция намеренно НЕ экранирует кавычки (" и '). Для экранирования пользовательского ввода
|
|
3125
3285
|
* внутри HTML-атрибутов используйте `encodeAttribute` во избежание уязвимостей инъекции атрибутов.
|
|
3126
3286
|
*/
|
|
3127
|
-
export declare function encodeLiteAttribute(text
|
|
3287
|
+
export declare function encodeLiteAttribute(text?: string | number | null): string;
|
|
3128
3288
|
|
|
3129
3289
|
/**
|
|
3130
3290
|
* Ensures that an image does not exceed the maximum size by resizing it if needed.
|
|
@@ -3155,7 +3315,14 @@ export declare class ErrorCenter {
|
|
|
3155
3315
|
* @param group error group / группа ошибки
|
|
3156
3316
|
* @returns error cause item or undefined / элемент причины ошибки или undefined
|
|
3157
3317
|
*/
|
|
3158
|
-
static get(code: string, group?:
|
|
3318
|
+
static get(code: string, group?: ErrorCenterGroup): ErrorCenterCauseItem | undefined;
|
|
3319
|
+
/**
|
|
3320
|
+
* Returns the handler instance.
|
|
3321
|
+
*
|
|
3322
|
+
* Возвращает экземпляр обработчика.
|
|
3323
|
+
* @returns handler instance / экземпляр обработчика
|
|
3324
|
+
*/
|
|
3325
|
+
static getHandler(): ErrorCenterHandler;
|
|
3159
3326
|
/**
|
|
3160
3327
|
* Checks if a cause with specific code exists.
|
|
3161
3328
|
*
|
|
@@ -3164,7 +3331,7 @@ export declare class ErrorCenter {
|
|
|
3164
3331
|
* @param group error group / группа ошибки
|
|
3165
3332
|
* @returns true if cause exists / true, если причина существует
|
|
3166
3333
|
*/
|
|
3167
|
-
static has(code: string, group?:
|
|
3334
|
+
static has(code: string, group?: ErrorCenterGroup): boolean;
|
|
3168
3335
|
/**
|
|
3169
3336
|
* Returns the global singleton instance of ErrorCenterInstance.
|
|
3170
3337
|
*
|
|
@@ -3215,6 +3382,35 @@ export declare class ErrorCenter {
|
|
|
3215
3382
|
* @param causes error causes list / список причин ошибок
|
|
3216
3383
|
*/
|
|
3217
3384
|
static addList(causes: ErrorCenterCauseList): void;
|
|
3385
|
+
/**
|
|
3386
|
+
* Removes a cause from the storage by code and group.
|
|
3387
|
+
*
|
|
3388
|
+
* Удаляет причину ошибки из хранилища по коду и группе.
|
|
3389
|
+
* @param code error code / код ошибки
|
|
3390
|
+
* @param group error group / группа ошибки
|
|
3391
|
+
*/
|
|
3392
|
+
static remove(code: string, group?: ErrorCenterGroup): void;
|
|
3393
|
+
/**
|
|
3394
|
+
* Removes a handler or all handlers for a group.
|
|
3395
|
+
*
|
|
3396
|
+
* Удаляет обработчик или все обработчики для группы.
|
|
3397
|
+
* @param group target group / целевая группа
|
|
3398
|
+
* @param handler handler callback / обратный вызов обработчика
|
|
3399
|
+
*/
|
|
3400
|
+
static removeHandler(group?: ErrorCenterGroup, handler?: ErrorCenterHandlerCallback): void;
|
|
3401
|
+
/**
|
|
3402
|
+
* Removes a global callback.
|
|
3403
|
+
*
|
|
3404
|
+
* Удаляет глобальный обратный вызов.
|
|
3405
|
+
* @param callback callback function to remove / функция обратного вызова для удаления
|
|
3406
|
+
*/
|
|
3407
|
+
static removeCallback(callback: ErrorCenterHandlerCallback): void;
|
|
3408
|
+
/**
|
|
3409
|
+
* Resets registered handlers and callbacks.
|
|
3410
|
+
*
|
|
3411
|
+
* Сбрасывает зарегистрированные обработчики и обратные вызовы.
|
|
3412
|
+
*/
|
|
3413
|
+
static reset(): void;
|
|
3218
3414
|
/**
|
|
3219
3415
|
* Triggers error handling for a group.
|
|
3220
3416
|
*
|
|
@@ -3265,7 +3461,9 @@ export declare class ErrorCenterHandler {
|
|
|
3265
3461
|
/** Console output flag or filter function / Флаг или функция фильтрации вывода в консоль */
|
|
3266
3462
|
protected isConsole: ErrorCenterHandlerIsConsole;
|
|
3267
3463
|
/**
|
|
3268
|
-
* Constructor
|
|
3464
|
+
* Constructor for ErrorCenterHandler.
|
|
3465
|
+
*
|
|
3466
|
+
* Конструктор ErrorCenterHandler.
|
|
3269
3467
|
* @param handlers initial handlers list / начальный список обработчиков
|
|
3270
3468
|
* @param isConsole console output flag or filter function / флаг или функция вывода в консоль
|
|
3271
3469
|
*/
|
|
@@ -3277,7 +3475,7 @@ export declare class ErrorCenterHandler {
|
|
|
3277
3475
|
* @param group error group / группа ошибки
|
|
3278
3476
|
* @returns handler item or undefined / элемент обработчика или undefined
|
|
3279
3477
|
*/
|
|
3280
|
-
get(group
|
|
3478
|
+
get(group?: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
|
|
3281
3479
|
/**
|
|
3282
3480
|
* Checks if handlers exist for a group.
|
|
3283
3481
|
*
|
|
@@ -3285,7 +3483,7 @@ export declare class ErrorCenterHandler {
|
|
|
3285
3483
|
* @param group error group / группа ошибки
|
|
3286
3484
|
* @returns true if handlers exist / true, если обработчики существуют
|
|
3287
3485
|
*/
|
|
3288
|
-
has(group
|
|
3486
|
+
has(group?: ErrorCenterGroup): boolean;
|
|
3289
3487
|
/**
|
|
3290
3488
|
* Sets console output flag or filter function.
|
|
3291
3489
|
*
|
|
@@ -3319,6 +3517,30 @@ export declare class ErrorCenterHandler {
|
|
|
3319
3517
|
* @returns this instance / текущий экземпляр
|
|
3320
3518
|
*/
|
|
3321
3519
|
addList(handlers: ErrorCenterHandlerList): this;
|
|
3520
|
+
/**
|
|
3521
|
+
* Removes a handler or all handlers for a group.
|
|
3522
|
+
*
|
|
3523
|
+
* Удаляет обработчик или все обработчики для группы.
|
|
3524
|
+
* @param group error group / группа ошибки
|
|
3525
|
+
* @param handler callback function to remove / функция обратного вызова для удаления
|
|
3526
|
+
* @returns this instance / текущий экземпляр
|
|
3527
|
+
*/
|
|
3528
|
+
remove(group?: ErrorCenterGroup, handler?: ErrorCenterHandlerCallback): this;
|
|
3529
|
+
/**
|
|
3530
|
+
* Removes a global callback.
|
|
3531
|
+
*
|
|
3532
|
+
* Удаляет глобальный обратный вызов.
|
|
3533
|
+
* @param callback callback function to remove / функция обратного вызова для удаления
|
|
3534
|
+
* @returns this instance / текущий экземпляр
|
|
3535
|
+
*/
|
|
3536
|
+
removeCallback(callback: ErrorCenterHandlerCallback): this;
|
|
3537
|
+
/**
|
|
3538
|
+
* Resets all registered handlers and callbacks.
|
|
3539
|
+
*
|
|
3540
|
+
* Сбрасывает все зарегистрированные обработчики и обратные вызовы.
|
|
3541
|
+
* @returns this instance / текущий экземпляр
|
|
3542
|
+
*/
|
|
3543
|
+
reset(): this;
|
|
3322
3544
|
/**
|
|
3323
3545
|
* Triggers handlers for a group and logs to console.
|
|
3324
3546
|
*
|
|
@@ -3377,7 +3599,9 @@ export declare class ErrorCenterInstance {
|
|
|
3377
3599
|
/** List of stored error causes / Список сохраненных причин ошибок */
|
|
3378
3600
|
protected causes: ErrorCenterCauseList;
|
|
3379
3601
|
/**
|
|
3380
|
-
* Constructor
|
|
3602
|
+
* Constructor for ErrorCenterInstance.
|
|
3603
|
+
*
|
|
3604
|
+
* Конструктор ErrorCenterInstance.
|
|
3381
3605
|
* @param causes initial list of error causes / начальный список причин ошибок
|
|
3382
3606
|
* @param handler handler instance / экземпляр обработчика
|
|
3383
3607
|
*/
|
|
@@ -3390,7 +3614,14 @@ export declare class ErrorCenterInstance {
|
|
|
3390
3614
|
* @param group error group / группа ошибки
|
|
3391
3615
|
* @returns error cause item or undefined / элемент причины ошибки или undefined
|
|
3392
3616
|
*/
|
|
3393
|
-
get(code: string, group?:
|
|
3617
|
+
get(code: string, group?: ErrorCenterGroup): ErrorCenterCauseItem | undefined;
|
|
3618
|
+
/**
|
|
3619
|
+
* Returns the handler instance.
|
|
3620
|
+
*
|
|
3621
|
+
* Возвращает экземпляр обработчика.
|
|
3622
|
+
* @returns handler instance / экземпляр обработчика
|
|
3623
|
+
*/
|
|
3624
|
+
getHandler(): ErrorCenterHandler;
|
|
3394
3625
|
/**
|
|
3395
3626
|
* Checks if a cause with specific code exists.
|
|
3396
3627
|
*
|
|
@@ -3399,7 +3630,7 @@ export declare class ErrorCenterInstance {
|
|
|
3399
3630
|
* @param group error group / группа ошибки
|
|
3400
3631
|
* @returns true if cause exists / true, если причина существует
|
|
3401
3632
|
*/
|
|
3402
|
-
has(code: string, group?:
|
|
3633
|
+
has(code: string, group?: ErrorCenterGroup): boolean;
|
|
3403
3634
|
/**
|
|
3404
3635
|
* Sets console output flag or filter function for the handler.
|
|
3405
3636
|
*
|
|
@@ -3449,6 +3680,39 @@ export declare class ErrorCenterInstance {
|
|
|
3449
3680
|
* @returns this instance / текущий экземпляр
|
|
3450
3681
|
*/
|
|
3451
3682
|
addList(causes: ErrorCenterCauseList): this;
|
|
3683
|
+
/**
|
|
3684
|
+
* Removes a cause from the storage by code and group.
|
|
3685
|
+
*
|
|
3686
|
+
* Удаляет причину ошибки из хранилища по коду и группе.
|
|
3687
|
+
* @param code error code / код ошибки
|
|
3688
|
+
* @param group error group / группа ошибки
|
|
3689
|
+
* @returns this instance / текущий экземпляр
|
|
3690
|
+
*/
|
|
3691
|
+
remove(code: string, group?: ErrorCenterGroup): this;
|
|
3692
|
+
/**
|
|
3693
|
+
* Removes a handler or all handlers for a group.
|
|
3694
|
+
*
|
|
3695
|
+
* Удаляет обработчик или все обработчики для группы.
|
|
3696
|
+
* @param group target group / целевая группа
|
|
3697
|
+
* @param handler handler callback / обратный вызов обработчика
|
|
3698
|
+
* @returns this instance / текущий экземпляр
|
|
3699
|
+
*/
|
|
3700
|
+
removeHandler(group?: ErrorCenterGroup, handler?: ErrorCenterHandlerCallback): this;
|
|
3701
|
+
/**
|
|
3702
|
+
* Removes a global callback.
|
|
3703
|
+
*
|
|
3704
|
+
* Удаляет глобальный обратный вызов.
|
|
3705
|
+
* @param callback callback function to remove / функция обратного вызова для удаления
|
|
3706
|
+
* @returns this instance / текущий экземпляр
|
|
3707
|
+
*/
|
|
3708
|
+
removeCallback(callback: ErrorCenterHandlerCallback): this;
|
|
3709
|
+
/**
|
|
3710
|
+
* Resets registered handlers and callbacks.
|
|
3711
|
+
*
|
|
3712
|
+
* Сбрасывает зарегистрированные обработчики и обратные вызовы.
|
|
3713
|
+
* @returns this instance / текущий экземпляр
|
|
3714
|
+
*/
|
|
3715
|
+
reset(): this;
|
|
3452
3716
|
/**
|
|
3453
3717
|
* Triggers error handling for a group.
|
|
3454
3718
|
*
|
|
@@ -3471,10 +3735,10 @@ export declare class ErrorCenterInstance {
|
|
|
3471
3735
|
* Escapes special regex characters in a string so it can be used safely in a RegExp.
|
|
3472
3736
|
*
|
|
3473
3737
|
* Экранирует специальные символы регулярного выражения в строке, чтобы её можно было безопасно использовать в RegExp.
|
|
3474
|
-
* @param value string to escape / строка для экранирования
|
|
3738
|
+
* @param value string or number to escape / строка или число для экранирования
|
|
3475
3739
|
* @returns escaped string / экранированная строка
|
|
3476
3740
|
*/
|
|
3477
|
-
export declare function escapeExp(value
|
|
3741
|
+
export declare function escapeExp(value?: string | number | null): string;
|
|
3478
3742
|
|
|
3479
3743
|
/**
|
|
3480
3744
|
* Type for tracking active event listeners and observers/
|
|
@@ -3766,22 +4030,31 @@ export declare function executeFunction<T, Args extends unknown[] = unknown[]>(c
|
|
|
3766
4030
|
*/
|
|
3767
4031
|
export declare function executePromise<T, Args extends unknown[] = unknown[]>(callback: ((...args: Args) => PromiseLike<T> | T) | PromiseLike<T> | T, ...args: Args): Promise<Awaited<T>>;
|
|
3768
4032
|
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
4033
|
+
/**
|
|
4034
|
+
* The function performs the specified function once for each element in the collection (Array, Object, Map, Set)
|
|
4035
|
+
* and returns an array with the results of executing the function (omitting undefined values unless saveUndefined is true).
|
|
4036
|
+
*
|
|
4037
|
+
* Функция выполняет указанную функцию один раз для каждого элемента в коллекции (Array, Object, Map, Set)
|
|
4038
|
+
* и возвращает массив с результатами выполнения функции (пропуская значения undefined, если saveUndefined не равен true).
|
|
4039
|
+
* @param data object or collection for iteration / объект или коллекция для перебора
|
|
4040
|
+
* @param callback a function to execute for each element / функция, которая будет вызвана для каждого элемента
|
|
4041
|
+
* @param saveUndefined if true, the function will preserve undefined return values / если true, функция сохранит значения undefined
|
|
4042
|
+
* @returns an array with the results of executing the function / массив с результатами выполнения функции
|
|
4043
|
+
*/
|
|
4044
|
+
export declare function forEach<T = any, R = any, D extends ForEachData<T> = ForEachData<T>, K = ForEachKey<D>, S extends boolean = false>(data: D, callback: (item: D extends object ? ForEachItem<D> : T, key: K, collection: D) => R, saveUndefined?: S): ForEachReturn<R, S>;
|
|
3778
4045
|
|
|
3779
4046
|
/** Type of collection supported for iteration / Тип коллекции, поддерживаемой для перебора */
|
|
3780
|
-
export declare type ForEachData<T> = readonly T[] | Record<
|
|
4047
|
+
export declare type ForEachData<T = any> = readonly T[] | Record<PropertyKey, T> | Map<unknown, T> | Set<T> | object;
|
|
4048
|
+
|
|
4049
|
+
/** Type of item based on collection structure / Тип элемента в зависимости от структуры коллекции */
|
|
4050
|
+
export declare type ForEachItem<D> = D extends readonly (infer T)[] ? T : D extends Set<infer S> ? S : D extends Map<unknown, infer V> ? V : D extends object ? D[keyof D] : unknown;
|
|
3781
4051
|
|
|
3782
4052
|
/** Type of key based on the collection structure / Тип ключа в зависимости от структуры коллекции */
|
|
3783
4053
|
export declare type ForEachKey<D> = D extends readonly unknown[] ? number : D extends Set<infer S> ? S : D extends Map<infer K, unknown> ? K : string;
|
|
3784
4054
|
|
|
4055
|
+
/** Return array type based on saveUndefined / Тип возвращаемого массива в зависимости от saveUndefined */
|
|
4056
|
+
export declare type ForEachReturn<R, S extends boolean = false> = (S extends true ? R : Exclude<R, undefined>)[];
|
|
4057
|
+
|
|
3785
4058
|
/**
|
|
3786
4059
|
* Class for formatting a list of data based on provided options.
|
|
3787
4060
|
*
|
|
@@ -4183,6 +4456,17 @@ export declare enum FormattersType {
|
|
|
4183
4456
|
unit = "unit"
|
|
4184
4457
|
}
|
|
4185
4458
|
|
|
4459
|
+
/**
|
|
4460
|
+
* Iterates over own enumerable properties of an object, safely skipping prototype pollution keys (__proto__, constructor, prototype).
|
|
4461
|
+
* Supports early termination when the callback returns false.
|
|
4462
|
+
*
|
|
4463
|
+
* Перебирает собственные перечисляемые свойства объекта, безопасно пропуская ключи загрязнения прототипа (__proto__, constructor, prototype).
|
|
4464
|
+
* Поддерживает досрочное прерывание, если функция обратного вызова возвращает false.
|
|
4465
|
+
* @param data object for iteration / объект для перебора
|
|
4466
|
+
* @param callback a function executed for each property / функция, выполняемая для каждого свойства
|
|
4467
|
+
*/
|
|
4468
|
+
export declare function forOwn<T extends object = Record<string, unknown>, K extends Extract<keyof T, string> = Extract<keyof T, string>>(data?: T, callback?: (value: T[K], key: K, collection: T) => void | boolean): void;
|
|
4469
|
+
|
|
4186
4470
|
/**
|
|
4187
4471
|
* Cyclically calls requestAnimationFrame while next returns true.
|
|
4188
4472
|
*
|
|
@@ -4229,6 +4513,11 @@ export declare type FunctionVoid = () => void;
|
|
|
4229
4513
|
* Предоставляет централизованный интерфейс для управления локалью, страной и часовым поясом.
|
|
4230
4514
|
*/
|
|
4231
4515
|
export declare class Geo {
|
|
4516
|
+
/**
|
|
4517
|
+
* Protected constructor for static utility class /
|
|
4518
|
+
* Защищенный конструктор для статического утилитного класса
|
|
4519
|
+
*/
|
|
4520
|
+
protected constructor();
|
|
4232
4521
|
/**
|
|
4233
4522
|
* Returns information about the current country and language.
|
|
4234
4523
|
*
|
|
@@ -4243,7 +4532,7 @@ export declare class Geo {
|
|
|
4243
4532
|
* @param code location code / код локации
|
|
4244
4533
|
* @param save whether to persist the change in storage / сохранять ли изменения в хранилище
|
|
4245
4534
|
*/
|
|
4246
|
-
static set(code
|
|
4535
|
+
static set(code?: string, save?: boolean): void;
|
|
4247
4536
|
/**
|
|
4248
4537
|
* Returns geo data by country or language code from the global database.
|
|
4249
4538
|
*
|
|
@@ -4259,7 +4548,7 @@ export declare class Geo {
|
|
|
4259
4548
|
* @param code full locale string / полная строка локали
|
|
4260
4549
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4261
4550
|
*/
|
|
4262
|
-
static getByCodeFull(code
|
|
4551
|
+
static getByCodeFull(code?: string): GeoItem | undefined;
|
|
4263
4552
|
/**
|
|
4264
4553
|
* Returns geo data for a specific country by its code.
|
|
4265
4554
|
*
|
|
@@ -4267,7 +4556,7 @@ export declare class Geo {
|
|
|
4267
4556
|
* @param country country code / код страны
|
|
4268
4557
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4269
4558
|
*/
|
|
4270
|
-
static getByCountry(country
|
|
4559
|
+
static getByCountry(country?: string): GeoItem | undefined;
|
|
4271
4560
|
/**
|
|
4272
4561
|
* Returns geo data for a specific language by its code.
|
|
4273
4562
|
*
|
|
@@ -4275,7 +4564,7 @@ export declare class Geo {
|
|
|
4275
4564
|
* @param language language code / код языка
|
|
4276
4565
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4277
4566
|
*/
|
|
4278
|
-
static getByLanguage(language
|
|
4567
|
+
static getByLanguage(language?: string): GeoItem | undefined;
|
|
4279
4568
|
/**
|
|
4280
4569
|
* Returns the 2-letter code of the current country.
|
|
4281
4570
|
*
|
|
@@ -4295,6 +4584,7 @@ export declare class Geo {
|
|
|
4295
4584
|
*
|
|
4296
4585
|
* Возвращает полностью обработанные гео-данные с учетом текущего языка.
|
|
4297
4586
|
* @returns full geo item data / полные данные гео-объекта
|
|
4587
|
+
* @deprecated Use get() / Используйте get()
|
|
4298
4588
|
*/
|
|
4299
4589
|
static getItem(): GeoItemFull;
|
|
4300
4590
|
/**
|
|
@@ -4373,7 +4663,7 @@ export declare class Geo {
|
|
|
4373
4663
|
* Устанавливает значение по умолчанию для кода страны.
|
|
4374
4664
|
* @param code default code value / значение кода по умолчанию
|
|
4375
4665
|
*/
|
|
4376
|
-
static setValueDefault(code?: string | (() => string)): void;
|
|
4666
|
+
static setValueDefault(code?: string | (() => string | undefined)): void;
|
|
4377
4667
|
/**
|
|
4378
4668
|
* Adds or updates country geo data.
|
|
4379
4669
|
* Merges with existing country data if found, or creates a new entry.
|
|
@@ -4384,7 +4674,7 @@ export declare class Geo {
|
|
|
4384
4674
|
* @param item partial or full geo item data / частичные или полные гео-данные
|
|
4385
4675
|
* @returns GeoInstance instance / экземпляр GeoInstance
|
|
4386
4676
|
*/
|
|
4387
|
-
static add(country: string, item
|
|
4677
|
+
static add(country: string, item?: Partial<GeoItem>): GeoInstance;
|
|
4388
4678
|
/**
|
|
4389
4679
|
* Adds or updates multiple countries in the geo list.
|
|
4390
4680
|
*
|
|
@@ -4392,25 +4682,31 @@ export declare class Geo {
|
|
|
4392
4682
|
* @param list map of country codes to geo items / карта кодов стран к гео-объектам
|
|
4393
4683
|
* @returns GeoInstance instance / экземпляр GeoInstance
|
|
4394
4684
|
*/
|
|
4395
|
-
static addList(list
|
|
4685
|
+
static addList(list?: Record<string, Partial<GeoItem>>): GeoInstance;
|
|
4396
4686
|
/**
|
|
4397
4687
|
* Finds or determines the geo data for a given code. Alias for getByCode.
|
|
4398
4688
|
*
|
|
4399
4689
|
* Находит или определяет гео-данные для заданного кода. Алиас для getByCode.
|
|
4400
4690
|
* @param code country or language code / код страны или языка
|
|
4401
4691
|
* @returns full geo data / полные гео-данные
|
|
4692
|
+
* @deprecated Use getByCode() / Используйте getByCode()
|
|
4402
4693
|
*/
|
|
4403
|
-
static find(code
|
|
4694
|
+
static find(code?: string): GeoItemFull;
|
|
4404
4695
|
/**
|
|
4405
4696
|
* Returns a standard concatenated string for a geo item (e.g., 'en-US').
|
|
4406
4697
|
*
|
|
4407
4698
|
* Возвращает стандартную объединенную строку для гео-объекта (например, 'ru-RU').
|
|
4408
4699
|
* @param item geo item data / данные гео-объекта
|
|
4700
|
+
* @param language optional language override / опциональное переопределение языка
|
|
4701
|
+
* @param raw whether to skip language processing / не обрабатывать ли язык
|
|
4409
4702
|
* @returns standard string / стандартная строка
|
|
4410
4703
|
*/
|
|
4411
|
-
static toStandard(item
|
|
4704
|
+
static toStandard(item?: GeoItem, language?: string, raw?: boolean): string;
|
|
4412
4705
|
}
|
|
4413
4706
|
|
|
4707
|
+
/** Default first day of the week ('Mo' = Monday) / Первый день недели по умолчанию ('Mo' = понедельник) */
|
|
4708
|
+
export declare const GEO_DEFAULT_FIRST_DAY = "Mo";
|
|
4709
|
+
|
|
4414
4710
|
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
4415
4711
|
|
|
4416
4712
|
/**
|
|
@@ -4604,40 +4900,20 @@ export declare type GeoHours = '12' | '24';
|
|
|
4604
4900
|
*/
|
|
4605
4901
|
export declare class GeoInstance {
|
|
4606
4902
|
/**
|
|
4607
|
-
*
|
|
4608
|
-
*
|
|
4609
|
-
*/
|
|
4610
|
-
private list;
|
|
4611
|
-
/**
|
|
4612
|
-
* Data storage instance for geo code /
|
|
4613
|
-
* Экземпляр хранилища данных для гео-кода
|
|
4614
|
-
*/
|
|
4615
|
-
private storage;
|
|
4616
|
-
/**
|
|
4617
|
-
* Current location code (e.g., 'en-GB') /
|
|
4618
|
-
* Текущий код локации (например, 'en-GB')
|
|
4903
|
+
* Location manager instance /
|
|
4904
|
+
* Экземпляр менеджера локации
|
|
4619
4905
|
*/
|
|
4620
|
-
|
|
4906
|
+
protected readonly location: GeoLocation;
|
|
4621
4907
|
/**
|
|
4622
|
-
*
|
|
4623
|
-
*
|
|
4908
|
+
* Time zone manager instance /
|
|
4909
|
+
* Экземпляр менеджера часового пояса
|
|
4624
4910
|
*/
|
|
4625
|
-
|
|
4911
|
+
protected timezone?: GeoTimezone;
|
|
4626
4912
|
/**
|
|
4627
4913
|
* Detailed data about the current country /
|
|
4628
4914
|
* Детальные данные о текущей стране
|
|
4629
4915
|
*/
|
|
4630
|
-
|
|
4631
|
-
/**
|
|
4632
|
-
* Current language code /
|
|
4633
|
-
* Текущий код языка
|
|
4634
|
-
*/
|
|
4635
|
-
private language;
|
|
4636
|
-
/**
|
|
4637
|
-
* Current time zone offset in minutes /
|
|
4638
|
-
* Текущее смещение часового пояса в минутах
|
|
4639
|
-
*/
|
|
4640
|
-
private timezone;
|
|
4916
|
+
protected item: GeoItemFull;
|
|
4641
4917
|
/**
|
|
4642
4918
|
* Constructor.
|
|
4643
4919
|
* Initializes the location and related data.
|
|
@@ -4659,8 +4935,9 @@ export declare class GeoInstance {
|
|
|
4659
4935
|
* Обновляет текущее местоположение и связанные с ним данные.
|
|
4660
4936
|
* @param code location code (e.g., 'en-GB') / код локации (например, 'en-GB')
|
|
4661
4937
|
* @param save whether to save the location in storage / нужно ли сохранять местоположение в хранилище
|
|
4938
|
+
* @returns current instance / текущий экземпляр
|
|
4662
4939
|
*/
|
|
4663
|
-
set(code
|
|
4940
|
+
set(code?: string, save?: boolean): this;
|
|
4664
4941
|
/**
|
|
4665
4942
|
* Returns data about the country by its code.
|
|
4666
4943
|
*
|
|
@@ -4670,29 +4947,29 @@ export declare class GeoInstance {
|
|
|
4670
4947
|
*/
|
|
4671
4948
|
getByCode(code?: string): GeoItemFull;
|
|
4672
4949
|
/**
|
|
4673
|
-
* Returns
|
|
4950
|
+
* Returns geo item data by language and country combination.
|
|
4674
4951
|
*
|
|
4675
|
-
* Возвращает
|
|
4952
|
+
* Возвращает гео-данные по комбинации языка и страны.
|
|
4676
4953
|
* @param code string in the form of language-country / строка в виде язык-страна
|
|
4677
4954
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4678
4955
|
*/
|
|
4679
|
-
getByCodeFull(code
|
|
4956
|
+
getByCodeFull(code?: string): GeoItem | undefined;
|
|
4680
4957
|
/**
|
|
4681
|
-
* Returns
|
|
4958
|
+
* Returns geo item data by country code.
|
|
4682
4959
|
*
|
|
4683
|
-
* Возвращает
|
|
4960
|
+
* Возвращает гео-данные по коду страны.
|
|
4684
4961
|
* @param country country code / код страны
|
|
4685
4962
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4686
4963
|
*/
|
|
4687
|
-
getByCountry(country
|
|
4964
|
+
getByCountry(country?: string): GeoItem | undefined;
|
|
4688
4965
|
/**
|
|
4689
|
-
* Returns
|
|
4966
|
+
* Returns geo item data by language code.
|
|
4690
4967
|
*
|
|
4691
|
-
* Возвращает
|
|
4968
|
+
* Возвращает гео-данные по коду языка.
|
|
4692
4969
|
* @param language language code / код языка
|
|
4693
4970
|
* @returns geo item or undefined / гео-объект или undefined
|
|
4694
4971
|
*/
|
|
4695
|
-
getByLanguage(language
|
|
4972
|
+
getByLanguage(language?: string): GeoItem | undefined;
|
|
4696
4973
|
/**
|
|
4697
4974
|
* Getting the current country code.
|
|
4698
4975
|
*
|
|
@@ -4712,6 +4989,7 @@ export declare class GeoInstance {
|
|
|
4712
4989
|
*
|
|
4713
4990
|
* Получение обработанных данных, включая текущий язык.
|
|
4714
4991
|
* @returns full geo item data / полные данные гео-объекта
|
|
4992
|
+
* @deprecated Use get() / Используйте get()
|
|
4715
4993
|
*/
|
|
4716
4994
|
getItem(): GeoItemFull;
|
|
4717
4995
|
/**
|
|
@@ -4779,12 +5057,13 @@ export declare class GeoInstance {
|
|
|
4779
5057
|
*/
|
|
4780
5058
|
setTimezone(timezone: number): this;
|
|
4781
5059
|
/**
|
|
4782
|
-
* Sets the default value for the
|
|
5060
|
+
* Sets the default value or resolver for the location code.
|
|
4783
5061
|
*
|
|
4784
|
-
* Устанавливает значение по умолчанию для кода
|
|
4785
|
-
* @param code default code value / значение кода по умолчанию
|
|
5062
|
+
* Устанавливает значение по умолчанию или функцию его вычисления для кода локации.
|
|
5063
|
+
* @param code default code value or provider / значение кода по умолчанию или провайдер
|
|
5064
|
+
* @returns current instance / текущий экземпляр
|
|
4786
5065
|
*/
|
|
4787
|
-
setValueDefault(code?: string | (() => string)):
|
|
5066
|
+
setValueDefault(code?: string | (() => string | undefined)): this;
|
|
4788
5067
|
/**
|
|
4789
5068
|
* Adds or updates country geo data.
|
|
4790
5069
|
* Merges with existing country data if found, or creates a new entry.
|
|
@@ -4795,7 +5074,7 @@ export declare class GeoInstance {
|
|
|
4795
5074
|
* @param item partial or full geo item data / частичные или полные гео-данные
|
|
4796
5075
|
* @returns current instance / текущий экземпляр
|
|
4797
5076
|
*/
|
|
4798
|
-
add(country: string, item
|
|
5077
|
+
add(country: string, item?: Partial<GeoItem>): this;
|
|
4799
5078
|
/**
|
|
4800
5079
|
* Adds or updates multiple countries in the geo list.
|
|
4801
5080
|
*
|
|
@@ -4803,80 +5082,40 @@ export declare class GeoInstance {
|
|
|
4803
5082
|
* @param list map of country codes to geo items / карта кодов стран к гео-объектам
|
|
4804
5083
|
* @returns current instance / текущий экземпляр
|
|
4805
5084
|
*/
|
|
4806
|
-
addList(list
|
|
5085
|
+
addList(list?: Record<string, Partial<GeoItem>>): this;
|
|
4807
5086
|
/**
|
|
4808
|
-
* Finds the country data by its code
|
|
5087
|
+
* Finds the country data by its code.
|
|
4809
5088
|
*
|
|
4810
|
-
* Ищет данные о стране по ее
|
|
5089
|
+
* Ищет данные о стране по ее коду.
|
|
4811
5090
|
* @param code country code / код страны
|
|
4812
5091
|
* @returns full geo data / полные гео-данные
|
|
5092
|
+
* @deprecated Use getByCode() / Используйте getByCode()
|
|
4813
5093
|
*/
|
|
4814
|
-
find(code
|
|
5094
|
+
find(code?: string): GeoItemFull;
|
|
4815
5095
|
/**
|
|
4816
5096
|
* Converts a geo item to its standard string representation (language-country).
|
|
4817
5097
|
*
|
|
4818
5098
|
* Преобразует гео-объект в его стандартное строковое представление (язык-страна).
|
|
4819
5099
|
* @param item geo item data / данные гео-объекта
|
|
4820
5100
|
* @param language optional language override / опциональное переопределение языка
|
|
5101
|
+
* @param raw whether to skip language processing / не обрабатывать ли язык
|
|
4821
5102
|
* @returns standard code string / строка стандартного кода
|
|
4822
5103
|
*/
|
|
4823
|
-
toStandard(item
|
|
4824
|
-
/**
|
|
4825
|
-
* Internal method to get the geo cookie instance.
|
|
4826
|
-
*
|
|
4827
|
-
* Внутренний метод для получения экземпляра гео-куки.
|
|
4828
|
-
* @returns Cookie instance for geo code / экземпляр куки для гео-кода
|
|
4829
|
-
*/
|
|
4830
|
-
private getCookie;
|
|
4831
|
-
/**
|
|
4832
|
-
* Internal method to determine the initial location.
|
|
4833
|
-
*
|
|
4834
|
-
* Внутренний метод для определения начального местоположения.
|
|
4835
|
-
* @returns initial location code / начальный код локации
|
|
4836
|
-
*/
|
|
4837
|
-
private findLocation;
|
|
4838
|
-
/**
|
|
4839
|
-
* Internal method to determine the location from DOM-specific sources.
|
|
4840
|
-
* Returns an empty string (falsy) when not in a DOM runtime.
|
|
4841
|
-
*
|
|
4842
|
-
* Внутренний метод для определения местоположения из DOM-источников.
|
|
4843
|
-
* Возвращает пустую строку (falsy) вне DOM-окружения.
|
|
4844
|
-
* @returns location code from DOM or empty string / код локации из DOM или пустая строка
|
|
4845
|
-
*/
|
|
4846
|
-
private findLocationDom;
|
|
4847
|
-
/**
|
|
4848
|
-
* Internal method to determine the language from the provided code.
|
|
4849
|
-
*
|
|
4850
|
-
* Внутренний метод для определения языка по предоставленному коду.
|
|
4851
|
-
* @param code location or language code / код локации или языка
|
|
4852
|
-
* @returns language code / код языка
|
|
4853
|
-
*/
|
|
4854
|
-
private findLanguage;
|
|
4855
|
-
/**
|
|
4856
|
-
* Internal method to extract country code from a location string.
|
|
4857
|
-
*
|
|
4858
|
-
* Внутренний метод для извлечения кода страны из строки локации.
|
|
4859
|
-
* @param code combined string / комбинированная строка
|
|
4860
|
-
* @returns country code / код страны
|
|
4861
|
-
*/
|
|
4862
|
-
private toCountry;
|
|
5104
|
+
toStandard(item?: GeoItem, language?: string, raw?: boolean): string;
|
|
4863
5105
|
/**
|
|
4864
|
-
* Internal method to
|
|
5106
|
+
* Internal method to get or initialize the time zone manager instance.
|
|
4865
5107
|
*
|
|
4866
|
-
* Внутренний метод для
|
|
4867
|
-
* @
|
|
4868
|
-
* @returns language code / код языка
|
|
5108
|
+
* Внутренний метод для получения или инициализации экземпляра менеджера часового пояса.
|
|
5109
|
+
* @returns time zone manager instance / экземпляр менеджера часового пояса
|
|
4869
5110
|
*/
|
|
4870
|
-
|
|
5111
|
+
protected getTimezoneObject(): GeoTimezone;
|
|
4871
5112
|
/**
|
|
4872
|
-
* Internal method to
|
|
5113
|
+
* Internal method to update current geo item.
|
|
4873
5114
|
*
|
|
4874
|
-
* Внутренний метод для
|
|
4875
|
-
* @
|
|
4876
|
-
* @param code country code, full form language-country or one of them / код страны, полный вид язык-страна или один из них
|
|
4877
|
-
* @returns full geo item data / полные данные гео-объекта
|
|
5115
|
+
* Внутренний метод для обновления текущего гео-объекта.
|
|
5116
|
+
* @returns void / ничего не возвращает
|
|
4878
5117
|
*/
|
|
4879
|
-
|
|
5118
|
+
protected updateItem(): void;
|
|
4880
5119
|
}
|
|
4881
5120
|
|
|
4882
5121
|
/**
|
|
@@ -5260,6 +5499,211 @@ export declare interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
|
5260
5499
|
locationLanguage: string;
|
|
5261
5500
|
}
|
|
5262
5501
|
|
|
5502
|
+
/**
|
|
5503
|
+
* Class for managing and querying the global list of geographical countries and locales.
|
|
5504
|
+
* Maintains an absolute deep copy of the media geo database shared across SSR requests.
|
|
5505
|
+
*
|
|
5506
|
+
* Класс для управления и запроса глобального списка географических стран и локалей.
|
|
5507
|
+
* Поддерживает абсолютную глубокую копию гео-базы данных media, общую для запросов в SSR.
|
|
5508
|
+
*/
|
|
5509
|
+
export declare class GeoList {
|
|
5510
|
+
/**
|
|
5511
|
+
* Cached deep copy of the global country list /
|
|
5512
|
+
* Кэшированная глубокая копия глобального списка стран
|
|
5513
|
+
*/
|
|
5514
|
+
protected static list?: GeoItem[];
|
|
5515
|
+
/**
|
|
5516
|
+
* Protected constructor for static utility class /
|
|
5517
|
+
* Защищенный конструктор для статического утилитного класса
|
|
5518
|
+
*/
|
|
5519
|
+
protected constructor();
|
|
5520
|
+
/**
|
|
5521
|
+
* Returns the list of countries, creating an absolute deep copy on first access.
|
|
5522
|
+
* Shared globally across the application and SSR requests.
|
|
5523
|
+
*
|
|
5524
|
+
* Возвращает список стран, создавая абсолютную глубокую копию при первом обращении.
|
|
5525
|
+
* Является общим глобально для всего приложения и SSR-запросов.
|
|
5526
|
+
* @returns list of geo items / список гео-объектов
|
|
5527
|
+
*/
|
|
5528
|
+
static get(): GeoItem[];
|
|
5529
|
+
/**
|
|
5530
|
+
* Returns full country data by language and country combination (e.g. 'en-US' or 'RU-ru').
|
|
5531
|
+
*
|
|
5532
|
+
* Возвращает полные данные по комбинации языка и страны (например, 'en-US' или 'RU-ru').
|
|
5533
|
+
* @param [code] string in the form of language-country / строка в виде язык-страна
|
|
5534
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
5535
|
+
*/
|
|
5536
|
+
static getByCodeFull(code?: string): GeoItem | undefined;
|
|
5537
|
+
/**
|
|
5538
|
+
* Returns country data by its primary country code or alternative codes.
|
|
5539
|
+
*
|
|
5540
|
+
* Возвращает данные страны по ее основному коду страны или альтернативным кодам.
|
|
5541
|
+
* @param [country] country code / код страны
|
|
5542
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
5543
|
+
*/
|
|
5544
|
+
static getByCountry(country?: string): GeoItem | undefined;
|
|
5545
|
+
/**
|
|
5546
|
+
* Returns country data by language code or alternative language codes.
|
|
5547
|
+
*
|
|
5548
|
+
* Возвращает данные страны по коду языка или альтернативным кодам языка.
|
|
5549
|
+
* @param [language] language code / код языка
|
|
5550
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
5551
|
+
*/
|
|
5552
|
+
static getByLanguage(language?: string): GeoItem | undefined;
|
|
5553
|
+
/**
|
|
5554
|
+
* Adds or updates country geo data in the list.
|
|
5555
|
+
* Merges with existing country data if found, or creates a new entry.
|
|
5556
|
+
*
|
|
5557
|
+
* Добавляет или обновляет гео-данные страны в списке.
|
|
5558
|
+
* Объединяет с существующими данными страны, если она найдена, или создает новую запись.
|
|
5559
|
+
* @param country country code (e.g., 'US', 'VN') / код страны (например, 'US', 'VN')
|
|
5560
|
+
* @param [item] partial or full geo item data / частичные или полные гео-данные
|
|
5561
|
+
* @returns added or updated geo item / добавленный или обновленный гео-объект
|
|
5562
|
+
*/
|
|
5563
|
+
static add(country: string, item?: Partial<GeoItem>): GeoItem;
|
|
5564
|
+
/**
|
|
5565
|
+
* Adds or updates multiple countries in the geo list.
|
|
5566
|
+
*
|
|
5567
|
+
* Добавляет или обновляет несколько стран в гео-списке.
|
|
5568
|
+
* @param [list] map of country codes to geo items / карта кодов стран к гео-объектам
|
|
5569
|
+
*/
|
|
5570
|
+
static addList(list?: Record<string, Partial<GeoItem>>): void;
|
|
5571
|
+
/**
|
|
5572
|
+
* Resets the cached list to undefined, forcing a fresh deep copy on next access.
|
|
5573
|
+
* Useful for testing and environment resets.
|
|
5574
|
+
*
|
|
5575
|
+
* Сбрасывает кэшированный список в undefined, вызывая создание новой глубокой копии при следующем доступе.
|
|
5576
|
+
* Полезно для тестов и сброса окружения.
|
|
5577
|
+
*/
|
|
5578
|
+
static reset(): void;
|
|
5579
|
+
/**
|
|
5580
|
+
* Finds the index of a country in the list by its country code.
|
|
5581
|
+
*
|
|
5582
|
+
* Находит индекс страны в списке по ее коду страны.
|
|
5583
|
+
* @param [country] country code / код страны
|
|
5584
|
+
* @returns index of the country in the list, or -1 if not found / индекс страны в списке или -1, если не найдена
|
|
5585
|
+
*/
|
|
5586
|
+
protected static getIndex(country?: string): number;
|
|
5587
|
+
/**
|
|
5588
|
+
* Merges and returns the unit configuration object for a country item.
|
|
5589
|
+
*
|
|
5590
|
+
* Объединяет и возвращает объект конфигурации единиц измерения для элемента страны.
|
|
5591
|
+
* @param current current unit configuration / текущая конфигурация единиц измерения
|
|
5592
|
+
* @param override unit configuration overrides / переопределения конфигурации единиц измерения
|
|
5593
|
+
* @returns object containing the merged unit property or an empty object / объект, содержащий объединенное свойство unit, или пустой объект
|
|
5594
|
+
*/
|
|
5595
|
+
protected static getUnit(current?: GeoItem['unit'], override?: GeoItem['unit']): {
|
|
5596
|
+
unit?: GeoItem['unit'];
|
|
5597
|
+
};
|
|
5598
|
+
}
|
|
5599
|
+
|
|
5600
|
+
/**
|
|
5601
|
+
* Class for managing and resolving the current location code within Geo.
|
|
5602
|
+
* Handles persistence in DataStorage and Cookie, DOM fallback detection, and default fallbacks.
|
|
5603
|
+
*
|
|
5604
|
+
* Класс для управления и определения текущего кода локации внутри Geo.
|
|
5605
|
+
* Обрабатывает сохранение в DataStorage и Cookie, определение по DOM и значения по умолчанию.
|
|
5606
|
+
*/
|
|
5607
|
+
export declare class GeoLocation {
|
|
5608
|
+
protected valueDefault?: string | (() => string | undefined) | undefined;
|
|
5609
|
+
/**
|
|
5610
|
+
* Data storage instance for geo code /
|
|
5611
|
+
* Экземпляр хранилища данных для гео-кода
|
|
5612
|
+
*/
|
|
5613
|
+
protected readonly storage: DataStorage<string>;
|
|
5614
|
+
/**
|
|
5615
|
+
* Current location code (e.g., 'en-GB') /
|
|
5616
|
+
* Текущий код локации (например, 'en-GB')
|
|
5617
|
+
*/
|
|
5618
|
+
protected location: string;
|
|
5619
|
+
/**
|
|
5620
|
+
* Constructor for GeoLocation.
|
|
5621
|
+
* Initializes the location from storage, cookies, DOM, or default fallback.
|
|
5622
|
+
*
|
|
5623
|
+
* Конструктор для GeoLocation.
|
|
5624
|
+
* Инициализирует местоположение из хранилища, куки, DOM или значения по умолчанию.
|
|
5625
|
+
* @param valueDefault optional default value or provider / опциональное значение по умолчанию или провайдер
|
|
5626
|
+
*/
|
|
5627
|
+
constructor(valueDefault?: string | (() => string | undefined) | undefined);
|
|
5628
|
+
/**
|
|
5629
|
+
* Returns the current location code string.
|
|
5630
|
+
*
|
|
5631
|
+
* Возвращает строку текущего кода локации.
|
|
5632
|
+
* @returns current location code / текущий код локации
|
|
5633
|
+
*/
|
|
5634
|
+
get(): string;
|
|
5635
|
+
/**
|
|
5636
|
+
* Updates the current location code and optionally persists it in storage and cookie.
|
|
5637
|
+
*
|
|
5638
|
+
* Обновляет текущий код локации и опционально сохраняет его в хранилище и куки.
|
|
5639
|
+
* @param code optional location code (e.g., 'en-GB') / опциональный код локации (например, 'en-GB')
|
|
5640
|
+
* @param save whether to save the location in storage and cookie / нужно ли сохранять местоположение в хранилище и куки
|
|
5641
|
+
* @returns current instance / текущий экземпляр
|
|
5642
|
+
*/
|
|
5643
|
+
set(code?: string, save?: boolean): this;
|
|
5644
|
+
/**
|
|
5645
|
+
* Returns the raw country code extracted from the current location.
|
|
5646
|
+
*
|
|
5647
|
+
* Возвращает сырой код страны, извлеченный из текущей локации.
|
|
5648
|
+
* @returns country code / код страны
|
|
5649
|
+
*/
|
|
5650
|
+
getCountry(): string;
|
|
5651
|
+
/**
|
|
5652
|
+
* Returns the raw language code extracted from the current location.
|
|
5653
|
+
*
|
|
5654
|
+
* Возвращает сырой код языка, извлеченный из текущей локации.
|
|
5655
|
+
* @returns language code / код языка
|
|
5656
|
+
*/
|
|
5657
|
+
getLanguage(): string;
|
|
5658
|
+
/**
|
|
5659
|
+
* Sets the default value or resolver for the location code.
|
|
5660
|
+
*
|
|
5661
|
+
* Устанавливает значение по умолчанию или функцию его вычисления для кода локации.
|
|
5662
|
+
* @param code default code value / значение кода по умолчанию
|
|
5663
|
+
* @returns current instance / текущий экземпляр
|
|
5664
|
+
*/
|
|
5665
|
+
setValueDefault(code?: string | (() => string | undefined)): this;
|
|
5666
|
+
/**
|
|
5667
|
+
* Internal method to get the geo cookie instance.
|
|
5668
|
+
*
|
|
5669
|
+
* Внутренний метод для получения экземпляра куки гео.
|
|
5670
|
+
* @returns cookie instance / экземпляр куки
|
|
5671
|
+
*/
|
|
5672
|
+
protected getCookie(): Cookie<string>;
|
|
5673
|
+
/**
|
|
5674
|
+
* Internal method to determine the initial location.
|
|
5675
|
+
* Resolves in order: Cookie -> DOM sources -> default provider -> DEFAULT_LOCATION.
|
|
5676
|
+
*
|
|
5677
|
+
* Внутренний метод для определения начального местоположения.
|
|
5678
|
+
* Определяет по порядку: Cookie -> источники DOM -> провайдер по умолчанию -> DEFAULT_LOCATION.
|
|
5679
|
+
* @returns initial location code / начальный код локации
|
|
5680
|
+
*/
|
|
5681
|
+
protected findLocation(): string;
|
|
5682
|
+
/**
|
|
5683
|
+
* Internal method to determine the location from document attributes (html lang).
|
|
5684
|
+
*
|
|
5685
|
+
* Внутренний метод для определения местоположения из атрибутов документа (html lang).
|
|
5686
|
+
* @returns location code from document or undefined / код локации из документа или undefined
|
|
5687
|
+
*/
|
|
5688
|
+
protected findLocationDocument(): string | undefined;
|
|
5689
|
+
/**
|
|
5690
|
+
* Internal method to determine the location from DOM-specific sources.
|
|
5691
|
+
* Returns undefined when not in a DOM runtime or when no DOM locale is available.
|
|
5692
|
+
*
|
|
5693
|
+
* Внутренний метод для определения местоположения из DOM-источников.
|
|
5694
|
+
* Возвращает undefined вне DOM-окружения или при отсутствии локали в DOM.
|
|
5695
|
+
* @returns location code from DOM or undefined / код локации из DOM или undefined
|
|
5696
|
+
*/
|
|
5697
|
+
protected findLocationDom(): string | undefined;
|
|
5698
|
+
/**
|
|
5699
|
+
* Internal method to determine the location from navigator properties.
|
|
5700
|
+
*
|
|
5701
|
+
* Внутренний метод для определения местоположения из свойств navigator.
|
|
5702
|
+
* @returns location code from navigator or undefined / код локации из navigator или undefined
|
|
5703
|
+
*/
|
|
5704
|
+
protected findLocationNavigator(): string | undefined;
|
|
5705
|
+
}
|
|
5706
|
+
|
|
5263
5707
|
/**
|
|
5264
5708
|
* A class for storing and processing phone number masks.
|
|
5265
5709
|
*
|
|
@@ -5419,6 +5863,62 @@ export declare interface GeoPhoneValue {
|
|
|
5419
5863
|
value: string;
|
|
5420
5864
|
}
|
|
5421
5865
|
|
|
5866
|
+
/**
|
|
5867
|
+
* Class for managing and formatting time zone offsets within a GeoInstance.
|
|
5868
|
+
* Stores the offset in minutes following Date.prototype.getTimezoneOffset() semantics
|
|
5869
|
+
* (negative for zones east of UTC, positive for zones west of UTC).
|
|
5870
|
+
*
|
|
5871
|
+
* Класс для управления и форматирования смещения часового пояса внутри GeoInstance.
|
|
5872
|
+
* Хранит смещение в минутах по семантике Date.prototype.getTimezoneOffset()
|
|
5873
|
+
* (отрицательное для зон восточнее UTC, положительное для зон западнее UTC).
|
|
5874
|
+
*/
|
|
5875
|
+
export declare class GeoTimezone {
|
|
5876
|
+
/**
|
|
5877
|
+
* Current time zone offset in minutes /
|
|
5878
|
+
* Текущее смещение часового пояса в минутах
|
|
5879
|
+
*/
|
|
5880
|
+
protected value: number;
|
|
5881
|
+
/**
|
|
5882
|
+
* Constructor for GeoTimezone.
|
|
5883
|
+
* Initializes the time zone offset in minutes.
|
|
5884
|
+
*
|
|
5885
|
+
* Конструктор для GeoTimezone.
|
|
5886
|
+
* Инициализирует смещение часового пояса в минутах.
|
|
5887
|
+
* @param timezone initial time zone offset in minutes / начальное смещение часового пояса в минутах
|
|
5888
|
+
*/
|
|
5889
|
+
constructor(timezone?: number);
|
|
5890
|
+
/**
|
|
5891
|
+
* Returns the current time zone offset in minutes.
|
|
5892
|
+
*
|
|
5893
|
+
* Возвращает текущее смещение часового пояса в минутах.
|
|
5894
|
+
* @returns time zone offset in minutes / смещение часового пояса в минутах
|
|
5895
|
+
*/
|
|
5896
|
+
get(): number;
|
|
5897
|
+
/**
|
|
5898
|
+
* Updates the current time zone offset in minutes.
|
|
5899
|
+
*
|
|
5900
|
+
* Обновляет текущее смещение часового пояса в минутах.
|
|
5901
|
+
* @param timezone new time zone offset in minutes / новое смещение часового пояса в минутах
|
|
5902
|
+
* @returns current instance / текущий экземпляр
|
|
5903
|
+
*/
|
|
5904
|
+
set(timezone: number): this;
|
|
5905
|
+
/**
|
|
5906
|
+
* Returns the current time zone offset as an ISO 8601 formatted string (e.g., '+03:00', '-05:00').
|
|
5907
|
+
*
|
|
5908
|
+
* Возвращает текущее смещение часового пояса в виде отформатированной строки ISO 8601 (например, '+03:00', '-05:00').
|
|
5909
|
+
* @returns formatted time zone string / отформатированная строка часового пояса
|
|
5910
|
+
*/
|
|
5911
|
+
getFormat(): string;
|
|
5912
|
+
/**
|
|
5913
|
+
* Normalizes a raw time zone offset to a finite integer number of minutes.
|
|
5914
|
+
*
|
|
5915
|
+
* Нормализует исходное смещение часового пояса до конечного целого числа минут.
|
|
5916
|
+
* @param timezone raw time zone offset / исходное смещение часового пояса
|
|
5917
|
+
* @returns normalized integer offset / нормализованное целочисленное смещение
|
|
5918
|
+
*/
|
|
5919
|
+
protected normalize(timezone: number): number;
|
|
5920
|
+
}
|
|
5921
|
+
|
|
5422
5922
|
/** Timezone display style options / Опции стиля отображения часового пояса */
|
|
5423
5923
|
export declare type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
|
|
5424
5924
|
|
|
@@ -5683,9 +6183,10 @@ export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>,
|
|
|
5683
6183
|
* Рекомендуется использовать эту функцию только внутри хуков, выполняющихся на клиенте (например, `onMounted` в Vue или `useEffect` in React).
|
|
5684
6184
|
*
|
|
5685
6185
|
* @param format type of date format for output / тип формата даты вывода
|
|
6186
|
+
* @param timeZone add time zone (default: true) / добавить временную зону (по умолчанию: true)
|
|
5686
6187
|
* @returns formatted current date / текущая дата в указанном формате
|
|
5687
6188
|
*/
|
|
5688
|
-
export declare function getCurrentDate(format?: GeoDate): string;
|
|
6189
|
+
export declare function getCurrentDate(format?: GeoDate, timeZone?: boolean): string;
|
|
5689
6190
|
|
|
5690
6191
|
/**
|
|
5691
6192
|
* Returns the current time in milliseconds.
|
|
@@ -5704,13 +6205,21 @@ export declare function getCurrentDate(format?: GeoDate): string;
|
|
|
5704
6205
|
export declare function getCurrentTime(): number;
|
|
5705
6206
|
|
|
5706
6207
|
/**
|
|
5707
|
-
* Returns the first Element in the document that matches the specified selector or the element.
|
|
6208
|
+
* Returns the first Element in the document that matches the specified selector or the element itself.
|
|
6209
|
+
* If Window is passed, returns document.body in DOM runtime.
|
|
6210
|
+
* In non-DOM environments (SSR), returns undefined for selector strings, or returns the provided element reference as-is.
|
|
6211
|
+
* Returns undefined if the element is not found, or if null/undefined is provided.
|
|
5708
6212
|
*
|
|
5709
6213
|
* Возвращает первый Element документа, который соответствует указанному селектору или сам элемент.
|
|
5710
|
-
*
|
|
6214
|
+
* При передаче Window возвращает document.body в DOM-окружении.
|
|
6215
|
+
* В средах без DOM (SSR) возвращает undefined для строковых селекторов или сам переданный элемент без изменений.
|
|
6216
|
+
* Возвращает undefined, если элемент не найден или передан null/undefined.
|
|
6217
|
+
* @template E element or Window type / тип элемента или Window
|
|
6218
|
+
* @template R resolved element type / тип разрешённого элемента
|
|
6219
|
+
* @param element selector for matching, Element, Window, or null / селектор для сопоставления, Element, Window или null
|
|
5711
6220
|
* @returns found element or undefined / найденный элемент или undefined
|
|
5712
6221
|
*/
|
|
5713
|
-
export declare function getElement<E extends ElementOrWindow, R extends
|
|
6222
|
+
export declare function getElement<E extends ElementOrWindow = HTMLElement, R extends ElementResolved<E> = ElementResolved<E>>(element?: ElementOrString<E> | null): R | undefined;
|
|
5714
6223
|
|
|
5715
6224
|
/**
|
|
5716
6225
|
* Returns the identifier (ID) of the element or creates it if the element has no ID.
|
|
@@ -5732,12 +6241,32 @@ export declare function getElementId<E extends ElementOrWindow>(element?: Elemen
|
|
|
5732
6241
|
* @param onload load callback / колбэк успешной загрузки
|
|
5733
6242
|
* @param onerror error callback / колбэк ошибки загрузки
|
|
5734
6243
|
* @returns HTMLImageElement or undefined / HTMLImageElement или undefined
|
|
6244
|
+
*
|
|
6245
|
+
* @remarks
|
|
6246
|
+
* If `image` is a string, this function creates a new in-memory `HTMLImageElement` via `createElement`.
|
|
6247
|
+
* The `onload` and `onerror` event listeners are attached before assigning the `src` attribute.
|
|
6248
|
+
* If `image` is already an `HTMLImageElement`, it is returned directly without modifying its existing listeners.
|
|
6249
|
+
* If `image` is null, undefined, or an invalid non-element value, the function safely returns `undefined`.
|
|
6250
|
+
*
|
|
6251
|
+
* When running in a server-side (SSR / non-DOM) environment, this function always returns `undefined` for string sources.
|
|
6252
|
+
*
|
|
6253
|
+
* The created element is not automatically attached to the DOM tree. If using dynamic Blob URLs (`URL.createObjectURL`),
|
|
6254
|
+
* remember to revoke them in `onload`/`onerror` to prevent memory leaks.
|
|
6255
|
+
*
|
|
6256
|
+
* Если `image` является строкой, функция создаёт новый элемент `HTMLImageElement` в памяти через `createElement`.
|
|
6257
|
+
* Обработчики событий `onload` и `onerror` назначаются до присвоения атрибута `src`.
|
|
6258
|
+
* Если `image` уже является экземпляром `HTMLImageElement`, он возвращается напрямую без изменения существующих обработчиков.
|
|
6259
|
+
* Если `image` равен null, undefined или является недопустимым не-элементом, функция безопасно возвращает `undefined`.
|
|
6260
|
+
*
|
|
6261
|
+
* При выполнении на сервере (в среде SSR / non-DOM) функция всегда возвращает `undefined` для строковых источников.
|
|
6262
|
+
*
|
|
6263
|
+
* Созданный элемент не добавляется в DOM-дерево автоматически. При использовании динамических Blob URL (`URL.createObjectURL`)
|
|
6264
|
+
* не забудьте освободить их в `onload`/`onerror` во избежание утечек памяти.
|
|
5735
6265
|
*/
|
|
5736
|
-
export declare function getElementImage(image?: HTMLImageElement | string, onload?: GetElementImageCallback, onerror?: GetElementImageCallback): HTMLImageElement | undefined;
|
|
6266
|
+
export declare function getElementImage(image?: HTMLImageElement | string | null, onload?: GetElementImageCallback, onerror?: GetElementImageCallback): HTMLImageElement | undefined;
|
|
5737
6267
|
|
|
5738
6268
|
/**
|
|
5739
|
-
* Callback function for image events
|
|
5740
|
-
*
|
|
6269
|
+
* Callback function for image events /
|
|
5741
6270
|
* Функция обратного вызова для событий изображения.
|
|
5742
6271
|
* @param image image element / элемент изображения
|
|
5743
6272
|
* @param event DOM event or error description / событие DOM или описание ошибки
|
|
@@ -5746,34 +6275,42 @@ export declare type GetElementImageCallback = (image: HTMLImageElement, event?:
|
|
|
5746
6275
|
|
|
5747
6276
|
/**
|
|
5748
6277
|
* Returns the value of an element property by its key.
|
|
6278
|
+
* If Window is passed, retrieves the property from document.body in DOM runtime.
|
|
5749
6279
|
*
|
|
5750
6280
|
* Возвращает значение свойства элемента по его ключу.
|
|
6281
|
+
* При передаче Window возвращает значение свойства из document.body в DOM-окружении.
|
|
6282
|
+
* @template E element or Window type / тип элемента или Window
|
|
6283
|
+
* @template K property key type / тип ключа свойства
|
|
6284
|
+
* @template D default value type / тип значения по умолчанию
|
|
5751
6285
|
* @param element checked element / проверяемый элемент
|
|
5752
6286
|
* @param property property key to retrieve / ключ свойства для получения значения
|
|
5753
6287
|
* @param defaultValue returns this parameter if the value is missing / возвращает этот параметр,
|
|
5754
6288
|
* если значение отсутствует
|
|
5755
6289
|
* @returns element value or default value / значение элемента или значение по умолчанию
|
|
5756
6290
|
*/
|
|
5757
|
-
export declare function getElementItem<
|
|
6291
|
+
export declare function getElementItem<E extends ElementOrWindow = HTMLElement, K extends keyof ElementResolved<E> = keyof ElementResolved<E>, D = undefined>(element?: ElementOrString<E> | null, property?: K | string | number, defaultValue?: D): ElementResolved<E>[K] | D;
|
|
5758
6292
|
|
|
5759
6293
|
/**
|
|
5760
|
-
* Returns window or element.
|
|
6294
|
+
* Returns the Window object if window is passed, or the first Element matching the specified selector or element itself.
|
|
6295
|
+
* Unlike getElement, it preserves and returns the Window object directly without resolving it to document.body.
|
|
5761
6296
|
*
|
|
5762
|
-
* Возвращает
|
|
5763
|
-
*
|
|
6297
|
+
* Возвращает объект Window при передаче window, либо первый Element, соответствующий селектору или переданному элементу.
|
|
6298
|
+
* В отличие от getElement, сохраняет и возвращает объект Window напрямую, не разрешая его в document.body.
|
|
6299
|
+
* @template E element or Window type / тип элемента или Window
|
|
6300
|
+
* @param element selector for matching, Element, Window, or null / селектор для сопоставления, Element, Window или null
|
|
5764
6301
|
* @returns window or DOM element, or undefined / окно или DOM-элемент, либо undefined
|
|
5765
6302
|
*/
|
|
5766
|
-
export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
|
|
6303
|
+
export declare function getElementOrWindow<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null): E | undefined;
|
|
5767
6304
|
|
|
5768
6305
|
/**
|
|
5769
6306
|
* Generates a safe script tag for data hydration.
|
|
5770
6307
|
*
|
|
5771
6308
|
* Генерирует безопасный тег скрипта для гидратации данных.
|
|
5772
|
-
* @param id script tag ID /
|
|
6309
|
+
* @param id script tag ID / идентификатор тега скрипта
|
|
5773
6310
|
* @param data data to be stored / данные для хранения
|
|
5774
|
-
* @returns generated script tag string / сгенерированная
|
|
6311
|
+
* @returns generated script tag string / сгенерированная HTML-строка тега скрипта
|
|
5775
6312
|
*/
|
|
5776
|
-
export declare function getElementSafeScript<T = unknown>(id: string, data
|
|
6313
|
+
export declare function getElementSafeScript<T = unknown>(id: string | number, data?: T): string;
|
|
5777
6314
|
|
|
5778
6315
|
/**
|
|
5779
6316
|
* Creates a case-insensitive regular expression for an exact match of a phrase (without anchors).
|
|
@@ -5804,27 +6341,27 @@ export declare function getExp(value: string, flags?: string, pattern?: string):
|
|
|
5804
6341
|
* @param value input value / входное значение
|
|
5805
6342
|
* @returns first element of an array or object / первый элемент массива или объекта
|
|
5806
6343
|
*/
|
|
5807
|
-
export declare function getFirst<T>(value
|
|
6344
|
+
export declare function getFirst<T = undefined>(value?: T | readonly T[] | Record<PropertyKey, T>): T;
|
|
5808
6345
|
|
|
5809
6346
|
/**
|
|
5810
6347
|
* Retrieves and parses JSON data from a script tag in the DOM.
|
|
5811
6348
|
*
|
|
5812
|
-
* Извлекает и парсит JSON
|
|
5813
|
-
* @param id script tag ID /
|
|
5814
|
-
* @param defaultValue default value if not found or invalid / значение по
|
|
5815
|
-
* @param remove remove script after reading / удалить
|
|
6349
|
+
* Извлекает и парсит JSON-данные из тега скрипта в DOM.
|
|
6350
|
+
* @param id script tag ID / идентификатор тега скрипта
|
|
6351
|
+
* @param defaultValue default value if not found or invalid / значение по умолчанию при отсутствии или невалидности
|
|
6352
|
+
* @param remove remove script element from DOM after reading / удалить ли элемент скрипта из DOM после чтения
|
|
5816
6353
|
* @returns parsed data or default value / распарсенные данные или значение по умолчанию
|
|
5817
6354
|
*/
|
|
5818
|
-
export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
|
|
6355
|
+
export declare function getHydrationData<T>(id: string | number, defaultValue: T, remove?: boolean): T;
|
|
5819
6356
|
|
|
5820
6357
|
/**
|
|
5821
|
-
* Returns the source string from an HTMLImageElement or string source.
|
|
6358
|
+
* Returns the source string from an HTMLImageElement, object with src, or string source.
|
|
5822
6359
|
*
|
|
5823
|
-
* Возвращает строку источника из HTMLImageElement или строкового источника.
|
|
5824
|
-
* @param image image element or string source / элемент
|
|
6360
|
+
* Возвращает строку источника из HTMLImageElement, объекта с src или строкового источника.
|
|
6361
|
+
* @param image image element, object with src, or string source / элемент изображения, объект с src или строковый источник
|
|
5825
6362
|
* @returns image source string / строка источника изображения
|
|
5826
6363
|
*/
|
|
5827
|
-
export declare function getImageSrc(image?: HTMLImageElement | string): string;
|
|
6364
|
+
export declare function getImageSrc(image?: HTMLImageElement | Record<string, unknown> | string | null): string;
|
|
5828
6365
|
|
|
5829
6366
|
/**
|
|
5830
6367
|
* Returns data by their path.
|
|
@@ -5852,7 +6389,7 @@ export declare function getKey(event: KeyboardEvent): string | number | undefine
|
|
|
5852
6389
|
* @param value input value / входное значение
|
|
5853
6390
|
* @returns last element of the array or object / последний элемент массива или объекта
|
|
5854
6391
|
*/
|
|
5855
|
-
export declare function getLast<T>(value
|
|
6392
|
+
export declare function getLast<T = undefined>(value?: T | readonly T[] | Record<PropertyKey, T>): T;
|
|
5856
6393
|
|
|
5857
6394
|
/**
|
|
5858
6395
|
* Returns the length or size of various data types including Arrays, Objects, Maps, Sets, and Strings.
|
|
@@ -5949,6 +6486,17 @@ export declare function getObjectNoUndefined<V>(data: readonly V[], exception?:
|
|
|
5949
6486
|
*/
|
|
5950
6487
|
export declare function getObjectNoUndefined<T extends Record<PropertyKey, unknown>>(data: T, exception?: unknown): T;
|
|
5951
6488
|
|
|
6489
|
+
/**
|
|
6490
|
+
* Creates an object without a prototype (Object.create(null)).
|
|
6491
|
+
* Optionally copies properties from the provided data object into the new prototype-less object.
|
|
6492
|
+
*
|
|
6493
|
+
* Создает объект без прототипа (Object.create(null)).
|
|
6494
|
+
* При необходимости копирует свойства из переданного объекта данных в новый объект без прототипа.
|
|
6495
|
+
* @param data optional initial object data / необязательные начальные данные объекта
|
|
6496
|
+
* @returns prototype-less object / объект без прототипа
|
|
6497
|
+
*/
|
|
6498
|
+
export declare function getObjectNull<T = unknown>(data?: Record<string, T>): Record<string, T>;
|
|
6499
|
+
|
|
5952
6500
|
/**
|
|
5953
6501
|
* Returns the object if the object’s values are set.
|
|
5954
6502
|
*
|
|
@@ -6011,11 +6559,11 @@ export declare function getRequestString(request: Record<string, unknown> | read
|
|
|
6011
6559
|
* Строит регистро-независимое `RegExp` для поиска "содержит все слова".
|
|
6012
6560
|
* Каждое слово из строки поиска экранируется и оборачивается в lookahead `(?=.*?слово)`,
|
|
6013
6561
|
* поэтому результат совпадает только если строка содержит все слова (в любом порядке).
|
|
6014
|
-
* @param search search string with one or more space-separated words / строка поиска с одним или несколькими словами через пробел
|
|
6562
|
+
* @param search search string with one or more space-separated words or query value / строка поиска с одним или несколькими словами через пробел или значение запроса
|
|
6015
6563
|
* @param limit maximum search string length / максимальная длина строки поиска
|
|
6016
6564
|
* @returns regular expression for multi-word search / регулярное выражение для поиска по всем словам
|
|
6017
6565
|
*/
|
|
6018
|
-
export declare function getSearchExp(search
|
|
6566
|
+
export declare function getSearchExp(search?: unknown, limit?: number): RegExp;
|
|
6019
6567
|
|
|
6020
6568
|
/**
|
|
6021
6569
|
* Creates a regular expression for a search by words (separating by space).
|
|
@@ -6023,11 +6571,11 @@ export declare function getSearchExp(search: string, limit?: number): RegExp;
|
|
|
6023
6571
|
*
|
|
6024
6572
|
* Создает регулярное выражение для поиска по словам (разделение пробелом).
|
|
6025
6573
|
* Возвращает регистронезависимое и глобальное `RegExp` для строковых запросов или клонирует переданный `RegExp` с сохранением его шаблона и флагов.
|
|
6026
|
-
* @param search search string or
|
|
6574
|
+
* @param search search string, RegExp, or query value / строка поиска, регулярное выражение или значение запроса
|
|
6027
6575
|
* @param limit maximum search string length / максимальная длина строки поиска
|
|
6028
6576
|
* @returns `RegExp` for search / регулярное выражение для поиска
|
|
6029
6577
|
*/
|
|
6030
|
-
export declare function getSeparatingSearchExp(search
|
|
6578
|
+
export declare function getSeparatingSearchExp(search?: unknown, limit?: number): RegExp;
|
|
6031
6579
|
|
|
6032
6580
|
/**
|
|
6033
6581
|
* Returns the unit of measurement for 1 step
|
|
@@ -6236,7 +6784,16 @@ export declare class HashInstance extends UrlInstanceAbstract {
|
|
|
6236
6784
|
* @param key property key / ключ свойства
|
|
6237
6785
|
* @returns true if the object has the own property / true, если у объекта есть собственное свойство
|
|
6238
6786
|
*/
|
|
6239
|
-
export declare function hasKey<K extends PropertyKey, T extends object = Record<K, unknown>>(object: unknown, key: K): object is T & Record<K, unknown>;
|
|
6787
|
+
export declare function hasKey<K extends PropertyKey = PropertyKey, T extends object = Record<K, unknown>>(object: unknown, key: K): object is T & Record<K, unknown>;
|
|
6788
|
+
|
|
6789
|
+
/**
|
|
6790
|
+
* Checks if the object has any own properties.
|
|
6791
|
+
*
|
|
6792
|
+
* Проверяет, есть ли у объекта хотя бы одно собственное свойство.
|
|
6793
|
+
* @param object object to check / объект для проверки
|
|
6794
|
+
* @returns true if the object has own properties / true, если у объекта есть собственные свойства
|
|
6795
|
+
*/
|
|
6796
|
+
export declare function hasKeys<T extends object = Record<PropertyKey, unknown>>(object: unknown): object is T;
|
|
6240
6797
|
|
|
6241
6798
|
/** Highlight match item type / Тип элемента подсветки совпадения */
|
|
6242
6799
|
export declare type HighlightMatchItem = {
|
|
@@ -6450,7 +7007,7 @@ export declare function isApiSuccess<T>(data?: ApiData<T>): boolean;
|
|
|
6450
7007
|
* Checks if the values are arrays.
|
|
6451
7008
|
*
|
|
6452
7009
|
* Проверяет, являются ли значения массивами.
|
|
6453
|
-
* @param value input value/ входное значение
|
|
7010
|
+
* @param value input value / входное значение
|
|
6454
7011
|
* @returns true if array / true, если массив
|
|
6455
7012
|
*/
|
|
6456
7013
|
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
|
@@ -6489,10 +7046,11 @@ export declare function isDomRuntime(): boolean;
|
|
|
6489
7046
|
*
|
|
6490
7047
|
* Проверяет, является ли элемент видимым (не скрыт через CSS и находится в DOM).
|
|
6491
7048
|
* Элемент может находиться за пределами экрана и при этом считаться видимым.
|
|
6492
|
-
* @
|
|
7049
|
+
* @template E element or Window type / тип элемента или Window
|
|
7050
|
+
* @param elementSelectors selectors for matching, an Element, or null / селекторы для сопоставления, Element или null
|
|
6493
7051
|
* @returns true if the element is visible, otherwise false / true, если элемент является видимым, иначе false
|
|
6494
7052
|
*/
|
|
6495
|
-
export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
|
|
7053
|
+
export declare function isElementVisible<E extends ElementOrWindow = HTMLElement>(elementSelectors?: ElementOrString<E> | null): boolean;
|
|
6496
7054
|
|
|
6497
7055
|
/**
|
|
6498
7056
|
* Checks if the pressed key is Enter or Space (WAI-ARIA action key) outside of text inputs.
|
|
@@ -6512,7 +7070,7 @@ export declare function isEnter(event: KeyboardEvent, isInputElement?: boolean):
|
|
|
6512
7070
|
* @param zeroTrue if true, '0' is considered filled / если true, то '0' считается заполненным
|
|
6513
7071
|
* @returns true if filled / true, если заполнено
|
|
6514
7072
|
*/
|
|
6515
|
-
export declare function isFilled<T>(value
|
|
7073
|
+
export declare function isFilled<T>(value?: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
|
|
6516
7074
|
|
|
6517
7075
|
/**
|
|
6518
7076
|
* Checks if the value is an integer or a floating-point number.
|
|
@@ -6527,7 +7085,7 @@ export declare function isFloat(value: unknown): boolean;
|
|
|
6527
7085
|
* Checks if the function is a callback function.
|
|
6528
7086
|
*
|
|
6529
7087
|
* Проверяет, является ли функция обратного вызова.
|
|
6530
|
-
* @param callback the value being checked/ проверяемое значение
|
|
7088
|
+
* @param callback the value being checked / проверяемое значение
|
|
6531
7089
|
* @returns true if function / true, если функция
|
|
6532
7090
|
*/
|
|
6533
7091
|
export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionAnyType>;
|
|
@@ -6574,31 +7132,31 @@ export declare function isMetaKey(event: KeyboardEvent): boolean;
|
|
|
6574
7132
|
* Is the variable equal to null or undefined.
|
|
6575
7133
|
*
|
|
6576
7134
|
* Является ли переменная равной null или undefined.
|
|
6577
|
-
* @param value input value/ входное значение
|
|
7135
|
+
* @param value input value / входное значение
|
|
6578
7136
|
* @returns true if null or undefined / true, если null или undefined
|
|
6579
7137
|
*/
|
|
6580
7138
|
export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
|
|
6581
7139
|
|
|
6582
7140
|
/**
|
|
6583
|
-
* Checks if the value is a number.
|
|
7141
|
+
* Checks if the value is a number, numeric string, or bigint.
|
|
6584
7142
|
*
|
|
6585
|
-
* Проверяет, является ли значение
|
|
6586
|
-
* @param value
|
|
6587
|
-
* @returns true if number / true, если
|
|
7143
|
+
* Проверяет, является ли значение числом, числовой строкой или bigint.
|
|
7144
|
+
* @param value value to check / проверяемое значение
|
|
7145
|
+
* @returns true if number, numeric string, or bigint / true, если число, числовая строка или bigint
|
|
6588
7146
|
*/
|
|
6589
|
-
export declare function isNumber(value
|
|
7147
|
+
export declare function isNumber(value?: unknown): value is number | string | bigint;
|
|
6590
7148
|
|
|
6591
7149
|
/**
|
|
6592
7150
|
* Checks if a value is an object.
|
|
6593
7151
|
*
|
|
6594
7152
|
* Проверяет, является ли значение объектом.
|
|
6595
|
-
* @param value input value/ входное значение
|
|
6596
|
-
* @returns true if object/ true, если объект
|
|
7153
|
+
* @param value input value / входное значение
|
|
7154
|
+
* @returns true if object / true, если объект
|
|
6597
7155
|
*/
|
|
6598
|
-
export declare function isObject<T>(value:
|
|
7156
|
+
export declare function isObject<T = unknown>(value: unknown): value is ObjectItem<T>;
|
|
6599
7157
|
|
|
6600
7158
|
/**
|
|
6601
|
-
* Checks if the value is an object
|
|
7159
|
+
* Checks if the value is an object and not an array.
|
|
6602
7160
|
*
|
|
6603
7161
|
* Проверяет, является ли значение объектом и не является массивом.
|
|
6604
7162
|
* @param value input value / входное значение
|
|
@@ -6623,6 +7181,15 @@ export declare function isOnLine(): boolean;
|
|
|
6623
7181
|
*/
|
|
6624
7182
|
export declare function isPrototypeKey(key: unknown): boolean;
|
|
6625
7183
|
|
|
7184
|
+
/**
|
|
7185
|
+
* Checks if the value is a regular expression (including cross-realm instances).
|
|
7186
|
+
*
|
|
7187
|
+
* Проверяет, является ли значение регулярным выражением (включая межконтекстные экземпляры).
|
|
7188
|
+
* @param value value to check / проверяемое значение
|
|
7189
|
+
* @returns true if value is a regular expression / true, если значение является регулярным выражением
|
|
7190
|
+
*/
|
|
7191
|
+
export declare function isRegExp(value: unknown): value is RegExp;
|
|
7192
|
+
|
|
6626
7193
|
/**
|
|
6627
7194
|
* Checks if a value is selected, comparing against a single target or an array of selected items.
|
|
6628
7195
|
* Supports intelligent numeric equivalence for numbers and numeric strings.
|
|
@@ -6634,7 +7201,7 @@ export declare function isPrototypeKey(key: unknown): boolean;
|
|
|
6634
7201
|
* @param selected target value or array of selected values / целевое значение или массив выбранных значений
|
|
6635
7202
|
* @returns true if selected / true, если выбрано
|
|
6636
7203
|
*/
|
|
6637
|
-
export declare function isSelected<T>(value
|
|
7204
|
+
export declare function isSelected<T = unknown>(value?: T, selected?: unknown): boolean;
|
|
6638
7205
|
|
|
6639
7206
|
/**
|
|
6640
7207
|
* Testing isSelected property for the entire list of values.
|
|
@@ -6658,10 +7225,10 @@ export declare function isShare(): boolean;
|
|
|
6658
7225
|
* Checks if the value is of type string.
|
|
6659
7226
|
*
|
|
6660
7227
|
* Проверяет, является ли значение типом строки.
|
|
6661
|
-
* @param value input value/ входное значение
|
|
7228
|
+
* @param value input value / входное значение
|
|
6662
7229
|
* @returns true if string / true, если строка
|
|
6663
7230
|
*/
|
|
6664
|
-
export declare function isString(value
|
|
7231
|
+
export declare function isString(value?: unknown): value is string;
|
|
6665
7232
|
|
|
6666
7233
|
/**
|
|
6667
7234
|
* Checks if the pressed key is Tab.
|
|
@@ -8356,12 +8923,12 @@ export declare class QueryInstance extends UrlInstanceAbstract {
|
|
|
8356
8923
|
}
|
|
8357
8924
|
|
|
8358
8925
|
/**
|
|
8359
|
-
*
|
|
8926
|
+
* Generates a random integer within the specified range (inclusive).
|
|
8360
8927
|
*
|
|
8361
|
-
* Генерирует случайное
|
|
8362
|
-
* @param min the lowest value to return/ наименьшее значение
|
|
8363
|
-
* @param max the highest value to return/ наибольшее значение
|
|
8364
|
-
* @returns random
|
|
8928
|
+
* Генерирует случайное целое число в указанном диапазоне (включительно).
|
|
8929
|
+
* @param min the lowest value to return / наименьшее возвращаемое значение
|
|
8930
|
+
* @param max the highest value to return / наибольшее возвращаемое значение
|
|
8931
|
+
* @returns random integer within [min, max] / случайное целое число в диапазоне [min, max]
|
|
8365
8932
|
*/
|
|
8366
8933
|
export declare function random(min: number, max: number): number;
|
|
8367
8934
|
|
|
@@ -8376,6 +8943,53 @@ export declare function random(min: number, max: number): number;
|
|
|
8376
8943
|
*/
|
|
8377
8944
|
export declare function removeCommonPrefix(mainString: string, prefix: string, trim?: boolean): string;
|
|
8378
8945
|
|
|
8946
|
+
/**
|
|
8947
|
+
* Removes all HTML/XML tags or specified tags from a string.
|
|
8948
|
+
*
|
|
8949
|
+
* Удаляет все HTML/XML теги или указанные теги из строки.
|
|
8950
|
+
* @param value initial string / исходная строка
|
|
8951
|
+
* @param options configuration options / объект опций
|
|
8952
|
+
* @returns cleaned string without tags / очищенная строка без тегов
|
|
8953
|
+
*
|
|
8954
|
+
* @remarks
|
|
8955
|
+
* When `removeContent` is true (or a list of tags is provided),
|
|
8956
|
+
* executable and styling tags (`<script>`, `<style>`, `<noscript>`) or specified content tags
|
|
8957
|
+
* are silently removed along with their inner content without applying `replacement`.
|
|
8958
|
+
* Other formatting and layout tags preserve their text content, and their tag syntax
|
|
8959
|
+
* is replaced with `replacement`.
|
|
8960
|
+
*
|
|
8961
|
+
* Если `removeContent = true` (или передан список тегов),
|
|
8962
|
+
* исполняемые теги и стили (`<script>`, `<style>`, `<noscript>`) или указанные теги
|
|
8963
|
+
* удаляются молча вместе со своим содержимым без подстановки `replacement`.
|
|
8964
|
+
* Остальные теги форматирования и разметки сохраняют текстовое содержимое, а синтаксис
|
|
8965
|
+
* их тегов заменяется на `replacement`.
|
|
8966
|
+
*
|
|
8967
|
+
* @example
|
|
8968
|
+
* ```ts
|
|
8969
|
+
* removeTag('<p>Hello <b>world</b>!</p>') // => 'Hello world!'
|
|
8970
|
+
* removeTag('<b>Hello</b> <p>world</p>', { tag: 'b' }) // => 'Hello <p>world</p>'
|
|
8971
|
+
* removeTag('<b>Hello</b> <p>world</p>', { tag: ['b', 'p'] }) // => 'Hello world'
|
|
8972
|
+
* removeTag('<p>Hello</p><p>world</p>', { replacement: ' ' }) // => ' Hello world '
|
|
8973
|
+
* removeTag('<p>Hello</p><script>alert(1)</script>') // => 'Hello'
|
|
8974
|
+
* removeTag('<p>Hello</p><script>alert(1)</script>', { removeContent: false }) // => 'Helloalert(1)'
|
|
8975
|
+
* removeTag('<div>Text</div><script>alert(1)</script>', { tag: 'script', removeContent: false }) // => '<div>Text</div>alert(1)'
|
|
8976
|
+
* ```
|
|
8977
|
+
*/
|
|
8978
|
+
export declare function removeTag(value?: string | number | null, options?: RemoveTagOptions): string;
|
|
8979
|
+
|
|
8980
|
+
/**
|
|
8981
|
+
* Options for configuring tag removal in removeTag /
|
|
8982
|
+
* Опции для настройки удаления тегов в removeTag
|
|
8983
|
+
*/
|
|
8984
|
+
export declare interface RemoveTagOptions {
|
|
8985
|
+
/** Tag or list of tags to remove (if omitted, removes all tags) / Тег или список тегов для удаления (если опущен, удаляет все теги) */
|
|
8986
|
+
tag?: string | string[];
|
|
8987
|
+
/** String to replace tags with (not applied to silently removed content blocks) / Строка для замены тегов (не применяется к молча удаляемым блокам содержимого) */
|
|
8988
|
+
replacement?: string;
|
|
8989
|
+
/** Whether to remove content of script, style, and noscript tags, or list of tags / Нужно ли удалять содержимое тегов script, style и noscript, или список тегов */
|
|
8990
|
+
removeContent?: boolean | string | string[];
|
|
8991
|
+
}
|
|
8992
|
+
|
|
8379
8993
|
/**
|
|
8380
8994
|
* Replaces the component name in the text.
|
|
8381
8995
|
*
|
|
@@ -8388,15 +9002,19 @@ export declare function removeCommonPrefix(mainString: string, prefix: string, t
|
|
|
8388
9002
|
export declare function replaceComponentName(text: string | undefined, name: string, componentName: string): string | undefined;
|
|
8389
9003
|
|
|
8390
9004
|
/**
|
|
8391
|
-
*
|
|
9005
|
+
* Recursively merges a target object with elements from a replacement object or array without mutating the source data.
|
|
8392
9006
|
*
|
|
8393
|
-
*
|
|
8394
|
-
* @
|
|
8395
|
-
* @param
|
|
8396
|
-
* @param
|
|
8397
|
-
* @
|
|
9007
|
+
* Рекурсивно объединяет целевой объект с элементами из объекта или массива замены без мутации исходных данных.
|
|
9008
|
+
* @template [I=unknown] item value type / тип значения элементов
|
|
9009
|
+
* @param target the object in which elements are replaced / целевой объект, элементы которого будут заменены
|
|
9010
|
+
* @param replacement object or array from which elements will be extracted / объект или массив, из которого извлекаются элементы для замены
|
|
9011
|
+
* @param [isMerge=true] merge arrays without duplicates or overwrite them / объединять массивы без дубликатов или перезаписывать их
|
|
9012
|
+
* @param [disableCopy=false] disables deep cloning of target (used internally during recursion or for mutable accumulators) / запрещает глубокое копирование target (используется внутри рекурсии или для мутабельных аккумуляторов)
|
|
9013
|
+
* @returns new merged object / новый объединенный объект
|
|
9014
|
+
* @warning This method is intended exclusively for processing plain JSON-like objects and arrays (such as data received via API or configurations); built-in class instances (`Date`, `RegExp`, `Map`, `Set`) and functions are not supported. /
|
|
9015
|
+
* Этот метод предназначен исключительно для обработки простых JSON-подобных объектов и массивов (таких как данные, полученные через API или файлы конфигураций); экземпляры встроенных классов (`Date`, `RegExp`, `Map`, `Set`) и функции не поддерживаются.
|
|
8398
9016
|
*/
|
|
8399
|
-
export declare function replaceRecursive<I>(target
|
|
9017
|
+
export declare function replaceRecursive<I = unknown>(target?: ObjectItem<I> | null, replacement?: ObjectOrArray<I> | readonly I[] | null, isMerge?: boolean, disableCopy?: boolean): ObjectItem<I>;
|
|
8400
9018
|
|
|
8401
9019
|
/**
|
|
8402
9020
|
* A simplified template replacement function for substituting values or function results into `[key]` placeholders.
|
|
@@ -8461,11 +9079,7 @@ export declare function resizeImage(image: HTMLImageElement | string, maxSize?:
|
|
|
8461
9079
|
*/
|
|
8462
9080
|
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string, quality?: number): string | undefined;
|
|
8463
9081
|
|
|
8464
|
-
/**
|
|
8465
|
-
* Resize type for image scaling.
|
|
8466
|
-
*
|
|
8467
|
-
* Тип изменения размера для масштабирования изображения.
|
|
8468
|
-
*/
|
|
9082
|
+
/** Resize type for image scaling / Тип изменения размера для масштабирования изображения */
|
|
8469
9083
|
export declare type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
8470
9084
|
|
|
8471
9085
|
/**
|
|
@@ -8563,6 +9177,17 @@ export declare class ResumableTimer {
|
|
|
8563
9177
|
protected stop(): this;
|
|
8564
9178
|
}
|
|
8565
9179
|
|
|
9180
|
+
/**
|
|
9181
|
+
* Validates and normalizes an external locale code string.
|
|
9182
|
+
* Ensures URL safety and ECMA-402 BCP-47 compatibility.
|
|
9183
|
+
*
|
|
9184
|
+
* Валидирует и нормализует внешнюю строку кода локали.
|
|
9185
|
+
* Обеспечивает безопасность для URL и совместимость со стандартом ECMA-402 BCP-47.
|
|
9186
|
+
* @param code candidate locale code / проверяемый код локали
|
|
9187
|
+
* @returns valid locale code or undefined / валидный код локали или undefined
|
|
9188
|
+
*/
|
|
9189
|
+
export declare function sanitizeLocation(code?: unknown): string | undefined;
|
|
9190
|
+
|
|
8566
9191
|
/**
|
|
8567
9192
|
* Class for getting the scroll width.
|
|
8568
9193
|
*
|
|
@@ -9149,34 +9774,34 @@ export declare class ServerStorage {
|
|
|
9149
9774
|
/** Flag to hide missing storage error / Флаг скрытия ошибки отсутствия хранилища */
|
|
9150
9775
|
protected static hideError?: boolean;
|
|
9151
9776
|
/**
|
|
9152
|
-
*
|
|
9777
|
+
* Checks if a value exists in storage.
|
|
9153
9778
|
*
|
|
9154
|
-
*
|
|
9779
|
+
* Проверяет наличие значения в хранилище.
|
|
9155
9780
|
* @param key unique storage key / уникальный ключ хранилища
|
|
9156
|
-
* @
|
|
9781
|
+
* @returns true if key exists, false otherwise / true, если ключ существует, иначе false
|
|
9782
|
+
*/
|
|
9783
|
+
static has(key: string): boolean;
|
|
9784
|
+
/**
|
|
9785
|
+
* Retrieves a value from storage. If it doesn't exist, creates it using the default value factory or value.
|
|
9786
|
+
*
|
|
9787
|
+
* Извлекает значение из хранилища. Если оно не существует, создает его с помощью фабрики значений по умолчанию или значения.
|
|
9788
|
+
* @param key unique storage key / уникальный ключ хранилища
|
|
9789
|
+
* @param defaultValue default value or function that returns the default value if not found / значение по умолчанию или функция, возвращающая значение по умолчанию, если оно не найдено
|
|
9157
9790
|
* @param hydration whether the value should be included in hydration / должно ли значение быть включено в гидратацию
|
|
9158
9791
|
* @returns stored value / сохраненное значение
|
|
9159
9792
|
*/
|
|
9160
|
-
static get<T = unknown>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
9793
|
+
static get<T = unknown>(key: string, defaultValue?: (() => T) | T, hydration?: boolean): T;
|
|
9161
9794
|
/**
|
|
9162
9795
|
* Saves a value to storage.
|
|
9163
9796
|
*
|
|
9164
9797
|
* Сохраняет значение в хранилище.
|
|
9165
9798
|
* @param key unique storage key / уникальный ключ хранилища
|
|
9166
|
-
* @param value function that returns the value to save / функция, возвращающая значение для сохранения
|
|
9799
|
+
* @param value value or function that returns the value to save / значение или функция, возвращающая значение для сохранения
|
|
9167
9800
|
* @param hydration whether the value should be included in hydration / должно ли значение быть включено в гидратацию
|
|
9168
9801
|
* @param storageList optional storage list / необязательный список хранилища
|
|
9169
9802
|
* @returns saved value / сохраненное значение
|
|
9170
9803
|
*/
|
|
9171
|
-
static set<T = unknown>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
9172
|
-
/**
|
|
9173
|
-
* Checks if a value exists in storage.
|
|
9174
|
-
*
|
|
9175
|
-
* Проверяет наличие значения в хранилище.
|
|
9176
|
-
* @param key unique storage key / уникальный ключ хранилища
|
|
9177
|
-
* @returns boolean / логическое значение
|
|
9178
|
-
*/
|
|
9179
|
-
static has(key: string): boolean;
|
|
9804
|
+
static set<T = unknown>(key: string, value: (() => T) | T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
9180
9805
|
/**
|
|
9181
9806
|
* Sets the visibility of error messages.
|
|
9182
9807
|
*
|
|
@@ -9202,7 +9827,7 @@ export declare class ServerStorage {
|
|
|
9202
9827
|
*
|
|
9203
9828
|
* Инициализирует хранилище слушателем контекста.
|
|
9204
9829
|
* @param listener function that returns the current request context / функция, возвращающая контекст текущего запроса
|
|
9205
|
-
* @returns
|
|
9830
|
+
* @returns ServerStorage class / класс ServerStorage
|
|
9206
9831
|
*/
|
|
9207
9832
|
static init(listener: () => Record<string, unknown> | undefined): typeof ServerStorage;
|
|
9208
9833
|
/**
|
|
@@ -9238,24 +9863,63 @@ export declare class ServerStorage {
|
|
|
9238
9863
|
}
|
|
9239
9864
|
|
|
9240
9865
|
/** Item stored in the server storage / Элемент, хранящийся в серверном хранилище */
|
|
9241
|
-
declare type ServerStorageItem = {
|
|
9866
|
+
export declare type ServerStorageItem = {
|
|
9867
|
+
/** Stored value / Сохраненное значение */
|
|
9242
9868
|
value: unknown;
|
|
9869
|
+
/** Whether the value is included in client hydration / Включено ли значение в клиентскую гидратацию */
|
|
9243
9870
|
hydration: boolean;
|
|
9244
9871
|
};
|
|
9245
9872
|
|
|
9246
9873
|
/** Map of server storage items / Карта элементов серверного хранилища */
|
|
9247
|
-
declare type ServerStorageList = Record<string, ServerStorageItem>;
|
|
9874
|
+
export declare type ServerStorageList = Record<string, ServerStorageItem>;
|
|
9248
9875
|
|
|
9249
9876
|
/**
|
|
9250
9877
|
* Modifies the value of an element identified by its key.
|
|
9251
9878
|
*
|
|
9252
9879
|
* Изменяет значение элемента, определенного ключом.
|
|
9253
|
-
* @
|
|
9880
|
+
* @template E element or Window type / тип элемента или Window
|
|
9881
|
+
* @template K property key type / тип ключа свойства
|
|
9882
|
+
* @template V value type / тип значения
|
|
9883
|
+
* @param element target element or selector / целевой элемент или селектор
|
|
9254
9884
|
* @param index property name, attribute, or style key / имя свойства, атрибута или ключа стилей
|
|
9255
9885
|
* @param value new value / новое значение
|
|
9256
|
-
* @returns modified
|
|
9886
|
+
* @returns true if the item was modified, false otherwise / true, если элемент был изменен, иначе false
|
|
9887
|
+
*/
|
|
9888
|
+
export declare function setElementItem<E extends ElementOrWindow = HTMLElement, K extends keyof E = keyof E, V extends E[K] = E[K]>(element?: ElementOrString<E> | null, index?: K | string, value?: V | Record<string, V> | unknown): boolean;
|
|
9889
|
+
|
|
9890
|
+
/**
|
|
9891
|
+
* Sets or removes an HTML or ARIA attribute on an element.
|
|
9892
|
+
*
|
|
9893
|
+
* Устанавливает или удаляет HTML- или ARIA-атрибут на элементе.
|
|
9894
|
+
* @param element target element or selector / целевой элемент или селектор
|
|
9895
|
+
* @param attribute attribute name / имя атрибута
|
|
9896
|
+
* @param value attribute value or factory function / значение атрибута или функция-фабрика
|
|
9897
|
+
* @returns true if the attribute was processed, false otherwise / true, если атрибут был обработан, иначе false
|
|
9898
|
+
*/
|
|
9899
|
+
export declare function setElementItemAttribute<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, attribute?: string, value?: unknown): boolean;
|
|
9900
|
+
|
|
9901
|
+
/**
|
|
9902
|
+
* Sets a property or merges nested object properties on an element with prototype pollution protection.
|
|
9903
|
+
*
|
|
9904
|
+
* Устанавливает свойство или объединяет свойства вложенного объекта на элементе с защитой от загрязнения прототипа.
|
|
9905
|
+
* @template E element or Window type / тип элемента или Window
|
|
9906
|
+
* @param element target element or selector / целевой элемент или селектор
|
|
9907
|
+
* @param index property name or symbol / имя свойства или символ
|
|
9908
|
+
* @param value property value or factory function / значение свойства или функция-фабрика
|
|
9909
|
+
* @returns true if property was set, false otherwise / true, если свойство было установлено, иначе false
|
|
9910
|
+
*/
|
|
9911
|
+
export declare function setElementItemProperty<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, index?: PropertyKey, value?: unknown): boolean;
|
|
9912
|
+
|
|
9913
|
+
/**
|
|
9914
|
+
* Sets style properties, CSS custom properties, or cssText on an element.
|
|
9915
|
+
*
|
|
9916
|
+
* Устанавливает свойства стиля, переменные CSS или cssText на элементе.
|
|
9917
|
+
* @template E element or Window type / тип элемента или Window
|
|
9918
|
+
* @param element target element, selector, or null / целевой элемент, селектор или null
|
|
9919
|
+
* @param styles style string, styles object, or factory function / строка стилей, объект стилей или функция-фабрика
|
|
9920
|
+
* @returns true if styles were applied, false otherwise / true, если стили были применены, иначе false
|
|
9257
9921
|
*/
|
|
9258
|
-
export declare function
|
|
9922
|
+
export declare function setElementItemStyle<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, styles?: unknown): boolean;
|
|
9259
9923
|
|
|
9260
9924
|
/**
|
|
9261
9925
|
* Modifies data according to its type and settings.
|
|
@@ -9340,17 +10004,20 @@ export declare type SortFunction<T = Record<string, unknown>> = (a: T, b: T, col
|
|
|
9340
10004
|
export declare function sortList<T = Record<string, unknown>>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
|
|
9341
10005
|
|
|
9342
10006
|
/**
|
|
9343
|
-
*
|
|
9344
|
-
*
|
|
10007
|
+
* Copies and recursively merges own enumerable properties from a replacement object into a target object,
|
|
10008
|
+
* optionally replacing a specific entry matched by key or value (`indexStart`) in place while preserving key order and cascade priority.
|
|
9345
10009
|
*
|
|
9346
|
-
*
|
|
9347
|
-
*
|
|
9348
|
-
* @
|
|
9349
|
-
* @param
|
|
9350
|
-
* @param
|
|
9351
|
-
* @
|
|
10010
|
+
* Копирует и рекурсивно объединяет собственные перечисляемые свойства из объекта замены в целевой объект,
|
|
10011
|
+
* опционально заменяя найденную по ключу или значению запись (`indexStart`) на месте с сохранением порядка ключей и приоритета по списку обработки.
|
|
10012
|
+
* @template [I=unknown] item value type / тип значения элементов
|
|
10013
|
+
* @param array target object / целевой объект
|
|
10014
|
+
* @param replacement source object with replacement properties / исходный объект с новыми свойствами
|
|
10015
|
+
* @param indexStart property key or value at which to inject replacement / ключ или значение свойства, начиная с которого выполняется замена
|
|
10016
|
+
* @returns new merged object / новый объединенный объект
|
|
10017
|
+
* @warning This method is intended exclusively for processing plain JSON-like objects (such as data received via API or configurations); built-in class instances (`Date`, `RegExp`, `Map`, `Set`) and functions are not supported. /
|
|
10018
|
+
* Этот метод предназначен исключительно для обработки простых JSON-подобных объектов (таких как данные, полученные через API или файлы конфигураций); экземпляры встроенных классов (`Date`, `RegExp`, `Map`, `Set`) и функции не поддерживаются.
|
|
9352
10019
|
*/
|
|
9353
|
-
export declare function splice<I>(array
|
|
10020
|
+
export declare function splice<I = unknown>(array?: ObjectItem<I> | null, replacement?: ObjectItem<I> | I | null, indexStart?: string | null): ObjectItem<I>;
|
|
9354
10021
|
|
|
9355
10022
|
/**
|
|
9356
10023
|
* A class for working with callback lists for storage.
|
|
@@ -9493,6 +10160,20 @@ export declare function toCamelCase(value?: string): string;
|
|
|
9493
10160
|
*/
|
|
9494
10161
|
export declare function toCamelCaseFirst(value?: string): string;
|
|
9495
10162
|
|
|
10163
|
+
/**
|
|
10164
|
+
* Extracts and validates a country code from a location or country string via GeoList.
|
|
10165
|
+
* Supports BCP-47 subtags (e.g., 'zh-Hans-CN'), case-insensitive tags ('en-gb'),
|
|
10166
|
+
* reversed tags ('RU-ru'), underscore separators ('en_US'), and alternative country codes ('UK', 'BY_BY').
|
|
10167
|
+
*
|
|
10168
|
+
* Извлекает и валидирует код страны из строки локации или страны через GeoList.
|
|
10169
|
+
* Поддерживает BCP-47 субтеги (например, 'zh-Hans-CN'), регистронезависимые теги ('en-gb'),
|
|
10170
|
+
* обратные теги ('RU-ru'), разделители подчеркивания ('en_US') и альтернативные коды стран ('UK', 'BY_BY').
|
|
10171
|
+
* @param code candidate location or country string / строка локации или код страны
|
|
10172
|
+
* @param raw whether to skip GeoList lookup and return raw extracted code / пропускать ли проверку в GeoList и возвращать сырой извлеченный код
|
|
10173
|
+
* @returns 2-letter country code or empty string / двухбуквенный код страны или пустая строка
|
|
10174
|
+
*/
|
|
10175
|
+
export declare function toCountry(code?: unknown, raw?: boolean): string;
|
|
10176
|
+
|
|
9496
10177
|
/**
|
|
9497
10178
|
* Conversion to Date object.
|
|
9498
10179
|
*
|
|
@@ -9502,6 +10183,36 @@ export declare function toCamelCaseFirst(value?: string): string;
|
|
|
9502
10183
|
*/
|
|
9503
10184
|
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
9504
10185
|
|
|
10186
|
+
/**
|
|
10187
|
+
* Finds geographical country and locale data by a language-country code, country code, or language code.
|
|
10188
|
+
*
|
|
10189
|
+
* Находит географические данные страны и локали по коду язык-страна, коду страны или коду языка.
|
|
10190
|
+
* @param code country code, full form language-country or one of them / код страны, полный вид язык-страна или один из них
|
|
10191
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
10192
|
+
*/
|
|
10193
|
+
export declare function toGeoItem(code?: unknown): GeoItem | undefined;
|
|
10194
|
+
|
|
10195
|
+
/**
|
|
10196
|
+
* Transforms a basic geo item into a full geo item with resolved location data and defaults.
|
|
10197
|
+
*
|
|
10198
|
+
* Преобразует базовый гео-объект в полный гео-объект с разрешенными данными локации и значениями по умолчанию.
|
|
10199
|
+
* @param item basic geo item / базовый гео-объект
|
|
10200
|
+
* @param code country code, full form language-country or one of them / код страны, полный вид язык-страна или один из них
|
|
10201
|
+
* @returns full geo item data / полные данные гео-объекта
|
|
10202
|
+
*/
|
|
10203
|
+
export declare function toGeoItemFull(item: GeoItem, code?: string): GeoItemFull;
|
|
10204
|
+
|
|
10205
|
+
/**
|
|
10206
|
+
* Converts a geo item to its standard string representation (language-country).
|
|
10207
|
+
*
|
|
10208
|
+
* Преобразует гео-объект в его стандартное строковое представление (язык-страна).
|
|
10209
|
+
* @param item geo item data / данные гео-объекта
|
|
10210
|
+
* @param language optional language override / опциональное переопределение языка
|
|
10211
|
+
* @param raw whether to skip language processing / не обрабатывать ли язык
|
|
10212
|
+
* @returns standard code string or empty string / строка стандартного кода или пустая строка
|
|
10213
|
+
*/
|
|
10214
|
+
export declare function toGeoStandard(item?: GeoItem, language?: string, raw?: boolean): string;
|
|
10215
|
+
|
|
9505
10216
|
/**
|
|
9506
10217
|
* Converts a string to kebab-case format.
|
|
9507
10218
|
* It converts uppercase letters to lowercase, replaces spaces and other characters with dashes.
|
|
@@ -9514,11 +10225,36 @@ export declare function toDate<T extends Date | number | string>(value?: T): (T
|
|
|
9514
10225
|
export declare function toKebabCase(value?: string): string;
|
|
9515
10226
|
|
|
9516
10227
|
/**
|
|
9517
|
-
*
|
|
10228
|
+
* Extracts and validates a language code from a location or language string via GeoList.
|
|
10229
|
+
* Supports BCP-47 subtags (e.g., 'zh-Hans-CN'), case-insensitive tags ('ru-ru', 'EN-GB'),
|
|
10230
|
+
* 3-letter ISO 639-3 codes ('cmn-SG'), reversed tags ('RU-ru'), and alternative language codes ('ua', 'cz').
|
|
10231
|
+
*
|
|
10232
|
+
* Извлекает и валидирует код языка из строки локации или языка через GeoList.
|
|
10233
|
+
* Поддерживает BCP-47 субтеги (например, 'zh-Hans-CN'), регистронезависимые теги ('ru-ru', 'EN-GB'),
|
|
10234
|
+
* трехбуквенные коды ISO 639-3 ('cmn-SG'), обратные теги ('RU-ru') и альтернативные коды языков ('ua', 'cz').
|
|
10235
|
+
* @param code candidate location or language string / строка локации или код языка
|
|
10236
|
+
* @param raw whether to skip GeoList lookup and return raw extracted code / пропускать ли проверку в GeoList и возвращать сырой извлеченный код
|
|
10237
|
+
* @returns canonical language code or empty string / канонический код языка или пустая строка
|
|
10238
|
+
*/
|
|
10239
|
+
export declare function toLanguage(code?: unknown, raw?: boolean): string;
|
|
10240
|
+
|
|
10241
|
+
/**
|
|
10242
|
+
* Converts a full locale string into a canonical standard locale (aa-AA) format.
|
|
10243
|
+
* Returns an empty string if the input is not a full locale format (missing country or language).
|
|
10244
|
+
*
|
|
10245
|
+
* Преобразует полную строку локали в канонический формат локали (aa-AA).
|
|
10246
|
+
* Возвращает пустую строку, если формат не полный (отсутствует страна или язык).
|
|
10247
|
+
* @param code candidate locale string / строка локали
|
|
10248
|
+
* @returns canonical locale code in 'aa-AA' format or empty string / канонический код локали в формате 'aa-AA' или пустая строка
|
|
10249
|
+
*/
|
|
10250
|
+
export declare function toLocale(code?: unknown): string;
|
|
10251
|
+
|
|
10252
|
+
/**
|
|
10253
|
+
* Converts a value to a finite floating-point number.
|
|
9518
10254
|
* Handles various separators (spaces, commas, dots) and strips non-numeric characters.
|
|
9519
10255
|
* Safe for use in SSR (Server-Side Rendering) environments.
|
|
9520
10256
|
*
|
|
9521
|
-
* Преобразует
|
|
10257
|
+
* Преобразует значение в конечное число с плавающей точкой.
|
|
9522
10258
|
* Обрабатывает различные разделители (пробелы, запятые, точки) и удаляет нечисловые символы.
|
|
9523
10259
|
* Безопасно для использования в SSR (Server-Side Rendering) средах.
|
|
9524
10260
|
*
|
|
@@ -9530,7 +10266,7 @@ export declare function toKebabCase(value?: string): string;
|
|
|
9530
10266
|
* toNumber("1,234.56") // 1234.56
|
|
9531
10267
|
* toNumber("1,234") // 1.234
|
|
9532
10268
|
*/
|
|
9533
|
-
export declare function toNumber(value?:
|
|
10269
|
+
export declare function toNumber(value?: unknown): number;
|
|
9534
10270
|
|
|
9535
10271
|
/**
|
|
9536
10272
|
* Converts the data into a number, taking into account the maximum permissible value.
|
|
@@ -9615,7 +10351,7 @@ export { toString_2 as toString }
|
|
|
9615
10351
|
* transformation('{"a":1}') // { a: 1 }
|
|
9616
10352
|
* transformation('null') // null
|
|
9617
10353
|
*/
|
|
9618
|
-
export declare function transformation<T = unknown>(value
|
|
10354
|
+
export declare function transformation<T = unknown>(value?: unknown, isFunctionCheck?: boolean): T;
|
|
9619
10355
|
|
|
9620
10356
|
/**
|
|
9621
10357
|
* Class for getting the translated text.
|
|
@@ -9745,6 +10481,20 @@ export declare const TRANSLATE_GLOBAL_PREFIX = "global";
|
|
|
9745
10481
|
*/
|
|
9746
10482
|
export declare const TRANSLATE_TIME_OUT = 160;
|
|
9747
10483
|
|
|
10484
|
+
/** Translation batch bound to its original locale / Партия переводов, привязанная к исходной локали */
|
|
10485
|
+
export declare interface TranslateBatch {
|
|
10486
|
+
/** Requested location / Запрошенный регион */
|
|
10487
|
+
readonly location: string;
|
|
10488
|
+
/** Requested language / Запрошенный язык */
|
|
10489
|
+
readonly language: string;
|
|
10490
|
+
/** API path resolved when queued / API-путь, вычисленный при добавлении в очередь */
|
|
10491
|
+
readonly path: string;
|
|
10492
|
+
/** Unique requested codes / Уникальные запрошенные коды */
|
|
10493
|
+
readonly codes: string[];
|
|
10494
|
+
/** Callbacks waiting for this batch / Колбэки, ожидающие завершения партии */
|
|
10495
|
+
readonly resolves: (() => void)[];
|
|
10496
|
+
}
|
|
10497
|
+
|
|
9748
10498
|
/**
|
|
9749
10499
|
* Translation code or a list of translation codes for template replacement/
|
|
9750
10500
|
* Код перевода или список кодов для замены шаблона
|
|
@@ -9783,33 +10533,41 @@ export declare type TranslateDataFileItem = () => Promise<TranslateDataFileList>
|
|
|
9783
10533
|
export declare type TranslateDataFileList = Record<string, string>;
|
|
9784
10534
|
|
|
9785
10535
|
/**
|
|
9786
|
-
* Class for
|
|
10536
|
+
* Class for managing and loading translation files with hierarchical locale resolution and caching.
|
|
10537
|
+
* Resolves translation files using the fallback chain: location -> language -> global prefix.
|
|
9787
10538
|
*
|
|
9788
|
-
* Класс для
|
|
10539
|
+
* Класс для управления и загрузки файлов перевода с иерархическим разрешением локалей и кэшированием.
|
|
10540
|
+
* Разрешает файлы перевода по цепочке отката: регион (location) -> язык (language) -> глобальный префикс (global).
|
|
9789
10541
|
*/
|
|
9790
10542
|
export declare class TranslateFile {
|
|
9791
|
-
protected language: string | (() => string);
|
|
9792
10543
|
protected location: string | (() => string);
|
|
10544
|
+
protected language: string | (() => string);
|
|
9793
10545
|
/** List of files with translations / Список файлов с переводами */
|
|
9794
10546
|
protected files: TranslateDataFile;
|
|
9795
10547
|
/** Data from files / Данные из файлов */
|
|
9796
10548
|
protected data: Record<string, TranslateDataFileList>;
|
|
10549
|
+
/** Active loading promises for deduplication / Активные промисы загрузки для дедупликации */
|
|
10550
|
+
protected promises: Record<string, TranslatePromiseItem>;
|
|
10551
|
+
/** Counter for generating unique request identifiers / Счетчик для генерации уникальных идентификаторов запросов */
|
|
10552
|
+
protected id: number;
|
|
9797
10553
|
/**
|
|
9798
10554
|
* Creates an instance of the class.
|
|
9799
10555
|
*
|
|
9800
10556
|
* Создает экземпляр класса.
|
|
9801
10557
|
* @param data list of files / список файлов
|
|
9802
|
-
* @param language language / язык
|
|
9803
10558
|
* @param location location / местоположение
|
|
10559
|
+
* @param language language / язык
|
|
9804
10560
|
*/
|
|
9805
|
-
constructor(data?: TranslateDataFile,
|
|
10561
|
+
constructor(data?: TranslateDataFile, location?: string | (() => string), language?: string | (() => string));
|
|
9806
10562
|
/**
|
|
9807
|
-
* Checks if there are files for the
|
|
10563
|
+
* Checks if there are files for the specified location or language.
|
|
9808
10564
|
*
|
|
9809
|
-
* Проверяет, есть ли файлы для
|
|
9810
|
-
* @
|
|
10565
|
+
* Проверяет, есть ли файлы для указанного местоположения или языка.
|
|
10566
|
+
* @param location location, current by default / регион, по умолчанию текущий
|
|
10567
|
+
* @param language language, current by default / язык, по умолчанию текущий
|
|
10568
|
+
* @returns true if matching file exists / true, если подходящий файл существует
|
|
9811
10569
|
*/
|
|
9812
|
-
isFile(): boolean;
|
|
10570
|
+
isFile(location?: string, language?: string): boolean;
|
|
9813
10571
|
/**
|
|
9814
10572
|
* Returns the language.
|
|
9815
10573
|
*
|
|
@@ -9825,19 +10583,28 @@ export declare class TranslateFile {
|
|
|
9825
10583
|
*/
|
|
9826
10584
|
getLocation(): string;
|
|
9827
10585
|
/**
|
|
9828
|
-
* Returns a
|
|
10586
|
+
* Returns translations for a fixed location and language, preserving them across asynchronous loading.
|
|
9829
10587
|
*
|
|
9830
|
-
* Возвращает
|
|
10588
|
+
* Возвращает переводы для заданных региона и языка, сохраняя их при асинхронной загрузке.
|
|
10589
|
+
* @param location location, current by default / регион, по умолчанию текущий
|
|
10590
|
+
* @param language language, current by default / язык, по умолчанию текущий
|
|
9831
10591
|
* @returns promise with list of translations / промис со списком переводов
|
|
9832
10592
|
*/
|
|
9833
|
-
getList(): Promise<TranslateDataFileList | undefined>;
|
|
10593
|
+
getList(location?: string, language?: string): Promise<TranslateDataFileList | undefined>;
|
|
9834
10594
|
/**
|
|
9835
|
-
* Adds a list of files with translations.
|
|
10595
|
+
* Adds a list of files with translations and clears stale cache for updated keys.
|
|
9836
10596
|
*
|
|
9837
|
-
* Добавляет список файлов с
|
|
10597
|
+
* Добавляет список файлов с переводами и очищает устаревший кэш для обновляемых ключей.
|
|
9838
10598
|
* @param data list of files / список файлов
|
|
9839
10599
|
*/
|
|
9840
10600
|
add(data: TranslateDataFile): void;
|
|
10601
|
+
/**
|
|
10602
|
+
* Resets the cache of loaded translation data and active promises.
|
|
10603
|
+
*
|
|
10604
|
+
* Сбрасывает кэш загруженных данных переводов и активные промисы.
|
|
10605
|
+
* @returns current instance / текущий экземпляр
|
|
10606
|
+
*/
|
|
10607
|
+
reset(): this;
|
|
9841
10608
|
/**
|
|
9842
10609
|
* Returns a list of translations from the cache.
|
|
9843
10610
|
*
|
|
@@ -9847,26 +10614,30 @@ export declare class TranslateFile {
|
|
|
9847
10614
|
*/
|
|
9848
10615
|
protected getByData(index: string): TranslateDataFileList | undefined;
|
|
9849
10616
|
/**
|
|
9850
|
-
* Returns a list of translations from the file and
|
|
10617
|
+
* Returns a list of translations from the file, deduplicating concurrent loads and caching the result.
|
|
9851
10618
|
*
|
|
9852
|
-
* Возвращает список переводов из
|
|
10619
|
+
* Возвращает список переводов из файла, дедуплицируя параллельные загрузки и кэшируя результат.
|
|
9853
10620
|
* @param index file key / ключ файла
|
|
9854
10621
|
* @returns promise with list of translations or undefined / промис со списком переводов или undefined
|
|
9855
10622
|
*/
|
|
9856
10623
|
protected getByFile(index: string): Promise<TranslateDataFileList | undefined>;
|
|
9857
10624
|
/**
|
|
9858
|
-
* Returns the key for the
|
|
10625
|
+
* Returns the file key for the specified location and language.
|
|
9859
10626
|
*
|
|
9860
|
-
* Возвращает ключ для
|
|
10627
|
+
* Возвращает ключ файла для указанных региона и языка.
|
|
10628
|
+
* @param location location, current by default / регион, по умолчанию текущий
|
|
10629
|
+
* @param language language, current by default / язык, по умолчанию текущий
|
|
9861
10630
|
* @returns file key or undefined / ключ файла или undefined
|
|
9862
10631
|
*/
|
|
9863
|
-
protected getIndex(): string | undefined;
|
|
10632
|
+
protected getIndex(location?: string, language?: string): string | undefined;
|
|
9864
10633
|
}
|
|
9865
10634
|
|
|
9866
10635
|
/**
|
|
9867
10636
|
* Class for getting the translated text.
|
|
10637
|
+
* Queued requests and their cache writes retain the language and location of the original call.
|
|
9868
10638
|
*
|
|
9869
10639
|
* Класс для получения переведенного текста.
|
|
10640
|
+
* Запросы в очереди и запись их результатов в кеш сохраняют язык и регион исходного вызова.
|
|
9870
10641
|
*/
|
|
9871
10642
|
export declare class TranslateInstance {
|
|
9872
10643
|
protected url: string;
|
|
@@ -9874,10 +10645,8 @@ export declare class TranslateInstance {
|
|
|
9874
10645
|
protected readonly files: TranslateFile;
|
|
9875
10646
|
/** List of translations / Список переводов */
|
|
9876
10647
|
protected readonly data: Record<string, string>;
|
|
9877
|
-
/**
|
|
9878
|
-
protected
|
|
9879
|
-
/** List of resolves for promises / Список разрешений для промисов */
|
|
9880
|
-
protected resolveList: (() => void)[];
|
|
10648
|
+
/** Pending batches grouped by language and location / Ожидающие партии, сгруппированные по языку и региону */
|
|
10649
|
+
protected batches: TranslateBatch[];
|
|
9881
10650
|
/** Timeout for getting translations / Таймаут для получения переводов */
|
|
9882
10651
|
protected timeout?: ReturnType<typeof setTimeout>;
|
|
9883
10652
|
/** Flag indicating whether to read from the API / Флаг, указывающий, нужно ли читать из API */
|
|
@@ -9998,25 +10767,29 @@ export declare class TranslateInstance {
|
|
|
9998
10767
|
*
|
|
9999
10768
|
* Получает текст перевода по коду, возвращая первое совпадение из запасных вариантов.
|
|
10000
10769
|
* @param name code name / название кода
|
|
10770
|
+
* @param location requested location / запрошенный регион
|
|
10771
|
+
* @param language requested language / запрошенный язык
|
|
10001
10772
|
* @returns translation text or undefined / текст перевода или undefined
|
|
10002
10773
|
*/
|
|
10003
|
-
protected getText(name: string): string | undefined;
|
|
10774
|
+
protected getText(name: string, location?: string, language?: string): string | undefined;
|
|
10004
10775
|
/**
|
|
10005
10776
|
* Getting the full title for translation.
|
|
10006
10777
|
*
|
|
10007
10778
|
* Получение полного названия для перевода.
|
|
10008
10779
|
* @param name code name / название кода
|
|
10780
|
+
* @param location requested location / запрошенный регион
|
|
10009
10781
|
* @returns full title / полное название
|
|
10010
10782
|
*/
|
|
10011
|
-
protected getName(name: string): string;
|
|
10783
|
+
protected getName(name: string, location?: string): string;
|
|
10012
10784
|
/**
|
|
10013
10785
|
* Getting the title for translation by language.
|
|
10014
10786
|
*
|
|
10015
10787
|
* Получение названия для перевода по языку.
|
|
10016
10788
|
* @param name code name / название кода
|
|
10789
|
+
* @param language requested language / запрошенный язык
|
|
10017
10790
|
* @returns title by language / название по языку
|
|
10018
10791
|
*/
|
|
10019
|
-
protected getNameByLanguage(name: string): string;
|
|
10792
|
+
protected getNameByLanguage(name: string, language?: string): string;
|
|
10020
10793
|
/**
|
|
10021
10794
|
* Getting the title for translation globally.
|
|
10022
10795
|
*
|
|
@@ -10037,9 +10810,11 @@ export declare class TranslateInstance {
|
|
|
10037
10810
|
* Getting the list of translations from the server.
|
|
10038
10811
|
*
|
|
10039
10812
|
* Получение списка переводов с сервера.
|
|
10813
|
+
* @param cache list of requested codes / список запрошенных кодов
|
|
10814
|
+
* @param path API path resolved for the original locale / API-путь, вычисленный для исходной локали
|
|
10040
10815
|
* @returns promise with record of translations / промис с записью переводов
|
|
10041
10816
|
*/
|
|
10042
|
-
protected getResponse(cache
|
|
10817
|
+
protected getResponse(cache: string[], path: string): Promise<Record<string, string>>;
|
|
10043
10818
|
/**
|
|
10044
10819
|
* Replaces the text with the specified values.
|
|
10045
10820
|
*
|
|
@@ -10054,17 +10829,21 @@ export declare class TranslateInstance {
|
|
|
10054
10829
|
*
|
|
10055
10830
|
* Добавление данных по переводу с сервера.
|
|
10056
10831
|
* @param cache list of codes to fetch / список кодов для загрузки
|
|
10832
|
+
* @param location original batch location / исходный регион партии
|
|
10833
|
+
* @param language original batch language / исходный язык партии
|
|
10834
|
+
* @param path API path resolved for the original locale / API-путь, вычисленный для исходной локали
|
|
10057
10835
|
* @returns promise / промис
|
|
10058
10836
|
*/
|
|
10059
|
-
protected make(cache
|
|
10837
|
+
protected make(cache: string[], location: string, language: string, path: string): Promise<void>;
|
|
10060
10838
|
/**
|
|
10061
10839
|
* Adding translation data from the list.
|
|
10062
10840
|
*
|
|
10063
10841
|
* Добавление данных по переводу из списка.
|
|
10064
10842
|
* @param list list of translations / список переводов
|
|
10065
10843
|
* @param cache list of requested codes / список запрошенных кодов
|
|
10844
|
+
* @param location original batch location / исходный регион партии
|
|
10066
10845
|
*/
|
|
10067
|
-
protected makeList(list: Record<string, string>, cache
|
|
10846
|
+
protected makeList(list: Record<string, string>, cache: string[], location: string): void;
|
|
10068
10847
|
}
|
|
10069
10848
|
|
|
10070
10849
|
/**
|
|
@@ -10081,6 +10860,17 @@ export declare type TranslateList<T extends TranslateCode[]> = {
|
|
|
10081
10860
|
[K in T[number] as K extends readonly string[] ? K[0] : K]: string;
|
|
10082
10861
|
};
|
|
10083
10862
|
|
|
10863
|
+
/**
|
|
10864
|
+
* Item for tracking active translation loading promises /
|
|
10865
|
+
* Элемент для отслеживания активных промисов загрузки переводов
|
|
10866
|
+
*/
|
|
10867
|
+
export declare type TranslatePromiseItem = {
|
|
10868
|
+
/** Unique request identifier / Уникальный идентификатор запроса */
|
|
10869
|
+
id: number;
|
|
10870
|
+
/** Loading promise / Промис загрузки */
|
|
10871
|
+
promise: Promise<TranslateDataFileList | undefined>;
|
|
10872
|
+
};
|
|
10873
|
+
|
|
10084
10874
|
/**
|
|
10085
10875
|
* Cookie key for storing the geo code /
|
|
10086
10876
|
* Ключ куки для хранения кода гео
|
|
@@ -10108,10 +10898,11 @@ export declare type Undefined = undefined | null;
|
|
|
10108
10898
|
* Removes duplicate entries in an array.
|
|
10109
10899
|
*
|
|
10110
10900
|
* Удаляет повторяющиеся записи в массиве.
|
|
10111
|
-
* @
|
|
10901
|
+
* @template [T=unknown] element type / тип элементов массива
|
|
10902
|
+
* @param value input array / входной массив
|
|
10112
10903
|
* @returns array without duplicates / массив без дубликатов
|
|
10113
10904
|
*/
|
|
10114
|
-
export declare function uniqueArray<T>(value
|
|
10905
|
+
export declare function uniqueArray<T = unknown>(value?: readonly T[] | null): T[];
|
|
10115
10906
|
|
|
10116
10907
|
/**
|
|
10117
10908
|
* Base abstract class for working with URL-based states (Hash, Query).
|