@dxtmisha/functional-basic 1.8.2 → 1.8.4

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,14 +1,4 @@
1
- 1) All these methods are in the @dxtmisha/functional-basic library.
2
- 2) Everything that is exported can be used.
3
- 3) Use what is in this library if it exists; do not use other libraries if there is an analogue here. Do not create new ones if an analogue already exists here.
4
-
5
- The following is the content of "exports" from package.json:
6
- {
7
- ".": {
8
- "import": "./dist/library.js",
9
- "types": "./dist/library.d.ts"
10
- }
11
- }
1
+ All these methods are in the @dxtmisha/functional-basic library.
12
2
 
13
3
  export declare enum ApiMethodItem {
14
4
  delete = "DELETE",
@@ -121,200 +111,616 @@ export type ApiStatusItem = {
121
111
  lastMessage?: string;
122
112
  };
123
113
  export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
124
- export type ApiInstanceOptions = {
125
- headersClass?: typeof ApiHeaders;
126
- requestDefaultClass?: typeof ApiDefault;
127
- statusClass?: typeof ApiStatus;
128
- responseClass?: typeof ApiResponse;
129
- preparationClass?: typeof ApiPreparation;
130
- loadingClass?: LoadingInstance;
131
- errorCenterClass?: ErrorCenterInstance;
132
- hydrationClass?: typeof ApiHydration;
133
- wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
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;
134
132
  };
135
- export declare class Api {
136
- static isLocalhost(): boolean;
137
- static getItem(): ApiInstance;
138
- static getStatus(): ApiStatus;
139
- static getResponse(): ApiResponse;
140
- static getHydration(): ApiHydration;
141
- static getHydrationScript(): string;
142
- static getOrigin(): string;
143
- static getUrl(path: string, api?: boolean): string;
144
- static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
145
- static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
146
- static setHeaders(headers: ApiHeadersValue): void;
147
- static setRequestDefault(request: ApiDefaultValue): void;
148
- static setUrl(url: string): void;
149
- static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
150
- static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
151
- static setTimeout(timeout: number): void;
152
- static setOrigin(origin: string): void;
153
- static setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): void;
154
- static setConfig(config?: ApiConfig): void;
155
- static request<T>(pathRequest: string | ApiFetch): Promise<T>;
156
- static get<T>(request: ApiFetch): Promise<T>;
157
- static post<T>(request: ApiFetch): Promise<T>;
158
- static put<T>(request: ApiFetch): Promise<T>;
159
- static patch<T>(request: ApiFetch): Promise<T>;
160
- static delete<T>(request: ApiFetch): Promise<T>;
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"
161
180
  }
162
- export declare class ApiCache {
163
- static init(getListener: (key: string) => Promise<ApiCacheItem | undefined>, setListener: (key: string, value: ApiCacheItem) => Promise<boolean>, removeListener: (key: string) => Promise<boolean>, cacheStepAgeClearOld?: number): void;
164
- static reset(): void;
165
- static get<T>(key: string): Promise<T | undefined>;
166
- static getByFetch<T>(fetch: ApiFetch): Promise<T | undefined>;
167
- static set<T>(key: string, value: T, age?: number): Promise<void>;
168
- static setByFetch<T>(fetch: ApiFetch, value: T): Promise<void>;
169
- static remove(key: string): Promise<void>;
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
+ };
170
259
  }
171
- export declare class ApiDataReturn<T = any> {
172
- constructor(apiFetch: ApiFetch, query: Response, end: ApiPreparationEnd, error?: ApiErrorItem | undefined);
173
- init(): Promise<this>;
174
- get(): ApiData<T>;
175
- getAndStatus(status: ApiStatus): ApiData<T>;
176
- getData(): ApiData<T> | undefined;
260
+ export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
261
+ standard: string;
262
+ firstDay: string;
263
+ location: string;
264
+ locationCountry: string;
265
+ locationLanguage: string;
177
266
  }
178
- export declare class ApiDefault {
179
- is(): boolean;
180
- get(): Record<string, any> | undefined;
181
- request(request: ApiFetch['request']): ApiFetch['request'];
182
- set(request: ApiDefaultValue): this;
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;
183
277
  }
184
- export declare class ApiError {
185
- static getStorage(): ApiErrorStorage;
186
- static add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): void;
187
- static getItem(method: ApiMethodItem, response: Response): Promise<ApiErrorItem>;
278
+ export interface GeoFlagNational extends GeoFlagItem {
279
+ description: string;
280
+ nationalLanguage: string;
281
+ nationalCountry: string;
188
282
  }
