@dxtmisha/functional-basic 0.12.2 → 0.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.d.ts CHANGED
@@ -107,6 +107,20 @@ export declare class Api {
107
107
  * @param callback function for call/ функция для вызова
108
108
  */
109
109
  static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): Api;
110
+ /**
111
+ * Change the timeout for the request in milliseconds.
112
+ *
113
+ * Изменить таймаут запроса в миллисекундах.
114
+ * @param timeout timeout in milliseconds/ таймаут в миллисекундах
115
+ */
116
+ static setTimeout(timeout: number): Api;
117
+ /**
118
+ * Set config for API.
119
+ *
120
+ * Установить конфигурацию для API.
121
+ * @param config config for API/ конфигурация для API
122
+ */
123
+ static setConfig(config?: ApiConfig): Api;
110
124
  /**
111
125
  * To execute a request.
112
126
  *
@@ -144,6 +158,24 @@ export declare class Api {
144
158
  static delete<T>(request: ApiFetch): Promise<T>;
145
159
  }
146
160
 
161
+ /**
162
+ * API configuration/ Конфигурация API
163
+ */
164
+ export declare type ApiConfig = {
165
+ /** Base URL for API requests/ Базовый URL для API-запросов */
166
+ urlRoot?: string;
167
+ /** Default headers for API requests/ Заголовки по умолчанию для API-запросов */
168
+ headers?: Record<string, string>;
169
+ /** Default request data for API requests/ Данные запроса по умолчанию для API-запросов */
170
+ requestDefault?: Record<string, any>;
171
+ /** Function to call before request/ Функция для вызова перед запросом */
172
+ preparation?: (apiFetch: ApiFetch) => Promise<void>;
173
+ /** Function to call after request/ Функция для вызова после запроса */
174
+ end: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
175
+ /** Timeout for the request in milliseconds/ Таймаут запроса в миллисекундах */
176
+ timeout?: number;
177
+ };
178
+
147
179
  /**
148
180
  * Shape of API response data wrapper/ Структура обёртки данных ответа API
149
181
  */
