@dxtmisha/functional-basic 1.8.4 → 1.8.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/ai-types.md CHANGED
@@ -1,1488 +1,2559 @@
1
1
  All these methods are in the @dxtmisha/functional-basic library.
2
2
 
3
- export declare enum ApiMethodItem {
4
- delete = "DELETE",
5
- get = "GET",
6
- post = "POST",
7
- put = "PUT",
8
- patch = "PATCH"
3
+ /** HTTP requests wrapper and singleton manager */
4
+ export declare class Api {
5
+ static isLocalhost(): boolean;
6
+ static getItem(): ApiInstance;
7
+ static getStatus(): ApiStatus;
8
+ static getResponse(): ApiResponse;
9
+ static getHydration(): ApiHydration;
10
+ static getHydrationScript(): string;
11
+ static getOrigin(): string;
12
+ static getUrl(path: string, api?: boolean): string;
13
+ /** Extracts body data for non-GET requests or FormData */
14
+ static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
15
+ /** Constructs query string for GET methods */
16
+ static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
17
+ static setHeaders(headers: ApiHeadersValue): void;
18
+ static setRequestDefault(request: ApiDefaultValue): void;
19
+ static setUrl(url: string): void;
20
+ static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
21
+ static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
22
+ static setTimeout(timeout: number): void;
23
+ static setOrigin(origin: string): void;
24
+ static setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): void;
25
+ static setConfig(config?: ApiConfig): void;
26
+ static request<T>(pathRequest: string | ApiFetch): Promise<T>;
27
+ static get<T>(request: ApiFetch): Promise<T>;
28
+ static post<T>(request: ApiFetch): Promise<T>;
29
+ static put<T>(request: ApiFetch): Promise<T>;
30
+ static patch<T>(request: ApiFetch): Promise<T>;
31
+ static delete<T>(request: ApiFetch): Promise<T>;
9
32
  }
10
- export type ApiCacheItem<T = any> = {
11
- value: T;
12
- age?: number;
13
- cacheAge: number;
14
- };
15
- export type ApiCacheList = Record<string, ApiCacheItem>;
16
- export type ApiConfig = {
17
- urlRoot?: string;
18
- origin?: string;
19
- headers?: ApiHeadersValue;
20
- requestDefault?: ApiDefaultValue;
21
- preparation?: (apiFetch: ApiFetch) => Promise<void>;
22
- end?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
23
- timeout?: number;
24
- devMode?: boolean;
33
+ /** API response caching manager */
34
+ export declare class ApiCache {
35
+ protected static getListener?: (key: string) => Promise<ApiCacheItem | undefined>;
36
+ protected static setListener?: (key: string, value: ApiCacheItem) => Promise<boolean>;
37
+ protected static removeListener?: (key: string) => Promise<boolean>;
38
+ /** Initializes storage listeners and sets the data retrieval count before cache cleaning */
39
+ static init(getListener: (key: string) => Promise<ApiCacheItem | undefined>, setListener: (key: string, value: ApiCacheItem) => Promise<boolean>, removeListener: (key: string) => Promise<boolean>, cacheStepAgeClearOld?: number): void;
40
+ static reset(): void;
41
+ static get<T>(key: string): Promise<T | undefined>;
42
+ static getByFetch<T>(fetch: ApiFetch): Promise<T | undefined>;
43
+ static set<T>(key: string, value: T, age?: number): Promise<void>;
44
+ static setByFetch<T>(fetch: ApiFetch, value: T): Promise<void>;
45
+ static remove(key: string): Promise<void>;
46
+ protected static isCache(fetch: ApiFetch): boolean;
47
+ protected static isAge(item?: ApiCacheItem): boolean;
48
+ protected static isItem(key: string): boolean;
49
+ protected static generateKey(fetch: ApiFetch): string;
50
+ protected static getItemOrListener(key: string): Promise<ApiCacheItem | undefined>;
51
+ protected static getList(): ApiCacheList;
52
+ protected static setItemOrListener(key: string, value: ApiCacheItem): Promise<void>;
53
+ protected static removeItemOrListener(key: string): Promise<void>;
54
+ protected static clearOld(): Promise<void>;
55
+ }
56
+ /** Formats and processes API response raw data */
57
+ export declare class ApiDataReturn<T = any> {
58
+ constructor(apiFetch: ApiFetch, query: Response, end: ApiPreparationEnd, error?: ApiErrorItem | undefined);
59
+ init(): Promise<this>;
60
+ get(): ApiData<T>;
61
+ getAndStatus(status: ApiStatus): ApiData<T>;
62
+ getData(): ApiData<T> | undefined;
63
+ protected readData<T>(): Promise<ApiData<T>>;
64
+ protected initData(): ApiData<T>;
65
+ /** Initializes result and merges metadata from raw response data */
66
+ protected initItem(data: Record<string, any>): ApiData<T>;
67
+ }
68
+ /** Default API request data manager */
69
+ export declare class ApiDefault {
70
+ is(): boolean;
71
+ get(): Record<string, any> | undefined;
72
+ request(request: ApiFetch['request']): ApiFetch['request'];
73
+ set(request: ApiDefaultValue): this;
74
+ protected addByFormData(request: FormData, value: ApiDefaultValue): this;
75
+ }
76
+ /** API error storage and response wrapper utility */
77
+ export declare class ApiError {
78
+ static getStorage(): ApiErrorStorage;
79
+ static add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): void;
80
+ /** Creates an ApiErrorItem matching response against stored error criteria */
81
+ static getItem(method: ApiMethodItem, response: Response): Promise<ApiErrorItem>;
82
+ }
83
+ /** Encapsulates request method, raw response, and identified error criteria for processing */
84
+ export declare class ApiErrorItem {
85
+ constructor(method: ApiMethodItem, response: Response, error: ApiErrorStorageItem);
86
+ getMethod(): ApiMethodItem;
87
+ getResponse(): Response;
88
+ getError(): ApiErrorStorageItem;
89
+ getCode(): string | undefined;
90
+ getMessage(): string | undefined;
91
+ getStatus(): number;
92
+ }
93
+ /** Centralized storage manager to identify errors by matching status, code, method, and URL */
94
+ export declare class ApiErrorStorage {
95
+ find(method: ApiMethodItem, response: Response): Promise<ApiErrorStorageItem>;
96
+ add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): this;
97
+ protected findItem(method: ApiMethodItem, response: Response, code?: string): ApiErrorStorageItem | undefined;
98
+ protected isUrl(url: string, pattern: string | RegExp): boolean;
99
+ protected getBody(response: Response): Promise<any>;
100
+ protected getDataByKey<R = string>(body: any, key: string): R | undefined;
101
+ protected getCode(body: any): string | undefined;
102
+ protected getMessage(body: any): string | undefined;
103
+ }
104
+ /** API request headers manager */
105
+ export declare class ApiHeaders {
106
+ get(value?: Record<string, string> | null, type?: string | undefined | null): Record<string, string> | undefined;
107
+ getByRequest(request: ApiFetch['request'], value?: Record<string, string> | null, type?: string): Record<string, string> | undefined;
108
+ set(headers: ApiHeadersValue): this;
109
+ }
110
+ /** Collects API data for SSR client hydration */
111
+ export declare class ApiHydration {
112
+ initResponse(response: ApiResponse): void;
113
+ toClient<T>(apiFetch: ApiFetch, response: T): void;
114
+ toString(): string;
115
+ protected getListByClient(): ApiHydrationList;
116
+ }
117
+ export type ApiInstanceOptions = {
118
+ headersClass?: typeof ApiHeaders;
119
+ requestDefaultClass?: typeof ApiDefault;
120
+ statusClass?: typeof ApiStatus;
121
+ responseClass?: typeof ApiResponse;
122
+ preparationClass?: typeof ApiPreparation;
123
+ loadingClass?: LoadingInstance;
124
+ errorCenterClass?: ErrorCenterInstance;
125
+ hydrationClass?: typeof ApiHydration;
25
126
  wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
26
127
  };
27
- export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
28
- export type ApiDataValidation = {
29
- status?: ApiStatusType;
30
- code?: string | number;
31
- message?: string;
32
- error?: {
33
- code?: string | number;
34
- message?: string;
35
- };
36
- };
37
- export type ApiDataItem<T = any> = T & ApiDataValidation & {
38
- data?: T;
39
- success?: boolean;
40
- statusObject?: ApiStatusItem;
41
- errorObject?: ApiErrorItem;
42
- };
43
- export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
44
- export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
45
- export type ApiFetch = {
46
- api?: boolean;
128
+ /** Core class for managing HTTP requests using the Fetch API */
129
+ export declare class ApiInstance {
130
+ protected wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
131
+ constructor(url?: string, options?: ApiInstanceOptions);
132
+ isLocalhost(): boolean;
133
+ getStatus(): ApiStatus;
134
+ getResponse(): ApiResponse;
135
+ getHydration(): ApiHydration;
136
+ getOrigin(): string;
137
+ getUrl(path: string, api?: boolean): string;
138
+ getBody(request?: ApiFetch['request'], method?: ApiMethod): string | FormData | undefined;
139
+ getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethod): string;
140
+ getHydrationScript(): string;
141
+ setHeaders(headers: ApiHeadersValue): this;
142
+ setRequestDefault(request: ApiDefaultValue): this;
143
+ setUrl(url: string): this;
144
+ setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): this;
145
+ setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
146
+ setTimeout(timeout: number): this;
147
+ setOrigin(origin: string): this;
148
+ setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): this;
149
+ request<T>(pathRequest: string | ApiFetch): Promise<T>;
150
+ get<T>(request: ApiFetch): Promise<T>;
151
+ post<T>(request: ApiFetch): Promise<T>;
152
+ put<T>(request: ApiFetch): Promise<T>;
153
+ patch<T>(request: ApiFetch): Promise<T>;
154
+ delete<T>(request: ApiFetch): Promise<T>;
155
+ protected getRetryDelay(retryCount: number, retryDelay: number): number;
156
+ protected fetch<T>(apiFetch: ApiFetch, retryCount?: number): Promise<T>;
157
+ protected makeQuery(apiFetch: ApiFetch, pathToApi: string): Promise<{
158
+ query: Response;
159
+ timeoutId: any;
160
+ }>;
161
+ protected makeError(error: Record<string, any> & {
162
+ name: string;
163
+ }, group?: string): void;
164
+ protected makeErrorQuery(error: ApiErrorItem | Response): void;
165
+ protected initController(apiFetch: ApiFetch, fetchInit: RequestInit): any;
166
+ }
167
+ /** Class for preparing requests */
168
+ export declare class ApiPreparation {
169
+ protected callback?: (apiFetch: ApiFetch) => Promise<void>;
170
+ protected callbackEnd?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
171
+ make(active: boolean, apiFetch: ApiFetch): Promise<void>;
172
+ makeEnd(active: boolean, query: Response, apiFetch: ApiFetch): Promise<ApiPreparationEnd>;
173
+ set(callback: (apiFetch: ApiFetch) => Promise<void>): this;
174
+ setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
175
+ protected go(apiFetch: ApiFetch, limit?: number): Promise<void>;
176
+ }
177
+ /** Manager for working with API responses and cache emulation */
178
+ export declare class ApiResponse {
179
+ constructor(requestDefault: ApiDefault);
180
+ get(path: string | undefined, method: ApiMethod, request?: ApiFetch['request'], devMode?: boolean): ApiResponseItem | undefined;
181
+ getList(): (ApiResponseItem & Record<string, any>)[];
182
+ add(response: ApiResponseItem | ApiResponseItem[]): this;
183
+ setDevMode(devMode: boolean): this;
184
+ emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
185
+ emulatorAsync<T>(apiFetch: ApiFetch): T | undefined;
186
+ protected isDisable(item: ApiResponseItem): boolean;
187
+ protected isPath(item: ApiResponseItem, path: string): boolean;
188
+ protected isDevMode(devMode?: boolean): boolean;
189
+ protected isFirst(item: ApiResponseItem, devMode?: boolean): boolean;
190
+ protected isResponse(item: ApiResponseItem, request?: ApiFetch['request']): boolean;
191
+ protected readData(apiFetch: ApiFetch): {
192
+ response: ApiResponseItem;
193
+ request: string | Record<string, any> | FormData | undefined;
194
+ } | undefined;
195
+ protected fetch<T>(response: ApiResponseItem, request?: ApiFetch['request']): Promise<T>;
196
+ protected fetchAsync<T>(response: ApiResponseItem): T;
197
+ protected startResponseLoading(): void;
198
+ protected stopResponseLoading(): void;
199
+ }
200
+ /** API request status manager */
201
+ export declare class ApiStatus {
202
+ get(): ApiStatusItem | undefined;
203
+ getStatus(): number | undefined;
204
+ getStatusText(): string | undefined;
205
+ getStatusType(): ApiStatusType | undefined;
206
+ getCode(): string | undefined;
207
+ getError(): string | undefined;
208
+ getResponse<T>(): T | undefined;
209
+ getMessage(): string;
210
+ set(data: ApiStatusItem): this;
211
+ setStatus(status?: number, statusText?: string): this;
212
+ setError(error?: string): this;
213
+ setLastResponse(response?: any): this;
214
+ setLastStatus(status?: ApiStatusType): this;
215
+ setLastCode(code?: string): this;
216
+ setLastMessage(message?: string): this;
217
+ protected setValue<K extends keyof ApiStatusItem>(name: K, value?: ApiStatusItem[K]): void;
218
+ }
219
+ /** Class for working with BroadcastChannel messages */
220
+ export declare class BroadcastMessage<Message = any> {
221
+ protected callback?: ((event: MessageEvent<Message>) => void) | undefined;
222
+ protected callbackError?: ((event: MessageEvent<Message>) => void) | undefined;
223
+ constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
224
+ getChannel(): BroadcastChannel | undefined;
225
+ post(message: Message): this;
226
+ setCallback(callback: (event: MessageEvent<Message>) => void): this;
227
+ setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
228
+ destroy(): this;
229
+ protected readonly update: (event: MessageEvent<Message>) => this;
230
+ protected readonly updateError: (event: MessageEvent<Message>) => this;
231
+ }
232
+ /** Simple in-memory cache class that stores computed values by key
233
+ * @deprecated This class is obsolete and should not be used
234
+ */
235
+ export declare class Cache {
236
+ get<T>(name: string, callback: () => T, comparison?: any[]): T;
237
+ getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
238
+ }
239
+ /** Class for managing a single cached value with dependency tracking
240
+ * @deprecated This class is obsolete and should not be used
241
+ */
242
+ export declare class CacheItem<T> {
243
+ constructor(callback: () => T);
244
+ getCache(comparison: any[]): T;
245
+ getCacheOld(): T | undefined;
246
+ getCacheAsync(comparison: any[]): Promise<T>;
247
+ }
248
+ /** Static cache class that uses ServerStorage for persistent caching across the application
249
+ * @deprecated This class is obsolete and should not be used
250
+ */
251
+ export declare class CacheStatic {
252
+ protected static getItem(): Cache;
253
+ static get<T>(name: string, callback: () => T, comparison?: any[]): T;
254
+ static getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
255
+ }
256
+ /** Class for working with cookies */
257
+ export declare class Cookie<T> {
258
+ static getInstance<T>(name: string): Cookie<T>;
259
+ constructor(name: string);
260
+ get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): string | T | undefined;
261
+ set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
262
+ remove(): void;
263
+ }
264
+ /** Class for changing cookie access status */
265
+ export declare class CookieBlock {
266
+ static getItem(): CookieBlockInstance;
267
+ static get(): boolean;
268
+ static set(value: boolean): void;
269
+ }
270
+ /** Class for changing cookie access status */
271
+ export declare class CookieBlockInstance {
272
+ get(): boolean;
273
+ set(value: boolean): void;
274
+ }
275
+ /** Cookie sameSite attribute */
276
+ export type CookieSameSite = 'strict' | 'lax';
277
+ /** Cookie options */
278
+ export type CookieOptions = {
279
+ age?: number;
280
+ sameSite?: CookieSameSite;
47
281
  path?: string;
48
- pathFull?: string;
49
- method?: ApiMethod;
50
- request?: FormData | Record<string, any> | string;
51
- auth?: boolean;
52
- headers?: Record<string, string> | null;
53
- type?: string;
54
- toData?: boolean;
55
- global?: boolean;
56
- devMode?: boolean;
57
- hideError?: boolean;
58
- hideLoading?: boolean;
59
- retry?: number;
60
- retryDelay?: number;
61
- queryReturn?: (query: Response) => Promise<any | ApiDataValidation>;
62
- globalPreparation?: boolean;
63
- globalEnd?: boolean;
64
- init?: RequestInit;
65
- initError?: boolean;
66
- timeout?: number;
67
- controller?: AbortController;
68
- cache?: number;
69
- enableClientCache?: boolean;
70
- cacheId?: number | string;
71
- endResetLimit?: number;
72
- wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
282
+ domain?: string;
283
+ secure?: boolean;
284
+ httpOnly?: boolean;
285
+ partitioned?: boolean;
286
+ arguments?: string[] | Record<string, string | number | boolean>;
73
287
  };