189
- export declare class ApiErrorItem {
190
- constructor(method: ApiMethodItem, response: Response, error: ApiErrorStorageItem);
191
- getMethod(): ApiMethodItem;
192
- getResponse(): Response;
193
- getError(): ApiErrorStorageItem;
194
- getCode(): string | undefined;
195
- getMessage(): string | undefined;
196
- getStatus(): number;
283
+ export interface GeoPhoneValue {
284
+ phone: number;
285
+ within: number;
286
+ mask: string[];
287
+ value: string;
197
288
  }
198
- export declare class ApiErrorStorage {
199
- find(method: ApiMethodItem, response: Response): Promise<ApiErrorStorageItem>;
200
- add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): this;
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>;
201
296
  }
202
- export declare class ApiHeaders {
203
- get(value?: Record<string, string> | null, type?: string | undefined | null): Record<string, string> | undefined;
204
- getByRequest(request: ApiFetch['request'], value?: Record<string, string> | null, type?: string): Record<string, string> | undefined;
205
- set(headers: ApiHeadersValue): this;
297
+ export interface GeoPhoneMapInfo {
298
+ item?: GeoPhoneMap;
299
+ phone?: string;
206
300
  }
207
- export declare class ApiHydration {
208
- initResponse(response: ApiResponse): void;
209
- toClient<T>(apiFetch: ApiFetch, response: T): void;
210
- toString(): string;
301
+ export declare enum MetaTag {
302
+ title = "title",
303
+ description = "description",
304
+ keywords = "keywords",
305
+ canonical = "canonical",
306
+ robots = "robots",
307
+ author = "author"
211
308
  }
212
- export declare class ApiInstance {
213
- constructor(url?: string, options?: ApiInstanceOptions);
214
- isLocalhost(): boolean;
215
- getStatus(): ApiStatus;
216
- getResponse(): ApiResponse;
217
- getHydration(): ApiHydration;
218
- getOrigin(): string;
219
- getUrl(path: string, api?: boolean): string;
220
- getBody(request?: ApiFetch['request'], method?: ApiMethod): string | FormData | undefined;
221
- getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethod): string;
222
- getHydrationScript(): string;
223
- setHeaders(headers: ApiHeadersValue): this;
224
- setRequestDefault(request: ApiDefaultValue): this;
225
- setUrl(url: string): this;
226
- setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): this;
227
- setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
228
- setTimeout(timeout: number): this;
229
- setOrigin(origin: string): this;
230
- setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): this;
231
- request<T>(pathRequest: string | ApiFetch): Promise<T>;
232
- get<T>(request: ApiFetch): Promise<T>;
233
- post<T>(request: ApiFetch): Promise<T>;
234
- put<T>(request: ApiFetch): Promise<T>;
235
- patch<T>(request: ApiFetch): Promise<T>;
236
- delete<T>(request: ApiFetch): Promise<T>;
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"
237
323
  }
238
- export declare class ApiPreparation {
239
- make(active: boolean, apiFetch: ApiFetch): Promise<void>;
240
- makeEnd(active: boolean, query: Response, apiFetch: ApiFetch): Promise<ApiPreparationEnd>;
241
- set(callback: (apiFetch: ApiFetch) => Promise<void>): this;
242
- setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
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"
243
398
  }
244
- export declare class ApiResponse {
245
- constructor(requestDefault: ApiDefault);
246
- get(path: string | undefined, method: ApiMethod, request?: ApiFetch['request'], devMode?: boolean): ApiResponseItem | undefined;
247
- getList(): (ApiResponseItem & Record<string, any>)[];
248
- add(response: ApiResponseItem | ApiResponseItem[]): this;
249
- setDevMode(devMode: boolean): this;
250
- emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
251
- emulatorAsync<T>(apiFetch: ApiFetch): T | undefined;
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"
252
417
  }
253
- export declare class ApiStatus {
254
- get(): ApiStatusItem | undefined;
255
- getStatus(): number | undefined;
256
- getStatusText(): string | undefined;
257
- getStatusType(): ApiStatusType | undefined;
258
- getCode(): string | undefined;
259
- getError(): string | undefined;
260
- getResponse<T>(): T | undefined;
261
- getMessage(): string;
262
- set(data: ApiStatusItem): this;
263
- setStatus(status?: number, statusText?: string): this;
264
- setError(error?: string): this;
265
- setLastResponse(response?: any): this;
266
- setLastStatus(status?: ApiStatusType): this;
267
- setLastCode(code?: string): this;
268
- setLastMessage(message?: string): this;
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"
269
425
  }