@@ -241,6 +273,12 @@ export declare type ApiFetch = {
241
273
  devMode?: boolean;
242
274
  /** Suppress error logging/ Подавить логирование ошибок */
243
275
  hideError?: boolean;
276
+ /** Suppress loading/ Подавить загрузку */
277
+ hideLoading?: boolean;
278
+ /** Retry count/ Количество повторов */
279
+ retry?: number;
280
+ /** Retry delay in milliseconds/ Задержка повтора в миллисекундах */
281
+ retryDelay?: number;
244
282
  /** Custom response processor/ Пользовательский процессор ответа */
245
283
  queryReturn?: (query: Response) => Promise<any>;
246
284
  /** Run global preparation hooks/ Запускать глобальные хуки подготовки */
@@ -249,6 +287,8 @@ export declare type ApiFetch = {
249
287
  globalEnd?: boolean;
250
288
  /** Additional fetch() options/ Дополнительные опции fetch() */
251
289
  init?: RequestInit;
290
+ /** Timeout for the request in milliseconds/ Таймаут запроса в миллисекундах */
291
+ timeout?: number;
252
292
  /** AbortController for canceling the request/ AbortController для отмены запроса */
253
293
  controller?: AbortController;
254
294
  };
@@ -294,11 +334,18 @@ export declare class ApiInstance {
294
334
  protected response: ApiResponse;
295
335
  /** Request modification handler / Обработчик модификации запроса */
296
336
  protected preparation: ApiPreparation;
337
+ /** Loading handler / Обработчик загрузки */
338
+ protected loading: LoadingInstance;
339
+ /** Error handler / Обработчик ошибок */
340
+ protected errorCenter: ErrorCenterInstance;
341
+ /** Timeout for the request in milliseconds/ Таймаут запроса в миллисекундах */
342
+ protected timeout: number;
297
343
  /**
298
344
  * Constructor
299
345
  * @param url base path to the script/ базовый путь к скрипту
346
+ * @param options options for the API instance/ опции для экземпляра API
300
347
  */
301
- constructor(url?: string);
348
+ constructor(url?: string, options?: ApiInstanceOptions);
302
349
  /**
303
350
  * Is the server local.
304
351
  *
@@ -375,6 +422,13 @@ export declare class ApiInstance {
375
422
  * @param callback function for call/ функция для вызова
376
423
  */
377
424
  setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
425
+ /**
426
+ * Change the timeout for the request in milliseconds.
427
+ *
428
+ * Изменить таймаут запроса в миллисекундах.
429
+ * @param timeout timeout in milliseconds/ таймаут в миллисекундах
430
+ */
431
+ setTimeout(timeout: number): this;
378
432
  /**
379
433
  * To execute a request.
380
434
  *
@@ -410,13 +464,22 @@ export declare class ApiInstance {
410
464
  * @param request list of parameters/ список параметров
411
465
  */
412
466
  delete<T>(request: ApiFetch): Promise<T>;
467
+ /**
468
+ * Get retry delay.
469
+ *
470
+ * Получить задержку повтора.
471
+ * @param retryCount count of retries/ количество повторов
472
+ * @param retryDelay delay between retries/ задержка между повторами
473
+ */
474
+ protected getRetryDelay(retryCount: number, retryDelay: number): number;
413
475
  /**
414
476
  * To execute a request.
415
477
  *
416
478
  * Выполнить запрос.
417
479
  * @param apiFetch property of the request/ свойство запроса
480
+ * @param retryCount count of retries/ количество повторов
418
481
  */
419
- protected fetch<T>(apiFetch: ApiFetch): Promise<T>;
482
+ protected fetch<T>(apiFetch: ApiFetch, retryCount?: number): Promise<T>;
420
483
  /**
421
484
  * Reading data from the response.
422
485
  *
@@ -432,7 +495,10 @@ export declare class ApiInstance {
432
495
  * Выполнение запроса.
433
496
  * @param apiFetch property of the request/ свойство запроса
434
497
  */
435
- protected makeQuery(apiFetch: ApiFetch): Promise<Response>;
498
+ protected makeQuery(apiFetch: ApiFetch): Promise<{
499
+ query: Response;
500
+ timeoutId: any;
501
+ }>;
436
502
  /**
437
503
  * Transforms data if needed.
438
504
  *
@@ -449,8 +515,51 @@ export declare class ApiInstance {
449
515
  * @param status status object/ объект статуса
450
516
  */
451
517
  protected makeStatus<T>(data: ApiData<T>, status: ApiStatus): ApiData<T>;
518
+ /**
519
+ * Processing an error.
520
+ *
521
+ * Обработка ошибки.
522
+ * @param error error object/ объект ошибки
523
+ * @param group error group/ группа ошибки
524
+ */
525
+ protected makeError(error: Record<string, any> & {
526
+ name: string;
527
+ }, group?: string): void;
528
+ /**
529
+ * Processing an error query.
530
+ *
531
+ * Обработка ошибки запроса.
532
+ * @param query error query/ ошибка запроса
533
+ */
534
+ protected makeErrorQuery(query: Response): void;
535
+ /**
536
+ * Initialize controller for request.
537
+ *
538
+ * Инициализация контроллера для запроса.
539
+ * @param apiFetch request options/ опции запроса
540
+ * @param fetchInit request initialization/ инициализация запроса
541
+ */
542
+ protected initController(apiFetch: ApiFetch, fetchInit: RequestInit): any;
452
543
  }
453
544
 
545
+ /** Options for the API instance/ Опции для экземпляра API */
546
+ export declare type ApiInstanceOptions = {
547
+ /** Class for working with headers/ Класс для работы с заголовками */
548
+ headersClass?: typeof ApiHeaders;
549
+ /** Class for working with default request parameters/ Класс для работы с параметрами запроса по умолчанию */
550
+ requestDefaultClass?: typeof ApiDefault;
551
+ /** Class for working with status/ Класс для работы со статусом */
552
+ statusClass?: typeof ApiStatus;
553
+ /** Class for working with response/ Класс для работы с ответом */
554
+ responseClass?: typeof ApiResponse;
555
+ /** Class for working with preparation/ Класс для работы с модификацией запроса */
556
+ preparationClass?: typeof ApiPreparation;
557
+ /** Instance of loading handler/ Экземпляр обработчика загрузки */
558
+ loadingClass?: LoadingInstance;
559
+ /** Instance of error handler/ Экземпляр обработчика ошибок */
560
+ errorCenterClass?: ErrorCenterInstance;
561
+ };
562
+
454
563
  /**
455
564
  * Supported HTTP methods type/ Тип HTTP-методов
456
565
  * (derived from ApiMethodItem enum)/ (получен из перечисления ApiMethodItem)
@@ -857,8 +966,9 @@ export declare class BroadcastMessage<Message = any> {
857
966
  * @param name channel name/ название канала
858
967
  * @param callback callback on message received/ колбэк на получение сообщения
859
968
  * @param callbackError callback on message error/ колбэк на ошибку сообщения
969
+ * @param errorCenter error center instance/ экземпляр центра ошибок
860
970
  */
861
- constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined);
971
+ constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
862
972
  /**
863
973
  * Get the channel.
864
974
  *
@@ -1013,6 +1123,14 @@ export declare class CacheStatic {
1013
1123
  static get<T>(name: string, callback: () => T, comparison?: any[]): T;
1014
1124
  }
1015
1125
 
1126
+ /**
1127
+ * Capitalizes the first letter of a string.
1128
+ *
1129
+ * Делает первую букву строки заглавной.
1130
+ * @param value string to capitalize / строка для капитализации
1131
+ */
1132
+ export declare function capitalize(value: string): string;
1133
+
1016
1134
  /**
1017
1135
  * Class for working with cookies.
1018
1136
  *
@@ -1136,6 +1254,7 @@ export declare function createElement<T extends HTMLElement>(parentElement?: HTM
1136
1254
  export declare class DataStorage<T> {
1137
1255
  private name;
1138
1256
  private isSession;
1257
+ private errorCenter;
1139
1258
  /**
1140
1259
  * Changing the prefix in key names. Should be called at the beginning of the code.
1141
1260
  *
@@ -1149,8 +1268,9 @@ export declare class DataStorage<T> {
1149
1268
  * Constructor
1150
1269
  * @param name value name/ название значения
1151
1270
  * @param isSession should we use a session/ использовать ли сессию
1271
+ * @param errorCenter error center instance/ экземпляр центра ошибок
1152
1272
  */
1153
- constructor(name: string, isSession?: boolean);
1273
+ constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
1154
1274
  /**
1155
1275
  * Getting data from local storage.
1156
1276
  *
@@ -1751,6 +1871,254 @@ export declare function encodeAttribute(text: string): string;
1751
1871
  */
1752
1872
  export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
1753
1873
 
