@dxtmisha/functional-basic 1.1.0 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/ai-description.txt +1 -0
- package/ai-types.txt +1062 -951
- package/dist/classes/Api.d.ts +201 -0
- package/dist/classes/ApiCache.d.ts +152 -0
- package/dist/classes/ApiDataReturn.d.ts +76 -0
- package/dist/classes/ApiDefault.d.ts +49 -0
- package/dist/classes/ApiHeaders.d.ts +37 -0
- package/dist/classes/ApiHydration.d.ts +39 -0
- package/dist/classes/ApiInstance.d.ts +283 -0
- package/dist/classes/ApiPreparation.d.ts +58 -0
- package/dist/classes/ApiResponse.d.ts +154 -0
- package/dist/classes/ApiStatus.d.ts +130 -0
- package/dist/classes/BroadcastMessage.d.ts +75 -0
- package/dist/classes/Cache.d.ts +38 -0
- package/dist/classes/CacheItem.d.ts +62 -0
- package/dist/classes/CacheStatic.d.ts +36 -0
- package/dist/classes/Cookie.d.ts +54 -0
- package/dist/classes/CookieBlock.d.ts +30 -0
- package/dist/classes/CookieBlockInstance.d.ts +23 -0
- package/dist/classes/CookieStorage.d.ts +174 -0
- package/dist/classes/DataStorage.d.ts +107 -0
- package/dist/classes/Datetime.d.ts +570 -0
- package/dist/classes/ErrorCenter.d.ts +72 -0
- package/dist/classes/ErrorCenterHandler.d.ts +64 -0
- package/dist/classes/ErrorCenterInstance.d.ts +85 -0
- package/dist/classes/EventItem.d.ts +251 -0
- package/dist/classes/Formatters.d.ts +161 -0
- package/dist/classes/Geo.d.ts +151 -0
- package/dist/classes/GeoFlag.d.ts +98 -0
- package/dist/classes/GeoInstance.d.ts +215 -0
- package/dist/classes/GeoIntl.d.ts +304 -0
- package/dist/classes/GeoPhone.d.ts +108 -0
- package/dist/classes/Global.d.ts +29 -0
- package/dist/classes/Hash.d.ts +57 -0
- package/dist/classes/HashInstance.d.ts +95 -0
- package/dist/classes/Icons.d.ts +128 -0
- package/dist/classes/Loading.d.ts +66 -0
- package/dist/classes/LoadingInstance.d.ts +99 -0
- package/dist/classes/Meta.d.ts +186 -0
- package/dist/classes/MetaManager.d.ts +121 -0
- package/dist/classes/MetaOg.d.ts +115 -0
- package/dist/classes/MetaStatic.d.ts +179 -0
- package/dist/classes/MetaTwitter.d.ts +115 -0
- package/dist/classes/ResumableTimer.d.ts +81 -0
- package/dist/classes/ScrollbarWidth.d.ts +51 -0
- package/dist/classes/SearchList.d.ts +128 -0
- package/dist/classes/SearchListData.d.ts +143 -0
- package/dist/classes/SearchListItem.d.ts +49 -0
- package/dist/classes/SearchListMatcher.d.ts +57 -0
- package/dist/classes/SearchListOptions.d.ts +66 -0
- package/dist/classes/ServerStorage.d.ts +106 -0
- package/dist/classes/StorageCallback.d.ts +84 -0
- package/dist/classes/Translate.d.ts +119 -0
- package/dist/classes/TranslateFile.d.ts +81 -0
- package/dist/classes/TranslateInstance.d.ts +206 -0
- package/dist/functions/addTagHighlightMatch.d.ts +11 -0
- package/dist/functions/anyToString.d.ts +10 -0
- package/dist/functions/applyTemplate.d.ts +10 -0
- package/dist/functions/arrFill.d.ts +9 -0
- package/dist/functions/blobToBase64.d.ts +9 -0
- package/dist/functions/capitalize.d.ts +9 -0
- package/dist/functions/copyObject.d.ts +10 -0
- package/dist/functions/copyObjectLite.d.ts +9 -0
- package/dist/functions/createElement.d.ts +21 -0
- package/dist/functions/domQuerySelector.d.ts +8 -0
- package/dist/functions/domQuerySelectorAll.d.ts +8 -0
- package/dist/functions/encodeAttribute.d.ts +8 -0
- package/dist/functions/encodeLiteAttribute.d.ts +8 -0
- package/dist/functions/ensureMaxSize.d.ts +10 -0
- package/dist/functions/escapeExp.d.ts +7 -0
- package/dist/functions/eventStopPropagation.d.ts +7 -0
- package/dist/functions/executeFunction.d.ts +12 -0
- package/dist/functions/executePromise.d.ts +11 -0
- package/dist/functions/forEach.d.ts +14 -0
- package/dist/functions/frame.d.ts +10 -0
- package/dist/functions/getArrayHighlightMatch.d.ts +10 -0
- package/dist/functions/getAttributes.d.ts +9 -0
- package/dist/functions/getClipboardData.d.ts +9 -0
- package/dist/functions/getColumn.d.ts +10 -0
- package/dist/functions/getCurrentDate.d.ts +19 -0
- package/dist/functions/getCurrentTime.d.ts +15 -0
- package/dist/functions/getElement.d.ts +9 -0
- package/dist/functions/getElementId.d.ts +26 -0
- package/dist/functions/getElementImage.d.ts +8 -0
- package/dist/functions/getElementItem.d.ts +12 -0
- package/dist/functions/getElementOrWindow.d.ts +8 -0
- package/dist/functions/getElementSafeScript.d.ts +9 -0
- package/dist/functions/getExactSearchExp.d.ts +8 -0
- package/dist/functions/getExp.d.ts +14 -0
- package/dist/functions/getHydrationData.d.ts +10 -0
- package/dist/functions/getItemByPath.d.ts +9 -0
- package/dist/functions/getKey.d.ts +8 -0
- package/dist/functions/getLengthOfAllArray.d.ts +8 -0
- package/dist/functions/getMaxLengthAllArray.d.ts +9 -0
- package/dist/functions/getMinLengthAllArray.d.ts +8 -0
- package/dist/functions/getMouseClient.d.ts +9 -0
- package/dist/functions/getMouseClientX.d.ts +8 -0
- package/dist/functions/getMouseClientY.d.ts +8 -0
- package/dist/functions/getObjectByKeys.d.ts +8 -0
- package/dist/functions/getObjectNoUndefined.d.ts +9 -0
- package/dist/functions/getObjectOrNone.d.ts +8 -0
- package/dist/functions/getOnlyText.d.ts +8 -0
- package/dist/functions/getRandomText.d.ts +12 -0
- package/dist/functions/getRequestString.d.ts +11 -0
- package/dist/functions/getSearchExp.d.ts +12 -0
- package/dist/functions/getSeparatingSearchExp.d.ts +9 -0
- package/dist/functions/getStepPercent.d.ts +9 -0
- package/dist/functions/getStepValue.d.ts +9 -0
- package/dist/functions/goScroll.d.ts +10 -0
- package/dist/functions/goScrollSmooth.d.ts +10 -0
- package/dist/functions/goScrollTo.d.ts +10 -0
- package/dist/functions/handleShare.d.ts +10 -0
- package/dist/functions/inArray.d.ts +9 -0
- package/dist/functions/initScrollbarOffset.d.ts +7 -0
- package/dist/functions/intersectKey.d.ts +9 -0
- package/dist/functions/isApiSuccess.d.ts +9 -0
- package/dist/functions/isArray.d.ts +8 -0
- package/dist/functions/isDifferent.d.ts +10 -0
- package/dist/functions/isDomData.d.ts +7 -0
- package/dist/functions/isDomRuntime.d.ts +10 -0
- package/dist/functions/isElementVisible.d.ts +11 -0
- package/dist/functions/isEnter.d.ts +9 -0
- package/dist/functions/isFilled.d.ts +10 -0
- package/dist/functions/isFloat.d.ts +8 -0
- package/dist/functions/isFunction.d.ts +9 -0
- package/dist/functions/isInDom.d.ts +9 -0
- package/dist/functions/isInput.d.ts +8 -0
- package/dist/functions/isIntegerBetween.d.ts +9 -0
- package/dist/functions/isNull.d.ts +9 -0
- package/dist/functions/isNumber.d.ts +8 -0
- package/dist/functions/isObject.d.ts +8 -0
- package/dist/functions/isObjectNotArray.d.ts +8 -0
- package/dist/functions/isOnLine.d.ts +7 -0
- package/dist/functions/isSelected.d.ts +9 -0
- package/dist/functions/isSelectedByList.d.ts +9 -0
- package/dist/functions/isShare.d.ts +7 -0
- package/dist/functions/isString.d.ts +8 -0
- package/dist/functions/isWindow.d.ts +7 -0
- package/dist/functions/random.d.ts +9 -0
- package/dist/functions/removeCommonPrefix.d.ts +9 -0
- package/dist/functions/replaceComponentName.d.ts +9 -0
- package/dist/functions/replaceRecursive.d.ts +11 -0
- package/dist/functions/replaceTemplate.d.ts +10 -0
- package/dist/functions/resizeImageByMax.d.ts +19 -0
- package/dist/functions/secondToTime.d.ts +9 -0
- package/dist/functions/setElementItem.d.ts +11 -0
- package/dist/functions/setValues.d.ts +18 -0
- package/dist/functions/sleep.d.ts +8 -0
- package/dist/functions/splice.d.ts +13 -0
- package/dist/functions/strFill.d.ts +9 -0
- package/dist/functions/strSplit.d.ts +12 -0
- package/dist/functions/toArray.d.ts +17 -0
- package/dist/functions/toCamelCase.d.ts +8 -0
- package/dist/functions/toCamelCaseFirst.d.ts +8 -0
- package/dist/functions/toDate.d.ts +8 -0
- package/dist/functions/toKebabCase.d.ts +15 -0
- package/dist/functions/toNumber.d.ts +19 -0
- package/dist/functions/toNumberByMax.d.ts +11 -0
- package/dist/functions/toPercent.d.ts +9 -0
- package/dist/functions/toPercentBy100.d.ts +9 -0
- package/dist/functions/toString.d.ts +8 -0
- package/dist/functions/transformation.d.ts +21 -0
- package/dist/functions/uint8ArrayToBase64.d.ts +8 -0
- package/dist/functions/uniqueArray.d.ts +8 -0
- package/dist/functions/writeClipboardData.d.ts +8 -0
- package/dist/library.d.ts +171 -8722
- package/dist/library.js +416 -338
- package/dist/media/errorCauseList.d.ts +2 -0
- package/dist/types/apiTypes.d.ts +217 -0
- package/dist/types/basicTypes.d.ts +131 -0
- package/dist/types/errorCenter.d.ts +42 -0
- package/dist/types/formattersTypes.d.ts +224 -0
- package/dist/types/geoTypes.d.ts +86 -0
- package/dist/types/metaTypes.d.ts +586 -0
- package/dist/types/searchTypes.d.ts +53 -0
- package/dist/types/translateTypes.d.ts +54 -0
- package/package.json +7 -5
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { SearchListItem } from './SearchListItem';
|
|
2
|
+
import { SearchListOptions } from './SearchListOptions';
|
|
3
|
+
import { SearchCache, SearchCacheItem, SearchColumns, SearchFormatItem, SearchFormatList, SearchItem, SearchListValue } from '../types/searchTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Class for managing and formatting the search data list and its cache.
|
|
6
|
+
*
|
|
7
|
+
* Класс для управления и форматирования списка данных поиска и его кэша.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SearchListData<T extends SearchItem, K extends SearchColumns<T>> {
|
|
10
|
+
protected list: SearchListValue<T>;
|
|
11
|
+
protected columns: K | undefined;
|
|
12
|
+
protected item: SearchListItem;
|
|
13
|
+
protected options: SearchListOptions;
|
|
14
|
+
protected listCache?: SearchCache<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for SearchListData.
|
|
17
|
+
*
|
|
18
|
+
* Конструктор для SearchListData.
|
|
19
|
+
* @param list original list of items/ исходный список элементов
|
|
20
|
+
* @param columns columns to search in/ столбцы для поиска
|
|
21
|
+
* @param item current search item state/ текущее состояние элемента поиска
|
|
22
|
+
* @param options search options/ опции поиска
|
|
23
|
+
*/
|
|
24
|
+
constructor(list: SearchListValue<T>, columns: K | undefined, item: SearchListItem, options: SearchListOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Checks if both list and columns are provided.
|
|
27
|
+
*
|
|
28
|
+
* Проверяет, предоставлены ли и список, и столбцы.
|
|
29
|
+
* @returns boolean indicating if ready for column-based search/ логическое значение, указывающее на готовность к поиску по столбцам
|
|
30
|
+
*/
|
|
31
|
+
is(): this is this & {
|
|
32
|
+
list: T[];
|
|
33
|
+
columns: string[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the list is provided.
|
|
37
|
+
*
|
|
38
|
+
* Проверяет, предоставлен ли список.
|
|
39
|
+
* @returns boolean/ логическое значение
|
|
40
|
+
*/
|
|
41
|
+
isList(): this is this & {
|
|
42
|
+
list: T[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Returns the original list.
|
|
46
|
+
*
|
|
47
|
+
* Возвращает исходный список.
|
|
48
|
+
* @returns list value/ значение списка
|
|
49
|
+
*/
|
|
50
|
+
getList(): SearchListValue<T>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the search columns.
|
|
53
|
+
*
|
|
54
|
+
* Возвращает столбцы поиска.
|
|
55
|
+
* @returns columns or undefined/ столбцы или undefined
|
|
56
|
+
*/
|
|
57
|
+
getColumns(): K | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Gets the search cache, initializing it if necessary.
|
|
60
|
+
*
|
|
61
|
+
* Получает кэш поиска, инициализируя его при необходимости.
|
|
62
|
+
* @returns search cache/ кэш поиска
|
|
63
|
+
*/
|
|
64
|
+
protected getCache(): SearchCache<T>;
|
|
65
|
+
/**
|
|
66
|
+
* Sets a new list and regenerates the cache.
|
|
67
|
+
*
|
|
68
|
+
* Устанавливает новый список и регенерирует кэш.
|
|
69
|
+
* @param list new list/ новый список
|
|
70
|
+
* @returns this instance/ данный экземпляр
|
|
71
|
+
*/
|
|
72
|
+
setList(list: SearchListValue<T>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Sets new search columns and regenerates the cache.
|
|
75
|
+
*
|
|
76
|
+
* Устанавливает новые столбцы поиска и регенерирует кэш.
|
|
77
|
+
* @param columns new columns/ новые столбцы
|
|
78
|
+
* @returns this instance/ данный экземпляр
|
|
79
|
+
*/
|
|
80
|
+
setColumns(columns?: SearchColumns<T>): this;
|
|
81
|
+
/**
|
|
82
|
+
* Finds a cached item corresponding to the given original item.
|
|
83
|
+
*
|
|
84
|
+
* Находит кэшированный элемент, соответствующий данному исходному элементу.
|
|
85
|
+
* @param item original item/ исходный элемент
|
|
86
|
+
* @returns cache item or undefined/ кэшированный элемент или undefined
|
|
87
|
+
*/
|
|
88
|
+
findCacheItem(item: T): SearchCacheItem<T> | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Iterates over the cached list and executes a callback for each item.
|
|
91
|
+
*
|
|
92
|
+
* Перебирает кэшированный список и выполняет обратный вызов для каждого элемента.
|
|
93
|
+
* @param callback function to execute for each item/ функция для выполнения для каждого элемента
|
|
94
|
+
* @returns formatted list/ отформатированный список
|
|
95
|
+
*/
|
|
96
|
+
forEach(callback: (item: SearchCacheItem<T>['item'], value: SearchCacheItem<T>['value']) => SearchFormatItem<T, K> | undefined): SearchFormatList<T, K>;
|
|
97
|
+
/**
|
|
98
|
+
* Converts a single item to a formatted item with highlighted matches if selected.
|
|
99
|
+
*
|
|
100
|
+
* Преобразует один элемент в отформатированный элемент с выделенными совпадениями, если он выбран.
|
|
101
|
+
* @param item original item/ исходный элемент
|
|
102
|
+
* @param selection whether the item matches the search and should be highlighted/ совпадает ли элемент с поиском и должен ли он быть выделен
|
|
103
|
+
* @returns formatted item/ отформатированный элемент
|
|
104
|
+
*/
|
|
105
|
+
toFormatItem(item: T, selection: boolean): SearchFormatItem<T, K>;
|
|
106
|
+
/**
|
|
107
|
+
* Formats a column path to a camelCase property name with a 'Search' suffix.
|
|
108
|
+
*
|
|
109
|
+
* Форматирует путь к столбцу в имя свойства camelCase с суффиксом 'Search'.
|
|
110
|
+
* @param column column path/ путь к столбцу
|
|
111
|
+
* @returns property name/ имя свойства
|
|
112
|
+
*/
|
|
113
|
+
protected getColumnName(column: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Adds highlight tags to the given value based on the current search value.
|
|
116
|
+
*
|
|
117
|
+
* Добавляет теги выделения к данному значению на основе текущего значения поиска.
|
|
118
|
+
* @param value value to highlight/ значение для выделения
|
|
119
|
+
* @returns highlighted string/ выделенная строка
|
|
120
|
+
*/
|
|
121
|
+
protected addTag(value: any): string;
|
|
122
|
+
/**
|
|
123
|
+
* Generates a search cache for the current list and columns.
|
|
124
|
+
*
|
|
125
|
+
* Генерирует кэш поиска для текущего списка и столбцов.
|
|
126
|
+
* @returns search cache/ кэш поиска
|
|
127
|
+
*/
|
|
128
|
+
protected generateCache(): SearchCache<T>;
|
|
129
|
+
/**
|
|
130
|
+
* Initializes the search cache.
|
|
131
|
+
*
|
|
132
|
+
* Инициализирует кэш поиска.
|
|
133
|
+
* @returns void
|
|
134
|
+
*/
|
|
135
|
+
protected initCache(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Resets the search cache.
|
|
138
|
+
*
|
|
139
|
+
* Сбрасывает кэш поиска.
|
|
140
|
+
* @returns void
|
|
141
|
+
*/
|
|
142
|
+
protected resetCache(): void;
|
|
143
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SearchListOptions } from './SearchListOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Class representing a single search item's value and its search-related state.
|
|
4
|
+
*
|
|
5
|
+
* Класс, представляющий значение одного элемента поиска и его состояние, связанное с поиском.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SearchListItem {
|
|
8
|
+
protected value: string | undefined;
|
|
9
|
+
protected options: SearchListOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Constructor for SearchListItem.
|
|
12
|
+
*
|
|
13
|
+
* Конструктор для SearchListItem.
|
|
14
|
+
* @param value current search value/ текущее значение поиска
|
|
15
|
+
* @param options search options/ опции поиска
|
|
16
|
+
*/
|
|
17
|
+
constructor(value: string | undefined, options: SearchListOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the value is filled.
|
|
20
|
+
*
|
|
21
|
+
* Проверяет, заполнено ли значение.
|
|
22
|
+
* @returns boolean indicating if value exists/ логическое значение, указывающее на наличие значения
|
|
23
|
+
*/
|
|
24
|
+
is(): this is this & {
|
|
25
|
+
value: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the value is filled and the length is greater than or equal to the limit.
|
|
29
|
+
*
|
|
30
|
+
* Проверяет, заполнено ли значение и длина больше или равна лимиту.
|
|
31
|
+
* @returns boolean/ логическое значение
|
|
32
|
+
*/
|
|
33
|
+
isSearch(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the current search value as a string.
|
|
36
|
+
*
|
|
37
|
+
* Возвращает текущее значение поиска в виде строки.
|
|
38
|
+
* @returns search value/ значение поиска
|
|
39
|
+
*/
|
|
40
|
+
get(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Sets a new search value.
|
|
43
|
+
*
|
|
44
|
+
* Устанавливает новое значение поиска.
|
|
45
|
+
* @param value new search value/ новое значение поиска
|
|
46
|
+
* @returns this instance/ данный экземпляр
|
|
47
|
+
*/
|
|
48
|
+
set(value?: string): this;
|
|
49
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SearchListItem } from './SearchListItem';
|
|
2
|
+
import { SearchListOptions } from './SearchListOptions';
|
|
3
|
+
import { SearchCacheItem } from '../types/searchTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Class responsible for matching search values against the search list data using regular expressions.
|
|
6
|
+
*
|
|
7
|
+
* Класс, отвечающий за сопоставление значений поиска с данными списка поиска с использованием регулярных выражений.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SearchListMatcher {
|
|
10
|
+
protected item: SearchListItem;
|
|
11
|
+
protected options: SearchListOptions;
|
|
12
|
+
protected matcher: RegExp | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for SearchListMatcher.
|
|
15
|
+
*
|
|
16
|
+
* Конструктор для SearchListMatcher.
|
|
17
|
+
* @param item search item containing the current value/ элемент поиска, содержащий текущее значение
|
|
18
|
+
* @param options search options/ опции поиска
|
|
19
|
+
*/
|
|
20
|
+
constructor(item: SearchListItem, options: SearchListOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the matcher is initialized.
|
|
23
|
+
*
|
|
24
|
+
* Проверяет, инициализирован ли сопоставитель.
|
|
25
|
+
* @returns boolean/ логическое значение
|
|
26
|
+
*/
|
|
27
|
+
is(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the given value matches the current search expression.
|
|
30
|
+
*
|
|
31
|
+
* Проверяет, соответствует ли данное значение текущему поисковому выражению.
|
|
32
|
+
* @param value value to check/ проверяемое значение
|
|
33
|
+
* @returns boolean indicating a match/ логическое значение, указывающее на совпадение
|
|
34
|
+
*/
|
|
35
|
+
isSelection(value: SearchCacheItem<any>['value']): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the current regular expression matcher.
|
|
38
|
+
*
|
|
39
|
+
* Возвращает текущий сопоставитель регулярных выражений.
|
|
40
|
+
* @returns RegExp or undefined/ RegExp или undefined
|
|
41
|
+
*/
|
|
42
|
+
get(): RegExp | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Updates the matcher based on the current item value and options.
|
|
45
|
+
*
|
|
46
|
+
* Обновляет сопоставитель на основе текущего значения элемента и опций.
|
|
47
|
+
* @returns void
|
|
48
|
+
*/
|
|
49
|
+
update(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Initializes or resets the regular expression matcher.
|
|
52
|
+
*
|
|
53
|
+
* Инициализирует или сбрасывает сопоставитель регулярных выражений.
|
|
54
|
+
* @returns void
|
|
55
|
+
*/
|
|
56
|
+
protected initMatcher(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SearchOptions } from '../types/searchTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Class for managing search list options.
|
|
4
|
+
*
|
|
5
|
+
* Класс для управления опциями списка поиска.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SearchListOptions {
|
|
8
|
+
protected options?: SearchOptions | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Constructor for SearchListOptions.
|
|
11
|
+
*
|
|
12
|
+
* Конструктор для SearchListOptions.
|
|
13
|
+
* @param options search options/ опции поиска
|
|
14
|
+
*/
|
|
15
|
+
constructor(options?: SearchOptions | undefined);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the current search options.
|
|
18
|
+
*
|
|
19
|
+
* Возвращает текущие опции поиска.
|
|
20
|
+
* @returns search options/ опции поиска
|
|
21
|
+
*/
|
|
22
|
+
getOptions(): SearchOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the minimum number of characters required to trigger a search.
|
|
25
|
+
*
|
|
26
|
+
* Возвращает минимальное количество символов, необходимых для запуска поиска.
|
|
27
|
+
* @returns limit value/ значение лимита
|
|
28
|
+
*/
|
|
29
|
+
getLimit(): number;
|
|
30
|
+
/**
|
|
31
|
+
* Returns whether to return all items even if they don't match the search query.
|
|
32
|
+
*
|
|
33
|
+
* Возвращает, следует ли возвращать все элементы, даже если они не соответствуют поисковому запросу.
|
|
34
|
+
* @returns boolean value/ логическое значение
|
|
35
|
+
*/
|
|
36
|
+
getReturnEverything(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the search delay in milliseconds.
|
|
39
|
+
*
|
|
40
|
+
* Возвращает задержку поиска в миллисекундах.
|
|
41
|
+
* @returns delay value/ значение задержки
|
|
42
|
+
*/
|
|
43
|
+
getDelay(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Returns whether to perform an exact match search.
|
|
46
|
+
*
|
|
47
|
+
* Возвращает, следует ли выполнять поиск с точным совпадением.
|
|
48
|
+
* @returns boolean value/ логическое значение
|
|
49
|
+
*/
|
|
50
|
+
getFindExactMatch(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the CSS class name used for highlighting matches.
|
|
53
|
+
*
|
|
54
|
+
* Возвращает имя класса CSS, используемое для выделения совпадений.
|
|
55
|
+
* @returns class name/ имя класса
|
|
56
|
+
*/
|
|
57
|
+
getClassName(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Sets new search options.
|
|
60
|
+
*
|
|
61
|
+
* Устанавливает новые опции поиска.
|
|
62
|
+
* @param options search options/ опции поиска
|
|
63
|
+
* @returns this instance/ данный экземпляр
|
|
64
|
+
*/
|
|
65
|
+
setOptions(options: SearchOptions): this;
|
|
66
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** Item stored in the server storage/ Элемент, хранящийся в серверном хранилище */
|
|
2
|
+
type ServerStorageItem = {
|
|
3
|
+
value: any;
|
|
4
|
+
hydration: boolean;
|
|
5
|
+
};
|
|
6
|
+
type ServerStorageList = Record<string, ServerStorageItem>;
|
|
7
|
+
/**
|
|
8
|
+
* Class for managing data storage during server-side rendering (SSR).
|
|
9
|
+
* Handles data isolation between parallel requests by using a request-specific context.
|
|
10
|
+
*
|
|
11
|
+
* Класс для управления хранением данных при серверном рендеринге (SSR).
|
|
12
|
+
* Обеспечивает изоляцию данных между параллельными запросами, используя контекст конкретного запроса.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ServerStorage {
|
|
15
|
+
protected static storage?: ServerStorageList;
|
|
16
|
+
protected static listener?: () => Record<string, any> | undefined;
|
|
17
|
+
protected static hideError?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Initializes the storage with a context listener.
|
|
20
|
+
*
|
|
21
|
+
* Инициализирует хранилище слушателем контекста.
|
|
22
|
+
* @param listener function that returns the current request context / функция, возвращающая контекст текущего запроса
|
|
23
|
+
* @returns this instance / текущий класс
|
|
24
|
+
*/
|
|
25
|
+
static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
|
|
26
|
+
/**
|
|
27
|
+
* Resets the storage.
|
|
28
|
+
*
|
|
29
|
+
* Сбрасывает хранилище.
|
|
30
|
+
*/
|
|
31
|
+
static reset(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a value exists in storage.
|
|
34
|
+
*
|
|
35
|
+
* Проверяет наличие значения в хранилище.
|
|
36
|
+
* @param key unique storage key / уникальный ключ хранилища
|
|
37
|
+
* @returns boolean / логическое значение
|
|
38
|
+
*/
|
|
39
|
+
static has(key: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves a value from storage. If it doesn't exist, creates it using the default value factory.
|
|
42
|
+
*
|
|
43
|
+
* Извлекает значение из хранилища. Если оно не существует, создает его с помощью фабрики значений по умолчанию.
|
|
44
|
+
* @param key unique storage key / уникальный ключ хранилища
|
|
45
|
+
* @param defaultValue function that returns the default value if not found / функция, возвращающая значение по умолчанию, если оно не найдено
|
|
46
|
+
* @param hydration whether the value should be included in hydration / должно ли значение быть включено в гидратацию
|
|
47
|
+
* @returns stored value / сохраненное значение
|
|
48
|
+
*/
|
|
49
|
+
static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
50
|
+
/**
|
|
51
|
+
* Saves a value to storage.
|
|
52
|
+
*
|
|
53
|
+
* Сохраняет значение в хранилище.
|
|
54
|
+
* @param key unique storage key / уникальный ключ хранилища
|
|
55
|
+
* @param value function that returns the value to save / функция, возвращающая значение для сохранения
|
|
56
|
+
* @param hydration whether the value should be included in hydration / должно ли значение быть включено в гидратацию
|
|
57
|
+
* @returns saved value / сохраненное значение
|
|
58
|
+
*/
|
|
59
|
+
static set<T = any>(key: string, value: () => T, hydration?: boolean): T;
|
|
60
|
+
/**
|
|
61
|
+
* Sets the visibility of error messages.
|
|
62
|
+
*
|
|
63
|
+
* Устанавливает видимость сообщений об ошибках.
|
|
64
|
+
* @param hide boolean value to hide or show errors / логическое значение для скрытия или отображения ошибок
|
|
65
|
+
*/
|
|
66
|
+
static setErrorStatus(hide: boolean): void;
|
|
67
|
+
/**
|
|
68
|
+
* Removes a value from storage.
|
|
69
|
+
*
|
|
70
|
+
* Удаляет значение из хранилища.
|
|
71
|
+
* @param key unique storage key / уникальный ключ хранилища
|
|
72
|
+
*/
|
|
73
|
+
static remove(key: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Returns a string representation of the storage for hydration.
|
|
76
|
+
*
|
|
77
|
+
* Возвращает строковое представление хранилища для гидратации.
|
|
78
|
+
* @returns script tag string / строка тега скрипта
|
|
79
|
+
*/
|
|
80
|
+
static toString(): string;
|
|
81
|
+
/**
|
|
82
|
+
* Returns storage.
|
|
83
|
+
*
|
|
84
|
+
* Возвращает хранилище.
|
|
85
|
+
* @param isInit whether to initialize the storage if it does not exist /
|
|
86
|
+
* инициализировать ли хранилище, если оно не существует
|
|
87
|
+
* @param status optional status for error reporting / необязательный статус для отчета об ошибках
|
|
88
|
+
* @returns storage list / список хранилища
|
|
89
|
+
*/
|
|
90
|
+
protected static getStorage(isInit?: boolean, status?: string): ServerStorageList;
|
|
91
|
+
/**
|
|
92
|
+
* Returns storage from DOM.
|
|
93
|
+
*
|
|
94
|
+
* Возвращает хранилище из DOM.
|
|
95
|
+
* @returns storage list from DOM / список хранилища из DOM
|
|
96
|
+
*/
|
|
97
|
+
protected static getStorageDom(): ServerStorageList;
|
|
98
|
+
/**
|
|
99
|
+
* Returns data for hydration.
|
|
100
|
+
*
|
|
101
|
+
* Возвращает данные для гидратации.
|
|
102
|
+
* @returns record of hydration data / запись данных гидратации
|
|
103
|
+
*/
|
|
104
|
+
protected static getDataForHydration(): Record<string, any>;
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A class for working with callback lists for storage.
|
|
3
|
+
*
|
|
4
|
+
* Класс для работы со списками обратных вызовов для хранилища.
|
|
5
|
+
*/
|
|
6
|
+
export declare class StorageCallback<T = any, Callback = (value: T) => void | Promise<void>> {
|
|
7
|
+
protected name: string;
|
|
8
|
+
protected group: string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns an instance of the class by name.
|
|
11
|
+
*
|
|
12
|
+
* Возвращает экземпляр класса по названию.
|
|
13
|
+
* @param name storage name/ название хранилища
|
|
14
|
+
* @param group storage group/ группа хранилища
|
|
15
|
+
* @returns StorageCallback instance / экземпляр StorageCallback
|
|
16
|
+
*/
|
|
17
|
+
static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
|
|
18
|
+
protected callbacks: {
|
|
19
|
+
callback: Callback;
|
|
20
|
+
isOnce?: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
protected loading: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Constructor for initialization.
|
|
25
|
+
*
|
|
26
|
+
* Конструктор для инициализации.
|
|
27
|
+
* @param name storage name/ название хранилища
|
|
28
|
+
* @param group storage group/ группа хранилища
|
|
29
|
+
*/
|
|
30
|
+
constructor(name: string, group?: string);
|
|
31
|
+
/**
|
|
32
|
+
* Returns the loading state.
|
|
33
|
+
*
|
|
34
|
+
* Возвращает состояние загрузки.
|
|
35
|
+
* @returns loading state / состояние загрузки
|
|
36
|
+
*/
|
|
37
|
+
isLoading(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the storage name.
|
|
40
|
+
*
|
|
41
|
+
* Возвращает название хранилища.
|
|
42
|
+
* @returns storage name / название хранилища
|
|
43
|
+
*/
|
|
44
|
+
getName(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the loading state.
|
|
47
|
+
*
|
|
48
|
+
* Возвращает состояние загрузки.
|
|
49
|
+
* @returns loading state / состояние загрузки
|
|
50
|
+
*/
|
|
51
|
+
getLoading(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Adds a callback to the list.
|
|
54
|
+
*
|
|
55
|
+
* Добавляет обратный вызов в список.
|
|
56
|
+
* @param callback function for callbacks/ функция для обратных вызовов
|
|
57
|
+
* @param isOnce whether the callback should only be called once/ является ли колбэк одноразовым
|
|
58
|
+
* @returns this instance / текущий экземпляр
|
|
59
|
+
*/
|
|
60
|
+
addCallback(callback: Callback, isOnce?: boolean): this;
|
|
61
|
+
/**
|
|
62
|
+
* Removes a callback from the list.
|
|
63
|
+
*
|
|
64
|
+
* Удаляет обратный вызов из списка.
|
|
65
|
+
* @param callback function for callbacks/ функция для обратных вызовов
|
|
66
|
+
* @returns this instance / текущий экземпляр
|
|
67
|
+
*/
|
|
68
|
+
removeCallback(callback: Callback): this;
|
|
69
|
+
/**
|
|
70
|
+
* Preparation of data before launch.
|
|
71
|
+
*
|
|
72
|
+
* Подготовка данных перед запуском.
|
|
73
|
+
* @returns this instance / текущий экземпляр
|
|
74
|
+
*/
|
|
75
|
+
preparation(): this;
|
|
76
|
+
/**
|
|
77
|
+
* Execution of all callbacks.
|
|
78
|
+
*
|
|
79
|
+
* Выполнение всех обратных вызовов.
|
|
80
|
+
* @param value storage data/ данные хранилища
|
|
81
|
+
* @returns this instance / текущий экземпляр
|
|
82
|
+
*/
|
|
83
|
+
run(value: T): Promise<this>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { TranslateInstance } from './TranslateInstance';
|
|
2
|
+
import { TranslateCode, TranslateConfig, TranslateDataFile, TranslateList } from '../types/translateTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Class for getting the translated text.
|
|
5
|
+
*
|
|
6
|
+
* Класс для получения переведенного текста.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Translate {
|
|
9
|
+
protected static item?: TranslateInstance;
|
|
10
|
+
/**
|
|
11
|
+
* Getting the translation text by its code.
|
|
12
|
+
*
|
|
13
|
+
* Получение текста перевода по его коду.
|
|
14
|
+
* @param name code name/ название кода
|
|
15
|
+
* @param replacement If set, replaces the text with the specified values/ если установлено, заменяет текст на указанные значения
|
|
16
|
+
* @returns translation text / текст перевода
|
|
17
|
+
*/
|
|
18
|
+
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a request-isolated instance of TranslateInstance.
|
|
21
|
+
*
|
|
22
|
+
* Возвращает изолированный в рамках запроса экземпляр TranslateInstance.
|
|
23
|
+
* @returns TranslateInstance instance / экземпляр TranslateInstance
|
|
24
|
+
*/
|
|
25
|
+
static getItem(): TranslateInstance;
|
|
26
|
+
/**
|
|
27
|
+
* Getting the translation text by its code (Sync).
|
|
28
|
+
*
|
|
29
|
+
* Получение текста перевода по его коду (Sync).
|
|
30
|
+
* @param name code name/ название кода
|
|
31
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
32
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
33
|
+
* @param replacement If set, replaces the text with the specified values/
|
|
34
|
+
* если установлено, заменяет текст на указанные значения
|
|
35
|
+
* @returns translation text / текст перевода
|
|
36
|
+
*/
|
|
37
|
+
static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
38
|
+
/**
|
|
39
|
+
* Getting a list of translations by an array of text codes.
|
|
40
|
+
*
|
|
41
|
+
* Получение списка переводов по массиву кодов текста.
|
|
42
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
43
|
+
* @returns object with translations / объект с переводами
|
|
44
|
+
*/
|
|
45
|
+
static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* Getting a list of translations by an array of text codes.
|
|
48
|
+
*
|
|
49
|
+
* Получение списка переводов по массиву кодов текста.
|
|
50
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
51
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
52
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
53
|
+
* @returns object with translations / объект с переводами
|
|
54
|
+
*/
|
|
55
|
+
static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Added a list of translated texts.
|
|
58
|
+
*
|
|
59
|
+
* Добавлен список переведенных текстов.
|
|
60
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
61
|
+
*/
|
|
62
|
+
static add(names: string | string[]): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Adds texts in sync mode.
|
|
65
|
+
*
|
|
66
|
+
* Добавляет тексты в режиме синхронизации.
|
|
67
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
68
|
+
*/
|
|
69
|
+
static addSync(data: Record<string, string>): void;
|
|
70
|
+
/**
|
|
71
|
+
* Adding data in the form of a query or directly, depending on the execution environment.
|
|
72
|
+
*
|
|
73
|
+
* Добавление данных в виде запроса или напрямую, в зависимости от среды выполнения.
|
|
74
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
75
|
+
*/
|
|
76
|
+
static addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Adds texts synchronously by location.
|
|
79
|
+
*
|
|
80
|
+
* Добавляет тексты синхронно по местоположению.
|
|
81
|
+
* @param data list of texts by location/ список текстов по местоположению
|
|
82
|
+
*/
|
|
83
|
+
static addSyncByLocation(data: Record<string, Record<string, string>>): void;
|
|
84
|
+
/**
|
|
85
|
+
* Adds texts synchronously from the file.
|
|
86
|
+
*
|
|
87
|
+
* Добавляет тексты синхронно из файла.
|
|
88
|
+
* @param data file with translations/ файл с переводами
|
|
89
|
+
*/
|
|
90
|
+
static addSyncByFile(data: TranslateDataFile): void;
|
|
91
|
+
/**
|
|
92
|
+
* Change the path to the script for obtaining the translation.
|
|
93
|
+
*
|
|
94
|
+
* Изменить путь к скрипту для получения перевода.
|
|
95
|
+
* @param url path to the script/ путь к скрипту
|
|
96
|
+
*/
|
|
97
|
+
static setUrl(url: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Change the name of the property to get the translation.
|
|
100
|
+
*
|
|
101
|
+
* Изменить имя свойства для получения перевода.
|
|
102
|
+
* @param name property name/ имя свойства
|
|
103
|
+
*/
|
|
104
|
+
static setPropsName(name: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Change the read mode from the API.
|
|
107
|
+
*
|
|
108
|
+
* Изменить режим чтения из API.
|
|
109
|
+
* @param value read mode/ режим чтения
|
|
110
|
+
*/
|
|
111
|
+
static setReadApi(value: boolean): void;
|
|
112
|
+
/**
|
|
113
|
+
* Set the configuration for the translation.
|
|
114
|
+
*
|
|
115
|
+
* Установить конфигурацию для перевода.
|
|
116
|
+
* @param config configuration/ конфигурация
|
|
117
|
+
*/
|
|
118
|
+
static setConfig(config: TranslateConfig): void;
|
|
119
|
+
}
|