270
- export declare class BroadcastMessage<Message = any> {
271
- constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
272
- getChannel(): BroadcastChannel | undefined;
273
- post(message: Message): this;
274
- setCallback(callback: (event: MessageEvent<Message>) => void): this;
275
- setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
276
- destroy(): this;
426
+ export declare enum MetaOpenGraphCondition {
427
+ new = "new",
428
+ used = "used",
429
+ refurbished = "refurbished"
277
430
  }
278
- /**
279
- * Simple in-memory cache class that stores computed values by key.
280
- * @deprecated This class is obsolete and should not be used
281
- */
282
- export declare class Cache {
283
- get<T>(name: string, callback: () => T, comparison?: any[]): T;
284
- getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
431
+ export declare enum MetaOpenGraphAge {
432
+ newborn = "newborn",
433
+ infant = "infant",
434
+ toddler = "toddler",
435
+ kids = "kids",
436
+ adult = "adult"
285
437
  }
286
- /**
287
- * Class for managing a single cached value with dependency tracking.
288
- * @deprecated This class is obsolete and should not be used
289
- */
290
- export declare class CacheItem<T> {
291
- constructor(callback: () => T);
292
- getCache(comparison: any[]): T;
293
- getCacheOld(): T | undefined;
294
- getCacheAsync(comparison: any[]): Promise<T>;
438
+ export declare enum MetaOpenGraphGender {
439
+ female = "female",
440
+ male = "male",
441
+ unisex = "unisex"
295
442
  }
296
- /**
297
- * Static cache class that uses ServerStorage for persistent caching across the application.
298
- * @deprecated This class is obsolete and should not be used
299
- */
300
- export declare class CacheStatic {
301
- static get<T>(name: string, callback: () => T, comparison?: any[]): T;
302
- static getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
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"
303
473
  }
304
- export type CookieSameSite = 'strict' | 'lax';
305
- export type CookieOptions = {
306
- age?: number;
307
- sameSite?: CookieSameSite;
308
- path?: string;
309
- domain?: string;
310
- secure?: boolean;
311
- httpOnly?: boolean;
312
- partitioned?: boolean;
313
- arguments?: string[] | Record<string, string | number | boolean>;
314
- };
315
- export declare class Cookie<T> {
316
- static getInstance<T>(name: string): Cookie<T>;
317
- constructor(name: string);
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;
568
+ 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;
605
+ }
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;
610
+ }
611
+ export declare class ApiHydration {
612
+ initResponse(response: ApiResponse): void;
613
+ toClient<T>(apiFetch: ApiFetch, response: T): void;
614
+ toString(): string;
615
+ }
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>;
652
+ }
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;
658
+ }
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;
667
+ }
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;
684
+ }
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;
692
+ }
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>;
697
+ }
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>;
704
+ }
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>;
709
+ }
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);
318
724
  get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): string | T | undefined;
319
725
  set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
320
726
  remove(): void;
@@ -345,11 +751,9 @@ export declare class DataStorage<T> {
345
751
  update(): this;
346
752
  }
347
753
  /**
348
- * A class for working with dates.
349
754
  * @remarks
350
- * Creating a `Datetime` instance without a specific date (using the current time)
351
- * for rendering in SSR may lead to hydration mismatches because the time or time zone
352
- * on the server may differ from the time on the client.
755
+ * Creating a `Datetime` instance without a specific date (using current time)
756
+ * in SSR may lead to hydration mismatches.
353
757
  */
