@dxtmisha/functional-basic 1.1.0 → 1.1.5
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 +66 -0
- package/ai-types.txt +499 -492
- package/dist/library.d.ts +178 -9
- package/dist/library.js +415 -337
- package/package.json +3 -2
package/dist/library.d.ts
CHANGED
|
@@ -69,6 +69,13 @@ export declare class Api {
|
|
|
69
69
|
* @returns HTML script element string / строка HTML элемента script
|
|
70
70
|
*/
|
|
71
71
|
static getHydrationScript(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the base origin URL combined with the API path.
|
|
74
|
+
*
|
|
75
|
+
* Получает базовый URL источника, объединенный с путем API.
|
|
76
|
+
* @returns final base URL string / итоговая строка базового URL
|
|
77
|
+
*/
|
|
78
|
+
static getOrigin(): string;
|
|
72
79
|
/**
|
|
73
80
|
* Gets the full path to the request script.
|
|
74
81
|
*
|
|
@@ -145,6 +152,14 @@ export declare class Api {
|
|
|
145
152
|
* @returns void / ничего не возвращает
|
|
146
153
|
*/
|
|
147
154
|
static setTimeout(timeout: number): void;
|
|
155
|
+
/**
|
|
156
|
+
* Changes the origin (protocol and domain) for the base URL.
|
|
157
|
+
*
|
|
158
|
+
* Изменяет источник (протокол и домен) для базового URL.
|
|
159
|
+
* @param origin protocol and domain / протокол и домен
|
|
160
|
+
* @returns void / ничего не возвращает
|
|
161
|
+
*/
|
|
162
|
+
static setOrigin(origin: string): void;
|
|
148
163
|
/**
|
|
149
164
|
* Sets multiple API configuration options at once.
|
|
150
165
|
*
|
|
@@ -378,6 +393,8 @@ export declare type ApiCacheList = Record<string, ApiCacheItem>;
|
|
|
378
393
|
export declare type ApiConfig = {
|
|
379
394
|
/** Base URL for API requests/ Базовый URL для API-запросов */
|
|
380
395
|
urlRoot?: string;
|
|
396
|
+
/** Base origin for API requests (protocol and domain)/ Базовый источник для API-запросов (протокол и домен) */
|
|
397
|
+
origin?: string;
|
|
381
398
|
/** Default headers for API requests/ Заголовки по умолчанию для API-запросов */
|
|
382
399
|
headers?: Record<string, string>;
|
|
383
400
|
/** Default request data for API requests/ Данные запроса по умолчанию для API-запросов */
|
|
@@ -722,6 +739,7 @@ export declare class ApiInstance {
|
|
|
722
739
|
protected hydration: ApiHydration;
|
|
723
740
|
/** Timeout for the request in milliseconds / Таймаут запроса в миллисекундах */
|
|
724
741
|
protected timeout: number;
|
|
742
|
+
protected origin?: string;
|
|
725
743
|
/**
|
|
726
744
|
* Constructor
|
|
727
745
|
* @param url base path to the script / базовый путь к скрипту
|
|
@@ -756,6 +774,13 @@ export declare class ApiInstance {
|
|
|
756
774
|
* @returns ApiHydration instance / экземпляр ApiHydration
|
|
757
775
|
*/
|
|
758
776
|
getHydration(): ApiHydration;
|
|
777
|
+
/**
|
|
778
|
+
* Gets the base origin URL combined with the API path.
|
|
779
|
+
*
|
|
780
|
+
* Получает базовый URL источника, объединенный с путем API.
|
|
781
|
+
* @returns final base URL string / итоговая строка базового URL
|
|
782
|
+
*/
|
|
783
|
+
getOrigin(): string;
|
|
759
784
|
/**
|
|
760
785
|
* Gets the full path to the request script.
|
|
761
786
|
*
|
|
@@ -773,7 +798,7 @@ export declare class ApiInstance {
|
|
|
773
798
|
* @param method HTTP method / HTTP метод
|
|
774
799
|
* @returns body data for non-GET requests or FormData / данные тела для не-GET запросов или FormData
|
|
775
800
|
*/
|
|
776
|
-
getBody(request?: ApiFetch['request'], method?:
|
|
801
|
+
getBody(request?: ApiFetch['request'], method?: ApiMethod): string | FormData | undefined;
|
|
777
802
|
/**
|
|
778
803
|
* Gets query string for GET method requests.
|
|
779
804
|
*
|
|
@@ -783,7 +808,7 @@ export declare class ApiInstance {
|
|
|
783
808
|
* @param method HTTP method / HTTP метод
|
|
784
809
|
* @returns query string with prefix (? or &) / строка запроса с префиксом (? или &)
|
|
785
810
|
*/
|
|
786
|
-
getBodyForGet(request: ApiFetch['request'], path?: string, method?:
|
|
811
|
+
getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethod): string;
|
|
787
812
|
/**
|
|
788
813
|
* Returns a string representation of the hydration data for the client.
|
|
789
814
|
*
|
|
@@ -833,6 +858,13 @@ export declare class ApiInstance {
|
|
|
833
858
|
* @param timeout timeout in milliseconds / таймаут в миллисекундах
|
|
834
859
|
*/
|
|
835
860
|
setTimeout(timeout: number): this;
|
|
861
|
+
/**
|
|
862
|
+
* Changes the origin (protocol and domain) for the base URL.
|
|
863
|
+
*
|
|
864
|
+
* Изменяет источник (протокол и домен) для базового URL.
|
|
865
|
+
* @param origin protocol and domain / протокол и домен
|
|
866
|
+
*/
|
|
867
|
+
setOrigin(origin: string): this;
|
|
836
868
|
/**
|
|
837
869
|
* Executes a request with the given path or configuration.
|
|
838
870
|
*
|
|
@@ -903,9 +935,10 @@ export declare class ApiInstance {
|
|
|
903
935
|
*
|
|
904
936
|
* Выполнение HTTP-запроса.
|
|
905
937
|
* @param apiFetch fetch configuration / конфигурация запроса
|
|
938
|
+
* @param pathToApi base path to API / базовый путь к API
|
|
906
939
|
* @returns object containing response and optional timeout ID / объект, содержащий ответ и опциональный ID таймера
|
|
907
940
|
*/
|
|
908
|
-
protected makeQuery(apiFetch: ApiFetch): Promise<{
|
|
941
|
+
protected makeQuery(apiFetch: ApiFetch, pathToApi: string): Promise<{
|
|
909
942
|
query: Response;
|
|
910
943
|
timeoutId: any;
|
|
911
944
|
}>;
|
|
@@ -961,7 +994,7 @@ export declare type ApiInstanceOptions = {
|
|
|
961
994
|
* Supported HTTP methods type/ Тип HTTP-методов
|
|
962
995
|
* (derived from ApiMethodItem enum)/ (получен из перечисления ApiMethodItem)
|
|
963
996
|
*/
|
|
964
|
-
export declare type ApiMethod = string
|
|
997
|
+
export declare type ApiMethod = string | ApiMethodItem;
|
|
965
998
|
|
|
966
999
|
/**
|
|
967
1000
|
* Supported HTTP methods for API requests.
|
|
@@ -1123,6 +1156,14 @@ export declare class ApiResponse {
|
|
|
1123
1156
|
* @returns emulated response or undefined / эмулированный ответ или undefined
|
|
1124
1157
|
*/
|
|
1125
1158
|
emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Executes the emulator synchronously if available.
|
|
1161
|
+
*
|
|
1162
|
+
* Выполняет эмулятор синхронно, если доступно.
|
|
1163
|
+
* @param apiFetch fetch configuration / конфигурация запроса
|
|
1164
|
+
* @returns emulated response or undefined / эмулированный ответ или undefined
|
|
1165
|
+
*/
|
|
1166
|
+
emulatorAsync<T>(apiFetch: ApiFetch): T | undefined;
|
|
1126
1167
|
/**
|
|
1127
1168
|
* Checks if the cached item is disabled.
|
|
1128
1169
|
*
|
|
@@ -1166,6 +1207,17 @@ export declare class ApiResponse {
|
|
|
1166
1207
|
* @returns true if requests match / true, если запросы совпадают
|
|
1167
1208
|
*/
|
|
1168
1209
|
protected isResponse(item: ApiResponseItem, request?: ApiFetch['request']): boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* Reads cached data configuration.
|
|
1212
|
+
*
|
|
1213
|
+
* Считывает конфигурацию кешированных данных.
|
|
1214
|
+
* @param apiFetch fetch configuration / конфигурация запроса
|
|
1215
|
+
* @returns object with response and request data or undefined / объект с данными ответа и запроса или undefined
|
|
1216
|
+
*/
|
|
1217
|
+
protected readData(apiFetch: ApiFetch): {
|
|
1218
|
+
response: ApiResponseItem;
|
|
1219
|
+
request: string | Record<string, any> | FormData | undefined;
|
|
1220
|
+
} | undefined;
|
|
1169
1221
|
/**
|
|
1170
1222
|
* Emulates an execution request (internal fetch).
|
|
1171
1223
|
*
|
|
@@ -1175,6 +1227,14 @@ export declare class ApiResponse {
|
|
|
1175
1227
|
* @returns Promise with emulated response data / Promise с эмулированными данными ответа
|
|
1176
1228
|
*/
|
|
1177
1229
|
protected fetch<T>(response: ApiResponseItem, request?: ApiFetch['request']): Promise<T>;
|
|
1230
|
+
/**
|
|
1231
|
+
* Emulates an execution request synchronously (internal fetch).
|
|
1232
|
+
*
|
|
1233
|
+
* Эмулирует запрос выполнения синхронно (внутренний fetch).
|
|
1234
|
+
* @param response response item for emulation / элемент ответа для эмуляции
|
|
1235
|
+
* @returns emulated response data / эмулированные данные ответа
|
|
1236
|
+
*/
|
|
1237
|
+
protected fetchAsync<T>(response: ApiResponseItem): T;
|
|
1178
1238
|
/**
|
|
1179
1239
|
* Enables loading for request emulation.
|
|
1180
1240
|
*
|
|
@@ -1736,6 +1796,16 @@ export declare type CookieOptions = {
|
|
|
1736
1796
|
age?: number;
|
|
1737
1797
|
/** SameSite attribute / Атрибут SameSite */
|
|
1738
1798
|
sameSite?: CookieSameSite_2;
|
|
1799
|
+
/** Path / Путь */
|
|
1800
|
+
path?: string;
|
|
1801
|
+
/** Domain / Домен */
|
|
1802
|
+
domain?: string;
|
|
1803
|
+
/** Secure attribute / Атрибут Secure */
|
|
1804
|
+
secure?: boolean;
|
|
1805
|
+
/** HttpOnly attribute / Атрибут HttpOnly */
|
|
1806
|
+
httpOnly?: boolean;
|
|
1807
|
+
/** Partitioned attribute / Атрибут Partitioned */
|
|
1808
|
+
partitioned?: boolean;
|
|
1739
1809
|
/** Additional arguments / Дополнительные аргументы */
|
|
1740
1810
|
arguments?: string[] | Record<string, string | number | boolean>;
|
|
1741
1811
|
};
|
|
@@ -1756,8 +1826,10 @@ export { CookieSameSite_2 as CookieSameSite }
|
|
|
1756
1826
|
export declare class CookieStorage {
|
|
1757
1827
|
/** Storage mechanism for getting data / механизм хранения для получения данных */
|
|
1758
1828
|
protected static getListener?: (key: string) => any | undefined;
|
|
1829
|
+
/** Storage mechanism for getting raw data / механизм хранения для получения сырых данных */
|
|
1830
|
+
protected static getListenerRaw?: () => string;
|
|
1759
1831
|
/** Storage mechanism for setting data / механизм хранения для сохранения данных */
|
|
1760
|
-
protected static setListener?: (key: string, value: any, options?: CookieOptions) => void;
|
|
1832
|
+
protected static setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void;
|
|
1761
1833
|
/**
|
|
1762
1834
|
* Initializes the storage with listeners.
|
|
1763
1835
|
*
|
|
@@ -1765,7 +1837,7 @@ export declare class CookieStorage {
|
|
|
1765
1837
|
* @param getListener Storage mechanism for getting data / механизм хранения для получения данных
|
|
1766
1838
|
* @param setListener Storage mechanism for setting data / механизм хранения для сохранения данных
|
|
1767
1839
|
*/
|
|
1768
|
-
static init(getListener
|
|
1840
|
+
static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
|
|
1769
1841
|
/**
|
|
1770
1842
|
* Resets the storage by clearing all in-memory items and resetting listeners.
|
|
1771
1843
|
*
|
|
@@ -1805,6 +1877,15 @@ export declare class CookieStorage {
|
|
|
1805
1877
|
* Обновляет данные из cookies.
|
|
1806
1878
|
*/
|
|
1807
1879
|
static update(): void;
|
|
1880
|
+
/**
|
|
1881
|
+
* Formats the cookie string for storage.
|
|
1882
|
+
*
|
|
1883
|
+
* Форматирует строку cookie для хранения.
|
|
1884
|
+
* @param name cookie name / имя cookie
|
|
1885
|
+
* @param value cookie value / значение cookie
|
|
1886
|
+
* @param options additional parameters / дополнительные параметры
|
|
1887
|
+
*/
|
|
1888
|
+
protected static format(name: string, value: string, options?: CookieOptions): string;
|
|
1808
1889
|
/**
|
|
1809
1890
|
* Check if the current environment is a DOM environment.
|
|
1810
1891
|
*
|
|
@@ -1812,6 +1893,14 @@ export declare class CookieStorage {
|
|
|
1812
1893
|
* @returns True if the current environment is a DOM environment, false otherwise / Возвращает true, если текущее окружение является DOM-окружением, иначе false
|
|
1813
1894
|
*/
|
|
1814
1895
|
protected static hasDom(): boolean;
|
|
1896
|
+
/**
|
|
1897
|
+
* Parses the cookie string into a key-value pair object.
|
|
1898
|
+
*
|
|
1899
|
+
* Разбирает строку cookie в объект пар ключ-значение.
|
|
1900
|
+
* @param cookie cookie string / строка cookie
|
|
1901
|
+
* @returns Record<string, any> parsed items / разобранные элементы
|
|
1902
|
+
*/
|
|
1903
|
+
protected static parse(cookie: string): Record<string, any>;
|
|
1815
1904
|
/**
|
|
1816
1905
|
* Initialize storage if not initialized.
|
|
1817
1906
|
*
|
|
@@ -1833,6 +1922,41 @@ export declare class CookieStorage {
|
|
|
1833
1922
|
* @param sameSite SameSite attribute / атрибут SameSite
|
|
1834
1923
|
*/
|
|
1835
1924
|
protected static toSameSite(sameSite?: CookieOptions['sameSite']): string;
|
|
1925
|
+
/**
|
|
1926
|
+
* Converts the value to a string for the path attribute.
|
|
1927
|
+
*
|
|
1928
|
+
* Преобразует значение в строку для атрибута path.
|
|
1929
|
+
* @param path Path / путь
|
|
1930
|
+
*/
|
|
1931
|
+
protected static toPath(path?: CookieOptions['path']): string;
|
|
1932
|
+
/**
|
|
1933
|
+
* Converts the value to a string for the domain attribute.
|
|
1934
|
+
*
|
|
1935
|
+
* Преобразует значение в строку для атрибута domain.
|
|
1936
|
+
* @param domain Domain / домен
|
|
1937
|
+
*/
|
|
1938
|
+
protected static toDomain(domain?: CookieOptions['domain']): string | undefined;
|
|
1939
|
+
/**
|
|
1940
|
+
* Converts the value to a string for the secure attribute.
|
|
1941
|
+
*
|
|
1942
|
+
* Преобразует значение в строку для атрибута secure.
|
|
1943
|
+
* @param secure Secure attribute / атрибут secure
|
|
1944
|
+
*/
|
|
1945
|
+
protected static toSecure(secure?: CookieOptions['secure']): string | undefined;
|
|
1946
|
+
/**
|
|
1947
|
+
* Converts the value to a string for the HttpOnly attribute.
|
|
1948
|
+
*
|
|
1949
|
+
* Преобразует значение в строку для атрибута HttpOnly.
|
|
1950
|
+
* @param httpOnly HttpOnly attribute / атрибут HttpOnly
|
|
1951
|
+
*/
|
|
1952
|
+
protected static toHttpOnly(httpOnly?: CookieOptions['httpOnly']): string | undefined;
|
|
1953
|
+
/**
|
|
1954
|
+
* Converts the value to a string for the partitioned attribute.
|
|
1955
|
+
*
|
|
1956
|
+
* Преобразует значение в строку для атрибута partitioned.
|
|
1957
|
+
* @param partitioned Partitioned attribute / атрибут partitioned
|
|
1958
|
+
*/
|
|
1959
|
+
protected static toPartitioned(partitioned?: CookieOptions['partitioned']): string | undefined;
|
|
1836
1960
|
/**
|
|
1837
1961
|
* Converts additional arguments to an array of strings.
|
|
1838
1962
|
*
|
|
@@ -5234,6 +5358,16 @@ export declare class Icons {
|
|
|
5234
5358
|
* @returns icon path or content/ путь к иконке или контент
|
|
5235
5359
|
*/
|
|
5236
5360
|
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
5361
|
+
/**
|
|
5362
|
+
* Returns the icon if it is already loaded or is a string.
|
|
5363
|
+
*
|
|
5364
|
+
* Возвращает иконку, если она уже загружена или является строкой.
|
|
5365
|
+
* @param index icon name/ название иконки
|
|
5366
|
+
* @param url path to the storage location of the icon, if the icon does not exist/
|
|
5367
|
+
* путь к месту хранения иконки, если иконка не существует
|
|
5368
|
+
* @returns icon path or content/ путь к иконке или контент
|
|
5369
|
+
*/
|
|
5370
|
+
static getAsync(index: string, url?: string): string;
|
|
5237
5371
|
/**
|
|
5238
5372
|
* Returns a list of names of all registered icons.
|
|
5239
5373
|
*
|
|
@@ -5300,6 +5434,16 @@ export declare class Icons {
|
|
|
5300
5434
|
* @returns icon name with prefix/ название иконки с префиксом
|
|
5301
5435
|
*/
|
|
5302
5436
|
protected static getName(index: string): string;
|
|
5437
|
+
/**
|
|
5438
|
+
* Returns the raw icon data by the name.
|
|
5439
|
+
*
|
|
5440
|
+
* Возвращает исходные данные иконки по названию.
|
|
5441
|
+
* @param index icon name/ название иконки
|
|
5442
|
+
* @param url path to the storage location of the icon, if the icon does not exist/
|
|
5443
|
+
* путь к месту хранения иконки, если иконка не существует
|
|
5444
|
+
* @returns icon path or content/ путь к иконке или контент
|
|
5445
|
+
*/
|
|
5446
|
+
protected static getRaw(index: string, url?: string): IconsItem;
|
|
5303
5447
|
/**
|
|
5304
5448
|
* Script execution delay.
|
|
5305
5449
|
*
|
|
@@ -5956,6 +6100,13 @@ export declare class Meta extends MetaManager<MetaTag[]> {
|
|
|
5956
6100
|
* @returns complete HTML string/ полная HTML-строка
|
|
5957
6101
|
*/
|
|
5958
6102
|
html(): string;
|
|
6103
|
+
/**
|
|
6104
|
+
* Generates the title as an HTML-safe string.
|
|
6105
|
+
*
|
|
6106
|
+
* Генерирует заголовок в виде HTML-безопасной строки.
|
|
6107
|
+
* @returns title HTML-safe string / HTML-безопасная строка заголовка
|
|
6108
|
+
*/
|
|
6109
|
+
htmlTitle(): string;
|
|
5959
6110
|
/**
|
|
5960
6111
|
* Gets the formatted suffix with separator.
|
|
5961
6112
|
*
|
|
@@ -6069,6 +6220,14 @@ export declare class MetaManager<T extends readonly string[], Key extends keyof
|
|
|
6069
6220
|
* @returns HTML string / HTML-строка
|
|
6070
6221
|
*/
|
|
6071
6222
|
protected toHtmlString(name: Key): string;
|
|
6223
|
+
/**
|
|
6224
|
+
* Converts the title to an HTML-safe string.
|
|
6225
|
+
*
|
|
6226
|
+
* Преобразует заголовок в HTML-безопасную строку.
|
|
6227
|
+
* @param title page title / заголовок страницы
|
|
6228
|
+
* @returns encoded title string / закодированная строка заголовка
|
|
6229
|
+
*/
|
|
6230
|
+
protected toHtmlTitle(title: string): string;
|
|
6072
6231
|
/**
|
|
6073
6232
|
* Updates meta tags data from the DOM.
|
|
6074
6233
|
*
|
|
@@ -6774,6 +6933,13 @@ export declare class MetaStatic {
|
|
|
6774
6933
|
* @returns complete HTML string / полная HTML-строка
|
|
6775
6934
|
*/
|
|
6776
6935
|
static html(): string;
|
|
6936
|
+
/**
|
|
6937
|
+
* Generates the title as an HTML-safe string.
|
|
6938
|
+
*
|
|
6939
|
+
* Генерирует заголовок в виде HTML-безопасной строки.
|
|
6940
|
+
* @returns title HTML-safe string / HTML-безопасная строка заголовка
|
|
6941
|
+
*/
|
|
6942
|
+
static htmlTitle(): string;
|
|
6777
6943
|
}
|
|
6778
6944
|
|
|
6779
6945
|
/**
|
|
@@ -7822,7 +7988,7 @@ export declare function secondToTime(second: number | string | undefined, hasHou
|
|
|
7822
7988
|
*/
|
|
7823
7989
|
export declare class ServerStorage {
|
|
7824
7990
|
protected static storage?: ServerStorageList;
|
|
7825
|
-
protected static listener?: () => Record<string, any
|
|
7991
|
+
protected static listener?: () => Record<string, any> | undefined;
|
|
7826
7992
|
protected static hideError?: boolean;
|
|
7827
7993
|
/**
|
|
7828
7994
|
* Initializes the storage with a context listener.
|
|
@@ -7831,7 +7997,7 @@ export declare class ServerStorage {
|
|
|
7831
7997
|
* @param listener function that returns the current request context / функция, возвращающая контекст текущего запроса
|
|
7832
7998
|
* @returns this instance / текущий класс
|
|
7833
7999
|
*/
|
|
7834
|
-
static init(listener: () => Record<string, any>): typeof ServerStorage;
|
|
8000
|
+
static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
|
|
7835
8001
|
/**
|
|
7836
8002
|
* Resets the storage.
|
|
7837
8003
|
*
|
|
@@ -7891,9 +8057,12 @@ export declare class ServerStorage {
|
|
|
7891
8057
|
* Returns storage.
|
|
7892
8058
|
*
|
|
7893
8059
|
* Возвращает хранилище.
|
|
8060
|
+
* @param isInit whether to initialize the storage if it does not exist /
|
|
8061
|
+
* инициализировать ли хранилище, если оно не существует
|
|
8062
|
+
* @param status optional status for error reporting / необязательный статус для отчета об ошибках
|
|
7894
8063
|
* @returns storage list / список хранилища
|
|
7895
8064
|
*/
|
|
7896
|
-
protected static getStorage(): ServerStorageList;
|
|
8065
|
+
protected static getStorage(isInit?: boolean, status?: string): ServerStorageList;
|
|
7897
8066
|
/**
|
|
7898
8067
|
* Returns storage from DOM.
|
|
7899
8068
|
*
|