@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,151 @@
|
|
|
1
|
+
import { GeoInstance } from './GeoInstance';
|
|
2
|
+
import { GeoItem, GeoItemFull } from '../types/geoTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Static class for working with geographical data.
|
|
5
|
+
* Provides a centralized interface for managing locale, country, and time zone.
|
|
6
|
+
*
|
|
7
|
+
* Статический класс для работы с географическими данными.
|
|
8
|
+
* Предоставляет централизованный интерфейс для управления локалью, страной и часовым поясом.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Geo {
|
|
11
|
+
/**
|
|
12
|
+
* Returns a request-isolated instance of GeoInstance.
|
|
13
|
+
*
|
|
14
|
+
* Возвращает изолированный в рамках запроса экземпляр GeoInstance.
|
|
15
|
+
* @returns GeoInstance instance / экземпляр GeoInstance
|
|
16
|
+
*/
|
|
17
|
+
static getObject(): GeoInstance;
|
|
18
|
+
/**
|
|
19
|
+
* Returns information about the current country and language.
|
|
20
|
+
*
|
|
21
|
+
* Возвращает информацию о текущей стране и языке.
|
|
22
|
+
* @returns current geo item / данные о текущей гео-позиции
|
|
23
|
+
*/
|
|
24
|
+
static get(): GeoItemFull;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the 2-letter code of the current country.
|
|
27
|
+
*
|
|
28
|
+
* Возвращает 2-буквенный код текущей страны.
|
|
29
|
+
* @returns country code / код страны
|
|
30
|
+
*/
|
|
31
|
+
static getCountry(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the 2-letter code of the current language.
|
|
34
|
+
*
|
|
35
|
+
* Возвращает 2-буквенный код текущего языка.
|
|
36
|
+
* @returns language code / код языка
|
|
37
|
+
*/
|
|
38
|
+
static getLanguage(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the combined locale string in the standard format (e.g., 'en-US').
|
|
41
|
+
*
|
|
42
|
+
* Возвращает комбинированную строку локали в стандартном формате (например, 'ru-RU').
|
|
43
|
+
* @returns standard locale string / стандартная строка локали
|
|
44
|
+
*/
|
|
45
|
+
static getStandard(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the code for the first day of the week for the current locale.
|
|
48
|
+
*
|
|
49
|
+
* Возвращает код первого дня недели для текущей локали.
|
|
50
|
+
* @returns first day of the week / первый день недели
|
|
51
|
+
*/
|
|
52
|
+
static getFirstDay(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the current location string.
|
|
55
|
+
*
|
|
56
|
+
* Возвращает текущую строку местоположения.
|
|
57
|
+
* @returns location string / строка местоположения
|
|
58
|
+
*/
|
|
59
|
+
static getLocation(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Returns fully processed geo data updated with the current language.
|
|
62
|
+
*
|
|
63
|
+
* Возвращает полностью обработанные гео-данные с учетом текущего языка.
|
|
64
|
+
* @returns full geo item data / полные данные гео-объекта
|
|
65
|
+
*/
|
|
66
|
+
static getItem(): GeoItemFull;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the complete list of available countries and regions.
|
|
69
|
+
*
|
|
70
|
+
* Возвращает полный список доступных стран и регионов.
|
|
71
|
+
* @returns list of geo items / список гео-объектов
|
|
72
|
+
*/
|
|
73
|
+
static getList(): GeoItem[];
|
|
74
|
+
/**
|
|
75
|
+
* Returns geo data by country or language code from the global database.
|
|
76
|
+
*
|
|
77
|
+
* Возвращает гео-данные по коду страны или языка из глобальной базы данных.
|
|
78
|
+
* @param code country or language code / код страны или языка
|
|
79
|
+
* @returns full geo data / полные гео-данные
|
|
80
|
+
*/
|
|
81
|
+
static getByCode(code?: string): GeoItemFull;
|
|
82
|
+
/**
|
|
83
|
+
* Returns exact geo data by searching for the full locale match (e.g., 'en-US').
|
|
84
|
+
*
|
|
85
|
+
* Возвращает точные гео-данные по поиску полного совпадения локали (например, 'ru-RU').
|
|
86
|
+
* @param code full locale string / полная строка локали
|
|
87
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
88
|
+
*/
|
|
89
|
+
static getByCodeFull(code: string): GeoItem | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Returns geo data for a specific country by its code.
|
|
92
|
+
*
|
|
93
|
+
* Возвращает гео-данные для конкретной страны по её коду.
|
|
94
|
+
* @param country country code / код страны
|
|
95
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
96
|
+
*/
|
|
97
|
+
static getByCountry(country: string): GeoItem | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Returns geo data for a specific language by its code.
|
|
100
|
+
*
|
|
101
|
+
* Возвращает гео-данные для конкретного языка по его коду.
|
|
102
|
+
* @param language language code / код языка
|
|
103
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
104
|
+
*/
|
|
105
|
+
static getByLanguage(language: string): GeoItem | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the time zone offset in minutes for the current context.
|
|
108
|
+
*
|
|
109
|
+
* Возвращает смещение часового пояса в минутах для текущего контекста.
|
|
110
|
+
* @returns timezone offset / смещение часового пояса
|
|
111
|
+
*/
|
|
112
|
+
static getTimezone(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the formatted time zone string (e.g., '+00:00') for the current context.
|
|
115
|
+
*
|
|
116
|
+
* Возвращает отформатированную строку часового пояса (например, '+03:00') для текущего контекста.
|
|
117
|
+
* @returns formatted timezone / отформатированная временная зона
|
|
118
|
+
*/
|
|
119
|
+
static getTimezoneFormat(): string;
|
|
120
|
+
/**
|
|
121
|
+
* Finds or determines the geo data for a given code. Alias for getByCode.
|
|
122
|
+
*
|
|
123
|
+
* Находит или определяет гео-данные для заданного кода. Алиас для getByCode.
|
|
124
|
+
* @param code country or language code / код страны или языка
|
|
125
|
+
* @returns full geo data / полные гео-данные
|
|
126
|
+
*/
|
|
127
|
+
static find(code: string): GeoItemFull;
|
|
128
|
+
/**
|
|
129
|
+
* Returns a standard concatenated string for a geo item (e.g., 'en-US').
|
|
130
|
+
*
|
|
131
|
+
* Возвращает стандартную объединенную строку для гео-объекта (например, 'ru-RU').
|
|
132
|
+
* @param item geo item data / данные гео-объекта
|
|
133
|
+
* @returns standard string / стандартная строка
|
|
134
|
+
*/
|
|
135
|
+
static toStandard(item: GeoItem): string;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the current geographical location. Updates the instance state.
|
|
138
|
+
*
|
|
139
|
+
* Устанавливает текущее географическое положение. Обновляет состояние инстанса.
|
|
140
|
+
* @param code location code / код локации
|
|
141
|
+
* @param save whether to persist the change in storage / сохранять ли изменения в хранилище
|
|
142
|
+
*/
|
|
143
|
+
static set(code: string, save?: boolean): void;
|
|
144
|
+
/**
|
|
145
|
+
* Sets a custom time zone offset for the current context.
|
|
146
|
+
*
|
|
147
|
+
* Устанавливает кастомное смещение часового пояса для текущего контекста.
|
|
148
|
+
* @param timezone timezone offset in minutes / смещение часового пояса в минутах
|
|
149
|
+
*/
|
|
150
|
+
static setTimezone(timezone: number): void;
|
|
151
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { GeoIntl } from './GeoIntl';
|
|
2
|
+
import { GeoFlagItem, GeoFlagNational, GeoItemFull } from '../types/geoTypes';
|
|
3
|
+
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
4
|
+
/**
|
|
5
|
+
* Class for working with flags and geographic information.
|
|
6
|
+
* Provides methods for retrieving country names, languages, and flag icons.
|
|
7
|
+
*
|
|
8
|
+
* Класс для работы с флагами и географической информацией.
|
|
9
|
+
* Предоставляет методы для получения названий стран, языков и иконок флагов.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GeoFlag {
|
|
12
|
+
protected code: string;
|
|
13
|
+
/**
|
|
14
|
+
* Mapping of country codes to flag icon names/
|
|
15
|
+
* Словарь соответствия кодов стран названиям иконок флагов
|
|
16
|
+
*/
|
|
17
|
+
static flags: Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Constructor
|
|
20
|
+
*
|
|
21
|
+
* Конструктор
|
|
22
|
+
* @param code country and language code / код страны и языка
|
|
23
|
+
*/
|
|
24
|
+
constructor(code?: string);
|
|
25
|
+
/**
|
|
26
|
+
* Returns information about the country and its flag.
|
|
27
|
+
*
|
|
28
|
+
* Возвращает информацию о стране и её флаге.
|
|
29
|
+
* @param code country code / код страны
|
|
30
|
+
* @returns country information / информация о стране
|
|
31
|
+
*/
|
|
32
|
+
get(code?: string): GeoFlagItem | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the identifier of the flag icon.
|
|
35
|
+
*
|
|
36
|
+
* Возвращает идентификатор иконки флага.
|
|
37
|
+
* @param code country code / код страны
|
|
38
|
+
* @returns flag icon identifier / идентификатор иконки флага
|
|
39
|
+
*/
|
|
40
|
+
getFlag(code?: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Returns a list of countries based on the provided codes.
|
|
43
|
+
* If no codes are provided, returns all available countries.
|
|
44
|
+
*
|
|
45
|
+
* Возвращает список стран на основе предоставленных кодов.
|
|
46
|
+
* Если коды не переданы, возвращает все доступные страны.
|
|
47
|
+
* @param codes array of country codes / массив кодов стран
|
|
48
|
+
* @returns list of countries / список стран
|
|
49
|
+
*/
|
|
50
|
+
getList(codes?: string[]): GeoFlagItem[];
|
|
51
|
+
/**
|
|
52
|
+
* Returns a list of countries in their national languages.
|
|
53
|
+
*
|
|
54
|
+
* Возвращает список стран на их национальных языках.
|
|
55
|
+
* @param codes array of country codes / массив кодов стран
|
|
56
|
+
* @returns list of countries with national names / список стран с национальными названиями
|
|
57
|
+
*/
|
|
58
|
+
getNational(codes?: string[]): GeoFlagNational[];
|
|
59
|
+
/**
|
|
60
|
+
* Changes the current locale/location.
|
|
61
|
+
*
|
|
62
|
+
* Изменяет текущую локаль/местоположение.
|
|
63
|
+
* @param code country and language code / код страны и языка
|
|
64
|
+
* @returns this
|
|
65
|
+
*/
|
|
66
|
+
setCode(code: string): this;
|
|
67
|
+
/**
|
|
68
|
+
* Returns a special object for formatting and translations.
|
|
69
|
+
*
|
|
70
|
+
* Возвращает специальный объект для работы с форматированием и переводами.
|
|
71
|
+
* @protected
|
|
72
|
+
* @returns GeoIntl instance / экземпляр GeoIntl
|
|
73
|
+
*/
|
|
74
|
+
protected getLocation(): GeoIntl;
|
|
75
|
+
/**
|
|
76
|
+
* Returns a list of country codes to retrieve data from.
|
|
77
|
+
*
|
|
78
|
+
* Возвращает список кодов стран для получения данных.
|
|
79
|
+
* @param codes optional array of codes / опциональный массив кодов
|
|
80
|
+
* @protected
|
|
81
|
+
* @returns array of codes / массив кодов
|
|
82
|
+
*/
|
|
83
|
+
protected getCodes(codes?: string[]): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Getting the name of the language.
|
|
86
|
+
*
|
|
87
|
+
* Получение названия языка.
|
|
88
|
+
* @param data object with information of data/ объект с информацией данных
|
|
89
|
+
*/
|
|
90
|
+
protected getLanguage(data: GeoItemFull): string;
|
|
91
|
+
/**
|
|
92
|
+
* Getting the name of the country.
|
|
93
|
+
*
|
|
94
|
+
* Получение названия страны.
|
|
95
|
+
* @param data object with information of data/ объект с информацией данных
|
|
96
|
+
*/
|
|
97
|
+
protected getCountry(data: GeoItemFull): string;
|
|
98
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { GeoItem, GeoItemFull } from '../types/geoTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for working with geographic data.
|
|
4
|
+
* Includes methods for determining location, language, and time zone.
|
|
5
|
+
*
|
|
6
|
+
* Базовый класс для работы с географическими данными.
|
|
7
|
+
* Включает методы для определения местоположения, языка и часового пояса.
|
|
8
|
+
*/
|
|
9
|
+
export declare class GeoInstance {
|
|
10
|
+
/**
|
|
11
|
+
* Data storage instance for geo code/
|
|
12
|
+
* Экземпляр хранилища данных для гео-кода
|
|
13
|
+
*/
|
|
14
|
+
private storage;
|
|
15
|
+
/**
|
|
16
|
+
* Current location code (e.g., 'en-GB')/
|
|
17
|
+
* Текущий код локации (например, 'en-GB')
|
|
18
|
+
*/
|
|
19
|
+
private location;
|
|
20
|
+
/**
|
|
21
|
+
* Detailed data about the current country/
|
|
22
|
+
* Детальные данные о текущей стране
|
|
23
|
+
*/
|
|
24
|
+
private item;
|
|
25
|
+
/**
|
|
26
|
+
* Current language code/
|
|
27
|
+
* Текущий код языка
|
|
28
|
+
*/
|
|
29
|
+
private language;
|
|
30
|
+
/**
|
|
31
|
+
* Current time zone offset in minutes/
|
|
32
|
+
* Текущее смещение часового пояса в минутах
|
|
33
|
+
*/
|
|
34
|
+
private timezone;
|
|
35
|
+
/**
|
|
36
|
+
* Constructor.
|
|
37
|
+
* Initializes the location and related data.
|
|
38
|
+
*
|
|
39
|
+
* Конструктор.
|
|
40
|
+
* Инициализирует местоположение и связанные с ним данные.
|
|
41
|
+
*/
|
|
42
|
+
constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Getting information about the current country.
|
|
45
|
+
*
|
|
46
|
+
* Получение информации о текущей стране.
|
|
47
|
+
* @returns object with geo data / объект с гео-данными
|
|
48
|
+
*/
|
|
49
|
+
get(): GeoItemFull;
|
|
50
|
+
/**
|
|
51
|
+
* Getting the current country code.
|
|
52
|
+
*
|
|
53
|
+
* Получение текущего кода страны.
|
|
54
|
+
* @returns country code / код страны
|
|
55
|
+
*/
|
|
56
|
+
getCountry(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Getting the current language code.
|
|
59
|
+
*
|
|
60
|
+
* Получение текущего кода языка.
|
|
61
|
+
* @returns language code / код языка
|
|
62
|
+
*/
|
|
63
|
+
getLanguage(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Getting the full format according to the standard (language-country).
|
|
66
|
+
*
|
|
67
|
+
* Получение полного формата согласно стандарту (язык-страна).
|
|
68
|
+
* @returns standard string / строка стандарта
|
|
69
|
+
*/
|
|
70
|
+
getStandard(): string;
|
|
71
|
+
/**
|
|
72
|
+
* Getting the first day of the week for the current country.
|
|
73
|
+
*
|
|
74
|
+
* Получение первого дня недели для текущей страны.
|
|
75
|
+
* @returns first day of the week / первый день недели
|
|
76
|
+
*/
|
|
77
|
+
getFirstDay(): string;
|
|
78
|
+
/**
|
|
79
|
+
* Getting the current location string.
|
|
80
|
+
*
|
|
81
|
+
* Получение строки текущего местоположения.
|
|
82
|
+
* @returns location string / строка местоположения
|
|
83
|
+
*/
|
|
84
|
+
getLocation(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Getting processed data including the current language.
|
|
87
|
+
*
|
|
88
|
+
* Получение обработанных данных, включая текущий язык.
|
|
89
|
+
* @returns full geo item data / полные данные гео-объекта
|
|
90
|
+
*/
|
|
91
|
+
getItem(): GeoItemFull;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the full list of available countries.
|
|
94
|
+
*
|
|
95
|
+
* Возвращает полный список доступных стран.
|
|
96
|
+
* @returns list of geo items / список гео-объектов
|
|
97
|
+
*/
|
|
98
|
+
getList(): GeoItem[];
|
|
99
|
+
/**
|
|
100
|
+
* Returns data about the country by its code.
|
|
101
|
+
*
|
|
102
|
+
* Возвращает данные о стране по ее коду.
|
|
103
|
+
* @param code country code, full form language-country or one of them / код страны, полный вид язык-страна или один из них
|
|
104
|
+
* @returns full geo data / полные гео-данные
|
|
105
|
+
*/
|
|
106
|
+
getByCode(code?: string): GeoItemFull;
|
|
107
|
+
/**
|
|
108
|
+
* Returns full data by language and country combination.
|
|
109
|
+
*
|
|
110
|
+
* Возвращает полные данные по комбинации языка и страны.
|
|
111
|
+
* @param code string in the form of language-country / строка в виде язык-страна
|
|
112
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
113
|
+
*/
|
|
114
|
+
getByCodeFull(code: string): GeoItem | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Returns full data by country code.
|
|
117
|
+
*
|
|
118
|
+
* Возвращает полные данные по коду страны.
|
|
119
|
+
* @param country country code / код страны
|
|
120
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
121
|
+
*/
|
|
122
|
+
getByCountry(country: string): GeoItem | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Returns full data by language code.
|
|
125
|
+
*
|
|
126
|
+
* Возвращает полные данные по коду языка.
|
|
127
|
+
* @param language language code / код языка
|
|
128
|
+
* @returns geo item or undefined / гео-объект или undefined
|
|
129
|
+
*/
|
|
130
|
+
getByLanguage(language: string): GeoItem | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the current time zone offset in minutes.
|
|
133
|
+
*
|
|
134
|
+
* Возвращает текущее смещение часового пояса в минутах.
|
|
135
|
+
* @returns timezone offset / смещение часового пояса
|
|
136
|
+
*/
|
|
137
|
+
getTimezone(): number;
|
|
138
|
+
/**
|
|
139
|
+
* Returns the current time zone offset in a formatted string (e.g., '+03:00').
|
|
140
|
+
*
|
|
141
|
+
* Возвращает текущее смещение часового пояса в виде отформатированной строки (например, '+03:00').
|
|
142
|
+
* @returns formatted timezone string / отформатированная строка часового пояса
|
|
143
|
+
*/
|
|
144
|
+
getTimezoneFormat(): string;
|
|
145
|
+
/**
|
|
146
|
+
* Finds the country data by its code or name.
|
|
147
|
+
*
|
|
148
|
+
* Ищет данные о стране по ее коду или названию.
|
|
149
|
+
* @param code country code / код страны
|
|
150
|
+
* @returns full geo data / полные гео-данные
|
|
151
|
+
*/
|
|
152
|
+
find(code: string): GeoItemFull;
|
|
153
|
+
/**
|
|
154
|
+
* Converts a geo item to its standard string representation (language-country).
|
|
155
|
+
*
|
|
156
|
+
* Преобразует гео-объект в его стандартное строковое представление (язык-страна).
|
|
157
|
+
* @param item geo item data / данные гео-объекта
|
|
158
|
+
* @returns standard code string / строка стандартного кода
|
|
159
|
+
*/
|
|
160
|
+
toStandard(item: GeoItem): string;
|
|
161
|
+
/**
|
|
162
|
+
* Updates the current location and related data.
|
|
163
|
+
*
|
|
164
|
+
* Обновляет текущее местоположение и связанные с ним данные.
|
|
165
|
+
* @param code location code (e.g., 'en-GB') / код локации (например, 'en-GB')
|
|
166
|
+
* @param save whether to save the location in storage / нужно ли сохранять местоположение в хранилище
|
|
167
|
+
*/
|
|
168
|
+
set(code: string, save?: boolean): void;
|
|
169
|
+
/**
|
|
170
|
+
* Updates the default time zone offset.
|
|
171
|
+
*
|
|
172
|
+
* Обновляет смещение часового пояса по умолчанию.
|
|
173
|
+
* @param timezone new time zone offset / новое смещение часового пояса
|
|
174
|
+
*/
|
|
175
|
+
setTimezone(timezone: number): void;
|
|
176
|
+
/**
|
|
177
|
+
* Internal method to determine the initial location.
|
|
178
|
+
*
|
|
179
|
+
* Внутренний метод для определения начального местоположения.
|
|
180
|
+
* @returns initial location code / начальный код локации
|
|
181
|
+
*/
|
|
182
|
+
private findLocation;
|
|
183
|
+
/**
|
|
184
|
+
* Internal method to determine the language from the provided code.
|
|
185
|
+
*
|
|
186
|
+
* Внутренний метод для определения языка по предоставленному коду.
|
|
187
|
+
* @param code location or language code / код локации или языка
|
|
188
|
+
* @returns language code / код языка
|
|
189
|
+
*/
|
|
190
|
+
private findLanguage;
|
|
191
|
+
/**
|
|
192
|
+
* Internal method to extract country code from a location string.
|
|
193
|
+
*
|
|
194
|
+
* Внутренний метод для извлечения кода страны из строки локации.
|
|
195
|
+
* @param code combined string / комбинированная строка
|
|
196
|
+
* @returns country code / код страны
|
|
197
|
+
*/
|
|
198
|
+
private toCountry;
|
|
199
|
+
/**
|
|
200
|
+
* Internal method to extract language code from a location string.
|
|
201
|
+
*
|
|
202
|
+
* Внутренний метод для извлечения кода языка из строки локации.
|
|
203
|
+
* @param code combined string / комбинированная строка
|
|
204
|
+
* @returns language code / код языка
|
|
205
|
+
*/
|
|
206
|
+
private toLanguage;
|
|
207
|
+
/**
|
|
208
|
+
* Internal method to fill missing fields in a geo item.
|
|
209
|
+
*
|
|
210
|
+
* Внутренний метод для заполнения отсутствующих полей в гео-объекте.
|
|
211
|
+
* @param item basic geo item / базовый гео-объект
|
|
212
|
+
* @returns full geo item data / полные данные гео-объекта
|
|
213
|
+
*/
|
|
214
|
+
private toFull;
|
|
215
|
+
}
|