74
- export type ApiHydrationItem = {
75
- path: string;
76
- method: ApiMethod;
77
- request?: ApiFetch['request'];
78
- response: any;
79
- };
80
- export type ApiHydrationList = ApiHydrationItem[];
81
- export type ApiErrorStorageItem = Record<string, any> & {
82
- url: string | RegExp;
83
- method: ApiMethodItem;
84
- code?: string;
85
- status?: number;
86
- validation?: (response: Response) => boolean;
87
- message?: string | ((response?: Response) => string);
88
- };
89
- export type ApiErrorStorageList = ApiErrorStorageItem[];
90
- export type ApiMethod = string | ApiMethodItem;
91
- export type ApiPreparationEnd = {
92
- reset?: boolean;
93
- data?: any;
94
- };
95
- export type ApiResponseItem = {
96
- path: string | RegExp;
97
- method: ApiMethod;
98
- request?: ApiFetch['request'] | '*any';
99
- response: any | ((request?: ApiFetch['request']) => any);
100
- disable?: any;
101
- isForGlobal?: boolean;
102
- lag?: any;
103
- };
104
- export type ApiStatusItem = {
105
- status?: number;
106
- statusText?: string;
107
- error?: string;
108
- lastResponse?: any;
109
- lastStatus?: ApiStatusType;
110
- lastCode?: string;
111
- lastMessage?: string;
112
- };
113
- export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
114
- export type Undefined = undefined | null;
115
- export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
116
- export type NumberOrString = number | string;
117
- export type NumberOrStringOrBoolean = number | string | boolean;
118
- export type NumberOrStringOrDate = NumberOrString | Date;
119
- export type NormalOrArray<T = NumberOrString> = T | T[];
120
- export type NormalOrPromise<T> = T | Promise<T>;
121
- export type ObjectItem<T = any> = Record<string, T>;
122
- export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
123
- export type ArrayToItem<T> = T extends any[] ? T[number] : T;
124
- export type FunctionReturn<R = any> = () => R;
125
- export type FunctionVoid = () => void;
126
- export type FunctionArgs<T, R> = (...args: T[]) => R;
127
- export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
128
- export type ItemList<T = any> = Record<string, T>;
129
- export type Item<V> = {
130
- index: string;
131
- value: V;
132
- };
133
- export type ItemValue<V> = {
134
- label: string;
135
- value: V;
136
- };
137
- export type ItemName<V> = {
138
- name: string | number;
139
- value: V;
140
- };
141
- export type ElementOrWindow = HTMLElement | Window;
142
- export type ElementOrString<E extends ElementOrWindow> = E | string;
143
- export type EventOptions = AddEventListenerOptions | boolean | undefined;
144
- export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
145
- export type EventActivityItem<E extends ElementOrWindow> = {
146
- element: E | undefined;
147
- type: string;
148
- listener?: (event: any | Event) => void;
149
- observer?: ResizeObserver;
150
- };
151
- export type ImageCoordinator = {
152
- x: number;
153
- y: number;
154
- };
155
- export type ErrorCenterGroup = string | undefined;
156
- export type ErrorCenterCauseItem<D = any> = {
157
- group?: ErrorCenterGroup;
158
- code: string;
159
- priority?: number;
160
- label?: string;
161
- message?: string;
162
- details?: D;
163
- };
164
- export type ErrorCenterCauseList = ErrorCenterCauseItem[];
165
- export type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
166
- export type ErrorCenterHandlerItem = {
167
- group?: ErrorCenterGroup;
168
- handlers: ErrorCenterHandlerCallback[];
169
- };
170
- export type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
171
- export type ErrorCenterHandlerIsConsoleCallback = (cause: ErrorCenterCauseItem) => boolean;
172
- export type ErrorCenterHandlerIsConsole = boolean | ErrorCenterHandlerIsConsoleCallback;
173
- export declare enum FormattersType {
174
- currency = "currency",
175
- date = "date",
176
- name = "name",
177
- number = "number",
178
- plural = "plural",
179
- unit = "unit"
180
- }
181
- export type FormattersOptionsCurrency = {
182
- currencyPropName?: string;
183
- options?: string | Intl.NumberFormatOptions;
184
- numberOnly?: boolean;
185
- };
186
- export type FormattersOptionsDate = {
187
- type?: GeoDate;
188
- options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions;
189
- hour24?: boolean;
190
- };
191
- export type FormattersOptionsName = {
192
- lastPropName?: string;
193
- firstPropName?: string;
194
- surname?: string;
195
- short?: boolean;
196
- };
197
- export type FormattersOptionsNumber = {
198
- options?: Intl.NumberFormatOptions;
199
- };
200
- export type FormattersOptionsPlural = {
201
- words: string;
202
- options?: Intl.PluralRulesOptions;
203
- optionsNumber?: Intl.NumberFormatOptions;
204
- };
205
- export type FormattersOptionsUnit = {
206
- unit: string | Intl.NumberFormatOptions;
207
- };
208
- export type FormattersOptionsInformation<Type extends FormattersType> = Type extends FormattersType.currency ? FormattersOptionsCurrency : Type extends FormattersType.date ? FormattersOptionsDate : Type extends FormattersType.name ? FormattersOptionsName : Type extends FormattersType.number ? FormattersOptionsNumber : Type extends FormattersType.plural ? FormattersOptionsPlural : Type extends FormattersType.unit ? FormattersOptionsUnit : Record<string, any>;
209
- export type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = {
210
- type?: Type;
211
- transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R;
212
- options?: FormattersOptionsInformation<Type>;
213
- };
214
- export type FormattersOptionsList = Record<string, FormattersOptionsItem>;
215
- export type FormattersListItem = Record<string, any>;
216
- export type FormattersList<Item extends FormattersListItem> = Item[];
217
- export type FormattersCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<FormattersCapitalize<Rest>>}` : K;
218
- export type FormattersColumns<T extends FormattersOptionsList> = (keyof T & string)[];
219
- export type FormattersKey<K, A extends string = 'Format'> = K extends string ? `${FormattersCapitalize<K>}${A}` : never;
220
- export type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = {
221
- [K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string;
222
- };
223
- export type FormattersListFormat<T extends FormattersListItem, K extends string[]> = FormattersDataItem<T, K>[];
224
- export type FormattersListColumnItem<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersDataItem<T, FormattersColumns<O>>;
225
- export type FormattersListColumns<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersListFormat<T, FormattersColumns<O>>;
226
- export type FormattersListProp = FormattersList<FormattersListItem> | FormattersListItem;
227
- export type FormattersItemProp<List extends FormattersListProp> = ArrayToItem<List>;
228
- export type FormattersReturn<List extends FormattersListProp, Options extends FormattersOptionsList = FormattersOptionsList, Item extends FormattersItemProp<List> = FormattersItemProp<List>> = List extends any[] ? FormattersListColumns<Item, Options> : (FormattersListColumnItem<Item, Options> | undefined);
229
- export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
230
- export type GeoFirstDay = 1 | 6 | 0;
231
- export type GeoHours = '12' | '24';
232
- export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
233
- export interface GeoItem {
234
- country: string;
235
- countryAlternative?: string[];
236
- language: string;
237
- languageAlternative?: string[];
238
- firstDay?: string | null;
239
- zone?: string | null;
240
- phoneCode?: string;
241
- phoneWithin?: string;
242
- phoneMask?: string | string[];
243
- nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
244
- unit?: {
245
- 'millimeter'?: string;
246
- 'centimeter'?: string;
247
- 'meter'?: string;
248
- 'kilometer'?: string;
249
- 'square-meter'?: string;
250
- 'hectare'?: string;
251
- 'gram'?: string;
252
- 'kilogram'?: string;
253
- 'tonne'?: string;
254
- 'milliliter'?: string;
255
- 'liter'?: string;
256
- 'celsius'?: string;
257
- 'kilometer-per-hour'?: string;
258
- };
259
- }
260
- export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
261
- standard: string;
262
- firstDay: string;
263
- location: string;
264
- locationCountry: string;
265
- locationLanguage: string;
266
- }
267
- export interface GeoFlagItem {
268
- language: string;
269
- languageCode: string;
270
- country: string;
271
- countryCode: string;
272
- standard: string;
273
- icon?: string;
274
- label: string;
275
- value: string;
276
- phoneCode?: string;
277
- }
278
- export interface GeoFlagNational extends GeoFlagItem {
279
- description: string;
280
- nationalLanguage: string;
281
- nationalCountry: string;
282
- }
283
- export interface GeoPhoneValue {
284
- phone: number;
285
- within: number;
286
- mask: string[];
287
- value: string;
288
- }
289
- export interface GeoPhoneMap {
290
- items: GeoPhoneValue[];
291
- info: GeoPhoneValue | undefined;
292
- value: string | undefined;
293
- mask: string[];
294
- maskFull: string[];
295
- next: Record<string, GeoPhoneMap>;
296
- }
297
- export interface GeoPhoneMapInfo {
298
- item?: GeoPhoneMap;
299
- phone?: string;
300
- }
301
- export declare enum MetaTag {
302
- title = "title",
303
- description = "description",
304
- keywords = "keywords",
305
- canonical = "canonical",
306
- robots = "robots",
307
- author = "author"
308
- }
309
- export declare enum MetaRobots {
310
- indexFollow = "index, follow",
311
- noIndexFollow = "noindex, follow",
312
- indexNoFollow = "index, nofollow",
313
- noIndexNoFollow = "noindex, nofollow",
314
- noArchive = "noarchive",
315
- noSnippet = "nosnippet",
316
- noImageIndex = "noimageindex",
317
- images = "images",
318
- noTranslate = "notranslate",
319
- noPreview = "nopreview",
320
- textOnly = "textonly",
321
- noIndexSubpages = "noindex, noarchive",
322
- none = "none"
323
- }
324
- export declare enum MetaOpenGraphTag {
325
- title = "og:title",
326
- type = "og:type",
327
- url = "og:url",
328
- image = "og:image",
329
- description = "og:description",
330
- locale = "og:locale",
331
- siteName = "og:site_name",
332
- localeAlternate = "og:locale:alternate",
333
- imageUrl = "og:image:url",
334
- imageSecureUrl = "og:image:secure_url",
335
- imageType = "og:image:type",
336
- imageWidth = "og:image:width",
337
- imageHeight = "og:image:height",
338
- imageAlt = "og:image:alt",
339
- video = "og:video",
340
- videoUrl = "og:video:url",
341
- videoSecureUrl = "og:video:secure_url",
342
- videoType = "og:video:type",
343
- videoWidth = "og:video:width",
344
- videoHeight = "og:video:height",
345
- audio = "og:audio",
346
- audioSecureUrl = "og:audio:secure_url",
347
- audioType = "og:audio:type",
348
- articlePublishedTime = "article:published_time",
349
- articleModifiedTime = "article:modified_time",
350
- articleExpirationTime = "article:expiration_time",
351
- articleAuthor = "article:author",
352
- articleSection = "article:section",
353
- articleTag = "article:tag",
354
- bookAuthor = "book:author",
355
- bookIsbn = "book:isbn",
356
- bookReleaseDate = "book:release_date",
357
- bookTag = "book:tag",
358
- musicDuration = "music:duration",
359
- musicAlbum = "music:album",
360
- musicAlbumDisc = "music:album:disc",
361
- musicAlbumTrack = "music:album:track",
362
- musicMusician = "music:musician",
363
- musicSong = "music:song",
364
- musicSongDisc = "music:song:disc",
365
- musicSongTrack = "music:song:track",
366
- musicReleaseDate = "music:release_date",
367
- musicCreator = "music:creator",
368
- videoActor = "video:actor",
369
- videoActorRole = "video:actor:role",
370
- videoDirector = "video:director",
371
- videoWriter = "video:writer",
372
- videoDuration = "video:duration",
373
- videoReleaseDate = "video:release_date",
374
- videoTag = "video:tag",
375
- videoSeries = "video:series",
376
- profileFirstName = "profile:first_name",
377
- profileLastName = "profile:last_name",
378
- profileUsername = "profile:username",
379
- profileGender = "profile:gender",
380
- productBrand = "product:brand",
381
- productAvailability = "product:availability",
382
- productCondition = "product:condition",
383
- productPriceAmount = "product:price:amount",
384
- productPriceCurrency = "product:price:currency",
385
- productRetailerItemId = "product:retailer_item_id",
386
- productCategory = "product:category",
387
- productEan = "product:ean",
388
- productIsbn = "product:isbn",
389
- productMfrPartNo = "product:mfr_part_no",
390
- productUpc = "product:upc",
391
- productWeightValue = "product:weight:value",
392
- productWeightUnits = "product:weight:units",
393
- productColor = "product:color",
394
- productMaterial = "product:material",
395
- productPattern = "product:pattern",
396
- productAgeGroup = "product:age_group",
397
- productGender = "product:gender"
398
- }
399
- export declare enum MetaOpenGraphType {
400
- website = "website",
401
- article = "article",
402
- video = "video.other",
403
- videoTvShow = "video.tv_show",
404
- videoEpisode = "video.episode",
405
- videoMovie = "video.movie",
406
- musicAlbum = "music.album",
407
- musicPlaylist = "music.playlist",
408
- musicSong = "music.song",
409
- musicRadioStation = "music.radio_station",
410
- app = "app",
411
- product = "product",
412
- business = "business.business",
413
- place = "place",
414
- event = "event",
415
- profile = "profile",
416
- book = "book"
417
- }
418
- export declare enum MetaOpenGraphAvailability {
419
- inStock = "in stock",
420
- outOfStock = "out of stock",
421
- preorder = "preorder",
422
- backorder = "backorder",
423
- discontinued = "discontinued",
424
- pending = "pending"
425
- }
426
- export declare enum MetaOpenGraphCondition {
427
- new = "new",
428
- used = "used",
429
- refurbished = "refurbished"
430
- }
431
- export declare enum MetaOpenGraphAge {
432
- newborn = "newborn",
433
- infant = "infant",
434
- toddler = "toddler",
435
- kids = "kids",
436
- adult = "adult"
437
- }
438
- export declare enum MetaOpenGraphGender {
439
- female = "female",
440
- male = "male",
441
- unisex = "unisex"
442
- }
443
- export declare enum MetaTwitterTag {
444
- card = "twitter:card",
445
- site = "twitter:site",
446
- creator = "twitter:creator",
447
- url = "twitter:url",
448
- title = "twitter:title",
449
- description = "twitter:description",
450
- image = "twitter:image",
451
- imageAlt = "twitter:image:alt",
452
- imageSrc = "twitter:image:src",
453
- imageWidth = "twitter:image:width",
454
- imageHeight = "twitter:image:height",
455
- label1 = "twitter:label1",
456
- data1 = "twitter:data1",
457
- label2 = "twitter:label2",
458
- data2 = "twitter:data2",
459
- appNameIphone = "twitter:app:name:iphone",
460
- appIdIphone = "twitter:app:id:iphone",
461
- appUrlIphone = "twitter:app:url:iphone",
462
- appNameIpad = "twitter:app:name:ipad",
463
- appIdIpad = "twitter:app:id:ipad",
464
- appUrlIpad = "twitter:app:url:ipad",
465
- appNameGooglePlay = "twitter:app:name:googleplay",
466
- appIdGooglePlay = "twitter:app:id:googleplay",
467
- appUrlGooglePlay = "twitter:app:url:googleplay",
468
- player = "twitter:player",
469
- playerWidth = "twitter:player:width",
470
- playerHeight = "twitter:player:height",
471
- playerStream = "twitter:player:stream",
472
- playerStreamContentType = "twitter:player:stream:content_type"
473
- }
474
- export declare enum MetaTwitterCard {
475
- summary = "summary",
476
- summaryLargeImage = "summary_large_image",
477
- app = "app",
478
- player = "player",
479
- product = "product",
480
- gallery = "gallery",
481
- photo = "photo",
482
- leadGeneration = "lead_generation",
483
- audio = "audio",
484
- poll = "poll"
485
- }
486
- export type SearchItem = Record<string, any>;
487
- export type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
488
- export type SearchColumn<T extends SearchItem> = {
489
- [K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
490
- }[keyof T];
491
- export type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
492
- export type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
493
- export type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
494
- export type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
495
- [K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
496
- } & {
497
- searchActive?: boolean;
498
- };
499
- export type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
500
- export type SearchListValue<T extends SearchItem> = T[] | undefined;
501
- export type SearchOptions = {
502
- limit?: number;
503
- returnEverything?: boolean;
504
- delay?: number;
505
- findExactMatch?: boolean;
506
- classSearchName?: string;
507
- };
508
- export type SearchCacheItem<T extends SearchItem> = {
509
- item: T;
510
- value: string;
511
- };
512
- export type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
513
- export type HighlightMatchItem = {
514
- text: string;
515
- isMatch: boolean;
516
- };
517
- export type SortDir = 'asc' | 'desc';
518
- export type SortColumnItem = {
519
- column?: string;
520
- dir?: SortDir;
521
- };
522
- export type SortFunction<T = any> = (a: T, b: T, column?: string, dir?: SortDir) => number;
523
- export type TranslateConfig = {
524
- url?: string;
525
- propsName?: string;
526
- readApi?: boolean;
527
- };
528
- export type TranslateCode = string | string[];
529
- export type TranslateList<T extends TranslateCode[]> = {
530
- [K in T[number] as K extends readonly string[] ? K[0] : K]: string;
531
- };
532
- export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
533
- export type TranslateDataFileList = Record<string, string>;
534
- export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
535
- export type TranslateDataFile = Record<string, TranslateDataFileItem>;
536
- export declare const TRANSLATE_GLOBAL_PREFIX = "global";
537
- export declare const TRANSLATE_TIME_OUT = 160;
538
- export declare const errorCauseList: ErrorCenterCauseList;
539
- export declare class Api {
540
- static isLocalhost(): boolean;
541
- static getItem(): ApiInstance;
542
- static getStatus(): ApiStatus;
543
- static getResponse(): ApiResponse;
544
- static getHydration(): ApiHydration;
545
- static getHydrationScript(): string;
546
- static getOrigin(): string;
547
- static getUrl(path: string, api?: boolean): string;
548
- static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
549
- static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
550
- static setHeaders(headers: ApiHeadersValue): void;
551
- static setRequestDefault(request: ApiDefaultValue): void;
552
- static setUrl(url: string): void;
553
- static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
554
- static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
555
- static setTimeout(timeout: number): void;
556
- static setOrigin(origin: string): void;
557
- static setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): void;
558
- static setConfig(config?: ApiConfig): void;
559
- static request<T>(pathRequest: string | ApiFetch): Promise<T>;
560
- static get<T>(request: ApiFetch): Promise<T>;
561
- static post<T>(request: ApiFetch): Promise<T>;
562
- static put<T>(request: ApiFetch): Promise<T>;
563
- static patch<T>(request: ApiFetch): Promise<T>;
564
- static delete<T>(request: ApiFetch): Promise<T>;
565
- }
566
- export declare class ApiCache {
567
- static init(getListener: (key: string) => Promise<ApiCacheItem | undefined>, setListener: (key: string, value: ApiCacheItem) => Promise<boolean>, removeListener: (key: string) => Promise<boolean>, cacheStepAgeClearOld?: number): void;
288
+ /**
289
+ * Class for managing cookie storage with support for custom listeners.
290
+ * Useful for consistent cookie handling across different environments (DOM, SSR).
291
+ */
292
+ export declare class CookieStorage {
293
+ protected static getListener?: (key: string) => any | undefined;
294
+ protected static getListenerRaw?: () => string;
295
+ protected static setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void;
296
+ static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
568
297
  static reset(): void;
569
- static get<T>(key: string): Promise<T | undefined>;
570
- static getByFetch<T>(fetch: ApiFetch): Promise<T | undefined>;
571
- static set<T>(key: string, value: T, age?: number): Promise<void>;
572
- static setByFetch<T>(fetch: ApiFetch, value: T): Promise<void>;
573
- static remove(key: string): Promise<void>;
574
- }
575
- export declare class ApiDataReturn<T = any> {
576
- constructor(apiFetch: ApiFetch, query: Response, end: ApiPreparationEnd, error?: ApiErrorItem | undefined);
577
- init(): Promise<this>;
578
- get(): ApiData<T>;
579
- getAndStatus(status: ApiStatus): ApiData<T>;
580
- getData(): ApiData<T> | undefined;
581
- }
582
- export declare class ApiDefault {
583
- is(): boolean;
584
- get(): Record<string, any> | undefined;
585
- request(request: ApiFetch['request']): ApiFetch['request'];
586
- set(request: ApiDefaultValue): this;
587
- }
588
- export declare class ApiError {
589
- static getStorage(): ApiErrorStorage;
590
- static add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): void;
591
- static getItem(method: ApiMethodItem, response: Response): Promise<ApiErrorItem>;
592
- }
593
- export declare class ApiErrorItem {
594
- constructor(method: ApiMethodItem, response: Response, error: ApiErrorStorageItem);
595
- getMethod(): ApiMethodItem;
596
- getResponse(): Response;
597
- getError(): ApiErrorStorageItem;
598
- getCode(): string | undefined;
599
- getMessage(): string | undefined;
600
- getStatus(): number;
601
- }
602
- export declare class ApiErrorStorage {
603
- find(method: ApiMethodItem, response: Response): Promise<ApiErrorStorageItem>;
604
- add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): this;
298
+ static get<T>(name: string, defaultValue?: T | (() => T)): T | undefined;
299
+ static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
300
+ static remove(name: string): void;
301
+ static update(): void;
302
+ protected static format(name: string, value: string, options?: CookieOptions): string;
303
+ protected static hasDom(): boolean;
304
+ protected static parse(cookie: string): Record<string, any>;
305
+ protected static initItems(): Record<string, any>;
306
+ protected static toMaxAge(stringValue: string, age?: CookieOptions['age']): string;
307
+ protected static toSameSite(sameSite?: CookieOptions['sameSite']): string;
308
+ protected static toPath(path?: CookieOptions['path']): string;
309
+ protected static toDomain(domain?: CookieOptions['domain']): string | undefined;
310
+ protected static toSecure(secure?: CookieOptions['secure']): string | undefined;
311
+ protected static toHttpOnly(httpOnly?: CookieOptions['httpOnly']): string | undefined;
312
+ protected static toPartitioned(partitioned?: CookieOptions['partitioned']): string | undefined;
313
+ protected static toArguments(args?: CookieOptions['arguments']): string[];
605
314
  }
606
- export declare class ApiHeaders {
607
- get(value?: Record<string, string> | null, type?: string | undefined | null): Record<string, string> | undefined;
608
- getByRequest(request: ApiFetch['request'], value?: Record<string, string> | null, type?: string): Record<string, string> | undefined;
609
- set(headers: ApiHeadersValue): this;
315
+ /**
316
+ * Class for working with localStorage and sessionStorage.
317
+ * Includes support for prefixes, expiration time, and request isolation in SSR.
318
+ */
319
+ export declare class DataStorage<T> {
320
+ static setPrefix(newPrefix: string): void;
321
+ constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
322
+ get(defaultValue?: T | (() => T), cache?: number): T | undefined;
323
+ set(value?: T | (() => T)): T | undefined;
324
+ remove(): this;
325
+ update(): this;
610
326
  }
611
- export declare class ApiHydration {
612
- initResponse(response: ApiResponse): void;
613
- toClient<T>(apiFetch: ApiFetch, response: T): void;
614
- toString(): string;
327
+ /**
328
+ * A class for working with dates.
329
+ *
330
+ * @remarks
331
+ * Creating a `Datetime` instance without a specific date (using the current time)
332
+ * for rendering in SSR may lead to hydration mismatches because the time or time zone
333
+ * on the server may differ from the time on the client.
334
+ */
335
+ export declare class Datetime {
336
+ protected watch?: (date: Date, type: GeoDate, hour24: boolean) => void;
337
+ constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
338
+ getIntl(): GeoIntl;
339
+ getDate(): Date;
340
+ getType(): GeoDate;
341
+ getHoursType(): GeoHours;
342
+ getHour24(): boolean;
343
+ getTimeZoneOffset(): number;
344
+ getTimeZone(style?: GeoTimeZoneStyle): string;
345
+ getFirstDayCode(): GeoFirstDay;
346
+ getYear(): number;
347
+ getMonth(): number;
348
+ getDay(): number;
349
+ getHour(): number;
350
+ getMinute(): number;
351
+ getSecond(): number;
352
+ getMaxDay(): number;
353
+ locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
354
+ localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
355
+ localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
356
+ localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
357
+ localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
358
+ localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
359
+ localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
360
+ standard(timeZone?: boolean): string;
361
+ setDate(value: NumberOrStringOrDate): this;
362
+ setType(value: GeoDate): this;
363
+ setHour24(value: boolean): this;
364
+ setCode(code: string): this;
365
+ setWatch(watch: (date: Date, type: GeoDate, hour24: boolean) => void): this;
366
+ setYear(value: number): this;
367
+ setMonth(value: number): this;
368
+ setDay(value: number): this;
369
+ setHour(value: number): this;
370
+ setMinute(value: number): this;
371
+ setSecond(value: number): this;
372
+ moveByYear(value: number): this;
373
+ moveByMonth(value: number): this;
374
+ moveByDay(value: number): this;
375
+ moveByHour(value: number): this;
376
+ moveByMinute(value: number): this;
377
+ moveBySecond(value: number): this;
378
+ moveMonthFirst(): this;
379
+ moveMonthLast(): this;
380
+ moveMonthNext(): this;
381
+ moveMonthPrevious(): this;
382
+ moveWeekdayFirst(): this;
383
+ moveWeekdayLast(): this;
384
+ moveWeekdayFirstByMonth(): this;
385
+ moveWeekdayLastByMonth(): this;
386
+ moveWeekdayNext(): this;
387
+ moveWeekdayPrevious(): this;
388
+ moveDayFirst(): this;
389
+ moveDayLast(): this;
390
+ moveDayNext(): this;
391
+ moveDayPrevious(): this;
392
+ clone(): Date;
393
+ cloneClass(): Datetime;
394
+ cloneMonthFirst(): Datetime;
395
+ cloneMonthLast(): Datetime;
396
+ cloneMonthNext(): Datetime;
397
+ cloneMonthPrevious(): Datetime;
398
+ cloneWeekdayFirst(): Datetime;
399
+ cloneWeekdayLast(): Datetime;
400
+ cloneWeekdayFirstByMonth(): Datetime;
401
+ cloneWeekdayLastByMonth(): Datetime;
402
+ cloneWeekdayNext(): Datetime;
403
+ cloneWeekdayPrevious(): Datetime;
404
+ cloneDayFirst(): Datetime;
405
+ cloneDayLast(): Datetime;
406
+ cloneDayNext(): Datetime;
407
+ cloneDayPrevious(): Datetime;
408
+ protected toTimeZoneHourFormat(hour: number): string;
409
+ protected update(): this;
615
410
  }
616
- export type ApiInstanceOptions = {
617
- headersClass?: typeof ApiHeaders;
618
- requestDefaultClass?: typeof ApiDefault;
619
- statusClass?: typeof ApiStatus;
620
- responseClass?: typeof ApiResponse;
621
- preparationClass?: typeof ApiPreparation;
622
- loadingClass?: LoadingInstance;
623
- errorCenterClass?: ErrorCenterInstance;
624
- hydrationClass?: typeof ApiHydration;
625
- wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
626
- };
627
- export declare class ApiInstance {
628
- constructor(url?: string, options?: ApiInstanceOptions);
629
- isLocalhost(): boolean;
630
- getStatus(): ApiStatus;
631
- getResponse(): ApiResponse;
632
- getHydration(): ApiHydration;
633
- getOrigin(): string;
634
- getUrl(path: string, api?: boolean): string;
635
- getBody(request?: ApiFetch['request'], method?: ApiMethod): string | FormData | undefined;
636
- getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethod): string;
637
- getHydrationScript(): string;
638
- setHeaders(headers: ApiHeadersValue): this;
639
- setRequestDefault(request: ApiDefaultValue): this;
640
- setUrl(url: string): this;
641
- setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): this;
642
- setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
643
- setTimeout(timeout: number): this;
644
- setOrigin(origin: string): this;
645
- setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): this;
646
- request<T>(pathRequest: string | ApiFetch): Promise<T>;
647
- get<T>(request: ApiFetch): Promise<T>;
648
- post<T>(request: ApiFetch): Promise<T>;
649
- put<T>(request: ApiFetch): Promise<T>;
650
- patch<T>(request: ApiFetch): Promise<T>;
651
- delete<T>(request: ApiFetch): Promise<T>;
411
+ /** Class for managing error storage and handling */
412
+ export declare class ErrorCenter {
413
+ static getItem(): ErrorCenterInstance;
414
+ static has(code: string, group?: string): boolean;
415
+ static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
416
+ static add(cause: ErrorCenterCauseItem): void;
417
+ static addList(causes: ErrorCenterCauseList): void;
418
+ static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
419
+ static addHandlerList(handlers: ErrorCenterHandlerList): void;
420
+ static addCallback(callback: ErrorCenterHandlerCallback): void;
421
+ static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
422
+ static on(cause: ErrorCenterCauseItem): void;
652
423
  }
653
- export declare class ApiPreparation {
654
- make(active: boolean, apiFetch: ApiFetch): Promise<void>;
655
- makeEnd(active: boolean, query: Response, apiFetch: ApiFetch): Promise<ApiPreparationEnd>;
656
- set(callback: (apiFetch: ApiFetch) => Promise<void>): this;
657
- setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
424
+ /** Class for managing and triggering error handlers */
425
+ export declare class ErrorCenterHandler {
426
+ constructor(handlers?: ErrorCenterHandlerList, isConsole?: ErrorCenterHandlerIsConsole);
427
+ has(group: ErrorCenterGroup): boolean;
428
+ get(group: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
429
+ add(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
430
+ addList(handlers: ErrorCenterHandlerList): this;
431
+ addCallback(callback: ErrorCenterHandlerCallback): this;
432
+ setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
433
+ on(cause: ErrorCenterCauseItem): this;
434
+ protected toConsole(cause: ErrorCenterCauseItem): this;
658
435
  }
659
- export declare class ApiResponse {
660
- constructor(requestDefault: ApiDefault);
661
- get(path: string | undefined, method: ApiMethod, request?: ApiFetch['request'], devMode?: boolean): ApiResponseItem | undefined;
662
- getList(): (ApiResponseItem & Record<string, any>)[];
663
- add(response: ApiResponseItem | ApiResponseItem[]): this;
664
- setDevMode(devMode: boolean): this;
665
- emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
666
- emulatorAsync<T>(apiFetch: ApiFetch): T | undefined;
436
+ /** Class for managing error storage and handling within an instance */
437
+ export declare class ErrorCenterInstance {
438
+ constructor(causes?: ErrorCenterCauseList, handler?: ErrorCenterHandler);
439
+ has(code: string, group?: string): boolean;
440
+ get(code: string, group?: string): ErrorCenterCauseItem | undefined;
441
+ add(cause: ErrorCenterCauseItem): this;
442
+ addList(causes: ErrorCenterCauseList): this;
443
+ addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
444
+ addHandlerList(handlers: ErrorCenterHandlerList): this;
445
+ addCallback(callback: ErrorCenterHandlerCallback): this;
446
+ setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
447
+ on(cause: ErrorCenterCauseItem): this;
448
+ protected assign(cause: ErrorCenterCauseItem): ErrorCenterCauseItem;
667
449
  }
668
- export declare class ApiStatus {
669
- get(): ApiStatusItem | undefined;
670
- getStatus(): number | undefined;
671
- getStatusText(): string | undefined;
672
- getStatusType(): ApiStatusType | undefined;
673
- getCode(): string | undefined;
674
- getError(): string | undefined;
675
- getResponse<T>(): T | undefined;
676
- getMessage(): string;
677
- set(data: ApiStatusItem): this;
678
- setStatus(status?: number, statusText?: string): this;
679
- setError(error?: string): this;
680
- setLastResponse(response?: any): this;
681
- setLastStatus(status?: ApiStatusType): this;
682
- setLastCode(code?: string): this;
683
- setLastMessage(message?: string): this;
450
+ /**
451
+ * Advanced wrapper for managing event listeners on DOM elements or the `window` object.
452
+ *
453
+ * `EventItem` simplifies the entire event lifecycle (start, stop, toggle, reset), provides
454
+ * built-in optimizations for high-frequency events, and ensures DOM safety by automatically
455
+ * checking if elements are still in the document.
456
+ *
457
+ * ### Key Features:
458
+ * - **Lifecycle Control**: Easily `start`, `stop`, `toggle`, or `reset` event listeners.
459
+ * - **DOM Safety**: Automatically halts the event if the target element is removed from the DOM.
460
+ * - **Specialized Optimizations**:
461
+ * - `resize`: Uses `ResizeObserver` for any HTML element (not limited to `window`).
462
+ * - `scroll-sync`: High-performance scroll tracking using `requestAnimationFrame`.
463
+ * - **Dynamic Configuration**: Chained setters for target element, event type, listener, and options.
464
+ * - **Custom Event Dispatching**: Built-in support for triggering events with custom data via `dispatch`.
465
+ * - **Strict Typing**: Generic support for elements, event objects, and custom detail data.
466
+ *
467
+ * ### Usage Examples:
468
+ *
469
+ * #### 1. Basic Listener
470
+ * ```typescript
471
+ * const clickEvent = new EventItem('.btn', 'click', (e) => console.log('Clicked!'));
472
+ * clickEvent.start();
473
+ * ```
474
+ *
475
+ * #### 2. Specialized 'resize' and 'scroll-sync'
476
+ * ```typescript
477
+ * // Tracks any element's size
478
+ * const resizeEvent = new EventItem('.box', 'resize', (entry) => console.log('New size:', entry));
479
+ *
480
+ * // Performance-optimized scroll
481
+ * const scrollEvent = new EventItem(window, 'scroll-sync', () => console.log('Scrolling...'));
482
+ *
483
+ * resizeEvent.start();
484
+ * scrollEvent.start();
485
+ * ```
486
+ *
487
+ * #### 3. Custom Data and Dispatching
488
+ * ```typescript
489
+ * interface UserData { id: number }
490
+ * const emitter = new EventItem<Window, CustomEvent, UserData>(window, 'user-update');
491
+ *
492
+ * emitter.setListener((e, detail) => {
493
+ * console.log('Update received for ID:', detail?.id);
494
+ * });
495
+ *
496
+ * emitter.start();
497
+ *
498
+ * // Trigger manually with data
499
+ * emitter.dispatch({ id: 456 });
500
+ * ```
501
+ *
502
+ * #### 4. Chaining and Dynamic Updates
503
+ * ```typescript
504
+ * const tracker = new EventItem('.item-1', 'mousemove', (e) => console.log(e.clientX));
505
+ *
506
+ * // Switch element on the fly
507
+ * tracker.start().setElement('.item-2');
508
+ * ```
509
+ */
510
+ export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> {
511
+ protected listenerRecent: (event?: O | ResizeObserverEntry) => void;
512
+ constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
513
+ isActive(): boolean;
514
+ getElement(): E | undefined;
515
+ setElement(elementSelector?: ElementOrString<E>): this;
516
+ setElementControl<EC extends HTMLElement>(elementSelector?: ElementOrString<EC>): this;
517
+ setType(type: string | string[]): this;
518
+ setListener(listener: EventListenerDetail<O, D>): this;
519
+ setOptions(options?: EventOptions): this;
520
+ setDetail(detail?: D): this;
521
+ dispatch(detail?: D | undefined): this;
522
+ start(): this;
523
+ stop(): this;
524
+ toggle(activity: boolean): this;
525
+ reset(): this;
526
+ protected isObserver(): boolean;
527
+ protected makeResize(): boolean;
528
+ protected makeScroll(): boolean;
529
+ }
530
+ /** Class for formatting a list of data based on provided options.
531
+ * @template Options type of formatting options.
532
+ * @template List type of the list of items (can be an array or a single item).
533
+ * @template Item type of a single item in the list.
534
+ */
535
+ export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
536
+ /** Constructor
537
+ * @param options formatting options for each column/property
538
+ * @param list initial list of data to format
539
+ */
540
+ constructor(options: Options, list?: List | undefined);
541
+ /** Checks if the list is set. */
542
+ is(): boolean;
543
+ /** Checks if the list is an array. */
544
+ isArray(): this is this & {
545
+ list: FormattersList<Item>;
546
+ };
547
+ /** Returns the count of records in the list. */
548
+ length(): number;
549
+ /** Returns the current list of data as an array. */
550
+ getList(): FormattersList<Item>;
551
+ /** Returns the current formatting options. */
552
+ getOptions(): Options;
553
+ /** Sets the list of data to be formatted. */
554
+ setList(list?: List): this;
555
+ /** Formats the entire list or a single item based on the provided options.
556
+ * Adds formatted values with the suffix 'Format' to each item.
557
+ * @returns formatted data (list or single item)
558
+ */
559
+ to(): FormattersReturn<List, Options>;
560
+ /** Generates formatted data for a single item based on options.
561
+ * @param item item to format
562
+ * @returns object with formatted fields
563
+ * @protected
564
+ */
565
+ protected getFormatData(item: Item): Record<string, string>;
566
+ /** Router-like method to delegate formatting to specific type formatters.
567
+ * @param valueOriginal original value to format
568
+ * @param item entire item context
569
+ * @param type type of formatter to use
570
+ * @param options additional options for the specific formatter
571
+ * @protected
572
+ * @returns Formatted string
573
+ */
574
+ protected transformation<Type extends FormattersType>(valueOriginal: any, item: any, type?: Type, options?: FormattersOptionsInformation<Type>): string;
575
+ /** Formats a value as currency.
576
+ * @param value value to format
577
+ * @param item item context
578
+ * @param options currency formatting options
579
+ * @protected
580
+ * @returns Formatted currency string
581
+ */
582
+ protected formatCurrency(value: any, item: Item, options?: FormattersOptionsCurrency): string;
583
+ /** Formats a value as a date.
584
+ * @param value value to format
585
+ * @param options date formatting options
586
+ * @protected
587
+ * @returns Formatted date string
588
+ */
589
+ protected formatDate(value: any, options?: FormattersOptionsDate): string;
590
+ /** Formats full name from multiple property names.
591
+ * @param item item context containing name components
592
+ * @param options name formatting options (prop names for first, last, surname)
593
+ * @protected
594
+ * @returns Formatted name string or empty string if components are missing
595
+ */
596
+ protected formatName(item: Item, options?: FormattersOptionsName): string;
597
+ /** Formats a value as a number.
598
+ * @param value value to format
599
+ * @param options number formatting options
600
+ * @protected
601
+ * @returns Formatted number string
602
+ */
603
+ protected formatNumber(value: any, options?: FormattersOptionsNumber): string;
604
+ /** Formats a value based on plural rules.
605
+ * @param value numeric value for pluralization
606
+ * @param options plural formatting options (words and rules)
607
+ * @protected
608
+ * @returns Formatted plural string
609
+ */
610
+ protected formatPlural(value: any, options?: FormattersOptionsPlural): string;
611
+ /** Formats a value with a specific unit.
612
+ * @param value value to format
613
+ * @param options unit formatting options
614
+ * @protected
615
+ * @returns Formatted unit string
616
+ */
617
+ protected formatUnit(value: any, options?: FormattersOptionsUnit): string;
618
+ }
619
+ /** Static class for working with geographical data.
620
+ * Provides a centralized interface for managing locale, country, and time zone.
621
+ */
622
+ export declare class Geo {
623
+ /** Returns a request-isolated instance of GeoInstance. */
624
+ static getObject(): GeoInstance;
625
+ /** Returns information about the current country and language. */
626
+ static get(): GeoItemFull;
627
+ /** Returns the 2-letter code of the current country. */
628
+ static getCountry(): string;
629
+ /** Returns the 2-letter code of the current language. */
630
+ static getLanguage(): string;
631
+ /** Returns the combined locale string in the standard format (e.g., 'en-US'). */
632
+ static getStandard(): string;
633
+ /** Returns the code for the first day of the week for the current locale. */
634
+ static getFirstDay(): string;
635
+ /** Returns the current location string. */
636
+ static getLocation(): string;
637
+ /** Returns the country code extracted from the location string. */
638
+ static getLocationCountry(): string;
639
+ /** Returns the language code extracted from the location string. */
640
+ static getLocationLanguage(): string;
641
+ /** Returns fully processed geo data updated with the current language. */
642
+ static getItem(): GeoItemFull;
643
+ /** Returns the complete list of available countries and regions. */
644
+ static getList(): GeoItem[];
645
+ /** Returns geo data by country or language code from the global database.
646
+ * @param code country or language code
647
+ */
648
+ static getByCode(code?: string): GeoItemFull;
649
+ /** Returns exact geo data by searching for the full locale match (e.g., 'en-US').
650
+ * @param code full locale string
651
+ */
652
+ static getByCodeFull(code: string): GeoItem | undefined;
653
+ /** Returns geo data for a specific country by its code.
654
+ * @param country country code
655
+ */
656
+ static getByCountry(country: string): GeoItem | undefined;
657
+ /** Returns geo data for a specific language by its code.
658
+ * @param language language code
659
+ */
660
+ static getByLanguage(language: string): GeoItem | undefined;
661
+ /** Returns the time zone offset in minutes for the current context. */
662
+ static getTimezone(): number;
663
+ /** Returns the formatted time zone string (e.g., '+00:00') for the current context. */
664
+ static getTimezoneFormat(): string;
665
+ /** Finds or determines the geo data for a given code. Alias for getByCode.
666
+ * @param code country or language code
667
+ */
668
+ static find(code: string): GeoItemFull;
669
+ /** Returns a standard concatenated string for a geo item (e.g., 'en-US').
670
+ * @param item geo item data
671
+ */
672
+ static toStandard(item: GeoItem): string;
673
+ /** Sets the current geographical location. Updates the instance state.
674
+ * @param code location code
675
+ * @param save whether to persist the change in storage
676
+ */
677
+ static set(code: string, save?: boolean): void;
678
+ /** Sets a custom time zone offset for the current context.
679
+ * @param timezone timezone offset in minutes
680
+ */
681
+ static setTimezone(timezone: number): void;
682
+ /** Sets the default value for the country code.
683
+ * @param code default code value
684
+ */
685
+ static setValueDefault(code?: string | (() => string)): void;
684
686
  }
685
- export declare class BroadcastMessage<Message = any> {
686
- constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
687
- getChannel(): BroadcastChannel | undefined;
688
- post(message: Message): this;
689
- setCallback(callback: (event: MessageEvent<Message>) => void): this;
690
- setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
691
- destroy(): this;
687
+ export declare const GEO_FLAG_ICON_NAME = "f";
688
+ /** Class for working with flags and geographic information.
689
+ * Provides methods for retrieving country names, languages, and flag icons.
690
+ */
691
+ export declare class GeoFlag {
692
+ /** Constructor
693
+ * @param code country and language code
694
+ */
695
+ constructor(code?: string);
696
+ /** Returns information about the country and its flag.
697
+ * @param code country code
698
+ */
699
+ get(code?: string): GeoFlagItem | undefined;
700
+ /** Returns information about the language and its flag.
701
+ * @param code country code
702
+ */
703
+ getLanguage(code?: string): GeoFlagItem | undefined;
704
+ /** Returns the country code. */
705
+ getCode(): string;
706
+ /** Returns the identifier of the flag icon.
707
+ * @param code country code
708
+ */
709
+ getFlag(code?: string): string | undefined;
710
+ /** Returns a list of countries based on the provided codes.
711
+ * If no codes are provided, returns all available countries.
712
+ * @param codes array of country codes
713
+ * @param sort whether to sort the list
714
+ */
715
+ getList(codes?: string[], sort?: boolean): GeoFlagItem[];
716
+ /** Returns a list of languages based on the provided codes.
717
+ * If no codes are provided, returns all available languages.
718
+ * @param codes array of country codes
719
+ * @param sort whether to sort the list
720
+ */
721
+ getListLanguage(codes?: string[], sort?: boolean): GeoFlagItem[];
722
+ /** Returns a list of countries in their national languages.
723
+ * @param codes array of country codes
724
+ * @param sort whether to sort the list
725
+ */
726
+ getNational(codes?: string[], sort?: boolean): GeoFlagNational[];
727
+ /** Returns a list of languages in their national names.
728
+ * @param codes array of country codes
729
+ * @param sort whether to sort the list
730
+ */
731
+ getNationalLanguage(codes?: string[], sort?: boolean): GeoFlagNational[];
732
+ /** Changes the current locale/location.
733
+ * @param code country and language code
734
+ */
735
+ setCode(code: string): this;
736
+ /** Returns a special object for formatting and translations.
737
+ * @protected
738
+ */
739
+ protected getLocation(): GeoIntl;
740
+ /** Returns a list of country codes to retrieve data from.
741
+ * @param codes optional array of codes
742
+ * @protected
743
+ */
744
+ protected getCodes(codes?: string[]): string[];
745
+ /** Getting the name of the language.
746
+ * @param data object with information of data
747
+ */
748
+ protected getLanguageName(data: GeoItemFull): string;
749
+ /** Getting the name of the country.
750
+ * @param data object with information of data
751
+ */
752
+ protected getCountry(data: GeoItemFull): string;
753
+ }
754
+ /** Cookie key for storing the geo code */
755
+ export declare const UI_GEO_COOKIE_KEY = "ui-geo-code";
756
+ /** Base class for working with geographic data.
757
+ * Includes methods for determining location, language, and time zone.
758
+ */
759
+ export declare class GeoInstance {
760
+ constructor();
761
+ get(): GeoItemFull;
762
+ getCountry(): string;
763
+ getLanguage(): string;
764
+ getStandard(): string;
765
+ getFirstDay(): string;
766
+ getLocation(): string;
767
+ getLocationCountry(): string;
768
+ getLocationLanguage(): string;
769
+ getItem(): GeoItemFull;
770
+ getList(): GeoItem[];
771
+ getByCode(code?: string): GeoItemFull;
772
+ getByCodeFull(code: string): GeoItem | undefined;
773
+ getByCountry(country: string): GeoItem | undefined;
774
+ getByLanguage(language: string): GeoItem | undefined;
775
+ getTimezone(): number;
776
+ getTimezoneFormat(): string;
777
+ find(code: string): GeoItemFull;
778
+ toStandard(item: GeoItem, language?: string): string;
779
+ set(code: string, save?: boolean): void;
780
+ setTimezone(timezone: number): void;
781
+ setValueDefault(code?: string | (() => string)): void;
692
782
  }
693
- /** @deprecated This class is obsolete and should not be used */
694
- export declare class Cache {
695
- get<T>(name: string, callback: () => T, comparison?: any[]): T;
696
- getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
783
+ /**
784
+ * The Intl namespace object contains several constructors as well as functionality common
785
+ * to the internationalization constructors and other language sensitive functions. Collectively,
786
+ * they comprise the ECMAScript Internationalization API, which provides language sensitive
787
+ * string comparison, number formatting, date and time formatting, and more
788
+ */
789
+ export declare class GeoIntl {
790
+ static isItem(code?: string): boolean;
791
+ static getLocation(code?: string): string;
792
+ static getInstance(code?: string): GeoIntl;
793
+ constructor(code?: string, errorCenter?: ErrorCenterInstance);
794
+ getLocation(): string;
795
+ getFirstDay(): string;
796
+ display(value?: string, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): string;
797
+ languageName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
798
+ countryName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
799
+ fullName(last: string, first: string, surname?: string, short?: boolean): string;
800
+ number(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
801
+ decimal(): string;
802
+ currency(value: NumberOrString, currencyOptions?: string | Intl.NumberFormatOptions, numberOnly?: boolean): string;
803
+ currencySymbol(currency: string, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): string;
804
+ unit(value: NumberOrString, unitOptions?: string | Intl.NumberFormatOptions): string;
805
+ sizeFile(value: NumberOrString, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): string;
806
+ percent(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
807
+ percentBy100(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
808
+ plural(value: NumberOrString, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): string;
809
+ date(value: NumberOrStringOrDate, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): string;
810
+ relative(value: NumberOrStringOrDate, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): string;
811
+ relativeLimit(value: NumberOrStringOrDate, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): string;
812
+ relativeByValue(value: NumberOrString, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): string;
813
+ month(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['month']): string;
814
+ months(style?: Intl.DateTimeFormatOptions['month']): ItemValue<number | undefined>[];
815
+ weekday(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['weekday']): string;
816
+ weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ItemValue<number | undefined>[];
817
+ time(value: NumberOrStringOrDate): string;
818
+ sort<T>(data: T[], compareFn?: (a: T, b: T) => [string, string]): T[];
697
819
  }
698
- /** @deprecated This class is obsolete and should not be used */
699
- export declare class CacheItem<T> {
700
- constructor(callback: () => T);
701
- getCache(comparison: any[]): T;
702
- getCacheOld(): T | undefined;
703
- getCacheAsync(comparison: any[]): Promise<T>;
820
+ /** A class for storing and processing phone number masks */
821
+ export declare class GeoPhone {
822
+ static get(code: string): GeoPhoneValue | undefined;
823
+ static getByPhone(phone: string): GeoPhoneMapInfo;
824
+ static getByCode(code: string): GeoPhoneMap | undefined;
825
+ static getList(): GeoPhoneValue[];
826
+ static getMap(): Record<string, GeoPhoneMap>;
827
+ static toMask(phone: string, masks?: string[]): string | undefined;
828
+ static removeZero(phone: string): string;
829
+ protected static getWithinSymbol(within: number | string): string;
830
+ protected static getUnnecessaryLength(mask: string): number;
831
+ protected static makeList(): void;
832
+ protected static makeMap(): void;
833
+ protected static toNumber(value: string): string[];
834
+ protected static toStandard(phone: string, mask: string): string;
835
+ protected static toWithin(mask: string, within: number | string): string;
704
836
  }
705
- /** @deprecated This class is obsolete and should not be used */
706
- export declare class CacheStatic {
707
- static get<T>(name: string, callback: () => T, comparison?: any[]): T;
708
- static getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
837
+ /**
838
+ * Class for localized unit formatting and automatic conversions.
839
+ * Automatically translates metric units (like gram, meter) to local equivalents
840
+ * (like ounce, foot) for non-metric regions (US, MM, LR) and formats them.
841
+ */
842
+ export declare class GeoUnit {
843
+ static getInstance(code?: string): GeoUnit;
844
+ constructor(code?: string);
845
+ getLocation(): string;
846
+ millimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
847
+ centimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
848
+ meter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
849
+ kilometer(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
850
+ squareMeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
851
+ hectare(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
852
+ gram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
853
+ kilogram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
854
+ tonne(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
855
+ milliliter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
856
+ liter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
857
+ celsius(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
858
+ kilometerPerHour(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
859
+ format(value: NumberOrString, unit: string, options?: Intl.NumberFormatOptions): string;
860
+ protected isCelsiusToFahrenheit(from: string, to: string): boolean;
861
+ protected getTargetUnit(sourceUnit: string): string;
862
+ protected formatUnit(value: NumberOrString, sourceUnit: string, options?: Intl.NumberFormatOptions): string;
863
+ protected convert(value: number, from: string, to: string): number;
864
+ protected celsiusToFahrenheit(value: number): number;
709
865
  }
710
- export type CookieSameSite = 'strict' | 'lax';
711
- export type CookieOptions = {
712
- age?: number;
713
- sameSite?: CookieSameSite;
714
- path?: string;
715
- domain?: string;
716
- secure?: boolean;
717
- httpOnly?: boolean;
718
- partitioned?: boolean;
719
- arguments?: string[] | Record<string, string | number | boolean>;
720
- };
721
- export declare class Cookie<T> {
722
- static getInstance<T>(name: string): Cookie<T>;
723
- constructor(name: string);
724
- get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): string | T | undefined;
725
- set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
726
- remove(): void;
866
+ /** Static utility class for storing and retrieving application-wide global data */
867
+ export declare class Global {
868
+ static getItem(): Record<string, any>;
869
+ static get<R = any>(name: string): R;
870
+ static add(data: Record<string, any>): void;
727
871
  }
728
- export declare class CookieBlock {
729
- static getItem(): CookieBlockInstance;
730
- static get(): boolean;
731
- static set(value: boolean): void;
872
+ /** Static class for working with data stored in the URL hash */
873
+ export declare class Hash {
874
+ static getItem(): HashInstance;
875
+ static get<T>(name: string, defaultValue?: T | (() => T)): T;
876
+ static set<T>(name: string, callback: T | (() => T)): void;
877
+ static addWatch<T>(name: string, callback: (value: T) => void): void;
878
+ static removeWatch<T>(name: string, callback: (value: T) => void): void;
879
+ static reload(): void;
732
880
  }
733
- export declare class CookieBlockInstance {
734
- get(): boolean;
735
- set(value: boolean): void;
881
+ /** Class for working with data stored in the URL hash */
882
+ export declare class HashInstance extends UrlInstanceAbstract {
883
+ protected init(): this;
884
+ protected getLocation(): Record<string, any>;
885
+ protected update(): this;
736
886
  }
737
- export declare class CookieStorage {
738
- static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
739
- static reset(): void;
740
- static get<T>(name: string, defaultValue?: T | (() => T)): T | undefined;
741
- static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
742
- static remove(name: string): void;
743
- static update(): void;
887
+ export type IconsItem = string | Promise<string | any> | (() => Promise<string | any>);
888
+ export type IconsConfig = {
889
+ /** URL to the icons storage / URL к хранилищу иконок */
890
+ url?: string;
891
+ /** List of custom icons / Список пользовательских иконок */
892
+ list?: Record<string, IconsItem>;
893
+ };
894
+ /** Class for managing icons */
895
+ export declare class Icons {
896
+ static is(index: string): boolean;
897
+ static get(index: string, url?: string, wait?: number): Promise<string>;
898
+ static getAsync(index: string, url?: string): string;
899
+ static getNameList(): string[];
900
+ static getUrlGlobal(): string;
901
+ static add(index: string, file: IconsItem): void;
902
+ static addLoad(index: string): void;
903
+ static addGlobal(index: string, file: string): void;
904
+ static addByList(list: Record<string, IconsItem>): void;
905
+ static setUrl(url: string): void;
906
+ static setConfig(config: IconsConfig): void;
907
+ protected static getName(index: string): string;
908
+ protected static getRaw(index: string, url?: string): IconsItem;
909
+ protected static wait(): Promise<void>;
744
910
  }
745
- export declare class DataStorage<T> {
746
- static setPrefix(newPrefix: string): void;
747
- constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
748
- get(defaultValue?: T | (() => T), cache?: number): T | undefined;
749
- set(value?: T | (() => T)): T | undefined;
750
- remove(): this;
751
- update(): this;
911
+ /** Class for working with global loading */
912
+ export declare class Loading {
913
+ static is(): boolean;
914
+ static get(): number;
915
+ static getItem(): LoadingInstance;
916
+ static show(): void;
917
+ static hide(): void;
918
+ static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
919
+ static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
752
920
  }
753
921
  /**
754
- * @remarks
755
- * Creating a `Datetime` instance without a specific date (using current time)
756
- * in SSR may lead to hydration mismatches.
922
+ * Data for the loading event.
923
+ *
924
+ * Данные для события загрузки.
757
925
  */
758
- export declare class Datetime {
759
- constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
760
- getIntl(): GeoIntl;
761
- getDate(): Date;
762
- getType(): GeoDate;
763
- getHoursType(): GeoHours;
764
- getHour24(): boolean;
765
- getTimeZoneOffset(): number;
766
- getTimeZone(style?: GeoTimeZoneStyle): string;
767
- getFirstDayCode(): GeoFirstDay;
768
- getYear(): number;
769
- getMonth(): number;
770
- getDay(): number;
771
- getHour(): number;
772
- getMinute(): number;
773
- getSecond(): number;
774
- getMaxDay(): number;
775
- locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
776
- localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
777
- localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
778
- localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
779
- localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
780
- localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
781
- localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
782
- standard(timeZone?: boolean): string;
783
- setDate(value: NumberOrStringOrDate): this;
784
- setType(value: GeoDate): this;
785
- setHour24(value: boolean): this;
786
- setCode(code: string): this;
787
- setWatch(watch: (date: Date, type: GeoDate, hour24: boolean) => void): this;
788
- setYear(value: number): this;
789
- setMonth(value: number): this;
790
- setDay(value: number): this;
791
- setHour(value: number): this;
792
- setMinute(value: number): this;
793
- setSecond(value: number): this;
794
- moveByYear(value: number): this;
795
- moveByMonth(value: number): this;
796
- moveByDay(value: number): this;
797
- moveByHour(value: number): this;
798
- moveByMinute(value: number): this;
799
- moveBySecond(value: number): this;
800
- moveMonthFirst(): this;
801
- moveMonthLast(): this;
802
- moveMonthNext(): this;
803
- moveMonthPrevious(): this;
804
- moveWeekdayFirst(): this;
805
- moveWeekdayLast(): this;
806
- moveWeekdayFirstByMonth(): this;
807
- moveWeekdayLastByMonth(): this;
808
- moveWeekdayNext(): this;
809
- moveWeekdayPrevious(): this;
810
- moveDayFirst(): this;
811
- moveDayLast(): this;
812
- moveDayNext(): this;
813
- moveDayPrevious(): this;
814
- clone(): Date;
815
- cloneClass(): Datetime;
816
- cloneMonthFirst(): Datetime;
817
- cloneMonthLast(): Datetime;
818
- cloneMonthNext(): Datetime;
819
- cloneMonthPrevious(): Datetime;
820
- cloneWeekdayFirst(): Datetime;
821
- cloneWeekdayLast(): Datetime;
822
- cloneWeekdayFirstByMonth(): Datetime;
823
- cloneWeekdayLastByMonth(): Datetime;
824
- cloneWeekdayNext(): Datetime;
825
- cloneWeekdayPrevious(): Datetime;
826
- cloneDayFirst(): Datetime;
827
- cloneDayLast(): Datetime;
828
- cloneDayNext(): Datetime;
829
- cloneDayPrevious(): Datetime;
926
+ export type LoadingDetail = {
927
+ /** Loading status / Статус загрузки */
928
+ loading: boolean;
929
+ };
930
+ /**
931
+ * Registration item for the loading event.
932
+ *
933
+ * Элемент регистрации для события загрузки.
934
+ */
935
+ export type LoadingRegistrationItem = {
936
+ /** Event item / Элемент события */
937
+ item: EventItem<Window, CustomEvent, LoadingDetail>;
938
+ /** Event listener / Слушатель события */
939
+ listener: EventListenerDetail<CustomEvent, LoadingDetail>;
940
+ /** Element / Элемент */
941
+ element?: ElementOrString<HTMLElement>;
942
+ };
943
+ /** Class for working with global loading */
944
+ export declare class LoadingInstance {
945
+ constructor(eventName?: string);
946
+ is(): boolean;
947
+ get(): number;
948
+ show(): void;
949
+ hide(): void;
950
+ registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
951
+ unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
952
+ protected dispatch(): void;
953
+ }
954
+ /** Unified class for managing all types of meta tags (standard HTML, Open Graph, Twitter Card) */
955
+ export declare class Meta extends MetaManager<MetaTag[]> {
956
+ constructor();
957
+ getOg(): MetaOg;
958
+ getTwitter(): MetaTwitter;
959
+ getTitle(): string;
960
+ getKeywords(): string;
961
+ getDescription(): string;
962
+ getImage(): string;
963
+ getCanonical(): string;
964
+ getRobots(): MetaRobots;
965
+ getAuthor(): string;
966
+ getSiteName(): string;
967
+ getLocale(): string;
968
+ setTitle(title: string): this;
969
+ setKeywords(keywords: string | string[]): this;
970
+ setDescription(description: string): this;
971
+ setImage(image: string): this;
972
+ setCanonical(canonical: string): this;
973
+ setRobots(robots: MetaRobots): this;
974
+ setAuthor(author: string): this;
975
+ setSiteName(siteName: string): this;
976
+ setLocale(locale: string): this;
977
+ setSuffix(suffix?: string): void;
978
+ html(): string;
979
+ htmlTitle(): string;
980
+ protected getSuffix(): string;
830
981
  }
831
- export declare class ErrorCenter {
832
- static getItem(): ErrorCenterInstance;
833
- static has(code: string, group?: string): boolean;
834
- static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
835
- static add(cause: ErrorCenterCauseItem): void;
836
- static addList(causes: ErrorCenterCauseList): void;
837
- static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
838
- static addHandlerList(handlers: ErrorCenterHandlerList): void;
839
- static addCallback(callback: ErrorCenterHandlerCallback): void;
840
- static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
841
- static on(cause: ErrorCenterCauseItem): void;
982
+ type MetaList<T extends readonly string[]> = {
983
+ [K in T[number]]?: string;
984
+ };
985
+ /** Class for working with meta tags */
986
+ export declare class MetaManager<T extends readonly string[], Key extends keyof MetaList<T> = keyof MetaList<T>> {
987
+ constructor(listMeta: T, isProperty?: boolean);
988
+ getListMeta(): T;
989
+ get(name: Key): string;
990
+ getItems(): MetaList<T>;
991
+ html(): string;
992
+ set(name: Key, content: string): this;
993
+ setByList(metaList: MetaList<T>): this;
994
+ protected getAttributeName(): string;
995
+ protected findMetaElement(name: string): HTMLMetaElement | undefined;
996
+ protected setItem(name: Key, content: string): this;
997
+ protected setMeta(name: Key): this;
998
+ protected toHtmlString(name: Key): string;
999
+ protected toHtmlTitle(title: string): string;
1000
+ protected update(): this;
1001
+ }
1002
+ export {};
1003
+ /** Class for working with Open Graph meta tags */
1004
+ export declare class MetaOg extends MetaManager<MetaOpenGraphTag[]> {
1005
+ constructor();
1006
+ getTitle(): string;
1007
+ getType(): MetaOpenGraphType;
1008
+ getUrl(): string;
1009
+ getImage(): string;
1010
+ getDescription(): string;
1011
+ getLocale(): string;
1012
+ getSiteName(): string;
1013
+ setTitle(title: string): this;
1014
+ setType(type: MetaOpenGraphType): this;
1015
+ setUrl(url: string): this;
1016
+ setImage(url: string): this;
1017
+ setDescription(description: string): this;
1018
+ setLocale(locale: string): this;
1019
+ setSiteName(siteName: string): this;
842
1020
  }
843
- export declare class ErrorCenterHandler {
844
- constructor(handlers?: ErrorCenterHandlerList, isConsole?: ErrorCenterHandlerIsConsole);
845
- has(group: ErrorCenterGroup): boolean;
846
- get(group: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
847
- add(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
848
- addList(handlers: ErrorCenterHandlerList): this;
849
- addCallback(callback: ErrorCenterHandlerCallback): this;
850
- setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
851
- on(cause: ErrorCenterCauseItem): this;
1021
+ /** Static class for managing meta tags */
1022
+ export declare class MetaStatic {
1023
+ static getItem(): Meta;
1024
+ static getOg(): MetaOg;
1025
+ static getTwitter(): MetaTwitter;
1026
+ static getTitle(): string;
1027
+ static getKeywords(): string;
1028
+ static getDescription(): string;
1029
+ static getImage(): string;
1030
+ static getCanonical(): string;
1031
+ static getRobots(): MetaRobots;
1032
+ static getAuthor(): string;
1033
+ static getSiteName(): string;
1034
+ static getLocale(): string;
1035
+ static setTitle(title: string): typeof MetaStatic;
1036
+ static setKeywords(keywords: string | string[]): typeof MetaStatic;
1037
+ static setDescription(description: string): typeof MetaStatic;
1038
+ static setImage(image: string): typeof MetaStatic;
1039
+ static setCanonical(canonical: string): typeof MetaStatic;
1040
+ static setRobots(robots: MetaRobots): typeof MetaStatic;
1041
+ static setAuthor(author: string): typeof MetaStatic;
1042
+ static setSiteName(siteName: string): typeof MetaStatic;
1043
+ static setLocale(locale: string): typeof MetaStatic;
1044
+ static setSuffix(suffix?: string): typeof MetaStatic;
1045
+ static html(): string;
1046
+ static htmlTitle(): string;
852
1047
  }
853
- export declare class ErrorCenterInstance {
854
- constructor(causes?: ErrorCenterCauseList, handler?: ErrorCenterHandler);
855
- has(code: string, group?: string): boolean;
856
- get(code: string, group?: string): ErrorCenterCauseItem | undefined;
857
- add(cause: ErrorCenterCauseItem): this;
858
- addList(causes: ErrorCenterCauseList): this;
859
- addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
860
- addHandlerList(handlers: ErrorCenterHandlerList): this;
861
- addCallback(callback: ErrorCenterHandlerCallback): this;
862
- setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
863
- on(cause: ErrorCenterCauseItem): this;
1048
+ /** Class for working with Twitter Card meta tags */
1049
+ export declare class MetaTwitter extends MetaManager<MetaTwitterTag[]> {
1050
+ constructor();
1051
+ getCard(): MetaTwitterCard;
1052
+ getSite(): string;
1053
+ getCreator(): string;
1054
+ getUrl(): string;
1055
+ getTitle(): string;
1056
+ getDescription(): string;
1057
+ getImage(): string;
1058
+ setCard(card: MetaTwitterCard): this;
1059
+ setSite(site: string): this;
1060
+ setCreator(creator: string): this;
1061
+ setUrl(url: string): this;
1062
+ setTitle(title: string): this;
1063
+ setDescription(description: string): this;
1064
+ setImage(image: string): this;
864
1065
  }
865
- export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> {
866
- constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
867
- isActive(): boolean;
868
- getElement(): E | undefined;
869
- setElement(elementSelector?: ElementOrString<E>): this;
870
- setElementControl<EC extends HTMLElement>(elementSelector?: ElementOrString<EC>): this;
871
- setType(type: string | string[]): this;
872
- setListener(listener: EventListenerDetail<O, D>): this;
873
- setOptions(options?: EventOptions): this;
874
- setDetail(detail?: D): this;
875
- dispatch(detail?: D | undefined): this;
876
- start(): this;
877
- stop(): this;
878
- toggle(activity: boolean): this;
1066
+ /** Static class for working with data stored in the URL query parameters */
1067
+ export declare class Query {
1068
+ static getItem(): QueryInstance;
1069
+ static get<T>(name: string, defaultValue?: T | (() => T)): T;
1070
+ static set<T>(name: string, callback: T | (() => T)): void;
1071
+ static addWatch<T>(name: string, callback: (value: T) => void): void;
1072
+ static removeWatch<T>(name: string, callback: (value: T) => void): void;
1073
+ static reload(): void;
1074
+ }
1075
+ /** Class for working with data stored in the URL query parameters */
1076
+ export declare class QueryInstance extends UrlInstanceAbstract {
1077
+ protected init(): this;
1078
+ protected getLocation(): Record<string, any>;
1079
+ protected update(): this;
1080
+ }
1081
+ /** Class for creating a timer that can be paused and resumed */
1082
+ export declare class ResumableTimer {
1083
+ constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
1084
+ resume(): this;
1085
+ pause(): this;
879
1086
  reset(): this;
1087
+ clear(): this;
1088
+ protected getRemaining(): number;
1089
+ protected getStartTime(): number;
1090
+ protected go(): this;
1091
+ protected updateRemaining(): this;
1092
+ protected updateStartTime(): this;
1093
+ protected stop(): this;
1094
+ }
1095
+ /** Class for getting the scroll width */
1096
+ export declare class ScrollbarWidth {
1097
+ static is(): Promise<boolean>;
1098
+ static get(): Promise<number>;
1099
+ static getStorage(): DataStorage<number>;
1100
+ static getCalculate(): boolean;
880
1101
  }
881
- export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
882
- constructor(options: Options, list?: List | undefined);
883
- is(): boolean;
884
- isArray(): this is this & {
885
- list: FormattersList<Item>;
1102
+ /** Main class for managing a searchable list */
1103
+ export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
1104
+ constructor(list: SearchListValue<T>, columns?: K, value?: string, options?: SearchOptions);
1105
+ getData(): SearchListData<T, K>;
1106
+ getList(): SearchListValue<T>;
1107
+ getColumns(): K | undefined;
1108
+ getItem(): SearchListItem;
1109
+ getValue(): string | undefined;
1110
+ getOptions(): SearchListOptions;
1111
+ setList(list: SearchListValue<T>): this;
1112
+ setColumns(columns?: K): this;
1113
+ setValue(value?: string): this;
1114
+ setOptions(options: SearchOptions): this;
1115
+ to(): SearchFormatList<T, K>;
1116
+ protected readonly callbackToSelection: (item: SearchCacheItem<T>["item"], value: SearchCacheItem<T>["value"]) => SearchFormatItem<T, K> | undefined;
1117
+ protected readonly callbackToNone: (item: SearchCacheItem<T>["item"]) => SearchFormatItem<T, K>;
1118
+ }
1119
+ /** Class for managing and formatting the search data list and its cache */
1120
+ export declare class SearchListData<T extends SearchItem, K extends SearchColumns<T>> {
1121
+ constructor(list: SearchListValue<T>, columns: K | undefined, item: SearchListItem, options: SearchListOptions);
1122
+ is(): this is this & {
1123
+ list: T[];
1124
+ columns: string[];
886
1125
  };
887
- length(): number;
888
- getList(): FormattersList<Item>;
889
- getOptions(): Options;
890
- setList(list?: List): this;
891
- to(): FormattersReturn<List, Options>;
1126
+ isList(): this is this & {
1127
+ list: T[];
1128
+ };
1129
+ getList(): SearchListValue<T>;
1130
+ getColumns(): K | undefined;
1131
+ protected getCache(): SearchCache<T>;
1132
+ setList(list: SearchListValue<T>): this;
1133
+ setColumns(columns?: SearchColumns<T>): this;
1134
+ findCacheItem(item: T): SearchCacheItem<T> | undefined;
1135
+ forEach(callback: (item: SearchCacheItem<T>['item'], value: SearchCacheItem<T>['value']) => SearchFormatItem<T, K> | undefined): SearchFormatList<T, K>;
1136
+ toFormatItem(item: T, selection: boolean): SearchFormatItem<T, K>;
1137
+ protected getColumnName(column: string): string;
1138
+ protected addTag(value: any): string;
1139
+ protected generateCache(): SearchCache<T>;
1140
+ protected initCache(): void;
1141
+ protected resetCache(): void;
892
1142
  }
893
- export declare class Geo {
894
- static getObject(): GeoInstance;
895
- static get(): GeoItemFull;
896
- static getCountry(): string;
897
- static getLanguage(): string;
898
- static getStandard(): string;
899
- static getFirstDay(): string;
900
- static getLocation(): string;
901
- static getLocationCountry(): string;
902
- static getLocationLanguage(): string;
903
- static getItem(): GeoItemFull;
904
- static getList(): GeoItem[];
905
- static getByCode(code?: string): GeoItemFull;
906
- static getByCodeFull(code: string): GeoItem | undefined;
907
- static getByCountry(country: string): GeoItem | undefined;
908
- static getByLanguage(language: string): GeoItem | undefined;
909
- static getTimezone(): number;
910
- static getTimezoneFormat(): string;
911
- static find(code: string): GeoItemFull;
912
- static toStandard(item: GeoItem): string;
913
- static set(code: string, save?: boolean): void;
914
- static setTimezone(timezone: number): void;
915
- static setValueDefault(code?: string | (() => string)): void;
1143
+ /** Class representing a single search item's value and its search-related state */
1144
+ export declare class SearchListItem {
1145
+ constructor(value: string | undefined, options: SearchListOptions);
1146
+ is(): this is this & {
1147
+ value: string;
1148
+ };
1149
+ isSearch(): boolean;
1150
+ get(): string;
1151
+ set(value?: string): this;
916
1152
  }
917
- export declare const GEO_FLAG_ICON_NAME = "f";
918
- export declare class GeoFlag {
919
- static flags: Record<string, string>;
920
- constructor(code?: string);
921
- get(code?: string): GeoFlagItem | undefined;
922
- getLanguage(code?: string): GeoFlagItem | undefined;
923
- getCode(): string;
924
- getFlag(code?: string): string | undefined;
925
- getList(codes?: string[], sort?: boolean): GeoFlagItem[];
926
- getListLanguage(codes?: string[], sort?: boolean): GeoFlagItem[];
927
- getNational(codes?: string[], sort?: boolean): GeoFlagNational[];
928
- getNationalLanguage(codes?: string[], sort?: boolean): GeoFlagNational[];
929
- setCode(code: string): this;
1153
+ /** Class responsible for matching search values against the search list data */
1154
+ export declare class SearchListMatcher {
1155
+ constructor(item: SearchListItem, options: SearchListOptions);
1156
+ is(): boolean;
1157
+ isSelection(value: SearchCacheItem<any>['value']): boolean;
1158
+ get(): RegExp | undefined;
1159
+ update(): void;
1160
+ protected initMatcher(): void;
930
1161
  }
931
- export declare const UI_GEO_COOKIE_KEY = "ui-geo-code";
932
- export declare class GeoInstance {
933
- constructor();
934
- get(): GeoItemFull;
935
- getCountry(): string;
936
- getLanguage(): string;
937
- getStandard(): string;
938
- getFirstDay(): string;
939
- getLocation(): string;
940
- getLocationCountry(): string;
941
- getLocationLanguage(): string;
942
- getItem(): GeoItemFull;
943
- getList(): GeoItem[];
944
- getByCode(code?: string): GeoItemFull;
945
- getByCodeFull(code: string): GeoItem | undefined;
946
- getByCountry(country: string): GeoItem | undefined;
947
- getByLanguage(language: string): GeoItem | undefined;
948
- getTimezone(): number;
949
- getTimezoneFormat(): string;
950
- find(code: string): GeoItemFull;
951
- toStandard(item: GeoItem, language?: string): string;
952
- set(code: string, save?: boolean): void;
953
- setTimezone(timezone: number): void;
954
- setValueDefault(code?: string | (() => string)): void;
1162
+ /** Class for managing search list options */
1163
+ export declare class SearchListOptions {
1164
+ constructor(options?: SearchOptions | undefined);
1165
+ getOptions(): SearchOptions;
1166
+ getLimit(): number;
1167
+ getReturnEverything(): boolean;
1168
+ getDelay(): number;
1169
+ getFindExactMatch(): boolean;
1170
+ getClassName(): string;
1171
+ setOptions(options: SearchOptions): this;
955
1172
  }
956
- export declare class GeoIntl {
957
- static isItem(code?: string): boolean;
958
- static getLocation(code?: string): string;
959
- static getInstance(code?: string): GeoIntl;
960
- constructor(code?: string, errorCenter?: ErrorCenterInstance);
961
- getLocation(): string;
962
- getFirstDay(): string;
963
- display(value?: string, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): string;
964
- languageName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
965
- countryName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
966
- fullName(last: string, first: string, surname?: string, short?: boolean): string;
967
- number(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
968
- decimal(): string;
969
- currency(value: NumberOrString, currencyOptions?: string | Intl.NumberFormatOptions, numberOnly?: boolean): string;
970
- currencySymbol(currency: string, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): string;
971
- unit(value: NumberOrString, unitOptions?: string | Intl.NumberFormatOptions): string;
972
- sizeFile(value: NumberOrString, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): string;
973
- percent(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
974
- percentBy100(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
975
- plural(value: NumberOrString, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): string;
976
- date(value: NumberOrStringOrDate, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): string;
977
- relative(value: NumberOrStringOrDate, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): string;
978
- relativeLimit(value: NumberOrStringOrDate, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): string;
979
- relativeByValue(value: NumberOrString, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): string;
980
- month(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['month']): string;
981
- months(style?: Intl.DateTimeFormatOptions['month']): ItemValue<number | undefined>[];
982
- weekday(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['weekday']): string;
983
- weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ItemValue<number | undefined>[];
984
- time(value: NumberOrStringOrDate): string;
985
- sort<T>(data: T[], compareFn?: (a: T, b: T) => [string, string]): T[];
1173
+ /** Item stored in the server storage */
1174
+ type ServerStorageItem = {
1175
+ value: any;
1176
+ hydration: boolean;
1177
+ };
1178
+ type ServerStorageList = Record<string, ServerStorageItem>;
1179
+ /** Class for managing data storage during server-side rendering (SSR) */
1180
+ export declare class ServerStorage {
1181
+ protected static listener?: () => Record<string, any> | undefined;
1182
+ static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
1183
+ static reset(): void;
1184
+ static has(key: string): boolean;
1185
+ static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
1186
+ static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
1187
+ static setErrorStatus(hide: boolean): void;
1188
+ static remove(key: string): void;
1189
+ static toString(): string;
1190
+ protected static getStorage(isInit?: boolean, status?: string): ServerStorageList;
1191
+ protected static getStorageDom(): ServerStorageList;
1192
+ protected static getDataForHydration(): Record<string, any>;
986
1193
  }
987
- export declare class GeoPhone {
988
- static get(code: string): GeoPhoneValue | undefined;
989
- static getByPhone(phone: string): GeoPhoneMapInfo;
990
- static getByCode(code: string): GeoPhoneMap | undefined;
991
- static getList(): GeoPhoneValue[];
992
- static getMap(): Record<string, GeoPhoneMap>;
993
- static toMask(phone: string, masks?: string[]): string | undefined;
994
- static removeZero(phone: string): string;
1194
+ export {};
1195
+ /** A class for working with callback lists for storage. */
1196
+ export declare class StorageCallback<T = any, Callback = (value: T) => void | Promise<void>> {
1197
+ /** Returns an instance of the class by name.
1198
+ * @param name storage name
1199
+ * @param group storage group
1200
+ * @returns StorageCallback instance
1201
+ */
1202
+ static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
1203
+ protected callbacks: {
1204
+ callback: Callback;
1205
+ isOnce?: boolean;
1206
+ }[];
1207
+ /** Constructor for initialization.
1208
+ * @param name storage name
1209
+ * @param group storage group
1210
+ */
1211
+ constructor(name: string, group?: string);
1212
+ /** Returns the loading state.
1213
+ * @returns loading state
1214
+ */
1215
+ isLoading(): boolean;
1216
+ /** Returns the storage name.
1217
+ * @returns storage name
1218
+ */
1219
+ getName(): string;
1220
+ /** Returns the loading state.
1221
+ * @returns loading state
1222
+ */
1223
+ getLoading(): boolean;
1224
+ /** Adds a callback to the list.
1225
+ * @param callback function for callbacks
1226
+ * @param isOnce whether the callback should only be called once
1227
+ */
1228
+ addCallback(callback: Callback, isOnce?: boolean): this;
1229
+ /** Removes a callback from the list.
1230
+ * @param callback function for callbacks
1231
+ */
1232
+ removeCallback(callback: Callback): this;
1233
+ /** Preparation of data before launch. */
1234
+ preparation(): this;
1235
+ /** Execution of all callbacks.
1236
+ * @param value storage data
1237
+ */
1238
+ run(value: T): Promise<this>;
995
1239
  }
996
- export declare class GeoUnit {
997
- static getInstance(code?: string): GeoUnit;
998
- constructor(code?: string);
999
- getLocation(): string;
1000
- millimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1001
- centimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1002
- meter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1003
- kilometer(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1004
- squareMeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1005
- hectare(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1006
- gram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1007
- kilogram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1008
- tonne(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1009
- milliliter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1010
- liter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1011
- celsius(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1012
- kilometerPerHour(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
1013
- format(value: NumberOrString, unit: string, options?: Intl.NumberFormatOptions): string;
1240
+ /** Class for getting the translated text. */
1241
+ export declare class Translate {
1242
+ /** Getting the translation text by its code.
1243
+ * @param name code name
1244
+ * @param replacement If set, replaces the text with the specified values
1245
+ * @returns translation text
1246
+ */
1247
+ static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
1248
+ /** Returns a request-isolated instance of TranslateInstance.
1249
+ * @returns TranslateInstance instance
1250
+ */
1251
+ static getItem(): TranslateInstance;
1252
+ /** Getting the translation text by its code (Sync).
1253
+ * @param name code name
1254
+ * @param first If set to false, returns an empty string if there is no text
1255
+ * @param replacement If set, replaces the text with the specified values
1256
+ * @returns translation text
1257
+ */
1258
+ static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
1259
+ /** Getting a list of translations by an array of text codes.
1260
+ * @param names list of codes to get translations
1261
+ * @returns object with translations
1262
+ */
1263
+ static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
1264
+ /** Getting a list of translations by an array of text codes.
1265
+ * @param names list of codes to get translations
1266
+ * @param first If set to false, returns an empty string if there is no text
1267
+ * @returns object with translations
1268
+ */
1269
+ static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
1270
+ /** Added a list of translated texts.
1271
+ * @param names list of codes to get translations
1272
+ */
1273
+ static add(names: string | string[]): Promise<void>;
1274
+ /** Adds texts in sync mode.
1275
+ * @param data list of texts in the form of key-value
1276
+ */
1277
+ static addSync(data: Record<string, string>): void;
1278
+ /** Adding data in the form of a query or directly, depending on the execution environment.
1279
+ * @param data list of texts in the form of key-value
1280
+ */
1281
+ static addNormalOrSync(data: Record<string, string>): Promise<void>;
1282
+ /** Adds texts synchronously by location.
1283
+ * @param data list of texts by location
1284
+ */
1285
+ static addSyncByLocation(data: Record<string, Record<string, string>>): void;
1286
+ /** Adds texts synchronously from the file.
1287
+ * @param data file with translations
1288
+ */
1289
+ static addSyncByFile(data: TranslateDataFile): void;
1290
+ /** Change the path to the script for obtaining the translation.
1291
+ * @param url path to the script
1292
+ */
1293
+ static setUrl(url: string): void;
1294
+ /** Change the name of the property to get the translation.
1295
+ * @param name property name
1296
+ */
1297
+ static setPropsName(name: string): void;
1298
+ /** Change the read mode from the API.
1299
+ * @param value read mode
1300
+ */
1301
+ static setReadApi(value: boolean): void;
1302
+ /** Set the configuration for the translation.
1303
+ * @param config configuration
1304
+ */
1305
+ static setConfig(config: TranslateConfig): void;
1014
1306
  }
1015
- export declare class Global {
1016
- static getItem(): Record<string, any>;
1017
- static get<R = any>(name: string): R;
1018
- static add(data: Record<string, any>): void;
1307
+ /** Class for working with translation files. */
1308
+ export declare class TranslateFile {
1309
+ protected language: string | (() => string);
1310
+ protected location: string | (() => string);
1311
+ /** List of files with translations */
1312
+ /** Creates an instance of the class.
1313
+ * @param data list of files
1314
+ * @param language language
1315
+ * @param location location
1316
+ */
1317
+ constructor(data?: TranslateDataFile, language?: string | (() => string), location?: string | (() => string));
1318
+ /** Checks if there are files for the current location or language. */
1319
+ isFile(): boolean;
1320
+ /** Returns the location. */
1321
+ getLocation(): string;
1322
+ /** Returns the language. */
1323
+ getLanguage(): string;
1324
+ /** Returns a list of translations from the file for the current location.
1325
+ * @returns promise with list of translations
1326
+ */
1327
+ getList(): Promise<TranslateDataFileList | undefined>;
1328
+ /** Adds a list of files with translations.
1329
+ * @param data list of files
1330
+ */
1331
+ add(data: TranslateDataFile): void;
1332
+ /** Returns the key for the current location from the list of files.
1333
+ * @returns file key or undefined
1334
+ */
1335
+ protected getIndex(): string | undefined;
1336
+ /** Returns a list of translations from the cache.
1337
+ * @param index file key
1338
+ * @returns list of translations or undefined
1339
+ */
1340
+ protected getByData(index: string): TranslateDataFileList | undefined;
1341
+ /** Returns a list of translations from the file and caches the result.
1342
+ * @param index file key
1343
+ * @returns promise with list of translations or undefined
1344
+ */
1345
+ protected getByFile(index: string): Promise<TranslateDataFileList | undefined>;
1346
+ }
1347
+ /** Class for getting the translated text */
1348
+ export declare class TranslateInstance {
1349
+ protected resolveList: (() => void)[];
1350
+ constructor(url?: string, propsName?: string, files?: TranslateFile);
1351
+ get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
1352
+ getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
1353
+ getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
1354
+ getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
1355
+ add(names: string | string[]): Promise<void>;
1356
+ addSync(data: Record<string, string>): void;
1357
+ addNormalOrSync(data: Record<string, string>): Promise<void>;
1358
+ addSyncByLocation(data: Record<string, Record<string, string>>): void;
1359
+ addSyncByFile(data: TranslateDataFile): void;
1360
+ setUrl(url: string): this;
1361
+ setPropsName(name: string): this;
1362
+ setReadApi(value: boolean): this;
1363
+ protected hasName(name: string): boolean;
1364
+ protected getText(name: string): string | undefined;
1365
+ protected getName(name: string): string;
1366
+ protected getNameByLanguage(name: string): string;
1367
+ protected getNameByGlobal(name: string): string;
1368
+ protected getNamesNone(names: string | string[]): string[];
1369
+ protected getResponse(): Promise<Record<string, string>>;
1370
+ protected replacement(text: string, replacement?: string[] | Record<string, string | number>): any;
1371
+ protected make(): Promise<void>;
1372
+ protected makeList(list: Record<string, string>): void;
1373
+ }
1374
+ /** Base abstract class for working with URL-based states (Hash, Query) */
1375
+ export declare abstract class UrlInstanceAbstract {
1376
+ protected watch: Record<string, ((value: any) => void)[]>;
1377
+ get<T>(name: string, defaultValue?: T | (() => T)): T;
1378
+ set<T>(name: string, callback: T | (() => T)): this;
1379
+ addWatch<T>(name: string, callback: (value: T) => void): this;
1380
+ removeWatch<T>(name: string, callback: (value: T) => void): this;
1381
+ reload(): this;
1382
+ protected getData(): Record<string, any>;
1383
+ protected initData(): this;
1384
+ protected makeWatch(location: Record<string, any>): this;
1385
+ protected abstract init(): this;
1386
+ protected abstract getLocation(): Record<string, any>;
1387
+ protected abstract update(): this;
1388
+ }
1389
+ /** Isomorphic utility class for working with URLs */
1390
+ export declare class UrlItem {
1391
+ static getInstance(): UrlItem;
1392
+ constructor(url?: string | URL);
1393
+ get href(): string;
1394
+ get protocol(): string;
1395
+ get username(): string;
1396
+ get password(): string;
1397
+ get host(): string;
1398
+ get hostname(): string;
1399
+ get port(): string;
1400
+ get pathname(): string;
1401
+ get search(): string;
1402
+ get searchParams(): URLSearchParams;
1403
+ get hash(): string;
1404
+ get origin(): string;
1405
+ hasParam(name: string): boolean;
1406
+ getParam(name: string): string | undefined;
1407
+ getParams(): Record<string, any>;
1408
+ set(url?: string | URL): this;
1409
+ setParam(name: string, value: string): this;
1410
+ setParams(params: Record<string, any>): this;
1411
+ deleteParam(name: string): this;
1412
+ toString(): string;
1413
+ toJSON(): string;
1019
1414
  }
1020
- export declare class Hash {
1021
- static getItem(): HashInstance;
1022
- static get<T>(name: string, defaultValue?: T | (() => T)): T;
1023
- static set<T>(name: string, callback: T | (() => T)): void;
1024
- static addWatch<T>(name: string, callback: (value: T) => void): void;
1025
- static removeWatch<T>(name: string, callback: (value: T) => void): void;
1026
- static reload(): void;
1415
+ /** Adds a tag to highlight the match in the string */
1416
+ export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
1417
+ /** Conversion of a value to a string */
1418
+ export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
1419
+ /** Applies a template to the text, replacing keys with values from the replacement object */
1420
+ export declare const applyTemplate: (text: string, replacement?: Record<string, string | number | boolean> | string[]) => string;
1421
+ /** The method creates an array of "count" elements with values equal to `value` */
1422
+ export declare function arrFill<T>(value: T, count: number): T[];
1423
+ /** Convert a Blob to a Base64 string */
1424
+ export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
1425
+ /** Capitalizes the first letter of a string */
1426
+ export declare function capitalize(value: string, isLocale?: boolean): string;
1427
+ /** Creates a deep copy of an object for independent data management */
1428
+ export declare function copyObject<T>(value: T): T;
1429
+ /** Copies a simple object */
1430
+ export declare function copyObjectLite<T, R = T>(value: T, source?: any): R;
1431
+ /**
1432
+ * In HTML documents, creates an element with the tag that is specified in the argument
1433
+ * @remarks
1434
+ * When running on the server, the function always returns `undefined`.
1435
+ * If you use it within a component's rendering logic, it may lead to hydration mismatches.
1436
+ * It is recommended to call this function only inside lifecycle hooks that run exclusively on the client (e.g., `onMounted` in Vue or `useEffect` in React).
1437
+ */
1438
+ export declare function createElement<T extends HTMLElement>(parentElement?: HTMLElement, tagName?: string, options?: Partial<T> | Record<keyof T, T[keyof T]> | ((element: T) => void), referenceElement?: HTMLElement): T | undefined;
1439
+ /** Executes a callback function when the DOMContentLoaded event is fired */
1440
+ export declare function domContentLoaded<T = void>(callback: () => T | Promise<T>): Promise<T>;
1441
+ /** Selects the first element that matches the specified selectors */
1442
+ export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
1443
+ /** Selects all elements that match the specified selectors */
1444
+ export declare function domQuerySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E> | undefined;
1445
+ /** Encodes special characters in a string for safe use in HTML attributes */
1446
+ export declare function encodeAttribute(text: string): string;
1447
+ /** Encodes special characters in a string for safe use in HTML attributes */
1448
+ export declare function encodeLiteAttribute(text: string): string;
1449
+ /** Ensures that an image does not exceed the maximum size by resizing it if needed */
1450
+ export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
1451
+ /** Escapes special regex characters in a string so it can be used safely in a RegExp */
1452
+ export declare function escapeExp(value: string): string;
1453
+ /** Stop listening to events in depth */
1454
+ export declare function eventStopPropagation(event: Event): void;
1455
+ /** Flexible utility that executes the provided argument if it is a function, otherwise returns it as is */
1456
+ export declare function executeFunction<T>(callback: T | FunctionArgs<any, T>, ...args: any[]): T;
1457
+ /**
1458
+ * Safely executes a function and awaits its result if it returns a Promise.
1459
+ * If the provided value is a static value or a synchronous function, it returns the result immediately wrapped in a Promise.
1460
+ */
1461
+ export declare function executePromise<T>(callback: ((...args: any[]) => Promise<T>) | ((...args: any[]) => T) | T, ...args: any[]): Promise<T>;
1462
+ /** The function performs the specified function once for each element in the object and returns an array with the results of executing the function */
1463
+ export declare function forEach<T, R, D extends T[] | Record<string, T> | Map<string, T> | Set<T> = T[] | Record<string, T> | Map<string, T> | Set<T>, K = D extends T[] ? number : string>(data: D & (T[] | Record<string, T> | Map<string, T> | Set<T>), callback: (item: T, key: K, dataMain: typeof data) => R, saveUndefined?: boolean): R[];
1464
+ /** Cyclically calls requestAnimationFrame until next returns true */
1465
+ export declare function frame(callback: () => void, next?: () => boolean, end?: () => void): void;
1466
+ /** Split a string into an array of objects to highlight matches */
1467
+ export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
1468
+ /** Gets a list of attributes of an element */
1469
+ export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
1470
+ /**
1471
+ * The method retrieves drag data (as a string) for the specified type.
1472
+ * If the drag operation does not include data, this method returns an empty string.
1473
+ */
1474
+ export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
1475
+ /** Returns an array of values for a specific column in the input array */
1476
+ export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>, column: K): (T[K] | undefined)[];
1477
+ /**
1478
+ * Returns the current date in the specified format
1479
+ * @remarks
1480
+ * Using this function for rendering in SSR may lead to hydration mismatches
1481
+ * because the time or time zone on the server may differ from the time on the client.
1482
+ * It is recommended to use this function inside client-side hooks only (e.g., `onMounted` in Vue or `useEffect` in React).
1483
+ */
1484
+ export declare function getCurrentDate(format?: GeoDate): string;
1485
+ /**
1486
+ * Returns the current time in milliseconds
1487
+ * @remarks
1488
+ * **Warning (SSR):** Using this function for rendering in SSR will almost certainly lead to hydration mismatches
1489
+ * because the timestamp on the server will differ from the timestamp on the client.
1490
+ */
1491
+ export declare function getCurrentTime(): number;
1492
+ /** Returns the first Element in the document that matches the specified selector or the element */
1493
+ export declare function getElement<E extends ElementOrWindow, R extends Exclude<E, Window>>(element?: ElementOrString<E>): R | undefined;
1494
+ /** Returns the identifier (ID) of the element or creates it if the element has no ID */
1495
+ export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
1496
+ /**
1497
+ * Initializes the getElementId function with a listener
1498
+ * @warning Initialization is mandatory for correct functioning of SSR on both server and client sides.
1499
+ * @example
1500
+ * ```typescript
1501
+ * import { useId } from 'vue'
1502
+ * import { initGetElementId } from '@dxtmisha/functional-basic'
1503
+ *
1504
+ * initGetElementId(() => useId())
1505
+ * ```
1506
+ */
1507
+ export declare function initGetElementId(newListener: () => string | number): void;
1508
+ /** Get image element from HTMLImageElement or string source */
1509
+ export declare function getElementImage(image: HTMLImageElement | string): HTMLImageElement | undefined;
1510
+ /** Returns the value of an element by its key */
1511
+ export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>, index: K | string, defaultValue?: D): T[K] | D | undefined;
1512
+ /** Returns window or element */
1513
+ export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
1514
+ /** Generates a safe script tag for data hydration */
1515
+ export declare function getElementSafeScript(id: string, data: any): string;
1516
+ /** Creates a case-insensitive regular expression for an exact match of a phrase (without anchors) */
1517
+ export declare function getExactSearchExp(search: string): RegExp;
1518
+ /** The object is used for matching text with a pattern */
1519
+ export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
1520
+ /** Returns the first element of an array or object */
1521
+ export declare function getFirst<T>(value: T | T[] | Record<string, T>): T | undefined;
1522
+ /** Retrieves and parses JSON data from a script tag in the DOM */
1523
+ export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
1524
+ /** Returns data by their path */
1525
+ export declare function getItemByPath<T extends Record<string, any>, R = string>(item: T, path: string): R | undefined;
1526
+ /** Returns the pressed key */
1527
+ export declare function getKey(event: KeyboardEvent): string | number | undefined;
1528
+ /** Returns the last element of an array or object */
1529
+ export declare function getLast<T>(value: T | T[] | Record<string, T>): T | undefined;
1530
+ /**
1531
+ * Returns the length or size of various data types including Arrays, Objects, Maps, Sets, and Strings.
1532
+ * If the value is null, undefined, or an unsupported type (e.g. number, boolean), it returns 0.
1533
+ */
1534
+ export declare function getLength(value: any): number;
1535
+ /** Returns the length of all elements in an array */
1536
+ export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
1537
+ /** Searches for the longest string in the array and returns its length */
1538
+ export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
1539
+ /** Searches for the shortest string in the array and returns its length */
1540
+ export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
1541
+ /** Returns the position of the mouse cursor or the location of the click */
1542
+ export declare function getMouseClient(event: MouseEvent & TouchEvent): ImageCoordinator;
1543
+ /** Returns the position of the mouse cursor or the location of the click (X) */
1544
+ export declare function getMouseClientX(event: MouseEvent & TouchEvent): number;
1545
+ /** Returns the position of the mouse cursor or the location of the click (Y) */
1546
+ export declare function getMouseClientY(event: MouseEvent & TouchEvent): number;
1547
+ /** Returns a new object with keys from the keys list */
1548
+ export declare function getObjectByKeys<T extends Record<string, any>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
1549
+ /** Removes from the object all properties belonging to the exception type */
1550
+ export declare function getObjectNoUndefined<T extends Record<string | number, any>>(data: T, exception?: any): T;
1551
+ /** Returns the object if the object’s values are set */
1552
+ export declare function getObjectOrNone<T>(value: T): T & Record<string, any>;
1553
+ /** Returns only letters, numbers, and spaces from a string */
1554
+ export declare function getOnlyText(text: any): string;
1555
+ /**
1556
+ * Returns a random element from an array, object, or value.
1557
+ * If the input is empty or invalid, returns undefined.
1558
+ */
1559
+ export declare function getRandomItem<T>(value?: T | T[] | Record<string, T>): T | undefined;
1560
+ /** Generates text.
1561
+ * @param min minimum word
1562
+ * @param max maximum word
1563
+ * @param symbol symbol for replacing a letter
1564
+ * @param lengthMin minimum word length
1565
+ * @param lengthMax maximum word length
1566
+ * @returns generated text
1567
+ */
1568
+ export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
1569
+ /** Returns a string in the form of key-value.
1570
+ * @param request data for conversion
1571
+ * @param sign delimiter sign of key and value
1572
+ * @param separator variable delimiter sign
1573
+ * @param subKey nested key for array elements
1574
+ * @returns formatted request string
1575
+ */
1576
+ export declare function getRequestString(request: Record<string, any> | any[], sign?: string, separator?: string, subKey?: string): string;
1577
+ /** Builds a case-insensitive global `RegExp` for multi-word "contains all words" search.
1578
+ * Each word in the search string is escaped and wrapped in a lookahead `(?=.*?word)`,
1579
+ * so the result matches a string only if it contains every word (in any order).
1580
+ * @param search search string with one or more space-separated words
1581
+ * @param limit maximum search string length
1582
+ */
1583
+ export declare function getSearchExp(search: string, limit?: number): RegExp;
1584
+ /** Creates a case-insensitive regular expression for a search by words (separating by space).
1585
+ * @param search search string or RegExp
1586
+ * @param limit maximum search string length
1587
+ * @returns `RegExp` for search
1588
+ */
1589
+ export declare function getSeparatingSearchExp(search: string | RegExp, limit?: number): RegExp;
1590
+ /** Returns the unit of measurement for 1 step
1591
+ * @param min minimum value
1592
+ * @param max maximum value
1593
+ * @returns step value in percent
1594
+ */
1595
+ export declare function getStepPercent(min: number | undefined, max: number): number;
1596
+ /** Returns the unit of measurement for a single step relative to the given value
1597
+ * @param min minimum value
1598
+ * @param max maximum value
1599
+ * @returns step value
1600
+ */
1601
+ export declare function getStepValue(min: number | undefined, max: number): number;
1602
+ /** Quick change of scroll at the element to the required element.
1603
+ * @param selector the selected an element, the scroll position of which needs to be changed
1604
+ * @param elementTo the element to which you need to scroll
1605
+ * @param elementCenter the element that needs to be centered
1606
+ */
1607
+ export declare function goScroll(selector: string, elementTo: HTMLElement | undefined, elementCenter?: HTMLElement): void;
1608
+ /** Smooth scrolling to the element.
1609
+ * @param element target element
1610
+ * @param options scroll options
1611
+ * @param shift shift from the top
1612
+ */
1613
+ export declare function goScrollSmooth<E extends HTMLElement>(element: E, options?: ScrollIntoViewOptions, shift?: number): void;
1614
+ /** Scrolls the container to make the target element visible */
1615
+ export declare function goScrollTo(element?: HTMLElement, elementTo?: HTMLElement, behavior?: ScrollBehavior): void;
1616
+ /**
1617
+ * The method invokes the native sharing mechanism of the device as part of the Web Share API.
1618
+ * If the Web Share API is not supported by the browser or the data cannot be shared, the method returns false.
1619
+ */
1620
+ export declare function handleShare(data: ShareData): Promise<boolean>;
1621
+ /** Checks if the value is in the current array */
1622
+ export declare function inArray<T>(array: T[], value: T): boolean;
1623
+ /** Initialization of data for scroll control */
1624
+ export declare function initScrollbarOffset(): Promise<void>;
1625
+ /** Computes the intersection of arrays using keys for comparison */
1626
+ export declare function intersectKey<T, KT extends keyof T, C, KC extends keyof C>(data?: T, comparison?: C): Record<KT & KC, T[KT]>;
1627
+ /** Checks if the API response is successful */
1628
+ export declare const isApiSuccess: <T>(data: ApiData<T>) => boolean;
1629
+ /** Checks if the values are arrays */
1630
+ export declare function isArray<T, R>(value: T): value is Extract<T, R[]>;
1631
+ /** Checks if the values of two objects are different */
1632
+ export declare function isDifferent<T>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
1633
+ /** Checks if the current environment is a data URL */
1634
+ export declare function isDomData(): boolean;
1635
+ /**
1636
+ * Checks if the code is running in a browser where the `window` object is available.
1637
+ * Returns `true` if `window` is defined, indicating the code is running in a browser.
1638
+ */
1639
+ export declare function isDomRuntime(): boolean;
1640
+ /**
1641
+ * Checks if an element is visible (not hidden by CSS and is in the DOM).
1642
+ * An element can be off-screen and still be considered visible.
1643
+ */
1644
+ export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
1645
+ /** Checks if the pressed key is Enter or Space */
1646
+ export declare const isEnter: (event: KeyboardEvent, isInputElement?: boolean) => boolean;
1647
+ /** Checks if the field is filled */
1648
+ export declare function isFilled<T>(value: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
1649
+ /** Checks if the value is an integer or a floating-point number */
1650
+ export declare function isFloat(value: any): boolean;
1651
+ /** Checks if the function is a callback function */
1652
+ export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionArgs<any, any>>;
1653
+ /** Checks if an element is still in the DOM tree */
1654
+ export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
1655
+ /** Checks if the element is an input field or editable */
1656
+ export declare const isInput: (element: HTMLElement | EventTarget | null) => boolean;
1657
+ /** Checks if the value is between integers */
1658
+ export declare function isIntegerBetween(value: number, between: number): boolean;
1659
+ /** Checks if a key event contains active modifier/meta keys */
1660
+ export declare const isMetaKey: (event: KeyboardEvent) => boolean;
1661
+ /** Is the variable equal to null or undefined */
1662
+ export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
1663
+ /** Checks if the value is a number */
1664
+ export declare function isNumber(value: any): boolean;
1665
+ /** Checks if a value is an object */
1666
+ export declare function isObject<T>(value: T): value is Extract<T, Record<any, any>>;
1667
+ /** Checks if the value is an object or not an array */
1668
+ export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, Record<any, any>>, any[] | undefined | null>;
1669
+ /** Check if the device is online */
1670
+ export declare function isOnLine(): boolean;
1671
+ /** Checks if value is in the array selected or if value equals selected, if selected is a string */
1672
+ export declare function isSelected<T, S>(value: T, selected: T | T[] | S): boolean;
1673
+ /** Testing isSelected property for the entire list of values */
1674
+ export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
1675
+ /** Checks if the Web Share API is supported in the current environment */
1676
+ export declare function isShare(): boolean;
1677
+ /** Checks if the value is of type string */
1678
+ export declare function isString<T>(value: T): value is Extract<T, string>;
1679
+ /** Checks if the pressed key is Tab */
1680
+ export declare const isTab: (event: KeyboardEvent) => boolean;
1681
+ /** Checks if object is Window */
1682
+ export declare function isWindow<E>(element: E): element is Extract<E, Window>;
1683
+ /** Generate a random integer */
1684
+ export declare function random(min: number, max: number): number;
1685
+ /** Removes the common prefix from the main string */
1686
+ export declare function removeCommonPrefix(mainStr: string, prefix: string): string;
1687
+ /** Replaces the component name in the text */
1688
+ export declare const replaceComponentName: (text: string | undefined, name: string, componentName: string) => string | undefined;
1689
+ /** Merge one or more arrays recursively */
1690
+ export declare function replaceRecursive<I>(array: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
1691
+ /** Replacing the value from replaces in value */
1692
+ export declare function replaceTemplate(value: string, replaces: Record<string, string | FunctionReturn<string>>): string;
1693
+ /** Resize type for image scaling */
1694
+ type ResizeImageByMaxType = 'auto' | 'width' | 'height';
1695
+ /** Resizes an image to fit within a maximum size constraint */
1696
+ export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
1697
+ export {};
1698
+ /** Converts seconds into a time string */
1699
+ export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
1700
+ /** Modifies the value of an element identified by its key */
1701
+ export declare function setElementItem<E extends ElementOrWindow, K extends keyof E, V extends E[K] = E[K]>(element: ElementOrString<E>, index: K, value: V | Record<string, V>): E | undefined;
1702
+ /** Modifies data according to its type and settings */
1703
+ export declare function setValues<T>(selected: T | T[] | undefined, value: any, { multiple, maxlength, alwaysChange, notEmpty }: {
1704
+ multiple?: boolean | undefined;
1705
+ maxlength?: number | undefined;
1706
+ alwaysChange?: boolean | undefined;
1707
+ notEmpty?: boolean | undefined;
1708
+ }): T | T[] | undefined;
1709
+ /** Pause execution for a specified number of milliseconds */
1710
+ export declare function sleep(ms: number): Promise<void>;
1711
+ /** Sorts an array of items by one or more column paths, directions, or a custom comparison function */
1712
+ export declare function sortList<T = any>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
1713
+ /**
1714
+ * This method is used to copy the values of all enumerable own properties from one source object to a target object.
1715
+ * In priority according to the processing list.
1716
+ */
1717
+ export declare function splice<I>(array: ObjectItem<I>, replacement?: ObjectItem<I> | I, indexStart?: string): ObjectItem<I>;
1718
+ /** The method creates a string of length count, consisting of the characters value */
1719
+ export declare function strFill(value: string, count: number): string;
1720
+ /**
1721
+ * Splits a string by a separator, limited to a certain number of elements.
1722
+ * If a limit is specified, the last element will contain the remainder of the string.
1723
+ */
1724
+ export declare function strSplit(value: number | string, separator: string, limit?: number): string[];
1725
+ /**
1726
+ * Converts a value to an array.
1727
+ * If the value is already an array, it returns it as is.
1728
+ * Otherwise, it wraps the value in an array.
1729
+ */
1730
+ export declare function toArray<T>(value: T): T extends any[] ? T : [T];
1731
+ /** Convert a String to Camel Case (upper) */
1732
+ export declare function toCamelCase(value: string): string;
1733
+ /** Convert a String to Camel Case (+ first letter) */
1734
+ export declare function toCamelCaseFirst(value: string): string;
1735
+ /** Conversion to Date object */
1736
+ export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
1737
+ /**
1738
+ * Converts a string to kebab-case.
1739
+ * It converts uppercase letters to lowercase, replaces spaces and other characters with dashes.
1740
+ */
1741
+ export declare function toKebabCase(value: string): string;
1742
+ /**
1743
+ * Converts a string or number to a finite floating-point number.
1744
+ * Handles various separators (spaces, commas, dots) and strips non-numeric characters.
1745
+ * Safe for use in SSR (Server-Side Rendering) environments.
1746
+ * @example
1747
+ * toNumber("1 234,56") // 1234.56
1748
+ * toNumber("1,234.56") // 1234.56
1749
+ * toNumber("1,234") // 1.234
1750
+ */
1751
+ export declare function toNumber(value?: NumberOrString): number;
1752
+ /** Converts the data into a number, taking into account the maximum permissible value */
1753
+ export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
1754
+ /** Converts a value to a positive finite number (> 0), or returns default value (0) if invalid */
1755
+ export declare function toNumberPositive(value?: number | string | null, defaultValue?: number): number;
1756
+ /** Converts values to percentages */
1757
+ export declare function toPercent(maxValue: number, value: number): number;
1758
+ /** Converts values to percentages (three-digit) */
1759
+ export declare function toPercentBy100(maxValue: number, value: number): number;
1760
+ /** Converts the given value to a string. Returns an empty string if the value is null or undefined */
1761
+ export declare function toString<T>(value: T): string;
1762
+ /**
1763
+ * Transforms a string into the corresponding data type.
1764
+ * Based on the string content, it may be transformed into `undefined`,
1765
+ * `null`, `true`, `false`, object, number, or function.
1766
+ */
1767
+ export declare function transformation(value: any, isFunction?: boolean): any;
1768
+ /** Converts a Uint8Array to a base64 encoded string */
1769
+ export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
1770
+ /** Removes duplicate entries in an array */
1771
+ export declare function uniqueArray<T>(value: T[]): T[];
1772
+ /** Writes data to the clipboard */
1773
+ export declare function writeClipboardData(text: string): Promise<void>;
1774
+ export declare const errorCauseList: ErrorCenterCauseList;
1775
+ /** Supported HTTP methods for API requests */
1776
+ export declare enum ApiMethodItem {
1777
+ /** HTTP DELETE — used to delete resources */
1778
+ delete = "DELETE",
1779
+ /** HTTP GET — used to retrieve resources (no request body) */
1780
+ get = "GET",
1781
+ /** HTTP POST — used to create resources or send data */
1782
+ post = "POST",
1783
+ /** HTTP PUT — used to update/replace resources */
1784
+ put = "PUT",
1785
+ /** HTTP PATCH — used to partially update resources */
1786
+ patch = "PATCH"
1027
1787
  }
1028
- export declare class HashInstance extends UrlInstanceAbstract {}
1029
- export type IconsItem = string | Promise<string | any> | (() => Promise<string | any>);
1030
- export type IconsConfig = {
1031
- url?: string;
1032
- list?: Record<string, IconsItem>;
1788
+ /** Saved value in cache */
1789
+ export type ApiCacheItem<T = any> = {
1790
+ /** Saved value */
1791
+ value: T;
1792
+ /** Age of the cache */
1793
+ age?: number;
1794
+ /** Cache age in seconds */
1795
+ cacheAge: number;
1033
1796
  };
1034
- export declare class Icons {
1035
- static is(index: string): boolean;
1036
- static get(index: string, url?: string, wait?: number): Promise<string>;
1037
- static getAsync(index: string, url?: string): string;
1038
- static getNameList(): string[];
1039
- static getUrlGlobal(): string;
1040
- static add(index: string, file: IconsItem): void;
1041
- static addLoad(index: string): void;
1042
- static addGlobal(index: string, file: string): void;
1043
- static addByList(list: Record<string, IconsItem>): void;
1044
- static setUrl(url: string): void;
1045
- static setConfig(config: IconsConfig): void;
1046
- }
1047
- export declare class Loading {
1048
- static is(): boolean;
1049
- static get(): number;
1050
- static getItem(): LoadingInstance;
1051
- static show(): void;
1052
- static hide(): void;
1053
- static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
1054
- static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
1055
- }
1056
- export type LoadingDetail = {
1057
- loading: boolean;
1797
+ /** List of saved values in cache */
1798
+ export type ApiCacheList = Record<string, ApiCacheItem>;
1799
+ /** API configuration */
1800
+ export type ApiConfig = {
1801
+ /** Base URL for API requests */
1802
+ urlRoot?: string;
1803
+ /** Base origin for API requests (protocol and domain) */
1804
+ origin?: string;
1805
+ /** Default headers for API requests */
1806
+ headers?: ApiHeadersValue;
1807
+ /** Default request data for API requests */
1808
+ requestDefault?: ApiDefaultValue;
1809
+ /** Function to call before request */
1810
+ preparation?: (apiFetch: ApiFetch) => Promise<void>;
1811
+ /** Function to call after request */
1812
+ end?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
1813
+ /** Timeout for the request in milliseconds */
1814
+ timeout?: number;
1815
+ /** Enable development logging */
1816
+ devMode?: boolean;
1817
+ /** Wrapper function for requests */
1818
+ wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
1819
+ };
1820
+ /** Shape of API response data wrapper */
1821
+ export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
1822
+ /** API response validation result */
1823
+ export type ApiDataValidation = {
1824
+ status?: ApiStatusType;
1825
+ code?: string | number;
1826
+ message?: string;
1827
+ error?: {
1828
+ code?: string | number;
1829
+ message?: string;
1830
+ };
1831
+ };
1832
+ /** Type of API response data item */
1833
+ export type ApiDataItem<T = any> = T & ApiDataValidation & {
1834
+ /** Primary payload */
1835
+ data?: T;
1836
+ success?: boolean;
1837
+ statusObject?: ApiStatusItem;
1838
+ errorObject?: ApiErrorItem;
1839
+ };
1840
+ /** Type for API request headers */
1841
+ export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
1842
+ /** Default API request data type */
1843
+ export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
1844
+ /** Options for making API requests */
1845
+ export type ApiFetch = {
1846
+ /** Use base API URL */
1847
+ api?: boolean;
1848
+ /** Endpoint path relative to base URL */
1849
+ path?: string;
1850
+ /** Complete URL (overrides api + path) */
1851
+ pathFull?: string;
1852
+ method?: ApiMethod;
1853
+ /** Request body data or query parameters */
1854
+ request?: FormData | Record<string, any> | string;
1855
+ /** Include authentication headers */
1856
+ auth?: boolean;
1857
+ /** Custom headers */
1858
+ headers?: Record<string, string> | null;
1859
+ /** Content-Type header value */
1860
+ type?: string;
1861
+ /** Extract 'data' field from response */
1862
+ toData?: boolean;
1863
+ /** Use global response cache */
1864
+ global?: boolean;
1865
+ devMode?: boolean;
1866
+ hideError?: boolean;
1867
+ hideLoading?: boolean;
1868
+ retry?: number;
1869
+ retryDelay?: number;
1870
+ /** Custom response processor */
1871
+ queryReturn?: (query: Response) => Promise<any | ApiDataValidation>;
1872
+ /** Run global preparation hooks */
1873
+ globalPreparation?: boolean;
1874
+ /** Run global end hooks */
1875
+ globalEnd?: boolean;
1876
+ /** Additional fetch() options */
1877
+ init?: RequestInit;
1878
+ initError?: boolean;
1879
+ timeout?: number;
1880
+ controller?: AbortController;
1881
+ /** Cache age in seconds */
1882
+ cache?: number;
1883
+ enableClientCache?: boolean;
1884
+ /** Cache ID for grouping */
1885
+ cacheId?: number | string;
1886
+ /** Limit of end reset */
1887
+ endResetLimit?: number;
1888
+ /** Wrapper function for requests */
1889
+ wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
1890
+ };
1891
+ /** Type of API hydration item */
1892
+ export type ApiHydrationItem = {
1893
+ /** Path string or RegExp to match request URL */
1894
+ path: string;
1895
+ method: ApiMethod;
1896
+ /** Expected request payload or special marker '*any' */
1897
+ request?: ApiFetch['request'];
1898
+ /** Static response or factory function */
1899
+ response: any;
1900
+ };
1901
+ /** List of API hydration items */
1902
+ export type ApiHydrationList = ApiHydrationItem[];
1903
+ /** Item for API error storage */
1904
+ export type ApiErrorStorageItem = Record<string, any> & {
1905
+ /** URL string or RegExp to match request URL */
1906
+ url: string | RegExp;
1907
+ method: ApiMethodItem;
1908
+ code?: string;
1909
+ status?: number;
1910
+ /** Validation function */
1911
+ validation?: (response: Response) => boolean;
1912
+ /** Error message or function that returns message */
1913
+ message?: string | ((response?: Response) => string);
1914
+ };
1915
+ /** List of API error storage items */
1916
+ export type ApiErrorStorageList = ApiErrorStorageItem[];
1917
+ /** Supported HTTP methods type */
1918
+ export type ApiMethod = string | ApiMethodItem;
1919
+ /** Result of global preparation/end hooks */
1920
+ export type ApiPreparationEnd = {
1921
+ /** Reset flag to indicate state reset */
1922
+ reset?: boolean;
1923
+ /** Arbitrary data returned by hook */
1924
+ data?: any;
1925
+ };
1926
+ /** Mock API response descriptor */
1927
+ export type ApiResponseItem = {
1928
+ /** Path string or RegExp to match request URL */
1929
+ path: string | RegExp;
1930
+ method: ApiMethod;
1931
+ /** Expected request payload or special marker '*any' */
1932
+ request?: ApiFetch['request'] | '*any';
1933
+ /** Static response or factory function */
1934
+ response: any | ((request?: ApiFetch['request']) => any);
1935
+ /** Disable this mock */
1936
+ disable?: any;
1937
+ /** Mark as global mock */
1938
+ isForGlobal?: boolean;
1939
+ /** Simulate network lag */
1940
+ lag?: any;
1941
+ };
1942
+ export type ApiStatusItem = {
1943
+ status?: number;
1944
+ statusText?: string;
1945
+ error?: string;
1946
+ /** Last response */
1947
+ lastResponse?: any;
1948
+ /** Last status */
1949
+ lastStatus?: ApiStatusType;
1950
+ /** Last code */
1951
+ lastCode?: string;
1952
+ /** Last message */
1953
+ lastMessage?: string;
1954
+ };
1955
+ /** API status type */
1956
+ export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
1957
+ /** Union type for undefined and null values */
1958
+ export type Undefined = undefined | null;
1959
+ /** Union type for all "empty" values including falsy primitives and string representations */
1960
+ export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
1961
+ /** Union type for numeric and string values */
1962
+ export type NumberOrString = number | string;
1963
+ /** Union type for numeric, string, and boolean values */
1964
+ export type NumberOrStringOrBoolean = number | string | boolean;
1965
+ /** Union type for numeric, string, and Date values */
1966
+ export type NumberOrStringOrDate = NumberOrString | Date;
1967
+ /** Generic type that can be either a single value or an array of values */
1968
+ export type NormalOrArray<T = NumberOrString> = T | T[];
1969
+ /** Generic type that can be either a direct value or a Promise resolving to that value */
1970
+ export type NormalOrPromise<T> = T | Promise<T>;
1971
+ /** Generic record/object type with string keys */
1972
+ export type ObjectItem<T = any> = Record<string, T>;
1973
+ /** Generic type that can be either an array or an object */
1974
+ export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
1975
+ /** Converts an array type to an item type (extracts the item type from an array) */
1976
+ export type ArrayToItem<T> = T extends any[] ? T[number] : T;
1977
+ /** Function type that returns a value of type R */
1978
+ export type FunctionReturn<R = any> = () => R;
1979
+ /** Function type that returns void */
1980
+ export type FunctionVoid = () => void;
1981
+ /** Function type that accepts multiple arguments of type T and returns type R */
1982
+ export type FunctionArgs<T, R> = (...args: T[]) => R;
1983
+ /** Most generic function type that accepts any arguments and returns any value */
1984
+ export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
1985
+ /** Generic record type for lists with string keys */
1986
+ export type ItemList<T = any> = Record<string, T>;
1987
+ /** Generic item type with index and value properties */
1988
+ export type Item<V> = {
1989
+ /** Unique string identifier for the item */
1990
+ index: string;
1991
+ /** The actual value of the item */
1992
+ value: V;
1993
+ };
1994
+ /** Generic item type with label and value properties */
1995
+ export type ItemValue<V> = {
1996
+ /** Display text for the item */
1997
+ label: string;
1998
+ /** The actual value of the item */
1999
+ value: V;
2000
+ };
2001
+ /** Generic item type with name and value properties */
2002
+ export type ItemName<V> = {
2003
+ name: string | number;
2004
+ value: V;
2005
+ };
2006
+ /** Union type for HTML elements and Window object */
2007
+ export type ElementOrWindow = HTMLElement | Window;
2008
+ /** Generic type that can be either an element or a string selector */
2009
+ export type ElementOrString<E extends ElementOrWindow> = E | string;
2010
+ /** Type for event listener options */
2011
+ export type EventOptions = AddEventListenerOptions | boolean | undefined;
2012
+ /** Generic event listener function type with additional detail parameter */
2013
+ export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
2014
+ /** Type for tracking active event listeners and observers */
2015
+ export type EventActivityItem<E extends ElementOrWindow> = {
2016
+ element: E | undefined;
2017
+ type: string;
2018
+ listener?: (event: any | Event) => void;
2019
+ observer?: ResizeObserver;
2020
+ };
2021
+ /** Type for 2D coordinates */
2022
+ export type ImageCoordinator = {
2023
+ x: number;
2024
+ y: number;
2025
+ };
2026
+ /** Error group identifier */
2027
+ export type ErrorCenterGroup = string | undefined;
2028
+ /** Interface for an error item */
2029
+ export type ErrorCenterCauseItem<D = any> = {
2030
+ group?: ErrorCenterGroup;
2031
+ code: string;
2032
+ priority?: number;
2033
+ label?: string;
2034
+ message?: string;
2035
+ details?: D;
1058
2036
  };
1059
- export type LoadingRegistrationItem = {
1060
- item: EventItem<Window, CustomEvent, LoadingDetail>;
1061
- listener: EventListenerDetail<CustomEvent, LoadingDetail>;
1062
- element?: ElementOrString<HTMLElement>;
2037
+ /** List of error items */
2038
+ export type ErrorCenterCauseList = ErrorCenterCauseItem[];
2039
+ /** Callback function for error handling */
2040
+ export type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
2041
+ /** Interface for error handler storage */
2042
+ export type ErrorCenterHandlerItem = {
2043
+ group?: ErrorCenterGroup;
2044
+ handlers: ErrorCenterHandlerCallback[];
1063
2045
  };
1064
- export declare class LoadingInstance {
1065
- constructor(eventName?: string);
1066
- is(): boolean;
1067
- get(): number;
1068
- show(): void;
1069
- hide(): void;
1070
- registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
1071
- unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
1072
- }
1073
- export declare class Meta extends MetaManager<MetaTag[]> {
1074
- constructor();
1075
- getOg(): MetaOg;
1076
- getTwitter(): MetaTwitter;
1077
- getTitle(): string;
1078
- getKeywords(): string;
1079
- getDescription(): string;
1080
- getImage(): string;
1081
- getCanonical(): string;
1082
- getRobots(): MetaRobots;
1083
- getAuthor(): string;
1084
- getSiteName(): string;
1085
- getLocale(): string;
1086
- setTitle(title: string): this;
1087
- setKeywords(keywords: string | string[]): this;
1088
- setDescription(description: string): this;
1089
- setImage(image: string): this;
1090
- setCanonical(canonical: string): this;
1091
- setRobots(robots: MetaRobots): this;
1092
- setAuthor(author: string): this;
1093
- setSiteName(siteName: string): this;
1094
- setLocale(locale: string): this;
1095
- setSuffix(suffix?: string): void;
1096
- html(): string;
1097
- htmlTitle(): string;
2046
+ /** List of error handlers */
2047
+ export type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
2048
+ /** Callback function to check whether to log error to console */
2049
+ export type ErrorCenterHandlerIsConsoleCallback = (cause: ErrorCenterCauseItem) => boolean;
2050
+ /** Type for console logging configuration */
2051
+ export type ErrorCenterHandlerIsConsole = boolean | ErrorCenterHandlerIsConsoleCallback;
2052
+ /** Enumeration of available formatter types */
2053
+ export declare enum FormattersType {
2054
+ currency = "currency",
2055
+ date = "date",
2056
+ name = "name",
2057
+ number = "number",
2058
+ plural = "plural",
2059
+ unit = "unit"
1098
2060
  }
1099
- type MetaList<T extends readonly string[]> = {
1100
- [K in T[number]]?: string;
2061
+ /** Options for currency formatting */
2062
+ export type FormattersOptionsCurrency = {
2063
+ currencyPropName?: string;
2064
+ options?: string | Intl.NumberFormatOptions;
2065
+ numberOnly?: boolean;
1101
2066
  };
1102
- export declare class MetaManager<T extends readonly string[], Key extends keyof MetaList<T> = keyof MetaList<T>> {
1103
- constructor(listMeta: T, isProperty?: boolean);
1104
- getListMeta(): T;
1105
- get(name: Key): string;
1106
- getItems(): MetaList<T>;
1107
- html(): string;
1108
- set(name: Key, content: string): this;
1109
- setByList(metaList: MetaList<T>): this;
1110
- }
1111
- export declare class MetaOg extends MetaManager<MetaOpenGraphTag[]> {
1112
- constructor();
1113
- getTitle(): string;
1114
- getType(): MetaOpenGraphType;
1115
- getUrl(): string;
1116
- getImage(): string;
1117
- getDescription(): string;
1118
- getLocale(): string;
1119
- getSiteName(): string;
1120
- setTitle(title: string): this;
1121
- setType(type: MetaOpenGraphType): this;
1122
- setUrl(url: string): this;
1123
- setImage(url: string): this;
1124
- setDescription(description: string): this;
1125
- setLocale(locale: string): this;
1126
- setSiteName(siteName: string): this;
1127
- }
1128
- export declare class MetaStatic {
1129
- static getItem(): Meta;
1130
- static getOg(): MetaOg;
1131
- static getTwitter(): MetaTwitter;
1132
- static getTitle(): string;
1133
- static getKeywords(): string;
1134
- static getDescription(): string;
1135
- static getImage(): string;
1136
- static getCanonical(): string;
1137
- static getRobots(): MetaRobots;
1138
- static getAuthor(): string;
1139
- static getSiteName(): string;
1140
- static getLocale(): string;
1141
- static setTitle(title: string): typeof MetaStatic;
1142
- static setKeywords(keywords: string | string[]): typeof MetaStatic;
1143
- static setDescription(description: string): typeof MetaStatic;
1144
- static setImage(image: string): typeof MetaStatic;
1145
- static setCanonical(canonical: string): typeof MetaStatic;
1146
- static setRobots(robots: MetaRobots): typeof MetaStatic;
1147
- static setAuthor(author: string): typeof MetaStatic;
1148
- static setSiteName(siteName: string): typeof MetaStatic;
1149
- static setLocale(locale: string): typeof MetaStatic;
1150
- static setSuffix(suffix?: string): typeof MetaStatic;
1151
- static html(): string;
1152
- static htmlTitle(): string;
1153
- }
1154
- export declare class MetaTwitter extends MetaManager<MetaTwitterTag[]> {
1155
- constructor();
1156
- getCard(): MetaTwitterCard;
1157
- getSite(): string;
1158
- getCreator(): string;
1159
- getUrl(): string;
1160
- getTitle(): string;
1161
- getDescription(): string;
1162
- getImage(): string;
1163
- setCard(card: MetaTwitterCard): this;
1164
- setSite(site: string): this;
1165
- setCreator(creator: string): this;
1166
- setUrl(url: string): this;
1167
- setTitle(title: string): this;
1168
- setDescription(description: string): this;
1169
- setImage(image: string): this;
1170
- }
1171
- export declare class Query {
1172
- static getItem(): QueryInstance;
1173
- static get<T>(name: string, defaultValue?: T | (() => T)): T;
1174
- static set<T>(name: string, callback: T | (() => T)): void;
1175
- static addWatch<T>(name: string, callback: (value: T) => void): void;
1176
- static removeWatch<T>(name: string, callback: (value: T) => void): void;
1177
- static reload(): void;
1178
- }
1179
- export declare class QueryInstance extends UrlInstanceAbstract {}
1180
- export declare class ResumableTimer {
1181
- constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
1182
- resume(): this;
1183
- pause(): this;
1184
- reset(): this;
1185
- clear(): this;
2067
+ /** Options for date formatting */
2068
+ export type FormattersOptionsDate = {
2069
+ type?: GeoDate;
2070
+ options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions;
2071
+ hour24?: boolean;
2072
+ };
2073
+ /** Options for name formatting */
2074
+ export type FormattersOptionsName = {
2075
+ lastPropName?: string;
2076
+ firstPropName?: string;
2077
+ surname?: string;
2078
+ short?: boolean;
2079
+ };
2080
+ /** Options for number formatting */
2081
+ export type FormattersOptionsNumber = {
2082
+ options?: Intl.NumberFormatOptions;
2083
+ };
2084
+ /** Options for plural forms formatting */
2085
+ export type FormattersOptionsPlural = {
2086
+ words: string;
2087
+ options?: Intl.PluralRulesOptions;
2088
+ optionsNumber?: Intl.NumberFormatOptions;
2089
+ };
2090
+ /** Options for unit formatting */
2091
+ export type FormattersOptionsUnit = {
2092
+ unit: string | Intl.NumberFormatOptions;
2093
+ };
2094
+ /** Mapping of formatter types to their respective option types.
2095
+ * @template Type - The formatter type.
2096
+ */
2097
+ export type FormattersOptionsInformation<Type extends FormattersType> = Type extends FormattersType.currency ? FormattersOptionsCurrency : Type extends FormattersType.date ? FormattersOptionsDate : Type extends FormattersType.name ? FormattersOptionsName : Type extends FormattersType.number ? FormattersOptionsNumber : Type extends FormattersType.plural ? FormattersOptionsPlural : Type extends FormattersType.unit ? FormattersOptionsUnit : Record<string, any>;
2098
+ /** Configuration for a single property formatter */
2099
+ export type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = {
2100
+ type?: Type;
2101
+ transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R;
2102
+ options?: FormattersOptionsInformation<Type>;
2103
+ };
2104
+ /** A dictionary mapping property paths to their formatting configurations */
2105
+ export type FormattersOptionsList = Record<string, FormattersOptionsItem>;
2106
+ /** Represents a single data item as a key-value record */
2107
+ export type FormattersListItem = Record<string, any>;
2108
+ /** An array of data items to be formatted */
2109
+ export type FormattersList<Item extends FormattersListItem> = Item[];
2110
+ /** Utility type to capitalize a camelCase or dot-notated string */
2111
+ export type FormattersCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<FormattersCapitalize<Rest>>}` : K;
2112
+ /** Utility type to extract column keys from formatting options */
2113
+ export type FormattersColumns<T extends FormattersOptionsList> = (keyof T & string)[];
2114
+ /** Utility type to generate a formatted property key */
2115
+ export type FormattersKey<K, A extends string = 'Format'> = K extends string ? `${FormattersCapitalize<K>}${A}` : never;
2116
+ /** Represents a data item with additional formatted properties */
2117
+ export type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = {
2118
+ [K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string;
2119
+ };
2120
+ /** An array of data items with additional formatted properties */
2121
+ export type FormattersListFormat<T extends FormattersListItem, K extends string[]> = FormattersDataItem<T, K>[];
2122
+ /** A single data item formatted based on the provided options list */
2123
+ export type FormattersListColumnItem<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersDataItem<T, FormattersColumns<O>>;
2124
+ /** A list of data items formatted based on the provided options list */
2125
+ export type FormattersListColumns<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersListFormat<T, FormattersColumns<O>>;
2126
+ /** Possible formats for input data: either a single item or a list of items */
2127
+ export type FormattersListProp = FormattersList<FormattersListItem> | FormattersListItem;
2128
+ /** Extracts the single item type from a single item or a list of items */
2129
+ export type FormattersItemProp<List extends FormattersListProp> = ArrayToItem<List>;
2130
+ /** The return type of the formatter, matching the structure of the input data */
2131
+ export type FormattersReturn<List extends FormattersListProp, Options extends FormattersOptionsList = FormattersOptionsList, Item extends FormattersItemProp<List> = FormattersItemProp<List>> = List extends any[] ? FormattersListColumns<Item, Options> : (FormattersListColumnItem<Item, Options> | undefined);
2132
+ /** Union type for date format options in geographic context */
2133
+ export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
2134
+ /** First day of week code (0 = Sunday, 1 = Monday, 6 = Saturday) */
2135
+ export type GeoFirstDay = 1 | 6 | 0;
2136
+ /** Hour format type (12-hour or 24-hour) */
2137
+ export type GeoHours = '12' | '24';
2138
+ /** Timezone display style options */
2139
+ export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
2140
+ /** Geographic item interface for country and language data */
2141
+ export interface GeoItem {
2142
+ country: string;
2143
+ countryAlternative?: string[];
2144
+ language: string;
2145
+ languageAlternative?: string[];
2146
+ firstDay?: string | null;
2147
+ zone?: string | null;
2148
+ phoneCode?: string;
2149
+ phoneWithin?: string;
2150
+ phoneMask?: string | string[];
2151
+ nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
2152
+ unit?: {
2153
+ 'millimeter'?: string;
2154
+ 'centimeter'?: string;
2155
+ 'meter'?: string;
2156
+ 'kilometer'?: string;
2157
+ 'square-meter'?: string;
2158
+ 'hectare'?: string;
2159
+ 'gram'?: string;
2160
+ 'kilogram'?: string;
2161
+ 'tonne'?: string;
2162
+ 'milliliter'?: string;
2163
+ 'liter'?: string;
2164
+ 'celsius'?: string;
2165
+ 'kilometer-per-hour'?: string;
2166
+ };
1186
2167
  }
1187
- export declare class ScrollbarWidth {
1188
- static is(): Promise<boolean>;
1189
- static get(): Promise<number>;
1190
- static getStorage(): DataStorage<number>;
1191
- static getCalculate(): boolean;
2168
+ /** Extended geographic item with required fields */
2169
+ export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
2170
+ standard: string;
2171
+ firstDay: string;
2172
+ location: string;
2173
+ locationCountry: string;
2174
+ locationLanguage: string;
1192
2175
  }
1193
- export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
1194
- constructor(list: SearchListValue<T>, columns?: K, value?: string, options?: SearchOptions);
1195
- getData(): SearchListData<T, K>;
1196
- getList(): SearchListValue<T>;
1197
- getColumns(): K | undefined;
1198
- getItem(): SearchListItem;
1199
- getValue(): string | undefined;
1200
- getOptions(): SearchListOptions;
1201
- setList(list: SearchListValue<T>): this;
1202
- setColumns(columns?: K): this;
1203
- setValue(value?: string): this;
1204
- setOptions(options: SearchOptions): this;
1205
- to(): SearchFormatList<T, K>;
2176
+ /** Geographic flag item for country flag display */
2177
+ export interface GeoFlagItem {
2178
+ language: string;
2179
+ languageCode: string;
2180
+ country: string;
2181
+ countryCode: string;
2182
+ standard: string;
2183
+ icon?: string;
2184
+ label: string;
2185
+ value: string;
2186
+ phoneCode?: string;
1206
2187
  }
1207
- export declare class SearchListData<T extends SearchItem, K extends SearchColumns<T>> {
1208
- constructor(list: SearchListValue<T>, columns: K | undefined, item: SearchListItem, options: SearchListOptions);
1209
- is(): this is this & {
1210
- list: T[];
1211
- columns: string[];
1212
- };
1213
- isList(): this is this & {
1214
- list: T[];
1215
- };
1216
- getList(): SearchListValue<T>;
1217
- getColumns(): K | undefined;
1218
- setList(list: SearchListValue<T>): this;
1219
- setColumns(columns?: SearchColumns<T>): this;
1220
- findCacheItem(item: T): SearchCacheItem<T> | undefined;
1221
- forEach(callback: (item: SearchCacheItem<T>['item'], value: SearchCacheItem<T>['value']) => SearchFormatItem<T, K> | undefined): SearchFormatList<T, K>;
1222
- toFormatItem(item: T, selection: boolean): SearchFormatItem<T, K>;
2188
+ /** Extended geographic flag item with national language information */
2189
+ export interface GeoFlagNational extends GeoFlagItem {
2190
+ description: string;
2191
+ nationalLanguage: string;
2192
+ nationalCountry: string;
1223
2193
  }
1224
- export declare class SearchListItem {
1225
- constructor(value: string | undefined, options: SearchListOptions);
1226
- is(): this is this & {
1227
- value: string;
1228
- };
1229
- isSearch(): boolean;
1230
- get(): string;
1231
- set(value?: string): this;
2194
+ /** Phone configuration metadata for a country */
2195
+ export interface GeoPhoneValue {
2196
+ phone: number;
2197
+ within: number;
2198
+ mask: string[];
2199
+ value: string;
1232
2200
  }
1233
- export declare class SearchListMatcher {
1234
- constructor(item: SearchListItem, options: SearchListOptions);
1235
- is(): boolean;
1236
- isSelection(value: SearchCacheItem<any>['value']): boolean;
1237
- get(): RegExp | undefined;
1238
- update(): void;
2201
+ /** Node in the internal phone prefix tree (Trie) */
2202
+ export interface GeoPhoneMap {
2203
+ items: GeoPhoneValue[];
2204
+ info: GeoPhoneValue | undefined;
2205
+ value: string | undefined;
2206
+ mask: string[];
2207
+ maskFull: string[];
2208
+ next: Record<string, GeoPhoneMap>;
1239
2209
  }
1240
- export declare class SearchListOptions {
1241
- constructor(options?: SearchOptions | undefined);
1242
- getOptions(): SearchOptions;
1243
- getLimit(): number;
1244
- getReturnEverything(): boolean;
1245
- getDelay(): number;
1246
- getFindExactMatch(): boolean;
1247
- getClassName(): string;
1248
- setOptions(options: SearchOptions): this;
2210
+ /** Result of searching a country by phone number */
2211
+ export interface GeoPhoneMapInfo {
2212
+ item?: GeoPhoneMap;
2213
+ phone?: string;
1249
2214
  }
1250
- export declare class ServerStorage {
1251
- static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
1252
- static reset(): void;
1253
- static has(key: string): boolean;
1254
- static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
1255
- static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
1256
- static setErrorStatus(hide: boolean): void;
1257
- static remove(key: string): void;
1258
- static toString(): string;
2215
+ /** Standard HTML meta tags */
2216
+ export declare enum MetaTag {
2217
+ title = "title",
2218
+ description = "description",
2219
+ keywords = "keywords",
2220
+ canonical = "canonical",
2221
+ robots = "robots",
2222
+ author = "author"
1259
2223
  }
1260
- export declare class StorageCallback<T = any, Callback = (value: T) => void | Promise<void>> {
1261
- static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
1262
- constructor(name: string, group?: string);
1263
- isLoading(): boolean;
1264
- getName(): string;
1265
- getLoading(): boolean;
1266
- addCallback(callback: Callback, isOnce?: boolean): this;
1267
- removeCallback(callback: Callback): this;
1268
- preparation(): this;
1269
- run(value: T): Promise<this>;
2224
+ export declare enum MetaRobots {
2225
+ indexFollow = "index, follow",
2226
+ noIndexFollow = "noindex, follow",
2227
+ indexNoFollow = "index, nofollow",
2228
+ noIndexNoFollow = "noindex, nofollow",
2229
+ noArchive = "noarchive",
2230
+ noSnippet = "nosnippet",
2231
+ noImageIndex = "noimageindex",
2232
+ images = "images",
2233
+ noTranslate = "notranslate",
2234
+ noPreview = "nopreview",
2235
+ textOnly = "textonly",
2236
+ noIndexSubpages = "noindex, noarchive",
2237
+ none = "none"
1270
2238
  }
1271
- export declare class Translate {
1272
- static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
1273
- static getItem(): TranslateInstance;
1274
- static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
1275
- static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
1276
- static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
1277
- static add(names: string | string[]): Promise<void>;
1278
- static addSync(data: Record<string, string>): void;
1279
- static addNormalOrSync(data: Record<string, string>): Promise<void>;
1280
- static addSyncByLocation(data: Record<string, Record<string, string>>): void;
1281
- static addSyncByFile(data: TranslateDataFile): void;
1282
- static setUrl(url: string): void;
1283
- static setPropsName(name: string): void;
1284
- static setReadApi(value: boolean): void;
1285
- static setConfig(config: TranslateConfig): void;
2239
+ /** Enumeration of Open Graph tags for metadata */
2240
+ export declare enum MetaOpenGraphTag {
2241
+ title = "og:title",
2242
+ type = "og:type",
2243
+ url = "og:url",
2244
+ image = "og:image",
2245
+ description = "og:description",
2246
+ locale = "og:locale",
2247
+ siteName = "og:site_name",
2248
+ localeAlternate = "og:locale:alternate",
2249
+ imageUrl = "og:image:url",
2250
+ imageSecureUrl = "og:image:secure_url",
2251
+ imageType = "og:image:type",
2252
+ imageWidth = "og:image:width",
2253
+ imageHeight = "og:image:height",
2254
+ imageAlt = "og:image:alt",
2255
+ video = "og:video",
2256
+ videoUrl = "og:video:url",
2257
+ videoSecureUrl = "og:video:secure_url",
2258
+ videoType = "og:video:type",
2259
+ videoWidth = "og:video:width",
2260
+ videoHeight = "og:video:height",
2261
+ audio = "og:audio",
2262
+ audioSecureUrl = "og:audio:secure_url",
2263
+ audioType = "og:audio:type",
2264
+ articlePublishedTime = "article:published_time",
2265
+ articleModifiedTime = "article:modified_time",
2266
+ articleExpirationTime = "article:expiration_time",
2267
+ articleAuthor = "article:author",
2268
+ articleSection = "article:section",
2269
+ articleTag = "article:tag",
2270
+ bookAuthor = "book:author",
2271
+ bookIsbn = "book:isbn",
2272
+ bookReleaseDate = "book:release_date",
2273
+ bookTag = "book:tag",
2274
+ musicDuration = "music:duration",
2275
+ musicAlbum = "music:album",
2276
+ musicAlbumDisc = "music:album:disc",
2277
+ musicAlbumTrack = "music:album:track",
2278
+ musicMusician = "music:musician",
2279
+ musicSong = "music:song",
2280
+ musicSongDisc = "music:song:disc",
2281
+ musicSongTrack = "music:song:track",
2282
+ musicReleaseDate = "music:release_date",
2283
+ musicCreator = "music:creator",
2284
+ videoActor = "video:actor",
2285
+ videoActorRole = "video:actor:role",
2286
+ videoDirector = "video:director",
2287
+ videoWriter = "video:writer",
2288
+ videoDuration = "video:duration",
2289
+ videoReleaseDate = "video:release_date",
2290
+ videoTag = "video:tag",
2291
+ videoSeries = "video:series",
2292
+ profileFirstName = "profile:first_name",
2293
+ profileLastName = "profile:last_name",
2294
+ profileUsername = "profile:username",
2295
+ profileGender = "profile:gender",
2296
+ productBrand = "product:brand",
2297
+ productAvailability = "product:availability",
2298
+ productCondition = "product:condition",
2299
+ productPriceAmount = "product:price:amount",
2300
+ productPriceCurrency = "product:price:currency",
2301
+ productRetailerItemId = "product:retailer_item_id",
2302
+ productCategory = "product:category",
2303
+ productEan = "product:ean",
2304
+ productIsbn = "product:isbn",
2305
+ productMfrPartNo = "product:mfr_part_no",
2306
+ productUpc = "product:upc",
2307
+ productWeightValue = "product:weight:value",
2308
+ productWeightUnits = "product:weight:units",
2309
+ productColor = "product:color",
2310
+ productMaterial = "product:material",
2311
+ productPattern = "product:pattern",
2312
+ productAgeGroup = "product:age_group",
2313
+ /** Gender (for whom — male, female, unisex) */
2314
+ productGender = "product:gender"
1286
2315
  }
1287
- export declare class TranslateFile {
1288
- constructor(data?: TranslateDataFile, language?: string | (() => string), location?: string | (() => string));
1289
- isFile(): boolean;
1290
- getLocation(): string;
1291
- getLanguage(): string;
1292
- getList(): Promise<TranslateDataFileList | undefined>;
1293
- add(data: TranslateDataFile): void;
2316
+ /** Possible content types for Open Graph (og:type) */
2317
+ export declare enum MetaOpenGraphType {
2318
+ /** Regular web page or article */
2319
+ website = "website",
2320
+ /** News article, blog post, or other text material */
2321
+ article = "article",
2322
+ /** Video (e.g., clip, film, series, music video) */
2323
+ video = "video.other",
2324
+ /** Entire TV series */
2325
+ videoTvShow = "video.tv_show",
2326
+ /** Specific TV series episode */
2327
+ videoEpisode = "video.episode",
2328
+ /** Movie */
2329
+ videoMovie = "video.movie",
2330
+ /** Music album */
2331
+ musicAlbum = "music.album",
2332
+ /** Music playlist */
2333
+ musicPlaylist = "music.playlist",
2334
+ /** Individual track (song) */
2335
+ musicSong = "music.song",
2336
+ /** Radio station or audio stream */
2337
+ musicRadioStation = "music.radio_station",
2338
+ /** Application (web, mobile, or desktop) */
2339
+ app = "app",
2340
+ /** Product or item (e.g., in a store) */
2341
+ product = "product",
2342
+ /** Brand, company, organization */
2343
+ business = "business.business",
2344
+ /** Place (geolocation, point on a map) */
2345
+ place = "place",
2346
+ /** Event (event, meeting, concert, etc.) */
2347
+ event = "event",
2348
+ /** User profile (personal page, author, etc.) */
2349
+ profile = "profile",
2350
+ /** Book page */
2351
+ book = "book"
1294
2352
  }
1295
- export declare class TranslateInstance {
1296
- constructor(url?: string, propsName?: string, files?: TranslateFile);
1297
- get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
1298
- getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
1299
- getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
1300
- getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
1301
- add(names: string | string[]): Promise<void>;
1302
- addSync(data: Record<string, string>): void;
1303
- addNormalOrSync(data: Record<string, string>): Promise<void>;
1304
- addSyncByLocation(data: Record<string, Record<string, string>>): void;
1305
- addSyncByFile(data: TranslateDataFile): void;
1306
- setUrl(url: string): this;
1307
- setPropsName(name: string): this;
1308
- setReadApi(value: boolean): this;
2353
+ /** Product availability states */
2354
+ export declare enum MetaOpenGraphAvailability {
2355
+ /** In stock, available for purchase */
2356
+ inStock = "in stock",
2357
+ /** Out of stock, currently unavailable */
2358
+ outOfStock = "out of stock",
2359
+ /** Available for pre-order */
2360
+ preorder = "preorder",
2361
+ /** Backordered, temporarily out of stock */
2362
+ backorder = "backorder",
2363
+ /** Discontinued, no longer available */
2364
+ discontinued = "discontinued",
2365
+ /** Pending availability status */
2366
+ pending = "pending"
1309
2367
  }
1310
- export declare abstract class UrlInstanceAbstract {
1311
- get<T>(name: string, defaultValue?: T | (() => T)): T;
1312
- set<T>(name: string, callback: T | (() => T)): this;
1313
- addWatch<T>(name: string, callback: (value: T) => void): this;
1314
- removeWatch<T>(name: string, callback: (value: T) => void): this;
1315
- reload(): this;
2368
+ /** Product condition states */
2369
+ export declare enum MetaOpenGraphCondition {
2370
+ /** Brand new product, never used */
2371
+ new = "new",
2372
+ /** Used product, previously owned */
2373
+ used = "used",
2374
+ /** Refurbished / restored product */
2375
+ refurbished = "refurbished"
2376
+ }
2377
+ /** Age groups for products */
2378
+ export declare enum MetaOpenGraphAge {
2379
+ /** For newborns (0–12 months) */
2380
+ newborn = "newborn",
2381
+ /** For infants (0–24 months) */
2382
+ infant = "infant",
2383
+ /** For toddlers (approximately 2–4 years) */
2384
+ toddler = "toddler",
2385
+ /** For kids (approximately 4–12 years) */
2386
+ kids = "kids",
2387
+ /** For adults */
2388
+ adult = "adult"
2389
+ }
2390
+ /** Gender categories for products */
2391
+ export declare enum MetaOpenGraphGender {
2392
+ /** For women */
2393
+ female = "female",
2394
+ /** For men */
2395
+ male = "male",
2396
+ /** Universal / suitable for everyone */
2397
+ unisex = "unisex"
2398
+ }
2399
+ /** Twitter Card meta-properties */
2400
+ export declare enum MetaTwitterTag {
2401
+ /** Type of card (summary, summary_large_image, app, player, product) */
2402
+ card = "twitter:card",
2403
+ /** Website or brand @username */
2404
+ site = "twitter:site",
2405
+ /** Content creator @username */
2406
+ creator = "twitter:creator",
2407
+ /** Page URL */
2408
+ url = "twitter:url",
2409
+ /** Title of the card */
2410
+ title = "twitter:title",
2411
+ /** Short description of the card */
2412
+ description = "twitter:description",
2413
+ /** Main image for the card */
2414
+ image = "twitter:image",
2415
+ /** Alternative text for the image (for accessibility) */
2416
+ imageAlt = "twitter:image:alt",
2417
+ /** Alternative way to define image source */
2418
+ imageSrc = "twitter:image:src",
2419
+ /** Image width (optional) */
2420
+ imageWidth = "twitter:image:width",
2421
+ /** Image height (optional) */
2422
+ imageHeight = "twitter:image:height",
2423
+ /** Custom label 1 (used in summary/product cards) */
2424
+ label1 = "twitter:label1",
2425
+ /** Custom value 1 (used with label1) */
2426
+ data1 = "twitter:data1",
2427
+ /** Custom label 2 (used in summary/product cards) */
2428
+ label2 = "twitter:label2",
2429
+ /** Custom value 2 (used with label2) */
2430
+ data2 = "twitter:data2",
2431
+ /** iPhone app name */
2432
+ appNameIphone = "twitter:app:name:iphone",
2433
+ /** iPhone app ID (App Store ID) */
2434
+ appIdIphone = "twitter:app:id:iphone",
2435
+ /** iPhone app URL (deep link) */
2436
+ appUrlIphone = "twitter:app:url:iphone",
2437
+ /** iPad app name */
2438
+ appNameIpad = "twitter:app:name:ipad",
2439
+ /** iPad app ID (App Store ID) */
2440
+ appIdIpad = "twitter:app:id:ipad",
2441
+ /** iPad app URL (deep link) */
2442
+ appUrlIpad = "twitter:app:url:ipad",
2443
+ /** Google Play app name */
2444
+ appNameGooglePlay = "twitter:app:name:googleplay",
2445
+ /** Google Play app ID (package name) */
2446
+ appIdGooglePlay = "twitter:app:id:googleplay",
2447
+ /** Google Play app URL (deep link) */
2448
+ appUrlGooglePlay = "twitter:app:url:googleplay",
2449
+ /** Player iframe URL */
2450
+ player = "twitter:player",
2451
+ /** Player width */
2452
+ playerWidth = "twitter:player:width",
2453
+ /** Player height */
2454
+ playerHeight = "twitter:player:height",
2455
+ /** Direct media stream URL (video/audio) */
2456
+ playerStream = "twitter:player:stream",
2457
+ /** MIME type of the media stream */
2458
+ playerStreamContentType = "twitter:player:stream:content_type"
1316
2459
  }
1317
- export declare class UrlItem {
1318
- static getInstance(): UrlItem;
1319
- constructor(url?: string | URL);
1320
- get href(): string;
1321
- get protocol(): string;
1322
- get username(): string;
1323
- get password(): string;
1324
- get host(): string;
1325
- get hostname(): string;
1326
- get port(): string;
1327
- get pathname(): string;
1328
- get search(): string;
1329
- get searchParams(): URLSearchParams;
1330
- get hash(): string;
1331
- get origin(): string;
1332
- hasParam(name: string): boolean;
1333
- getParam(name: string): string | undefined;
1334
- getParams(): Record<string, any>;
1335
- set(url?: string | URL): this;
1336
- setParam(name: string, value: string): this;
1337
- setParams(params: Record<string, any>): this;
1338
- deleteParam(name: string): this;
1339
- toString(): string;
1340
- toJSON(): string;
2460
+ /** Twitter Card types */
2461
+ export declare enum MetaTwitterCard {
2462
+ /** Summary card — small image, short title and description */
2463
+ summary = "summary",
2464
+ /** Summary card with large image — most popular card type */
2465
+ summaryLargeImage = "summary_large_image",
2466
+ /** App card — used for promoting mobile applications (iOS / Android) */
2467
+ app = "app",
2468
+ /** Player card — for embedding video, audio, or other rich media */
2469
+ player = "player",
2470
+ /** Product card (deprecated) — used for e-commerce products */
2471
+ product = "product",
2472
+ /** Gallery card (deprecated) — used for displaying multiple images */
2473
+ gallery = "gallery",
2474
+ /** Photo card (deprecated) — single image card, replaced by summary_large_image */
2475
+ photo = "photo",
2476
+ /** Lead generation card (deprecated) for collecting user data (via CTA) */
2477
+ leadGeneration = "lead_generation",
2478
+ /** Audio card (experimental) — similar to player, but focused on audio players */
2479
+ audio = "audio",
2480
+ /** Poll card (internal/experimental) — used for Twitter polls */
2481
+ poll = "poll"
1341
2482
  }
1342
- export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
1343
- export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
1344
- export declare function applyTemplate(text: string, replacement?: Record<string, string | number | boolean> | string[]): string;
1345
- export declare function arrFill<T>(value: T, count: number): T[];
1346
- export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
1347
- export declare function capitalize(value: string, isLocale?: boolean): string;
1348
- export declare function copyObject<T>(value: T): T;
1349
- export declare function copyObjectLite<T, R = T>(value: T, source?: any): R;
1350
- /**
1351
- * @remarks
1352
- * Always returns `undefined` when running on server.
1353
- */
1354
- export declare function createElement<T extends HTMLElement>(parentElement?: HTMLElement, tagName?: string, options?: Partial<T> | Record<keyof T, T[keyof T]> | ((element: T) => void), referenceElement?: HTMLElement): T | undefined;
1355
- export declare function domContentLoaded<T = void>(callback: () => T | Promise<T>): Promise<T>;
1356
- export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
1357
- export declare function domQuerySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E> | undefined;
1358
- export declare function encodeAttribute(text: string): string;
1359
- export declare function encodeLiteAttribute(text: string): string;
1360
- export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
1361
- export declare function escapeExp(value: string): string;
1362
- export declare function eventStopPropagation(event: Event): void;
1363
- export declare function executeFunction<T>(callback: T | FunctionArgs<any, T>, ...args: any[]): T;
1364
- export declare function executePromise<T>(callback: ((...args: any[]) => Promise<T>) | ((...args: any[]) => T) | T, ...args: any[]): Promise<T>;
1365
- export declare function forEach<T, R, D extends T[] | Record<string, T> | Map<string, T> | Set<T> = T[] | Record<string, T> | Map<string, T> | Set<T>, K = D extends T[] ? number : string>(data: D & (T[] | Record<string, T> | Map<string, T> | Set<T>), callback: (item: T, key: K, dataMain: typeof data) => R, saveUndefined?: boolean): R[];
1366
- export declare function frame(callback: () => void, next?: () => boolean, end?: () => void): void;
1367
- export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
1368
- export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
1369
- export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
1370
- export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>, column: K): (T[K] | undefined)[];
1371
- /**
1372
- * @remarks
1373
- * Using in SSR may cause hydration mismatches.
1374
- */
1375
- export declare function getCurrentDate(format?: GeoDate): string;
1376
- /**
1377
- * @remarks
1378
- * Using in SSR will cause hydration mismatches.
1379
- */
1380
- export declare function getCurrentTime(): number;
1381
- export declare function getElement<E extends ElementOrWindow, R extends Exclude<E, Window>>(element?: ElementOrString<E>): R | undefined;
1382
- export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
1383
- /**
1384
- * @warning Initialization mandatory for correct SSR functioning.
1385
- * @example
1386
- * ```typescript
1387
- * import { useId } from 'vue'
1388
- * import { initGetElementId } from '@dxtmisha/functional-basic'
1389
- * initGetElementId(() => useId())
1390
- * ```
1391
- */
1392
- export declare function initGetElementId(newListener: () => string | number): void;
1393
- export declare function getElementImage(image: HTMLImageElement | string): HTMLImageElement | undefined;
1394
- export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>, index: K | string, defaultValue?: D): T[K] | D | undefined;
1395
- export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
1396
- export declare function getElementSafeScript(id: string, data: any): string;
1397
- export declare function getExactSearchExp(search: string): RegExp;
1398
- export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
1399
- export declare function getFirst<T>(value: T | T[] | Record<string, T>): T | undefined;
1400
- export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
1401
- export declare function getItemByPath<T extends Record<string, any>, R = string>(item: T, path: string): R | undefined;
1402
- export declare function getKey(event: KeyboardEvent): string | number | undefined;
1403
- export declare function getLast<T>(value: T | T[] | Record<string, T>): T | undefined;
1404
- export declare function getLength(value: any): number;
1405
- export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
1406
- export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
1407
- export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
1408
- export declare function getMouseClient(event: MouseEvent & TouchEvent): ImageCoordinator;
1409
- export declare function getMouseClientX(event: MouseEvent & TouchEvent): number;
1410
- export declare function getMouseClientY(event: MouseEvent & TouchEvent): number;
1411
- export declare function getObjectByKeys<T extends Record<string, any>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
1412
- export declare function getObjectNoUndefined<T extends Record<string | number, any>>(data: T, exception?: any): T;
1413
- export declare function getObjectOrNone<T>(value: T): T & Record<string, any>;
1414
- export declare function getOnlyText(text: any): string;
1415
- export declare function getRandomItem<T>(value?: T | T[] | Record<string, T>): T | undefined;
1416
- export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
1417
- export declare function getRequestString(request: Record<string, any> | any[], sign?: string, separator?: string, subKey?: string): string;
1418
- export declare function getSearchExp(search: string, limit?: number): RegExp;
1419
- export declare function getSeparatingSearchExp(search: string | RegExp, limit?: number): RegExp;
1420
- export declare function getStepPercent(min: number | undefined, max: number): number;
1421
- export declare function getStepValue(min: number | undefined, max: number): number;
1422
- export declare function goScroll(selector: string, elementTo: HTMLElement | undefined, elementCenter?: HTMLElement): void;
1423
- export declare function goScrollSmooth<E extends HTMLElement>(element: E, options?: ScrollIntoViewOptions, shift?: number): void;
1424
- export declare function goScrollTo(element?: HTMLElement, elementTo?: HTMLElement, behavior?: ScrollBehavior): void;
1425
- export declare function handleShare(data: ShareData): Promise<boolean>;
1426
- export declare function inArray<T>(array: T[], value: T): boolean;
1427
- export declare function initScrollbarOffset(): Promise<void>;
1428
- export declare function intersectKey<T, KT extends keyof T, C, KC extends keyof C>(data?: T, comparison?: C): Record<KT & KC, T[KT]>;
1429
- export declare const isApiSuccess: <T>(data: ApiData<T>) => boolean;
1430
- export declare function isArray<T, R>(value: T): value is Extract<T, R[]>;
1431
- export declare function isDifferent<T>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
1432
- export declare function isDomData(): boolean;
1433
- export declare function isDomRuntime(): boolean;
1434
- export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
1435
- export declare const isEnter: (event: KeyboardEvent, isInputElement?: boolean) => boolean;
1436
- export declare function isFilled<T>(value: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
1437
- export declare function isFloat(value: any): boolean;
1438
- export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionArgs<any, any>>;
1439
- export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
1440
- export declare const isInput: (element: HTMLElement | EventTarget | null) => boolean;
1441
- export declare function isIntegerBetween(value: number, between: number): boolean;
1442
- export declare const isMetaKey: (event: KeyboardEvent) => boolean;
1443
- export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
1444
- export declare function isNumber(value: any): boolean;
1445
- export declare function isObject<T>(value: T): value is Extract<T, Record<any, any>>;
1446
- export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, Record<any, any>>, any[] | undefined | null>;
1447
- export declare function isOnLine(): boolean;
1448
- export declare function isSelected<T, S>(value: T, selected: T | T[] | S): boolean;
1449
- export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
1450
- export declare function isShare(): boolean;
1451
- export declare function isString<T>(value: T): value is Extract<T, string>;
1452
- export declare const isTab: (event: KeyboardEvent) => boolean;
1453
- export declare function isWindow<E>(element: E): element is Extract<E, Window>;
1454
- export declare function random(min: number, max: number): number;
1455
- export declare function removeCommonPrefix(mainStr: string, prefix: string): string;
1456
- export declare const replaceComponentName: (text: string | undefined, name: string, componentName: string) => string | undefined;
1457
- export declare function replaceRecursive<I>(array: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
1458
- export declare function replaceTemplate(value: string, replaces: Record<string, string | FunctionReturn<string>>): string;
1459
- export type ResizeImageByMaxType = 'auto' | 'width' | 'height';
1460
- export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
1461
- export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
1462
- export declare function setElementItem<E extends ElementOrWindow, K extends keyof E, V extends E[K] = E[K]>(element: ElementOrString<E>, index: K, value: V | Record<string, V>): E | undefined;
1463
- export declare function setValues<T>(selected: T | T[] | undefined, value: any, { multiple, maxlength, alwaysChange, notEmpty }: {
1464
- multiple?: boolean | undefined;
1465
- maxlength?: number | undefined;
1466
- alwaysChange?: boolean | undefined;
1467
- notEmpty?: boolean | undefined;
1468
- }): T | T[] | undefined;
1469
- export declare function sleep(ms: number): Promise<void>;
1470
- export declare function sortList<T = any>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
1471
- export declare function splice<I>(array: ObjectItem<I>, replacement?: ObjectItem<I> | I, indexStart?: string): ObjectItem<I>;
1472
- export declare function strFill(value: string, count: number): string;
1473
- export declare function strSplit(value: number | string, separator: string, limit?: number): string[];
1474
- export declare function toArray<T>(value: T): T extends any[] ? T : [T];
1475
- export declare function toCamelCase(value: string): string;
1476
- export declare function toCamelCaseFirst(value: string): string;
1477
- export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
1478
- export declare function toKebabCase(value: string): string;
1479
- export declare function toNumber(value?: NumberOrString): number;
1480
- export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
1481
- export declare function toNumberPositive(value?: number | string | null, defaultValue?: number): number;
1482
- export declare function toPercent(maxValue: number, value: number): number;
1483
- export declare function toPercentBy100(maxValue: number, value: number): number;
1484
- export declare function toString<T>(value: T): string;
1485
- export declare function transformation(value: any, isFunction?: boolean): any;
1486
- export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
1487
- export declare function uniqueArray<T>(value: T[]): T[];
1488
- export declare function writeClipboardData(text: string): Promise<void>;
2483
+ /** Search item type */
2484
+ export type SearchItem = Record<string, any>;
2485
+ /** Type for generating a column path */
2486
+ export type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
2487
+ /** Type for getting a column */
2488
+ export type SearchColumn<T extends SearchItem> = {
2489
+ [K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
2490
+ }[keyof T];
2491
+ /** Type for a list of columns */
2492
+ export type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
2493
+ /** Type for formatting the key */
2494
+ export type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
2495
+ /** Type for generating a search key */
2496
+ export type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
2497
+ /** Type for a formatted search item */
2498
+ export type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
2499
+ [K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
2500
+ } & {
2501
+ searchActive?: boolean;
2502
+ };
2503
+ /** Type for a list of formatted search items */
2504
+ export type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
2505
+ /** Search list value */
2506
+ export type SearchListValue<T extends SearchItem> = T[] | undefined;
2507
+ /** Search options */
2508
+ export type SearchOptions = {
2509
+ limit?: number;
2510
+ returnEverything?: boolean;
2511
+ delay?: number;
2512
+ findExactMatch?: boolean;
2513
+ classSearchName?: string;
2514
+ };
2515
+ /** Search cache item */
2516
+ export type SearchCacheItem<T extends SearchItem> = {
2517
+ item: T;
2518
+ value: string;
2519
+ };
2520
+ /** Search cache list */
2521
+ export type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
2522
+ /** Highlight match item type */
2523
+ export type HighlightMatchItem = {
2524
+ text: string;
2525
+ isMatch: boolean;
2526
+ };
2527
+ /** Sorting direction */
2528
+ export type SortDir = 'asc' | 'desc';
2529
+ /** Single column sorting specification item */
2530
+ export type SortColumnItem = {
2531
+ column?: string;
2532
+ dir?: SortDir;
2533
+ };
2534
+ /** Custom sort function signature */
2535
+ export type SortFunction<T = any> = (a: T, b: T, column?: string, dir?: SortDir) => number;
2536
+ /** Interface for the functional plugin options */
2537
+ export type TranslateConfig = {
2538
+ url?: string;
2539
+ propsName?: string;
2540
+ readApi?: boolean;
2541
+ };
2542
+ /** Translation code or a list of translation codes for template replacement */
2543
+ export type TranslateCode = string | string[];
2544
+ /** Object with translated strings, where the keys are the names of the translation codes */
2545
+ export type TranslateList<T extends TranslateCode[]> = {
2546
+ [K in T[number] as K extends readonly string[] ? K[0] : K]: string;
2547
+ };
2548
+ /** Return type for translation retrieval: an object if a list was requested, or a string for a single key */
2549
+ export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
2550
+ /** A simple key-value record of translations from a file */
2551
+ export type TranslateDataFileList = Record<string, string>;
2552
+ /** Asynchronous loader function for a translation file */
2553
+ export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
2554
+ /** A mapping of locale strings to their respective translation file loaders */
2555
+ export type TranslateDataFile = Record<string, TranslateDataFileItem>;
2556
+ /** Prefix for global translations */
2557
+ export declare const TRANSLATE_GLOBAL_PREFIX = "global";
2558
+ /** Request timeout for batch loading (ms) */
2559
+ export declare const TRANSLATE_TIME_OUT = 160;