1874
+ /**
1875
+ * Class for managing error storage and handling.
1876
+ *
1877
+ * Класс для управления хранилищем ошибок и их обработкой.
1878
+ */
1879
+ export declare class ErrorCenter {
1880
+ /** Instance of the error center / Экземпляр центра ошибок */
1881
+ protected static item: ErrorCenterInstance;
1882
+ /**
1883
+ * Checks if a cause with specific code exists.
1884
+ *
1885
+ * Проверяет наличие причины с конкретным кодом.
1886
+ * @param code error code / код ошибки
1887
+ * @param group error group / группа ошибки
1888
+ */
1889
+ static has(code: string, group?: string): boolean;
1890
+ /**
1891
+ * Gets a specific error cause by code and group.
1892
+ *
1893
+ * Получает конкретную причину ошибки по коду и группе.
1894
+ * @param code error code / код ошибки
1895
+ * @param group error group / группа ошибки
1896
+ */
1897
+ static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
1898
+ /**
1899
+ * Returns the instance of the class.
1900
+ *
1901
+ * Возвращает инстанс класса.
1902
+ */
1903
+ static getItem(): ErrorCenterInstance;
1904
+ /**
1905
+ * Adds an error cause to the storage.
1906
+ *
1907
+ * Добавляет причину ошибки в хранилище.
1908
+ * @param cause error cause item / элемент причины ошибки
1909
+ */
1910
+ static add(cause: ErrorCenterCauseItem): ErrorCenter;
1911
+ /**
1912
+ * Adds a list of error causes to the storage.
1913
+ *
1914
+ * Добавляет список причин ошибок в хранилище.
1915
+ * @param causes error causes list / список причин ошибок
1916
+ */
1917
+ static addList(causes: ErrorCenterCauseList): ErrorCenter;
1918
+ /**
1919
+ * Registers a new handler.
1920
+ *
1921
+ * Регистрирует новый обработчик.
1922
+ * @param group target group / целевая группа
1923
+ * @param handler handler callback / обратный вызов обработчика
1924
+ */
1925
+ static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): ErrorCenter;
1926
+ /**
1927
+ * Registers a list of handlers.
1928
+ *
1929
+ * Регистрирует список обработчиков.
1930
+ * @param handlers handlers list / список обработчиков
1931
+ */
1932
+ static addHandlerList(handlers: ErrorCenterHandlerList): ErrorCenter;
1933
+ /**
1934
+ * Triggers error handling for a group.
1935
+ *
1936
+ * Вызывает обработку ошибки для группы.
1937
+ * @param cause error cause details / детали причины ошибки
1938
+ */
1939
+ static on(cause: ErrorCenterCauseItem): ErrorCenter;
1940
+ }
1941
+
1942
+ /**
1943
+ * Interface for an error item / Интерфейс для элемента ошибки
1944
+ */
1945
+ export declare type ErrorCenterCauseItem = {
1946
+ /** Error group / Группа ошибки */
1947
+ group?: ErrorCenterGroup;
1948
+ /** Error code / Код ошибки */
1949
+ code: string;
1950
+ /** Error label / Название ошибки */
1951
+ label?: string;
1952
+ /** Error message / Сообщение ошибки */
1953
+ message?: string;
1954
+ /** Additional details / Дополнительные детали */
1955
+ details?: any;
1956
+ };
1957
+
1958
+ /**
1959
+ * List of error items / Список элементов ошибок
1960
+ */
1961
+ export declare type ErrorCenterCauseList = ErrorCenterCauseItem[];
1962
+
1963
+ /**
1964
+ * Error group identifier / Идентификатор группы ошибок
1965
+ */
1966
+ export declare type ErrorCenterGroup = string | undefined;
1967
+
1968
+ /**
1969
+ * Class for managing and triggering error handlers.
1970
+ *
1971
+ * Класс для управления и вызова обработчиков ошибок.
1972
+ */
1973
+ export declare class ErrorCenterHandler {
1974
+ /** Registered handlers list / Список зарегистрированных обработчиков */
1975
+ protected handlers: ErrorCenterHandlerList;
1976
+ /**
1977
+ * Constructor
1978
+ * @param handlers initial handlers list / начальный список обработчиков
1979
+ */
1980
+ constructor(handlers?: ErrorCenterHandlerList);
1981
+ /**
1982
+ * Checks if handlers exist for a group.
1983
+ *
1984
+ * Проверяет наличие обработчиков для группы.
1985
+ * @param group error group / группа ошибки
1986
+ */
1987
+ has(group: ErrorCenterGroup): boolean;
1988
+ /**
1989
+ * Gets handlers for a group.
1990
+ *
1991
+ * Получает обработчики для группы.
1992
+ * @param group error group / группа ошибки
1993
+ */
1994
+ get(group: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
1995
+ /**
1996
+ * Adds a handler for a specific group.
1997
+ *
1998
+ * Добавляет обработчик для определенной группы.
1999
+ * @param group error group / группа ошибки
2000
+ * @param handler callback function / функция обратного вызова
2001
+ */
2002
+ add(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
2003
+ /**
2004
+ * Adds a list of group-based handlers.
2005
+ *
2006
+ * Добавляет список обработчиков по группам.
2007
+ * @param handlers handlers list / список обработчиков
2008
+ */
2009
+ addList(handlers: ErrorCenterHandlerList): this;
2010
+ /**
2011
+ * Triggers handlers for a group and logs to console.
2012
+ *
2013
+ * Вызывает обработчики для группы и выводит ошибку в консоль.
2014
+ * @param cause error cause details / детали причины ошибки
2015
+ */
2016
+ on(cause: ErrorCenterCauseItem): this;
2017
+ /**
2018
+ * Logs error cause to the console.
2019
+ *
2020
+ * Выводит причину ошибки в консоль.
2021
+ * @param cause error details / детали ошибки
2022
+ */
2023
+ protected toConsole(cause: ErrorCenterCauseItem): this;
2024
+ }
2025
+
2026
+ /**
2027
+ * Callback function for error handling / Функция обратного вызова для обработки ошибок
2028
+ */
2029
+ export declare type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
2030
+
2031
+ /**
2032
+ * Interface for error handler storage / Интерфейс для хранения обработчика ошибок
2033
+ */
2034
+ export declare type ErrorCenterHandlerItem = {
2035
+ /** Targeted error group / Целевая группа ошибок */
2036
+ group?: ErrorCenterGroup;
2037
+ /** List of handlers / Список обработчиков */
2038
+ handlers: ErrorCenterHandlerCallback[];
2039
+ };
2040
+
2041
+ /**
2042
+ * List of error handlers / Список обработчиков ошибок
2043
+ */
2044
+ export declare type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
2045
+
2046
+ /**
2047
+ * Class for managing error storage and handling within an instance.
2048
+ *
2049
+ * Класс для управления хранилищем ошибок и их обработкой внутри экземпляра.
2050
+ */
2051
+ export declare class ErrorCenterInstance {
2052
+ protected handler: ErrorCenterHandler;
2053
+ /** List of stored error causes / Список сохраненных причин ошибок */
2054
+ protected causes: ErrorCenterCauseList;
2055
+ /**
2056
+ * Constructor
2057
+ * @param causes initial list of error causes / начальный список причин ошибок
2058
+ * @param handler handler instance / экземпляр обработчика
2059
+ */
2060
+ constructor(causes?: ErrorCenterCauseList, handler?: ErrorCenterHandler);
2061
+ /**
2062
+ * Checks if a cause with specific code exists.
2063
+ *
2064
+ * Проверяет наличие причины с конкретным кодом.
2065
+ * @param code error code / код ошибки
2066
+ * @param group error group / группа ошибки
2067
+ */
2068
+ has(code: string, group?: string): boolean;
2069
+ /**
2070
+ * Gets a specific error cause by code and group.
2071
+ *
2072
+ * Получает конкретную причину ошибки по коду и группе.
2073
+ * @param code error code / код ошибки
2074
+ * @param group error group / группа ошибки
2075
+ */
2076
+ get(code: string, group?: string): ErrorCenterCauseItem | undefined;
2077
+ /**
2078
+ * Adds an error cause to the storage.
2079
+ *
2080
+ * Добавляет причину ошибки в хранилище.
2081
+ * @param cause error cause item / элемент причины ошибки
2082
+ */
2083
+ add(cause: ErrorCenterCauseItem): this;
2084
+ /**
2085
+ * Adds a list of error causes to the storage.
2086
+ *
2087
+ * Добавляет список причин ошибок в хранилище.
2088
+ * @param causes error causes list / список причин ошибок
2089
+ */
2090
+ addList(causes: ErrorCenterCauseList): this;
2091
+ /**
2092
+ * Registers a new handler.
2093
+ *
2094
+ * Регистрирует новый обработчик.
2095
+ * @param group target group / целевая группа
2096
+ * @param handler handler callback / обратный вызов обработчика
2097
+ */
2098
+ addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
2099
+ /**
2100
+ * Registers a list of handlers.
2101
+ *
2102
+ * Регистрирует список обработчиков.
2103
+ * @param handlers handlers list / список обработчиков
2104
+ */
2105
+ addHandlerList(handlers: ErrorCenterHandlerList): this;
2106
+ /**
2107
+ * Triggers error handling for a group.
2108
+ *
2109
+ * Вызывает обработку ошибки для группы.
2110
+ * @param cause error cause details / детали причины ошибки
2111
+ */
2112
+ on(cause: ErrorCenterCauseItem): this;
2113
+ /**
2114
+ * Merges provided cause with stored cause data.
2115
+ *
2116
+ * Объединяет предоставленную причину с сохраненными данными причины.
2117
+ * @param cause input cause / входная причина
2118
+ */
2119
+ protected assign(cause: ErrorCenterCauseItem): ErrorCenterCauseItem;
2120
+ }
2121
+
1754
2122
  /**
1755
2123
  * Escapes special regex characters in a string so it can be used safely in a RegExp.
1756
2124
  *
@@ -2726,6 +3094,7 @@ export declare type GeoHours = '12' | '24';
2726
3094
  * языка-зависимых функций
2727
3095
  */
2728
3096
  export declare class GeoIntl {
3097
+ private errorCenter;
2729
3098
  /**
2730
3099
  * Returns an instance of the class according to the specified country code.
2731
3100
  *
@@ -2739,8 +3108,9 @@ export declare class GeoIntl {
2739
3108
  * Constructor
2740
3109
  * @param code country code, full form language-country or one of them/
2741
3110
  * код страны, полный вид язык-страна или один из них
3111
+ * @param errorCenter error center instance/ экземпляр центра ошибок
2742
3112
  */
2743
- constructor(code?: string);
3113
+ constructor(code?: string, errorCenter?: ErrorCenterInstance);
2744
3114
  /**
2745
3115
  * Returns country code and language.
2746
3116
  *
@@ -3024,8 +3394,8 @@ export declare interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
3024
3394
  * Класс для хранения и обработка маски телефона.
3025
3395
  */
3026
3396
  export declare class GeoPhone {
3027
- protected static list: GeoPhoneValue[];
3028
- protected static map: Record<string, GeoPhoneMap>;
3397
+ protected static list?: GeoPhoneValue[];
3398
+ protected static map?: Record<string, GeoPhoneMap>;
3029
3399
  /**
3030
3400
  * Getting an object with information about the phone code and country.
3031
3401
  *
@@ -3611,6 +3981,13 @@ export declare class Icons {
3611
3981
  * @param url new file path/ новый путь к файлу
3612
3982
  */
3613
3983
  static setUrl(url: string): void;
3984
+ /**
3985
+ * Changes the configuration.
3986
+ *
3987
+ * Изменяет конфигурацию.
3988
+ * @param config new configuration/ новая конфигурация
3989
+ */
3990
+ static setConfig(config: IconsConfig): void;
3614
3991
  /**
3615
3992
  * Returns the icon name.
3616
3993
  *
@@ -3626,6 +4003,13 @@ export declare class Icons {
3626
4003
  protected static wait(): Promise<void>;
3627
4004
  }
3628
4005
 
4006
+ export declare type IconsConfig = {
4007
+ /** URL to the icons storage / URL к хранилищу иконок */
4008
+ url?: string;
4009
+ /** List of custom icons / Список пользовательских иконок */
4010
+ list?: Record<string, IconsItem>;
4011
+ };
4012
+
3629
4013
  export declare type IconsItem = string | Promise<string | any> | (() => Promise<string | any>);
3630
4014
 
3631
4015
  /** Type for 2D coordinates/ Тип для 2D координат */
@@ -3806,6 +4190,14 @@ export declare function isObject<T>(value: T): value is Extract<T, Record<any, a
3806
4190
  */
3807
4191
  export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, Record<any, any>>, any[] | undefined | null>;
3808
4192
 
4193
+ /**
4194
+ * Check if the device is online.
4195
+ *
4196
+ * Проверка, находится ли устройство в сети.
4197
+ * @returns true if the device is online, false otherwise/true, если устройство в сети, иначе false
4198
+ */
4199
+ export declare function isOnLine(): boolean;
4200
+
3809
4201
  /**
3810
4202
  * Checks if value is in the array selected or if value equals selected, if selected is a string.
3811
4203
  *
@@ -3893,9 +4285,8 @@ export declare type ItemValue<V> = {
3893
4285
  * Класс для работы с глобальной загрузкой.
3894
4286
  */
3895
4287
  export declare class Loading {
3896
- protected static value: number;
3897
- protected static event?: EventItem<Window, CustomEvent>;
3898
- protected static registrationList: LoadingRegistrationItem[];
4288
+ /** Instance of the loading class / Экземпляр класса загрузки */
4289
+ protected static item: LoadingInstance;
3899
4290
  /**
3900
4291
  * Check if the loader is active now.
3901
4292
  *
@@ -3908,6 +4299,12 @@ export declare class Loading {
3908
4299
  * Получить текущее значение загрузки.
3909
4300
  */
3910
4301
  static get(): number;
4302
+ /**
4303
+ * Get instance of the loading class.
4304
+ *
4305
+ * Получить экземпляр класса загрузки.
4306
+ */
4307
+ static getItem(): LoadingInstance;
3911
4308
  /**
3912
4309
  * Shows the loader.
3913
4310
  *
@@ -3940,21 +4337,101 @@ export declare class Loading {
3940
4337
  * @param element element/ элемент
3941
4338
  */
3942
4339
  static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
4340
+ }
4341
+
4342
+ /**
4343
+ * Data for the loading event.
4344
+ *
4345
+ * Данные для события загрузки.
4346
+ */
4347
+ export declare type LoadingDetail = {
4348
+ /** Loading status / Статус загрузки */
4349
+ loading: boolean;
4350
+ };
4351
+
4352
+ /**
4353
+ * Class for working with global loading.
4354
+ *
4355
+ * Класс для работы с глобальной загрузкой.
4356
+ */
4357
+ export declare class LoadingInstance {
4358
+ protected eventName: string;
4359
+ /** Current loading value / Текущее значение загрузки */
4360
+ protected value: number;
4361
+ /** Event item / Элемент события */
4362
+ protected event?: EventItem<Window, CustomEvent>;
4363
+ /** Registration list / Список регистрации */
4364
+ protected registrationList: LoadingRegistrationItem[];
4365
+ /**
4366
+ * Constructor
4367
+ * @param eventName name of the event for tracking loading/ название события для отслеживания загрузки
4368
+ */
4369
+ constructor(eventName?: string);
4370
+ /**
4371
+ * Check if the loader is active now.
4372
+ *
4373
+ * Проверить, активен ли сейчас загрузчик.
4374
+ * @returns returns true if the loader is active/ возвращает true, если загрузчик активен
4375
+ */
4376
+ is(): boolean;
4377
+ /**
4378
+ * Get current loading value.
4379
+ *
4380
+ * Получить текущее значение загрузки.
4381
+ * @returns returns the current loading value/ возвращает текущее значение загрузки
4382
+ */
4383
+ get(): number;
4384
+ /**
4385
+ * Shows the loader.
4386
+ *
4387
+ * Показывает загрузчик.
4388
+ */
4389
+ show(): void;
4390
+ /**
4391
+ * Hides the loader.
4392
+ *
4393
+ * Скрывает загрузчик.
4394
+ */
4395
+ hide(): void;
4396
+ /**
4397
+ * Event registration to listen for data changes.
4398
+ *
4399
+ * Регистрация события для прослушивания изменений данных.
4400
+ * @param listener the object that receives a notification (an object that implements the
4401
+ * Event interface) when an event of the specified type occurs/ объект, который принимает
4402
+ * уведомление, когда событие указанного типа произошло
4403
+ * @param element element/ элемент
4404
+ */
4405
+ registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
4406
+ /**
4407
+ * Unregistration of an event.
4408
+ *
4409
+ * Отмена регистрации события.
4410
+ * @param listener the object that receives a notification (an object that implements the
4411
+ * Event interface) when an event of the specified type occurs/ объект, который принимает
4412
+ * уведомление, когда событие указанного типа произошло
4413
+ * @param element element/ элемент
4414
+ */
4415
+ unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
3943
4416
  /**
3944
4417
  * Calls the event listener.
3945
4418
  *
3946
4419
  * Вызывает слушателя событий.
3947
4420
  */
3948
- protected static dispatch(): void;
4421
+ protected dispatch(): void;
3949
4422
  }
3950
4423
 
3951
- declare type LoadingDetail = {
3952
- loading: boolean;
3953
- };
3954
-
3955
- declare type LoadingRegistrationItem = {
4424
+ /**
4425
+ * Registration item for the loading event.
4426
+ *
4427
+ * Элемент регистрации для события загрузки.
4428
+ */
4429
+ export declare type LoadingRegistrationItem = {
4430
+ /** Event item / Элемент события */
3956
4431
  item: EventItem<Window, CustomEvent, LoadingDetail>;
4432
+ /** Event listener / Слушатель события */
3957
4433
  listener: EventListenerDetail<CustomEvent, LoadingDetail>;
4434
+ /** Element / Элемент */
3958
4435
  element?: ElementOrString<HTMLElement>;
3959
4436
  };
3960
4437
 
@@ -5689,6 +6166,14 @@ export declare function setValues<T>(selected: T | T[] | undefined, value: any,
5689
6166
  notEmpty?: boolean | undefined;
5690
6167
  }): T | T[] | undefined;
5691
6168
 
6169
+ /**
6170
+ * Pause execution for a specified number of milliseconds.
6171
+ *
6172
+ * Приостановить выполнение на указанное количество миллисекунд.
6173
+ * @param ms milliseconds/ миллисекунды
6174
+ */
6175
+ export declare function sleep(ms: number): Promise<void>;
6176
+
5692
6177
  /**
5693
6178
  * This method is used to copy the values of all enumerable own properties from one source object to a target object.
5694
6179
  * In priority according to the processing list.
@@ -5844,13 +6329,7 @@ export declare function transformation(value: any, isFunction?: boolean): any;
5844
6329
  * Класс для получения переведенного текста.
5845
6330
  */
5846
6331
  export declare class Translate {
5847
- protected static url: string;
5848
- protected static propsName: string;
5849
- protected static readonly data: Record<string, string>;
5850
- protected static cache: string[];
5851
- protected static resolveList: (() => void)[];
5852
- protected static timeout?: any;
5853
- protected static isReadApi: boolean;
6332
+ protected static item: TranslateInstance;
5854
6333
  /**
5855
6334
  * Getting the translation text by its code.
5856
6335
  *
@@ -5859,6 +6338,12 @@ export declare class Translate {
5859
6338
  * @param replacement If set, replaces the text with the specified values/ если установлено, заменяет текст на указанные значения
5860
6339
  */
5861
6340
  static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
6341
+ /**
6342
+ * Returns an instance of the class.
6343
+ *
6344
+ * Возвращает экземпляр класса.
6345
+ */
6346
+ static getItem(): TranslateInstance;
5862
6347
  /**
5863
6348
  * Getting the translation text by its code (Sync).
5864
6349
  *
@@ -5943,109 +6428,60 @@ export declare class Translate {
5943
6428
  */
5944
6429
  static setReadApi(value: boolean): Translate;
5945
6430
  /**
5946
- * Checks for translation by code, taking into account fallback options.
5947
- *
5948
- * Проверяет наличие перевода по коду с учетом запасных вариантов.
5949
- * @param name code name/ название кода
5950
- */
5951
- protected static hasName(name: string): boolean;
5952
- /**
5953
- * Retrieves translation text by code, returning the first matching fallback.
5954
- *
5955
- * Получает текст перевода по коду, возвращая первое совпадение из запасных вариантов.
5956
- * @param name code name/ название кода
5957
- */
5958
- protected static getText(name: string): string | undefined;
5959
- /**
5960
- * Getting the full title for translation.
5961
- *
5962
- * Получение полного названия для перевода.
5963
- * @param name code name/ название кода
5964
- */
5965
- protected static getName(name: string): string;
5966
- /**
5967
- * Getting the title for translation by language.
5968
- *
5969
- * Получение названия для перевода по языку.
5970
- * @param name code name/ название кода
5971
- */
5972
- protected static getNameByLanguage(name: string): string;
5973
- /**
5974
- * Getting the title for translation globally.
5975
- *
5976
- * Получение названия для перевода глобально.
5977
- * @param name code name/ название кода
5978
- */
5979
- protected static getNameByGlobal(name: string): string;
5980
- /**
5981
- * Returns a list of names that are not yet in the list.
5982
- *
5983
- * Возвращает список имен, которых еще нет в списке.
5984
- * @param names list of codes to get translations/ список кодов для получения переводов
5985
- */
5986
- protected static getNamesNone(names: string | string[]): string[];
5987
- /**
5988
- * Getting the list of translations from the server.
5989
- *
5990
- * Получение списка переводов с сервера.
5991
- */
5992
- protected static getResponse(): Promise<Record<string, string>>;
5993
- /**
5994
- * Replaces the text with the specified values.
5995
- *
5996
- * Заменяет текст на указанные значения.
5997
- * @param text text to replace/ текст для замены
5998
- * @param replacement values for replacement/ значения для замены
5999
- */
6000
- protected static replacement(text: string, replacement?: string[] | Record<string, string | number>): any;
6001
- /**
6002
- * Adding translation data from the server.
6431
+ * Set the configuration for the translation.
6003
6432
  *
6004
- * Добавление данных по переводу с сервера.
6433
+ * Установить конфигурацию для перевода.
6434
+ * @param config configuration/ конфигурация
6005
6435
  */
6006
- protected static make(): Promise<void>;
6007
- /**
6008
- * Adding translation data from the list.
6009
- *
6010
- * Добавление данных по переводу из списка.
6011
- * @param list list of translations/ список переводов
6012
- */
6013
- protected static makeList(list: Record<string, string>): void;
6436
+ static setConfig(config: TranslateConfig): Translate;
6014
6437
  }
6015
6438
 
6016
6439
  /**
6017
- * Prefix for global translations.
6018
- * Префикс для глобальных переводов.
6440
+ * Prefix for global translations/
6441
+ * Префикс для глобальных переводов
6019
6442
  */
6020
6443
  export declare const TRANSLATE_GLOBAL_PREFIX = "global";
6021
6444
 
6022
6445
  /**
6023
- * Request timeout for batch loading (ms).
6024
- * Таймаут запроса для пакетной загрузки (мс).
6446
+ * Request timeout for batch loading (ms)/
6447
+ * Таймаут запроса для пакетной загрузки (мс)
6025
6448
  */
6026
6449
  export declare const TRANSLATE_TIME_OUT = 160;
6027
6450
 
6028
6451
  /**
6029
- * Translation code or a list of translation codes for template replacement.
6030
- * Код перевода или список кодов для замены шаблона.
6452
+ * Translation code or a list of translation codes for template replacement/
6453
+ * Код перевода или список кодов для замены шаблона
6031
6454
  */
6032
6455
  export declare type TranslateCode = string | string[];
6033
6456
 
6034
6457
  /**
6035
- * A mapping of locale strings to their respective translation file loaders.
6036
- * Сопоставление строк локалей и соответствующих им загрузчиков файлов перевода.
6458
+ * Interface for the functional plugin options /
6459
+ * Интерфейс для опций функционального плагина
6460
+ */
6461
+ export declare type TranslateConfig = {
6462
+ /** URL to the translations script / URL к скрипту переводов */
6463
+ url?: string;
6464
+ /** Property name for translations / Имя свойства для переводов */
6465
+ propsName?: string;
6466
+ /** Read translations from API / Читать переводы из API */
6467
+ readApi?: boolean;
6468
+ };
6469
+
6470
+ /**
6471
+ * A mapping of locale strings to their respective translation file loaders/
6472
+ * Сопоставление строк локалей и соответствующих им загрузчиков файлов перевода
6037
6473
  */
6038
6474
  export declare type TranslateDataFile = Record<string, TranslateDataFileItem>;
6039
6475
 
6040
6476
  /**
6041
- * Asynchronous loader function for a translation file.
6042
- * Асинхронная функция-загрузчик для файла перевода.
6477
+ * Asynchronous loader function for a translation file/
6478
+ * Асинхронная функция-загрузчик для файла перевода
6043
6479
  */
6044
6480
  export declare type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
6045
6481
 
6046
6482
  /**
6047
- * A simple key-value record of translations from a file.
6048
- * Простой рекорд «ключ-значение» с переводами из файла.
6483
+ * A simple key-value record of translations from a file/
6484
+ * Простой рекорд «ключ-значение» с переводами из файла
6049
6485
  */
6050
6486
  export declare type TranslateDataFileList = Record<string, string>;
6051
6487
 
@@ -6055,60 +6491,273 @@ export declare type TranslateDataFileList = Record<string, string>;
6055
6491
  * Класс для работы с файлами перевода.
6056
6492
  */
6057
6493
  export declare class TranslateFile {
6494
+ protected language: string | (() => string);
6495
+ protected location: string | (() => string);
6058
6496
  /** List of files with translations/ Список файлов с переводами */
6059
- protected static files: TranslateDataFile;
6497
+ protected files: TranslateDataFile;
6060
6498
  /** Data from files/ Данные из файлов */
6061
- protected static data: Record<string, TranslateDataFileList>;
6499
+ protected data: Record<string, TranslateDataFileList>;
6500
+ /**
6501
+ * Creates an instance of the class.
6502
+ *
6503
+ * Создает экземпляр класса.
6504
+ * @param data list of files/ список файлов
6505
+ * @param language language/ язык
6506
+ * @param location location/ местоположение
6507
+ */
6508
+ constructor(data?: TranslateDataFile, language?: string | (() => string), location?: string | (() => string));
6062
6509
  /**
6063
6510
  * Checks if there are files for the current location.
6064
6511
  *
6065
6512
  * Проверяет, есть ли файлы для текущего местоположения.
6066
6513
  */
6067
- static isFile(): boolean;
6514
+ isFile(): boolean;
6515
+ /**
6516
+ * Returns the location.
6517
+ *
6518
+ * Возвращает местоположение.
6519
+ */
6520
+ getLocation(): string;
6521
+ /**
6522
+ * Returns the language.
6523
+ *
6524
+ * Возвращает язык.
6525
+ */
6526
+ getLanguage(): string;
6068
6527
  /**
6069
6528
  * Returns a list of translations from the file for the current location.
6070
6529
  *
6071
6530
  * Возвращает список переводов из файла для текущего местоположения.
6072
6531
  */
6073
- static getList(): Promise<TranslateDataFileList | undefined>;
6532
+ getList(): Promise<TranslateDataFileList | undefined>;
6074
6533
  /**
6075
6534
  * Adds a list of files with translations.
6076
6535
  *
6077
6536
  * Добавляет список файлов с переводами.
6078
6537
  * @param data list of files/ список файлов
6079
6538
  */
6080
- static add(data: TranslateDataFile): void;
6539
+ add(data: TranslateDataFile): void;
6081
6540
  /**
6082
6541
  * Returns the key for the current location from the list of files.
6083
6542
  *
6084
6543
  * Возвращает ключ для текущего местоположения из списка файлов.
6085
6544
  */
6086
- protected static getIndex(): string | undefined;
6545
+ protected getIndex(): string | undefined;
6087
6546
  /**
6088
6547
  * Returns a list of translations from the cache.
6089
6548
  *
6090
6549
  * Возвращает список переводов из кэша.
6091
6550
  * @param index file key/ ключ файла
6092
6551
  */
6093
- protected static getByData(index: string): TranslateDataFileList | undefined;
6552
+ protected getByData(index: string): TranslateDataFileList | undefined;
6094
6553
  /**
6095
6554
  * Returns a list of translations from the file and caches the result.
6096
6555
  *
6097
6556
  * Возвращает список переводов из файла и кэширует результат.
6098
6557
  * @param index file key/ ключ файла
6099
6558
  */
6100
- protected static getByFile(index: string): Promise<TranslateDataFileList | undefined>;
6559
+ protected getByFile(index: string): Promise<TranslateDataFileList | undefined>;
6560
+ }
6561
+
6562
+ /**
6563
+ * Class for getting the translated text.
6564
+ *
6565
+ * Класс для получения переведенного текста.
6566
+ */
6567
+ export declare class TranslateInstance {
6568
+ protected url: string;
6569
+ protected propsName: string;
6570
+ protected readonly files: TranslateFile;
6571
+ /** List of translations/ Список переводов */
6572
+ protected readonly data: Record<string, string>;
6573
+ /** Cache of codes to get/ Кэш кодов для получения */
6574
+ protected cache: string[];
6575
+ /** List of resolves for promises/ Список разрешений для промисов */
6576
+ protected resolveList: (() => void)[];
6577
+ /** Timeout for getting translations/ Таймаут для получения переводов */
6578
+ protected timeout?: any;
6579
+ /** Flag indicating whether to read from the API/ Флаг, указывающий, нужно ли читать из API */
6580
+ protected isReadApi: boolean;
6581
+ /**
6582
+ * Creates an instance of the class.
6583
+ *
6584
+ * Создает экземпляр класса.
6585
+ * @param url URL for getting translations/ URL для получения переводов
6586
+ * @param propsName Property name for getting translations/ Имя свойства для получения переводов
6587
+ * @param files List of files with translations/ Список файлов с переводами
6588
+ */
6589
+ constructor(url?: string, propsName?: string, files?: TranslateFile);
6590
+ /**
6591
+ * Getting the translation text by its code.
6592
+ *
6593
+ * Получение текста перевода по его коду.
6594
+ * @param name code name/ название кода
6595
+ * @param replacement If set, replaces the text with the specified values/ если установлено, заменяет текст на указанные значения
6596
+ */
6597
+ get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
6598
+ /**
6599
+ * Getting the translation text by its code (Sync).
6600
+ *
6601
+ * Получение текста перевода по его коду (Sync).
6602
+ * @param name code name/ название кода
6603
+ * @param first If set to false, returns an empty string if there is no text/
6604
+ * если установлено false, возвращает пустую строку, если нет текста
6605
+ * @param replacement If set, replaces the text with the specified values/
6606
+ * если установлено, заменяет текст на указанные значения
6607
+ */
6608
+ getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
6609
+ /**
6610
+ * Getting a list of translations by an array of text codes.
6611
+ *
6612
+ * Получение списка переводов по массиву кодов текста.
6613
+ * @param names list of codes to get translations/ список кодов для получения переводов
6614
+ */
6615
+ getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
6616
+ /**
6617
+ * Getting a list of translations by an array of text codes.
6618
+ *
6619
+ * Получение списка переводов по массиву кодов текста.
6620
+ * @param names list of codes to get translations/ список кодов для получения переводов
6621
+ * @param first If set to false, returns an empty string if there is no text/
6622
+ * если установлено false, возвращает пустую строку, если нет текста
6623
+ */
6624
+ getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
6625
+ /**
6626
+ * Added a list of translated texts.
6627
+ *
6628
+ * Добавлен список переведенных текстов.
6629
+ * @param names list of codes to get translations/ список кодов для получения переводов
6630
+ */
6631
+ add(names: string | string[]): Promise<void>;
6632
+ /**
6633
+ * Adds texts in sync mode.
6634
+ *
6635
+ * Добавляет тексты в режиме синхронизации.
6636
+ * @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
6637
+ */
6638
+ addSync(data: Record<string, string>): void;
6639
+ /**
6640
+ * Adding data in the form of a query or directly, depending on the execution environment.
6641
+ *
6642
+ * Добавление данных в виде запроса или напрямую, в зависимости от среды выполнения.
6643
+ * @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
6644
+ */
6645
+ addNormalOrSync(data: Record<string, string>): Promise<void>;
6646
+ /**
6647
+ * Adds texts synchronously by location.
6648
+ *
6649
+ * Добавляет тексты синхронно по местоположению.
6650
+ * @param data list of texts by location/ список текстов по местоположению
6651
+ */
6652
+ addSyncByLocation(data: Record<string, Record<string, string>>): void;
6653
+ /**
6654
+ * Adds texts synchronously from the file.
6655
+ *
6656
+ * Добавляет тексты синхронно из файла.
6657
+ * @param data file with translations/ файл с переводами
6658
+ */
6659
+ addSyncByFile(data: TranslateDataFile): void;
6660
+ /**
6661
+ * Change the path to the script for obtaining the translation.
6662
+ *
6663
+ * Изменить путь к скрипту для получения перевода.
6664
+ * @param url path to the script/ путь к скрипту
6665
+ */
6666
+ setUrl(url: string): this;
6667
+ /**
6668
+ * Change the name of the property to get the translation.
6669
+ *
6670
+ * Изменить имя свойства для получения перевода.
6671
+ * @param name property name/ имя свойства
6672
+ */
6673
+ setPropsName(name: string): this;
6674
+ /**
6675
+ * Change the read mode from the API.
6676
+ *
6677
+ * Изменить режим чтения из API.
6678
+ * @param value read mode/ режим чтения
6679
+ */
6680
+ setReadApi(value: boolean): this;
6681
+ /**
6682
+ * Checks for translation by code, taking into account fallback options.
6683
+ *
6684
+ * Проверяет наличие перевода по коду с учетом запасных вариантов.
6685
+ * @param name code name/ название кода
6686
+ */
6687
+ protected hasName(name: string): boolean;
6688
+ /**
6689
+ * Retrieves translation text by code, returning the first matching fallback.
6690
+ *
6691
+ * Получает текст перевода по коду, возвращая первое совпадение из запасных вариантов.
6692
+ * @param name code name/ название кода
6693
+ */
6694
+ protected getText(name: string): string | undefined;
6695
+ /**
6696
+ * Getting the full title for translation.
6697
+ *
6698
+ * Получение полного названия для перевода.
6699
+ * @param name code name/ название кода
6700
+ */
6701
+ protected getName(name: string): string;
6702
+ /**
6703
+ * Getting the title for translation by language.
6704
+ *
6705
+ * Получение названия для перевода по языку.
6706
+ * @param name code name/ название кода
6707
+ */
6708
+ protected getNameByLanguage(name: string): string;
6709
+ /**
6710
+ * Getting the title for translation globally.
6711
+ *
6712
+ * Получение названия для перевода глобально.
6713
+ * @param name code name/ название кода
6714
+ */
6715
+ protected getNameByGlobal(name: string): string;
6716
+ /**
6717
+ * Returns a list of names that are not yet in the list.
6718
+ *
6719
+ * Возвращает список имен, которых еще нет в списке.
6720
+ * @param names list of codes to get translations/ список кодов для получения переводов
6721
+ */
6722
+ protected getNamesNone(names: string | string[]): string[];
6723
+ /**
6724
+ * Getting the list of translations from the server.
6725
+ *
6726
+ * Получение списка переводов с сервера.
6727
+ */
6728
+ protected getResponse(): Promise<Record<string, string>>;
6729
+ /**
6730
+ * Replaces the text with the specified values.
6731
+ *
6732
+ * Заменяет текст на указанные значения.
6733
+ * @param text text to replace/ текст для замены
6734
+ * @param replacement values for replacement/ значения для замены
6735
+ */
6736
+ protected replacement(text: string, replacement?: string[] | Record<string, string | number>): any;
6737
+ /**
6738
+ * Adding translation data from the server.
6739
+ *
6740
+ * Добавление данных по переводу с сервера.
6741
+ */
6742
+ protected make(): Promise<void>;
6743
+ /**
6744
+ * Adding translation data from the list.
6745
+ *
6746
+ * Добавление данных по переводу из списка.
6747
+ * @param list list of translations/ список переводов
6748
+ */
6749
+ protected makeList(list: Record<string, string>): void;
6101
6750
  }
6102
6751
 
6103
6752
  /**
6104
- * Return type for translation retrieval: an object if a list was requested, or a string for a single key.
6105
- * Тип возвращаемого значения для получения перевода: объект, если был запрошен список, или строка для одного ключа.
6753
+ * Return type for translation retrieval: an object if a list was requested, or a string for a single key/
6754
+ * Тип возвращаемого значения для получения перевода: объект, если был запрошен список, или строка для одного ключа
6106
6755
  */
6107
6756
  export declare type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
6108
6757
 
6109
6758
  /**
6110
- * Object with translated strings, where the keys are the names of the translation codes.
6111
- * Объект с переведенными строками, где ключи — имена кодов переводов.
6759
+ * Object with translated strings, where the keys are the names of the translation codes/
6760
+ * Объект с переведенными строками, где ключи — имена кодов переводов
6112
6761
  */
6113
6762
  export declare type TranslateList<T extends TranslateCode[]> = {
6114
6763
  [K in T[number] as K extends readonly string[] ? K[0] : K]: string;