354
758
  export declare class Datetime {
355
759
  constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
@@ -424,22 +828,6 @@ export declare class Datetime {
424
828
  cloneDayNext(): Datetime;
425
829
  cloneDayPrevious(): Datetime;
426
830
  }
427
- export type ErrorCenterGroup = string | undefined;
428
- export type ErrorCenterCauseItem<D = any> = {
429
- group?: ErrorCenterGroup;
430
- code: string;
431
- priority?: number;
432
- label?: string;
433
- message?: string;
434
- details?: D;
435
- };
436
- export type ErrorCenterCauseList = ErrorCenterCauseItem[];
437
- export type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
438
- export type ErrorCenterHandlerItem = {
439
- group?: ErrorCenterGroup;
440
- handlers: ErrorCenterHandlerCallback[];
441
- };
442
- export type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
443
831
  export declare class ErrorCenter {
444
832
  static getItem(): ErrorCenterInstance;
445
833
  static has(code: string, group?: string): boolean;
@@ -449,15 +837,17 @@ export declare class ErrorCenter {
449
837
  static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
450
838
  static addHandlerList(handlers: ErrorCenterHandlerList): void;
451
839
  static addCallback(callback: ErrorCenterHandlerCallback): void;
840
+ static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
452
841
  static on(cause: ErrorCenterCauseItem): void;
453
842
  }
454
843
  export declare class ErrorCenterHandler {
455
- constructor(handlers?: ErrorCenterHandlerList);
844
+ constructor(handlers?: ErrorCenterHandlerList, isConsole?: ErrorCenterHandlerIsConsole);
456
845
  has(group: ErrorCenterGroup): boolean;
457
846
  get(group: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
458
847
  add(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
459
848
  addList(handlers: ErrorCenterHandlerList): this;
460
849
  addCallback(callback: ErrorCenterHandlerCallback): this;
850
+ setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
461
851
  on(cause: ErrorCenterCauseItem): this;
462
852
  }
463
853
  export declare class ErrorCenterInstance {
@@ -469,16 +859,9 @@ export declare class ErrorCenterInstance {
469
859
  addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
470
860
  addHandlerList(handlers: ErrorCenterHandlerList): this;
471
861
  addCallback(callback: ErrorCenterHandlerCallback): this;
862
+ setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
472
863
  on(cause: ErrorCenterCauseItem): this;
473
864
  }
474
- /**
475
- * Advanced wrapper for managing event listeners on DOM elements or the `window` object.
476
- * @example
477
- * ```typescript
478
- * const clickEvent = new EventItem('.btn', 'click', (e) => console.log('Clicked!'));
479
- * clickEvent.start();
480
- * ```
481
- */
482
865
  export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> {
483
866
  constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
484
867
  isActive(): boolean;
@@ -495,62 +878,6 @@ export declare class EventItem<E extends ElementOrWindow, O extends Event, D ext
495
878
  toggle(activity: boolean): this;
496
879
  reset(): this;
497
880
  }
498
- export declare enum FormattersType {
499
- currency = "currency",
500
- date = "date",
501
- name = "name",
502
- number = "number",
503
- plural = "plural",
504
- unit = "unit"
505
- }
506
- export type FormattersOptionsCurrency = {
507
- currencyPropName?: string;
508
- options?: string | Intl.NumberFormatOptions;
509
- numberOnly?: boolean;
510
- };
511
- export type FormattersOptionsDate = {
512
- type?: GeoDate;
513
- options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions;
514
- hour24?: boolean;
515
- };
516
- export type FormattersOptionsName = {
517
- lastPropName?: string;
518
- firstPropName?: string;
519
- surname?: string;
520
- short?: boolean;
521
- };
522
- export type FormattersOptionsNumber = {
523
- options?: Intl.NumberFormatOptions;
524
- };
525
- export type FormattersOptionsPlural = {
526
- words: string;
527
- options?: Intl.PluralRulesOptions;
528
- optionsNumber?: Intl.NumberFormatOptions;
529
- };
530
- export type FormattersOptionsUnit = {
531
- unit: string | Intl.NumberFormatOptions;
532
- };
533
- 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>;
534
- export type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = {
535
- type?: Type;
536
- transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R;
537
- options?: FormattersOptionsInformation<Type>;
538
- };
539
- export type FormattersOptionsList = Record<string, FormattersOptionsItem>;
540
- export type FormattersListItem = Record<string, any>;
541
- export type FormattersList<Item extends FormattersListItem> = Item[];
542
- export type FormattersCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<FormattersCapitalize<Rest>>}` : K;
543
- export type FormattersColumns<T extends FormattersOptionsList> = (keyof T & string)[];
544
- export type FormattersKey<K, A extends string = 'Format'> = K extends string ? `${FormattersCapitalize<K>}${A}` : never;
545
- export type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = {
546
- [K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string;
547
- };
548
- export type FormattersListFormat<T extends FormattersListItem, K extends string[]> = FormattersDataItem<T, K>[];
549
- export type FormattersListColumnItem<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersDataItem<T, FormattersColumns<O>>;
550
- export type FormattersListColumns<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersListFormat<T, FormattersColumns<O>>;
551
- export type FormattersListProp = FormattersList<FormattersListItem> | FormattersListItem;
552
- export type FormattersItemProp<List extends FormattersListProp> = ArrayToItem<List>;
553
- 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);
554
881
  export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
555
882
  constructor(options: Options, list?: List | undefined);
556
883
  is(): boolean;
@@ -925,7 +1252,7 @@ export declare class ServerStorage {
925
1252
  static reset(): void;
926
1253
  static has(key: string): boolean;
927
1254
  static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
928
- static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: Record<string, any>): T;
1255
+ static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
929
1256
  static setErrorStatus(hide: boolean): void;
930
1257
  static remove(key: string): void;
931
1258
  static toString(): string;
@@ -977,7 +1304,7 @@ export declare class TranslateInstance {
977
1304
  addSyncByLocation(data: Record<string, Record<string, string>>): void;
978
1305
  addSyncByFile(data: TranslateDataFile): void;
979
1306
  setUrl(url: string): this;
980
- setPropsName(propsName: string): this;
1307
+ setPropsName(name: string): this;
981
1308
  setReadApi(value: boolean): this;
982
1309
  }
983
1310
  export declare abstract class UrlInstanceAbstract {
@@ -1014,7 +1341,7 @@ export declare class UrlItem {
1014
1341
  }
1015
1342
  export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
1016
1343
  export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
1017
- export declare const applyTemplate: (text: string, replacement?: Record<string, string | number | boolean> | string[]) => string;
1344
+ export declare function applyTemplate(text: string, replacement?: Record<string, string | number | boolean> | string[]): string;
1018
1345
  export declare function arrFill<T>(value: T, count: number): T[];
1019
1346
  export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
1020
1347
  export declare function capitalize(value: string, isLocale?: boolean): string;
@@ -1022,9 +1349,7 @@ export declare function copyObject<T>(value: T): T;
1022
1349
  export declare function copyObjectLite<T, R = T>(value: T, source?: any): R;
1023
1350
  /**
1024
1351
  * @remarks
1025
- * When running on the server, the function always returns `undefined`.
1026
- * If you use it within a component's rendering logic, it may lead to hydration mismatches.
1027
- * 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).
1352
+ * Always returns `undefined` when running on server.
1028
1353
  */
1029
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;
1030
1355
  export declare function domContentLoaded<T = void>(callback: () => T | Promise<T>): Promise<T>;
@@ -1045,28 +1370,25 @@ export declare function getClipboardData(event?: ClipboardEvent): Promise<string
1045
1370
  export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>, column: K): (T[K] | undefined)[];
1046
1371
  /**
1047
1372
  * @remarks
1048
- * Using this function for rendering in SSR may lead to hydration mismatches
1049
- * because the time or time zone on the server may differ from the time on the client.
1050
- * It is recommended to use this function inside client-side hooks only (e.g., `onMounted` in Vue or `useEffect` in React).
1373
+ * Using in SSR may cause hydration mismatches.
1051
1374
  */
1052
1375
  export declare function getCurrentDate(format?: GeoDate): string;
1053
1376
  /**
1054
1377
  * @remarks
1055
- * **Warning (SSR):** Using this function for rendering in SSR will almost certainly lead to hydration mismatches
1056
- * because the timestamp on the server will differ from the timestamp on the client.
1378
+ * Using in SSR will cause hydration mismatches.
1057
1379
  */
1058
1380
  export declare function getCurrentTime(): number;
1059
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;
1060
1383
  /**
1384
+ * @warning Initialization mandatory for correct SSR functioning.
1061
1385
  * @example
1062
1386
  * ```typescript
1063
1387
  * import { useId } from 'vue'
1064
1388
  * import { initGetElementId } from '@dxtmisha/functional-basic'
1065
- *
1066
1389
  * initGetElementId(() => useId())
1067
1390
  * ```
1068
1391
  */
1069
- export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
1070
1392
  export declare function initGetElementId(newListener: () => string | number): void;
1071
1393
  export declare function getElementImage(image: HTMLImageElement | string): HTMLImageElement | undefined;
1072
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;
@@ -1134,14 +1456,15 @@ export declare function removeCommonPrefix(mainStr: string, prefix: string): str
1134
1456
  export declare const replaceComponentName: (text: string | undefined, name: string, componentName: string) => string | undefined;
1135
1457
  export declare function replaceRecursive<I>(array: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
1136
1458
  export declare function replaceTemplate(value: string, replaces: Record<string, string | FunctionReturn<string>>): string;
1137
- export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: 'auto' | 'width' | 'height', typeData?: string): string | undefined;
1459
+ export type ResizeImageByMaxType = 'auto' | 'width' | 'height';
1460
+ export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
1138
1461
  export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
1139
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;
1140
- export declare function setValues<T>(selected: T | T[] | undefined, value: any, options: {
1141
- multiple?: boolean;
1142
- maxlength?: number;
1143
- alwaysChange?: boolean;
1144
- notEmpty?: boolean;
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;
1145
1468
  }): T | T[] | undefined;
1146
1469
  export declare function sleep(ms: number): Promise<void>;
1147
1470
  export declare function sortList<T = any>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
@@ -1153,12 +1476,6 @@ export declare function toCamelCase(value: string): string;
1153
1476
  export declare function toCamelCaseFirst(value: string): string;
1154
1477
  export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
1155
1478
  export declare function toKebabCase(value: string): string;
1156
- /**
1157
- * @example
1158
- * toNumber("1 234,56") // 1234.56
1159
- * toNumber("1,234.56") // 1234.56
1160
- * toNumber("1,234") // 1.234
1161
- */
1162
1479
  export declare function toNumber(value?: NumberOrString): number;
1163
1480
  export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
1164
1481
  export declare function toNumberPositive(value?: number | string | null, defaultValue?: number): number;
@@ -1168,355 +1485,4 @@ export declare function toString<T>(value: T): string;
1168
1485
  export declare function transformation(value: any, isFunction?: boolean): any;
1169
1486
  export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
1170
1487
  export declare function uniqueArray<T>(value: T[]): T[];
1171
- export declare function writeClipboardData(text: string): Promise<void>;
1172
- export declare const errorCauseList: ErrorCenterCauseList;
1173
- export type Undefined = undefined | null;
1174
- export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
1175
- export type NumberOrString = number | string;
1176
- export type NumberOrStringOrBoolean = number | string | boolean;
1177
- export type NumberOrStringOrDate = NumberOrString | Date;
1178
- export type NormalOrArray<T = NumberOrString> = T | T[];
1179
- export type NormalOrPromise<T> = T | Promise<T>;
1180
- export type ObjectItem<T = any> = Record<string, T>;
1181
- export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
1182
- export type ArrayToItem<T> = T extends any[] ? T[number] : T;
1183
- export type FunctionReturn<R = any> = () => R;
1184
- export type FunctionVoid = () => void;
1185
- export type FunctionArgs<T, R> = (...args: T[]) => R;
1186
- export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
1187
- export type ItemList<T = any> = Record<string, T>;
1188
- export type Item<V> = {
1189
- index: string;
1190
- value: V;
1191
- };
1192
- export type ItemValue<V> = {
1193
- label: string;
1194
- value: V;
1195
- };
1196
- export type ItemName<V> = {
1197
- name: string | number;
1198
- value: V;
1199
- };
1200
- export type ElementOrWindow = HTMLElement | Window;
1201
- export type ElementOrString<E extends ElementOrWindow> = E | string;
1202
- export type EventOptions = AddEventListenerOptions | boolean | undefined;
1203
- export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
1204
- export type EventActivityItem<E extends ElementOrWindow> = {
1205
- element: E | undefined;
1206
- type: string;
1207
- listener?: (event: any | Event) => void;
1208
- observer?: ResizeObserver;
1209
- };
1210
- export type ImageCoordinator = {
1211
- x: number;
1212
- y: number;
1213
- };
1214
- export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
1215
- export type GeoFirstDay = 1 | 6 | 0;
1216
- export type GeoHours = '12' | '24';
1217
- export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
1218
- export interface GeoItem {
1219
- country: string;
1220
- countryAlternative?: string[];
1221
- language: string;
1222
- languageAlternative?: string[];
1223
- firstDay?: string | null;
1224
- zone?: string | null;
1225
- phoneCode?: string;
1226
- phoneWithin?: string;
1227
- phoneMask?: string | string[];
1228
- nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
1229
- unit?: {
1230
- 'millimeter'?: string;
1231
- 'centimeter'?: string;
1232
- 'meter'?: string;
1233
- 'kilometer'?: string;
1234
- 'square-meter'?: string;
1235
- 'hectare'?: string;
1236
- 'gram'?: string;
1237
- 'kilogram'?: string;
1238
- 'tonne'?: string;
1239
- 'milliliter'?: string;
1240
- 'liter'?: string;
1241
- 'celsius'?: string;
1242
- 'kilometer-per-hour'?: string;
1243
- };
1244
- }
1245
- export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
1246
- standard: string;
1247
- firstDay: string;
1248
- location: string;
1249
- locationCountry: string;
1250
- locationLanguage: string;
1251
- }
1252
- export interface GeoFlagItem {
1253
- language: string;
1254
- languageCode: string;
1255
- country: string;
1256
- countryCode: string;
1257
- standard: string;
1258
- icon?: string;
1259
- label: string;
1260
- value: string;
1261
- phoneCode?: string;
1262
- }
1263
- export interface GeoFlagNational extends GeoFlagItem {
1264
- description: string;
1265
- nationalLanguage: string;
1266
- nationalCountry: string;
1267
- }
1268
- export interface GeoPhoneValue {
1269
- phone: number;
1270
- within: number;
1271
- mask: string[];
1272
- value: string;
1273
- }
1274
- export interface GeoPhoneMap {
1275
- items: GeoPhoneValue[];
1276
- info: GeoPhoneValue | undefined;
1277
- value: string | undefined;
1278
- mask: string[];
1279
- maskFull: string[];
1280
- next: Record<string, GeoPhoneMap>;
1281
- }
1282
- export interface GeoPhoneMapInfo {
1283
- item?: GeoPhoneMap;
1284
- phone?: string;
1285
- }
1286
- export declare enum MetaTag {
1287
- title = "title",
1288
- description = "description",
1289
- keywords = "keywords",
1290
- canonical = "canonical",
1291
- robots = "robots",
1292
- author = "author"
1293
- }
1294
- export declare enum MetaRobots {
1295
- indexFollow = "index, follow",
1296
- noIndexFollow = "noindex, follow",
1297
- indexNoFollow = "index, nofollow",
1298
- noIndexNoFollow = "noindex, nofollow",
1299
- noArchive = "noarchive",
1300
- noSnippet = "nosnippet",
1301
- noImageIndex = "noimageindex",
1302
- images = "images",
1303
- noTranslate = "notranslate",
1304
- noPreview = "nopreview",
1305
- textOnly = "textonly",
1306
- noIndexSubpages = "noindex, noarchive",
1307
- none = "none"
1308
- }
1309
- export declare enum MetaOpenGraphTag {
1310
- title = "og:title",
1311
- type = "og:type",
1312
- url = "og:url",
1313
- image = "og:image",
1314
- description = "og:description",
1315
- locale = "og:locale",
1316
- siteName = "og:site_name",
1317
- localeAlternate = "og:locale:alternate",
1318
- imageUrl = "og:image:url",
1319
- imageSecureUrl = "og:image:secure_url",
1320
- imageType = "og:image:type",
1321
- imageWidth = "og:image:width",
1322
- imageHeight = "og:image:height",
1323
- imageAlt = "og:image:alt",
1324
- video = "og:video",
1325
- videoUrl = "og:video:url",
1326
- videoSecureUrl = "og:video:secure_url",
1327
- videoType = "og:video:type",
1328
- videoWidth = "og:video:width",
1329
- videoHeight = "og:video:height",
1330
- audio = "og:audio",
1331
- audioSecureUrl = "og:audio:secure_url",
1332
- audioType = "og:audio:type",
1333
- articlePublishedTime = "article:published_time",
1334
- articleModifiedTime = "article:modified_time",
1335
- articleExpirationTime = "article:expiration_time",
1336
- articleAuthor = "article:author",
1337
- articleSection = "article:section",
1338
- articleTag = "article:tag",
1339
- bookAuthor = "book:author",
1340
- bookIsbn = "book:isbn",
1341
- bookReleaseDate = "book:release_date",
1342
- bookTag = "book:tag",
1343
- musicDuration = "music:duration",
1344
- musicAlbum = "music:album",
1345
- musicAlbumDisc = "music:album:disc",
1346
- musicAlbumTrack = "music:album:track",
1347
- musicMusician = "music:musician",
1348
- musicSong = "music:song",
1349
- musicSongDisc = "music:song:disc",
1350
- musicSongTrack = "music:song:track",
1351
- musicReleaseDate = "music:release_date",
1352
- musicCreator = "music:creator",
1353
- videoActor = "video:actor",
1354
- videoActorRole = "video:actor:role",
1355
- videoDirector = "video:director",
1356
- videoWriter = "video:writer",
1357
- videoDuration = "video:duration",
1358
- videoReleaseDate = "video:release_date",
1359
- videoTag = "video:tag",
1360
- videoSeries = "video:series",
1361
- profileFirstName = "profile:first_name",
1362
- profileLastName = "profile:last_name",
1363
- profileUsername = "profile:username",
1364
- profileGender = "profile:gender",
1365
- productBrand = "product:brand",
1366
- productAvailability = "product:availability",
1367
- productCondition = "product:condition",
1368
- productPriceAmount = "product:price:amount",
1369
- productPriceCurrency = "product:price:currency",
1370
- productRetailerItemId = "product:retailer_item_id",
1371
- productCategory = "product:category",
1372
- productEan = "product:ean",
1373
- productIsbn = "product:isbn",
1374
- productMfrPartNo = "product:mfr_part_no",
1375
- productUpc = "product:upc",
1376
- productWeightValue = "product:weight:value",
1377
- productWeightUnits = "product:weight:units",
1378
- productColor = "product:color",
1379
- productMaterial = "product:material",
1380
- productPattern = "product:pattern",
1381
- productAgeGroup = "product:age_group",
1382
- productGender = "product:gender"
1383
- }
1384
- export declare enum MetaOpenGraphType {
1385
- website = "website",
1386
- article = "article",
1387
- video = "video.other",
1388
- videoTvShow = "video.tv_show",
1389
- videoEpisode = "video.episode",
1390
- videoMovie = "video.movie",
1391
- musicAlbum = "music.album",
1392
- musicPlaylist = "music.playlist",
1393
- musicSong = "music.song",
1394
- musicRadioStation = "music.radio_station",
1395
- app = "app",
1396
- product = "product",
1397
- business = "business.business",
1398
- place = "place",
1399
- event = "event",
1400
- profile = "profile",
1401
- book = "book"
1402
- }
1403
- export declare enum MetaOpenGraphAvailability {
1404
- inStock = "in stock",
1405
- outOfStock = "out of stock",
1406
- preorder = "preorder",
1407
- backorder = "backorder",
1408
- discontinued = "discontinued",
1409
- pending = "pending"
1410
- }
1411
- export declare enum MetaOpenGraphCondition {
1412
- new = "new",
1413
- used = "used",
1414
- refurbished = "refurbished"
1415
- }
1416
- export declare enum MetaOpenGraphAge {
1417
- newborn = "newborn",
1418
- infant = "infant",
1419
- toddler = "toddler",
1420
- kids = "kids",
1421
- adult = "adult"
1422
- }
1423
- export declare enum MetaOpenGraphGender {
1424
- female = "female",
1425
- male = "male",
1426
- unisex = "unisex"
1427
- }
1428
- export declare enum MetaTwitterTag {
1429
- card = "twitter:card",
1430
- site = "twitter:site",
1431
- creator = "twitter:creator",
1432
- url = "twitter:url",
1433
- title = "twitter:title",
1434
- description = "twitter:description",
1435
- image = "twitter:image",
1436
- imageAlt = "twitter:image:alt",
1437
- imageSrc = "twitter:image:src",
1438
- imageWidth = "twitter:image:width",
1439
- imageHeight = "twitter:image:height",
1440
- label1 = "twitter:label1",
1441
- data1 = "twitter:data1",
1442
- label2 = "twitter:label2",
1443
- data2 = "twitter:data2",
1444
- appNameIphone = "twitter:app:name:iphone",
1445
- appIdIphone = "twitter:app:id:iphone",
1446
- appUrlIphone = "twitter:app:url:iphone",
1447
- appNameIpad = "twitter:app:name:ipad",
1448
- appIdIpad = "twitter:app:id:ipad",
1449
- appUrlIpad = "twitter:app:url:ipad",
1450
- appNameGooglePlay = "twitter:app:name:googleplay",
1451
- appIdGooglePlay = "twitter:app:id:googleplay",
1452
- appUrlGooglePlay = "twitter:app:url:googleplay",
1453
- player = "twitter:player",
1454
- playerWidth = "twitter:player:width",
1455
- playerHeight = "twitter:player:height",
1456
- playerStream = "twitter:player:stream",
1457
- playerStreamContentType = "twitter:player:stream:content_type"
1458
- }
1459
- export declare enum MetaTwitterCard {
1460
- summary = "summary",
1461
- summaryLargeImage = "summary_large_image",
1462
- app = "app",
1463
- player = "player",
1464
- product = "product",
1465
- gallery = "gallery",
1466
- photo = "photo",
1467
- leadGeneration = "lead_generation",
1468
- audio = "audio",
1469
- poll = "poll"
1470
- }
1471
- export type SearchItem = Record<string, any>;
1472
- export type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
1473
- export type SearchColumn<T extends SearchItem> = {
1474
- [K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
1475
- }[keyof T];
1476
- export type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
1477
- export type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
1478
- export type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
1479
- export type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
1480
- [K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
1481
- } & {
1482
- searchActive?: boolean;
1483
- };
1484
- export type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
1485
- export type SearchListValue<T extends SearchItem> = T[] | undefined;
1486
- export type SearchOptions = {
1487
- limit?: number;
1488
- returnEverything?: boolean;
1489
- delay?: number;
1490
- findExactMatch?: boolean;
1491
- classSearchName?: string;
1492
- };
1493
- export type SearchCacheItem<T extends SearchItem> = {
1494
- item: T;
1495
- value: string;
1496
- };
1497
- export type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
1498
- export type HighlightMatchItem = {
1499
- text: string;
1500
- isMatch: boolean;
1501
- };
1502
- export type SortDir = 'asc' | 'desc';
1503
- export type SortColumnItem = {
1504
- column?: string;
1505
- dir?: SortDir;
1506
- };
1507
- export type SortFunction<T = any> = (a: T, b: T, column?: string, dir?: SortDir) => number;
1508
- export type TranslateConfig = {
1509
- url?: string;
1510
- propsName?: string;
1511
- readApi?: boolean;
1512
- };
1513
- export type TranslateCode = string | string[];
1514
- export type TranslateList<T extends TranslateCode[]> = {
1515
- [K in T[number] as K extends readonly string[] ? K[0] : K]: string;
1516
- };
1517
- export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
1518
- export type TranslateDataFileList = Record<string, string>;
1519
- export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
1520
- export type TranslateDataFile = Record<string, TranslateDataFileItem>;
1521
- export declare const TRANSLATE_GLOBAL_PREFIX = "global";
1522
- export declare const TRANSLATE_TIME_OUT = 160;
1488
+ export declare function writeClipboardData(text: string): Promise<void>;