@dxtmisha/functional-basic 1.1.0 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/ai-types.txt +499 -492
- package/dist/library.d.ts +178 -9
- package/dist/library.js +415 -337
- package/package.json +3 -2
package/ai-types.txt
CHANGED
|
@@ -15,144 +15,158 @@ The following is the content of "exports" from package.json:
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// File: library.d.ts
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param value initial string
|
|
18
|
+
/** Adds a highlight tag to matches in a string.
|
|
19
|
+
* @param value input string
|
|
21
20
|
* @param search search string or RegExp
|
|
22
|
-
* @param className CSS class
|
|
23
|
-
* @param shouldEscape escape
|
|
24
|
-
* @returns string with highlighting
|
|
21
|
+
* @param className CSS class for highlight
|
|
22
|
+
* @param shouldEscape escape string flag
|
|
25
23
|
*/
|
|
26
24
|
export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
|
|
26
|
+
/** Converts a value to a string.
|
|
29
27
|
* @param value value to convert
|
|
30
28
|
* @param isArrayString convert arrays to strings
|
|
31
29
|
* @param trim trim result
|
|
32
|
-
* @returns string representation
|
|
33
30
|
*/
|
|
34
31
|
export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
32
|
+
|
|
33
|
+
/** HTTP request utility class. */
|
|
38
34
|
export declare class Api {
|
|
39
|
-
/** Check if
|
|
35
|
+
/** Check if localhost. */
|
|
40
36
|
static isLocalhost(): boolean;
|
|
41
37
|
/** Get ApiInstance singleton. */
|
|
42
38
|
static getItem(): ApiInstance;
|
|
43
|
-
/** Get
|
|
39
|
+
/** Get last request status. */
|
|
44
40
|
static getStatus(): ApiStatus;
|
|
45
41
|
/** Get response handler. */
|
|
46
42
|
static getResponse(): ApiResponse;
|
|
47
43
|
/** Get hydration handler. */
|
|
48
44
|
static getHydration(): ApiHydration;
|
|
49
|
-
/** Get hydration script
|
|
45
|
+
/** Get client hydration script string. */
|
|
50
46
|
static getHydrationScript(): string;
|
|
51
|
-
/** Get
|
|
47
|
+
/** Get base origin URL. */
|
|
48
|
+
static getOrigin(): string;
|
|
49
|
+
/** Get full script URL. */
|
|
52
50
|
static getUrl(path: string, api?: boolean): string;
|
|
53
51
|
/** Get request body data. */
|
|
54
52
|
static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
|
|
55
|
-
/** Get query string
|
|
53
|
+
/** Get GET request query string. */
|
|
56
54
|
static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
|
|
57
55
|
/** Set default headers. */
|
|
58
56
|
static setHeaders(headers: Record<string, string>): void;
|
|
59
57
|
/** Set default request data. */
|
|
60
58
|
static setRequestDefault(request: Record<string, any>): void;
|
|
61
|
-
/** Set base URL. */
|
|
59
|
+
/** Set base script URL. */
|
|
62
60
|
static setUrl(url: string): void;
|
|
63
61
|
/** Set pre-request callback. */
|
|
64
62
|
static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
|
|
65
63
|
/** Set post-request callback. */
|
|
66
64
|
static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
|
|
67
|
-
/** Set request timeout
|
|
65
|
+
/** Set request timeout. */
|
|
68
66
|
static setTimeout(timeout: number): void;
|
|
69
|
-
/** Set
|
|
67
|
+
/** Set base origin. */
|
|
68
|
+
static setOrigin(origin: string): void;
|
|
69
|
+
/** Set full API config. */
|
|
70
70
|
static setConfig(config?: ApiConfig): void;
|
|
71
71
|
/** Execute request. */
|
|
72
72
|
static request<T>(pathRequest: string | ApiFetch): Promise<T>;
|
|
73
|
-
/** GET request. */
|
|
73
|
+
/** Send GET request. */
|
|
74
74
|
static get<T>(request: ApiFetch): Promise<T>;
|
|
75
|
-
/** POST request. */
|
|
75
|
+
/** Send POST request. */
|
|
76
76
|
static post<T>(request: ApiFetch): Promise<T>;
|
|
77
|
-
/** PUT request. */
|
|
77
|
+
/** Send PUT request. */
|
|
78
78
|
static put<T>(request: ApiFetch): Promise<T>;
|
|
79
|
-
/** PATCH request. */
|
|
79
|
+
/** Send PATCH request. */
|
|
80
80
|
static patch<T>(request: ApiFetch): Promise<T>;
|
|
81
|
-
/** DELETE request. */
|
|
81
|
+
/** Send DELETE request. */
|
|
82
82
|
static delete<T>(request: ApiFetch): Promise<T>;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
84
|
+
|
|
85
|
+
/** API response caching. */
|
|
87
86
|
export declare class ApiCache {
|
|
88
|
-
/** Initialize storage listeners. */
|
|
87
|
+
/** Initialize cache storage with listeners. */
|
|
89
88
|
static init(getListener: (key: string) => Promise<ApiCacheItem | undefined>, setListener: (key: string, value: ApiCacheItem) => Promise<boolean>, removeListener: (key: string) => Promise<boolean>, cacheStepAgeClearOld?: number): void;
|
|
90
|
-
/**
|
|
89
|
+
/** Clear all cache. */
|
|
91
90
|
static reset(): void;
|
|
92
|
-
/** Get
|
|
91
|
+
/** Get from cache by key. */
|
|
93
92
|
static get<T>(key: string): Promise<T | undefined>;
|
|
94
|
-
/** Get
|
|
93
|
+
/** Get from cache using fetch options. */
|
|
95
94
|
static getByFetch<T>(fetch: ApiFetch): Promise<T | undefined>;
|
|
96
|
-
/** Save
|
|
95
|
+
/** Save to cache. */
|
|
97
96
|
static set<T>(key: string, value: T, age?: number): Promise<void>;
|
|
98
|
-
/** Save
|
|
97
|
+
/** Save to cache using fetch options. */
|
|
99
98
|
static setByFetch<T>(fetch: ApiFetch, value: T): Promise<void>;
|
|
100
|
-
/** Remove
|
|
99
|
+
/** Remove from cache. */
|
|
101
100
|
static remove(key: string): Promise<void>;
|
|
102
101
|
}
|
|
102
|
+
|
|
103
|
+
/** Cached API item. */
|
|
103
104
|
export declare type ApiCacheItem<T = any> = {
|
|
104
105
|
value: T;
|
|
105
106
|
age?: number;
|
|
106
107
|
cacheAge: number;
|
|
107
108
|
};
|
|
109
|
+
|
|
110
|
+
/** Cache list record. */
|
|
108
111
|
export declare type ApiCacheList = Record<string, ApiCacheItem>;
|
|
112
|
+
|
|
113
|
+
/** API Configuration. */
|
|
109
114
|
export declare type ApiConfig = {
|
|
110
115
|
urlRoot?: string;
|
|
116
|
+
origin?: string;
|
|
111
117
|
headers?: Record<string, string>;
|
|
112
118
|
requestDefault?: Record<string, any>;
|
|
113
119
|
preparation?: (apiFetch: ApiFetch) => Promise<void>;
|
|
114
120
|
end?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
|
|
115
121
|
timeout?: number;
|
|
116
122
|
};
|
|
123
|
+
|
|
124
|
+
/** API data wrapper. */
|
|
117
125
|
export declare type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
|
|
126
|
+
|
|
127
|
+
/** API data item. */
|
|
118
128
|
export declare type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
119
129
|
data?: T;
|
|
120
130
|
success?: boolean;
|
|
121
131
|
statusObject?: ApiStatusItem;
|
|
122
132
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*/
|
|
133
|
+
|
|
134
|
+
/** Processes data from API request. */
|
|
126
135
|
export declare class ApiDataReturn<T = any> {
|
|
127
136
|
constructor(apiFetch: ApiFetch, query: Response, end: ApiPreparationEnd);
|
|
128
137
|
/** Read data from response. */
|
|
129
138
|
init(): Promise<this>;
|
|
130
139
|
/** Get processed data. */
|
|
131
140
|
get(): ApiData<T>;
|
|
132
|
-
/** Get data with status. */
|
|
141
|
+
/** Get processed data with status. */
|
|
133
142
|
getAndStatus(status: ApiStatus): ApiData<T>;
|
|
134
|
-
/** Get raw
|
|
143
|
+
/** Get raw API data. */
|
|
135
144
|
getData(): ApiData<T> | undefined;
|
|
136
145
|
}
|
|
146
|
+
|
|
147
|
+
/** API validation metadata. */
|
|
137
148
|
export declare type ApiDataValidation = {
|
|
138
149
|
status?: ApiStatusType;
|
|
139
150
|
code?: string | number;
|
|
140
151
|
message?: string;
|
|
141
152
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*/
|
|
153
|
+
|
|
154
|
+
/** Manages default request data. */
|
|
145
155
|
export declare class ApiDefault {
|
|
146
156
|
/** Check if default data exists. */
|
|
147
157
|
is(): boolean;
|
|
148
158
|
/** Get default data. */
|
|
149
159
|
get(): ApiDefaultValue | undefined;
|
|
150
|
-
/** Merge
|
|
160
|
+
/** Merge defaults into request. */
|
|
151
161
|
request(request: ApiFetch['request']): ApiFetch['request'];
|
|
152
|
-
/** Set
|
|
162
|
+
/** Set defaults. */
|
|
153
163
|
set(request: ApiDefaultValue): this;
|
|
154
164
|
}
|
|
165
|
+
|
|
166
|
+
/** Default API request data. */
|
|
155
167
|
export declare type ApiDefaultValue = Record<string, any>;
|
|
168
|
+
|
|
169
|
+
/** API fetch options. */
|
|
156
170
|
export declare type ApiFetch = {
|
|
157
171
|
api?: boolean;
|
|
158
172
|
path?: string;
|
|
@@ -180,53 +194,56 @@ export declare type ApiFetch = {
|
|
|
180
194
|
cacheId?: number | string;
|
|
181
195
|
endResetLimit?: number;
|
|
182
196
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*/
|
|
197
|
+
|
|
198
|
+
/** Manages HTTP headers. */
|
|
186
199
|
export declare class ApiHeaders {
|
|
187
200
|
/** Get merged headers. */
|
|
188
201
|
get(value?: Record<string, string> | null, type?: string | undefined | null): Record<string, string> | undefined;
|
|
189
|
-
/** Get headers based on request
|
|
202
|
+
/** Get headers based on request data. */
|
|
190
203
|
getByRequest(request: ApiFetch['request'], value?: Record<string, string> | null, type?: string): Record<string, string> | undefined;
|
|
191
204
|
/** Set default headers. */
|
|
192
205
|
set(headers: Record<string, string>): this;
|
|
193
206
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
*/
|
|
207
|
+
|
|
208
|
+
/** Collects API data for SSR hydration. */
|
|
197
209
|
export declare class ApiHydration {
|
|
198
|
-
/** Init response with hydration. */
|
|
210
|
+
/** Init response with hydration data. */
|
|
199
211
|
initResponse(response: ApiResponse): void;
|
|
200
212
|
/** Save response for client. */
|
|
201
213
|
toClient<T>(apiFetch: ApiFetch, response: T): void;
|
|
202
|
-
/**
|
|
214
|
+
/** Get hydration script string. */
|
|
203
215
|
toString(): string;
|
|
204
216
|
}
|
|
217
|
+
|
|
218
|
+
/** Hydration item. */
|
|
205
219
|
export declare type ApiHydrationItem = {
|
|
206
220
|
path: string;
|
|
207
221
|
method: ApiMethod;
|
|
208
222
|
request?: ApiFetch['request'];
|
|
209
223
|
response: any;
|
|
210
224
|
};
|
|
225
|
+
|
|
226
|
+
/** List of hydration items. */
|
|
211
227
|
export declare type ApiHydrationList = ApiHydrationItem[];
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*/
|
|
228
|
+
|
|
229
|
+
/** Core fetch manager. */
|
|
215
230
|
export declare class ApiInstance {
|
|
216
231
|
constructor(url?: string, options?: ApiInstanceOptions);
|
|
217
232
|
/** Check if localhost. */
|
|
218
233
|
isLocalhost(): boolean;
|
|
219
|
-
/** Get
|
|
234
|
+
/** Get last status. */
|
|
220
235
|
getStatus(): ApiStatus;
|
|
221
236
|
/** Get response handler. */
|
|
222
237
|
getResponse(): ApiResponse;
|
|
223
238
|
/** Get hydration handler. */
|
|
224
239
|
getHydration(): ApiHydration;
|
|
240
|
+
/** Get base origin. */
|
|
241
|
+
getOrigin(): string;
|
|
225
242
|
/** Get full script URL. */
|
|
226
243
|
getUrl(path: string, api?: boolean): string;
|
|
227
|
-
/** Get body
|
|
244
|
+
/** Get request body. */
|
|
228
245
|
getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
|
|
229
|
-
/** Get
|
|
246
|
+
/** Get query string for GET. */
|
|
230
247
|
getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
|
|
231
248
|
/** Get hydration script. */
|
|
232
249
|
getHydrationScript(): string;
|
|
@@ -236,25 +253,29 @@ export declare class ApiInstance {
|
|
|
236
253
|
setRequestDefault(request: Record<string, any>): this;
|
|
237
254
|
/** Set base URL. */
|
|
238
255
|
setUrl(url: string): this;
|
|
239
|
-
/** Set
|
|
256
|
+
/** Set pre-request hook. */
|
|
240
257
|
setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): this;
|
|
241
|
-
/** Set
|
|
258
|
+
/** Set post-request hook. */
|
|
242
259
|
setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
|
|
243
|
-
/** Set timeout
|
|
260
|
+
/** Set timeout. */
|
|
244
261
|
setTimeout(timeout: number): this;
|
|
262
|
+
/** Set origin. */
|
|
263
|
+
setOrigin(origin: string): this;
|
|
245
264
|
/** Execute request. */
|
|
246
265
|
request<T>(pathRequest: string | ApiFetch): Promise<T>;
|
|
247
|
-
/** GET
|
|
266
|
+
/** GET request. */
|
|
248
267
|
get<T>(request: ApiFetch): Promise<T>;
|
|
249
|
-
/** POST
|
|
268
|
+
/** POST request. */
|
|
250
269
|
post<T>(request: ApiFetch): Promise<T>;
|
|
251
|
-
/** PUT
|
|
270
|
+
/** PUT request. */
|
|
252
271
|
put<T>(request: ApiFetch): Promise<T>;
|
|
253
|
-
/** PATCH
|
|
272
|
+
/** PATCH request. */
|
|
254
273
|
patch<T>(request: ApiFetch): Promise<T>;
|
|
255
|
-
/** DELETE
|
|
274
|
+
/** DELETE request. */
|
|
256
275
|
delete<T>(request: ApiFetch): Promise<T>;
|
|
257
276
|
}
|
|
277
|
+
|
|
278
|
+
/** API instance configuration. */
|
|
258
279
|
export declare type ApiInstanceOptions = {
|
|
259
280
|
headersClass?: typeof ApiHeaders;
|
|
260
281
|
requestDefaultClass?: typeof ApiDefault;
|
|
@@ -265,7 +286,11 @@ export declare type ApiInstanceOptions = {
|
|
|
265
286
|
errorCenterClass?: ErrorCenterInstance;
|
|
266
287
|
hydrationClass?: typeof ApiHydration;
|
|
267
288
|
};
|
|
289
|
+
|
|
290
|
+
/** HTTP Method type. */
|
|
268
291
|
export declare type ApiMethod = string & ApiMethodItem;
|
|
292
|
+
|
|
293
|
+
/** Supported HTTP methods. */
|
|
269
294
|
export declare enum ApiMethodItem {
|
|
270
295
|
delete = "DELETE",
|
|
271
296
|
get = "GET",
|
|
@@ -273,39 +298,41 @@ export declare enum ApiMethodItem {
|
|
|
273
298
|
put = "PUT",
|
|
274
299
|
patch = "PATCH"
|
|
275
300
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
*/
|
|
301
|
+
|
|
302
|
+
/** Request preparation hooks. */
|
|
279
303
|
export declare class ApiPreparation {
|
|
280
|
-
/**
|
|
304
|
+
/** Run pre-request preparation. */
|
|
281
305
|
make(active: boolean, apiFetch: ApiFetch): Promise<void>;
|
|
282
|
-
/**
|
|
306
|
+
/** Run post-request analysis. */
|
|
283
307
|
makeEnd(active: boolean, query: Response, apiFetch: ApiFetch): Promise<ApiPreparationEnd>;
|
|
284
|
-
/** Set pre-request
|
|
308
|
+
/** Set pre-request callback. */
|
|
285
309
|
set(callback: (apiFetch: ApiFetch) => Promise<void>): this;
|
|
286
|
-
/** Set post-request
|
|
310
|
+
/** Set post-request callback. */
|
|
287
311
|
setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
|
|
288
312
|
}
|
|
313
|
+
|
|
314
|
+
/** Hook result. */
|
|
289
315
|
export declare type ApiPreparationEnd = {
|
|
290
316
|
reset?: boolean;
|
|
291
317
|
data?: any;
|
|
292
318
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
*/
|
|
319
|
+
|
|
320
|
+
/** Manages API response mocks and cache. */
|
|
296
321
|
export declare class ApiResponse {
|
|
297
322
|
constructor(requestDefault: ApiDefault);
|
|
298
|
-
/** Get cached
|
|
323
|
+
/** Get cached or global response. */
|
|
299
324
|
get(path: string | undefined, method: ApiMethod, request?: ApiFetch['request'], devMode?: boolean): ApiResponseItem | undefined;
|
|
300
325
|
/** Get list of cached responses. */
|
|
301
326
|
getList(): (ApiResponseItem & Record<string, any>)[];
|
|
302
|
-
/** Add response
|
|
327
|
+
/** Add response to cache. */
|
|
303
328
|
add(response: ApiResponseItem | ApiResponseItem[]): this;
|
|
304
|
-
/** Set
|
|
329
|
+
/** Set dev mode. */
|
|
305
330
|
setDevMode(devMode: boolean): this;
|
|
306
|
-
/** Run
|
|
331
|
+
/** Run emulator if available. */
|
|
307
332
|
emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
|
|
308
333
|
}
|
|
334
|
+
|
|
335
|
+
/** Mock descriptor. */
|
|
309
336
|
export declare type ApiResponseItem = {
|
|
310
337
|
path: string | RegExp;
|
|
311
338
|
method: ApiMethod;
|
|
@@ -315,9 +342,8 @@ export declare type ApiResponseItem = {
|
|
|
315
342
|
isForGlobal?: boolean;
|
|
316
343
|
lag?: any;
|
|
317
344
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*/
|
|
345
|
+
|
|
346
|
+
/** API status manager. */
|
|
321
347
|
export declare class ApiStatus {
|
|
322
348
|
/** Get status data. */
|
|
323
349
|
get(): ApiStatusItem | undefined;
|
|
@@ -327,7 +353,7 @@ export declare class ApiStatus {
|
|
|
327
353
|
getStatusText(): string | undefined;
|
|
328
354
|
/** Get status type. */
|
|
329
355
|
getStatusType(): ApiStatusType | undefined;
|
|
330
|
-
/** Get
|
|
356
|
+
/** Get result code. */
|
|
331
357
|
getCode(): string | undefined;
|
|
332
358
|
/** Get error message. */
|
|
333
359
|
getError(): string | undefined;
|
|
@@ -337,19 +363,21 @@ export declare class ApiStatus {
|
|
|
337
363
|
getMessage(): string;
|
|
338
364
|
/** Set status data. */
|
|
339
365
|
set(data: ApiStatusItem): this;
|
|
340
|
-
/** Set status
|
|
366
|
+
/** Set HTTP status. */
|
|
341
367
|
setStatus(status?: number, statusText?: string): this;
|
|
342
368
|
/** Set error message. */
|
|
343
369
|
setError(error?: string): this;
|
|
344
|
-
/** Set response data
|
|
370
|
+
/** Set last response data. */
|
|
345
371
|
setLastResponse(response?: any): this;
|
|
346
372
|
/** Set status type. */
|
|
347
373
|
setLastStatus(status?: ApiStatusType): this;
|
|
348
|
-
/** Set
|
|
374
|
+
/** Set execution code. */
|
|
349
375
|
setLastCode(code?: string): this;
|
|
350
|
-
/** Set
|
|
376
|
+
/** Set message. */
|
|
351
377
|
setLastMessage(message?: string): this;
|
|
352
378
|
}
|
|
379
|
+
|
|
380
|
+
/** Status record. */
|
|
353
381
|
export declare type ApiStatusItem = {
|
|
354
382
|
status?: number;
|
|
355
383
|
statusText?: string;
|
|
@@ -359,17 +387,21 @@ export declare type ApiStatusItem = {
|
|
|
359
387
|
lastCode?: string;
|
|
360
388
|
lastMessage?: string;
|
|
361
389
|
};
|
|
390
|
+
|
|
362
391
|
export declare type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
|
|
363
|
-
|
|
392
|
+
|
|
393
|
+
/** Template applier. */
|
|
364
394
|
export declare const applyTemplate: (text: string, replacement?: Record<string, string | number | boolean> | string[]) => string;
|
|
395
|
+
|
|
365
396
|
export declare type ArrayToItem<T> = T extends any[] ? T[number] : T;
|
|
366
|
-
|
|
397
|
+
|
|
398
|
+
/** Create filled array. */
|
|
367
399
|
export declare function arrFill<T>(value: T, count: number): T[];
|
|
368
|
-
|
|
400
|
+
|
|
401
|
+
/** Blob to Base64. */
|
|
369
402
|
export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
*/
|
|
403
|
+
|
|
404
|
+
/** BroadcastChannel manager. */
|
|
373
405
|
export declare class BroadcastMessage<Message = any> {
|
|
374
406
|
constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
|
|
375
407
|
/** Get BroadcastChannel instance. */
|
|
@@ -383,113 +415,120 @@ export declare class BroadcastMessage<Message = any> {
|
|
|
383
415
|
/** Close channel. */
|
|
384
416
|
destroy(): this;
|
|
385
417
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
* @deprecated Use modern caching solutions.
|
|
389
|
-
*/
|
|
418
|
+
|
|
419
|
+
/** Memory cache. @deprecated */
|
|
390
420
|
declare class Cache_2 {
|
|
391
421
|
/** Get or compute cached value. */
|
|
392
422
|
get<T>(name: string, callback: () => T, comparison?: any[]): T;
|
|
393
|
-
/** Get or compute cached value
|
|
423
|
+
/** Get or compute cached value async. */
|
|
394
424
|
getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
|
|
395
425
|
}
|
|
396
426
|
export { Cache_2 as Cache }
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
* @deprecated Use modern caching solutions.
|
|
400
|
-
*/
|
|
427
|
+
|
|
428
|
+
/** Cache item with dependencies. @deprecated */
|
|
401
429
|
export declare class CacheItem<T> {
|
|
402
430
|
constructor(callback: () => T);
|
|
403
|
-
/** Get cached value
|
|
431
|
+
/** Get cached value. */
|
|
404
432
|
getCache(comparison: any[]): T;
|
|
405
433
|
/** Get previous cached value. */
|
|
406
434
|
getCacheOld(): T | undefined;
|
|
407
|
-
/** Get cached value
|
|
435
|
+
/** Get cached value async. */
|
|
408
436
|
getCacheAsync(comparison: any[]): Promise<T>;
|
|
409
437
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
* @deprecated Use modern caching solutions.
|
|
413
|
-
*/
|
|
438
|
+
|
|
439
|
+
/** Persistent static cache. @deprecated */
|
|
414
440
|
export declare class CacheStatic {
|
|
415
441
|
/** Get cached value. */
|
|
416
442
|
static get<T>(name: string, callback: () => T, comparison?: any[]): T;
|
|
417
|
-
/** Get cached value
|
|
443
|
+
/** Get cached value async. */
|
|
418
444
|
static getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
|
|
419
445
|
}
|
|
420
|
-
|
|
446
|
+
|
|
447
|
+
/** Capitalize first letter. */
|
|
421
448
|
export declare function capitalize(value: string, isLocale?: boolean): string;
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
*/
|
|
449
|
+
|
|
450
|
+
/** Cookie manager. */
|
|
425
451
|
export declare class Cookie<T> {
|
|
426
|
-
static getInstance<T>(name: string): Cookie<unknown>;
|
|
427
452
|
constructor(name: string);
|
|
428
|
-
/** Get
|
|
453
|
+
/** Get instance by name. */
|
|
454
|
+
static getInstance<T>(name: string): Cookie<unknown>;
|
|
455
|
+
/** Get value or default. */
|
|
429
456
|
get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): string | T | undefined;
|
|
430
|
-
/** Set
|
|
457
|
+
/** Set value. */
|
|
431
458
|
set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
|
|
432
459
|
/** Remove cookie. */
|
|
433
460
|
remove(): void;
|
|
434
461
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
*/
|
|
462
|
+
|
|
463
|
+
/** Cookie blocking status. */
|
|
438
464
|
export declare class CookieBlock {
|
|
439
465
|
static getItem(): CookieBlockInstance;
|
|
440
466
|
static get(): boolean;
|
|
441
467
|
static set(value: boolean): void;
|
|
442
468
|
}
|
|
469
|
+
|
|
443
470
|
export declare class CookieBlockInstance {
|
|
444
471
|
get(): boolean;
|
|
445
472
|
set(value: boolean): void;
|
|
446
473
|
}
|
|
474
|
+
|
|
447
475
|
export declare type CookieOptions = {
|
|
448
476
|
age?: number;
|
|
449
477
|
sameSite?: CookieSameSite_2;
|
|
478
|
+
path?: string;
|
|
479
|
+
domain?: string;
|
|
480
|
+
secure?: boolean;
|
|
481
|
+
httpOnly?: boolean;
|
|
482
|
+
partitioned?: boolean;
|
|
450
483
|
arguments?: string[] | Record<string, string | number | boolean>;
|
|
451
484
|
};
|
|
485
|
+
|
|
452
486
|
declare type CookieSameSite_2 = 'strict' | 'lax';
|
|
453
487
|
export { CookieSameSite_2 as CookieSameSite }
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
*/
|
|
488
|
+
|
|
489
|
+
/** Cross-environment cookie storage. */
|
|
457
490
|
export declare class CookieStorage {
|
|
458
|
-
|
|
491
|
+
/** Set custom listeners. */
|
|
492
|
+
static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
|
|
493
|
+
/** Clear storage. */
|
|
459
494
|
static reset(): void;
|
|
460
|
-
/** Get
|
|
495
|
+
/** Get cookie value. */
|
|
461
496
|
static get<T>(name: string, defaultValue?: T | (() => T)): T | undefined;
|
|
462
|
-
/**
|
|
497
|
+
/** Set cookie value. */
|
|
463
498
|
static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
464
|
-
/** Remove
|
|
499
|
+
/** Remove cookie. */
|
|
465
500
|
static remove(name: string): void;
|
|
466
|
-
/**
|
|
501
|
+
/** Refresh from source. */
|
|
467
502
|
static update(): void;
|
|
468
503
|
}
|
|
504
|
+
|
|
469
505
|
/** Deep copy object. */
|
|
470
506
|
export declare function copyObject<T>(value: T): T;
|
|
471
|
-
|
|
507
|
+
|
|
508
|
+
/** Shallow copy with source merge. */
|
|
472
509
|
export declare function copyObjectLite<T, R = T>(value: T, source?: any): R;
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
* Storage wrapper for local/session storage with SSR isolation.
|
|
510
|
+
|
|
511
|
+
/** Create DOM element.
|
|
512
|
+
* @remarks Client-only. Returns undefined in SSR.
|
|
477
513
|
*/
|
|
514
|
+
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;
|
|
515
|
+
|
|
516
|
+
/** Local/Session storage wrapper. */
|
|
478
517
|
export declare class DataStorage<T> {
|
|
479
|
-
static setPrefix(newPrefix: string): void;
|
|
480
518
|
constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
|
|
519
|
+
static setPrefix(newPrefix: string): void;
|
|
481
520
|
/** Get data. */
|
|
482
521
|
get(defaultValue?: T | (() => T), cache?: number): T | undefined;
|
|
483
522
|
/** Set data. */
|
|
484
523
|
set(value?: T | (() => T)): T | undefined;
|
|
485
524
|
/** Remove data. */
|
|
486
525
|
remove(): this;
|
|
487
|
-
/** Sync
|
|
526
|
+
/** Sync data. */
|
|
488
527
|
update(): this;
|
|
489
528
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
* @remarks
|
|
529
|
+
|
|
530
|
+
/** Date manipulation utility.
|
|
531
|
+
* @remarks SSR unstable if initialized without specific date.
|
|
493
532
|
*/
|
|
494
533
|
export declare class Datetime {
|
|
495
534
|
constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
|
|
@@ -564,22 +603,29 @@ export declare class Datetime {
|
|
|
564
603
|
cloneDayNext(): Datetime;
|
|
565
604
|
cloneDayPrevious(): Datetime;
|
|
566
605
|
}
|
|
567
|
-
|
|
606
|
+
|
|
607
|
+
/** DOM query first element. */
|
|
568
608
|
export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
|
|
569
|
-
|
|
609
|
+
|
|
610
|
+
/** DOM query all elements. */
|
|
570
611
|
export declare function domQuerySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E> | undefined;
|
|
612
|
+
|
|
571
613
|
export declare type ElementOrString<E extends ElementOrWindow> = E | string;
|
|
614
|
+
|
|
572
615
|
export declare type ElementOrWindow = HTMLElement | Window;
|
|
616
|
+
|
|
573
617
|
export declare type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
|
|
574
|
-
|
|
618
|
+
|
|
619
|
+
/** Encode string for HTML attributes. */
|
|
575
620
|
export declare function encodeAttribute(text: string): string;
|
|
576
|
-
|
|
621
|
+
|
|
622
|
+
/** Simple HTML attribute encoding. */
|
|
577
623
|
export declare function encodeLiteAttribute(text: string): string;
|
|
578
|
-
|
|
624
|
+
|
|
625
|
+
/** Resize image if exceeds max size. */
|
|
579
626
|
export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
*/
|
|
627
|
+
|
|
628
|
+
/** Global error management. */
|
|
583
629
|
export declare class ErrorCenter {
|
|
584
630
|
static getItem(): ErrorCenterInstance;
|
|
585
631
|
static has(code: string, group?: string): boolean;
|
|
@@ -590,6 +636,7 @@ export declare class ErrorCenter {
|
|
|
590
636
|
static addHandlerList(handlers: ErrorCenterHandlerList): void;
|
|
591
637
|
static on(cause: ErrorCenterCauseItem): void;
|
|
592
638
|
}
|
|
639
|
+
|
|
593
640
|
export declare type ErrorCenterCauseItem = {
|
|
594
641
|
group?: ErrorCenterGroup;
|
|
595
642
|
code: string;
|
|
@@ -598,11 +645,12 @@ export declare type ErrorCenterCauseItem = {
|
|
|
598
645
|
message?: string;
|
|
599
646
|
details?: any;
|
|
600
647
|
};
|
|
648
|
+
|
|
601
649
|
export declare type ErrorCenterCauseList = ErrorCenterCauseItem[];
|
|
650
|
+
|
|
602
651
|
export declare type ErrorCenterGroup = string | undefined;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
*/
|
|
652
|
+
|
|
653
|
+
/** Registry for error handlers. */
|
|
606
654
|
export declare class ErrorCenterHandler {
|
|
607
655
|
constructor(handlers?: ErrorCenterHandlerList);
|
|
608
656
|
has(group: ErrorCenterGroup): boolean;
|
|
@@ -611,15 +659,17 @@ export declare class ErrorCenterHandler {
|
|
|
611
659
|
addList(handlers: ErrorCenterHandlerList): this;
|
|
612
660
|
on(cause: ErrorCenterCauseItem): this;
|
|
613
661
|
}
|
|
662
|
+
|
|
614
663
|
export declare type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
|
|
664
|
+
|
|
615
665
|
export declare type ErrorCenterHandlerItem = {
|
|
616
666
|
group?: ErrorCenterGroup;
|
|
617
667
|
handlers: ErrorCenterHandlerCallback[];
|
|
618
668
|
};
|
|
669
|
+
|
|
619
670
|
export declare type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
*/
|
|
671
|
+
|
|
672
|
+
/** Error context instance. */
|
|
623
673
|
export declare class ErrorCenterInstance {
|
|
624
674
|
constructor(causes?: ErrorCenterCauseList, handler?: ErrorCenterHandler);
|
|
625
675
|
has(code: string, group?: string): boolean;
|
|
@@ -630,17 +680,18 @@ export declare class ErrorCenterInstance {
|
|
|
630
680
|
addHandlerList(handlers: ErrorCenterHandlerList): this;
|
|
631
681
|
on(cause: ErrorCenterCauseItem): this;
|
|
632
682
|
}
|
|
633
|
-
|
|
683
|
+
|
|
684
|
+
/** Escape string for RegExp. */
|
|
634
685
|
export declare function escapeExp(value: string): string;
|
|
686
|
+
|
|
635
687
|
export declare type EventActivityItem<E extends ElementOrWindow> = {
|
|
636
688
|
element: E | undefined;
|
|
637
689
|
type: string;
|
|
638
690
|
listener?: (event: any | Event) => void;
|
|
639
691
|
observer?: ResizeObserver;
|
|
640
692
|
};
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
*/
|
|
693
|
+
|
|
694
|
+
/** Lifecycle-controlled event listener wrapper. */
|
|
644
695
|
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> {
|
|
645
696
|
constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
|
|
646
697
|
isActive(): boolean;
|
|
@@ -657,37 +708,39 @@ export declare class EventItem<E extends ElementOrWindow, O extends Event, D ext
|
|
|
657
708
|
toggle(activity: boolean): this;
|
|
658
709
|
reset(): this;
|
|
659
710
|
}
|
|
711
|
+
|
|
660
712
|
export declare type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
|
|
713
|
+
|
|
661
714
|
export declare type EventOptions = AddEventListenerOptions | boolean | undefined;
|
|
715
|
+
|
|
662
716
|
/** Stop event propagation. */
|
|
663
717
|
export declare function eventStopPropagation(event: Event): void;
|
|
664
|
-
|
|
718
|
+
|
|
719
|
+
/** Execute value as function if applicable. */
|
|
665
720
|
export declare function executeFunction<T>(callback: T | FunctionArgs<any, T>, ...args: any[]): T;
|
|
666
|
-
|
|
721
|
+
|
|
722
|
+
/** Execute async or sync function. */
|
|
667
723
|
export declare function executePromise<T>(callback: ((...args: any[]) => Promise<T>) | ((...args: any[]) => T) | T, ...args: any[]): Promise<T>;
|
|
668
|
-
|
|
724
|
+
|
|
725
|
+
/** Iterate object/array and map results. */
|
|
669
726
|
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[];
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
*/
|
|
727
|
+
|
|
728
|
+
/** Data list formatter. */
|
|
673
729
|
export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
|
|
674
730
|
constructor(options: Options, list?: List | undefined);
|
|
675
731
|
is(): boolean;
|
|
676
|
-
isArray(): this is this & {
|
|
677
|
-
list: FormattersList<Item>;
|
|
678
|
-
};
|
|
732
|
+
isArray(): this is this & { list: FormattersList<Item>; };
|
|
679
733
|
length(): number;
|
|
680
734
|
getList(): FormattersList<Item>;
|
|
681
735
|
getOptions(): Options;
|
|
682
736
|
setList(list?: List): this;
|
|
683
|
-
/**
|
|
737
|
+
/** Formats data and appends 'Format' properties. */
|
|
684
738
|
to(): FormattersReturn<List, Options>;
|
|
685
739
|
}
|
|
740
|
+
|
|
686
741
|
export declare type FormattersCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<FormattersCapitalize<Rest>>}` : K;
|
|
687
742
|
export declare type FormattersColumns<T extends FormattersOptionsList> = (keyof T & string)[];
|
|
688
|
-
export declare type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = {
|
|
689
|
-
[K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string;
|
|
690
|
-
};
|
|
743
|
+
export declare type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = { [K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string; };
|
|
691
744
|
export declare type FormattersItemProp<List extends FormattersListProp> = ArrayToItem<List>;
|
|
692
745
|
export declare type FormattersKey<K, A extends string = 'Format'> = K extends string ? `${FormattersCapitalize<K>}${A}` : never;
|
|
693
746
|
export declare type FormattersList<Item extends FormattersListItem> = Item[];
|
|
@@ -696,41 +749,18 @@ export declare type FormattersListColumns<T extends FormattersListItem, O extend
|
|
|
696
749
|
export declare type FormattersListFormat<T extends FormattersListItem, K extends string[]> = FormattersDataItem<T, K>[];
|
|
697
750
|
export declare type FormattersListItem = Record<string, any>;
|
|
698
751
|
export declare type FormattersListProp = FormattersList<FormattersListItem> | FormattersListItem;
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
numberOnly?: boolean;
|
|
703
|
-
};
|
|
704
|
-
export declare type FormattersOptionsDate = {
|
|
705
|
-
type?: GeoDate;
|
|
706
|
-
options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions;
|
|
707
|
-
hour24?: boolean;
|
|
708
|
-
};
|
|
752
|
+
|
|
753
|
+
export declare type FormattersOptionsCurrency = { currencyPropName?: string; options?: string | Intl.NumberFormatOptions; numberOnly?: boolean; };
|
|
754
|
+
export declare type FormattersOptionsDate = { type?: GeoDate; options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions; hour24?: boolean; };
|
|
709
755
|
export declare 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>;
|
|
710
|
-
export declare type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = {
|
|
711
|
-
type?: Type;
|
|
712
|
-
transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R;
|
|
713
|
-
options?: FormattersOptionsInformation<Type>;
|
|
714
|
-
};
|
|
756
|
+
export declare type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = { type?: Type; transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R; options?: FormattersOptionsInformation<Type>; };
|
|
715
757
|
export declare type FormattersOptionsList = Record<string, FormattersOptionsItem>;
|
|
716
|
-
export declare type FormattersOptionsName = {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
short?: boolean;
|
|
721
|
-
};
|
|
722
|
-
export declare type FormattersOptionsNumber = {
|
|
723
|
-
options?: Intl.NumberFormatOptions;
|
|
724
|
-
};
|
|
725
|
-
export declare type FormattersOptionsPlural = {
|
|
726
|
-
words: string;
|
|
727
|
-
options?: Intl.PluralRulesOptions;
|
|
728
|
-
optionsNumber?: Intl.NumberFormatOptions;
|
|
729
|
-
};
|
|
730
|
-
export declare type FormattersOptionsUnit = {
|
|
731
|
-
unit: string | Intl.NumberFormatOptions;
|
|
732
|
-
};
|
|
758
|
+
export declare type FormattersOptionsName = { lastPropName?: string; firstPropName?: string; surname?: string; short?: boolean; };
|
|
759
|
+
export declare type FormattersOptionsNumber = { options?: Intl.NumberFormatOptions; };
|
|
760
|
+
export declare type FormattersOptionsPlural = { words: string; options?: Intl.PluralRulesOptions; optionsNumber?: Intl.NumberFormatOptions; };
|
|
761
|
+
export declare type FormattersOptionsUnit = { unit: string | Intl.NumberFormatOptions; };
|
|
733
762
|
export declare 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);
|
|
763
|
+
|
|
734
764
|
export declare enum FormattersType {
|
|
735
765
|
currency = "currency",
|
|
736
766
|
date = "date",
|
|
@@ -739,15 +769,16 @@ export declare enum FormattersType {
|
|
|
739
769
|
plural = "plural",
|
|
740
770
|
unit = "unit"
|
|
741
771
|
}
|
|
772
|
+
|
|
742
773
|
/** Cyclic requestAnimationFrame. */
|
|
743
774
|
export declare function frame(callback: () => void, next?: () => boolean, end?: () => void): void;
|
|
775
|
+
|
|
744
776
|
export declare type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
|
|
745
777
|
export declare type FunctionArgs<T, R> = (...args: T[]) => R;
|
|
746
778
|
export declare type FunctionReturn<R = any> = () => R;
|
|
747
779
|
export declare type FunctionVoid = () => void;
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
*/
|
|
780
|
+
|
|
781
|
+
/** Geographical data manager. */
|
|
751
782
|
export declare class Geo {
|
|
752
783
|
static getObject(): GeoInstance;
|
|
753
784
|
static get(): GeoItemFull;
|
|
@@ -769,12 +800,13 @@ export declare class Geo {
|
|
|
769
800
|
static set(code: string, save?: boolean): void;
|
|
770
801
|
static setTimezone(timezone: number): void;
|
|
771
802
|
}
|
|
803
|
+
|
|
772
804
|
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
805
|
+
|
|
773
806
|
export declare type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
|
|
774
807
|
export declare type GeoFirstDay = 1 | 6 | 0;
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
*/
|
|
808
|
+
|
|
809
|
+
/** Flag and country info. */
|
|
778
810
|
export declare class GeoFlag {
|
|
779
811
|
static flags: Record<string, string>;
|
|
780
812
|
constructor(code?: string);
|
|
@@ -784,6 +816,7 @@ export declare class GeoFlag {
|
|
|
784
816
|
getNational(codes?: string[]): GeoFlagNational[];
|
|
785
817
|
setCode(code: string): this;
|
|
786
818
|
}
|
|
819
|
+
|
|
787
820
|
export declare interface GeoFlagItem {
|
|
788
821
|
language: string;
|
|
789
822
|
country: string;
|
|
@@ -792,15 +825,16 @@ export declare interface GeoFlagItem {
|
|
|
792
825
|
label: string;
|
|
793
826
|
value: string;
|
|
794
827
|
}
|
|
828
|
+
|
|
795
829
|
export declare interface GeoFlagNational extends GeoFlagItem {
|
|
796
830
|
description: string;
|
|
797
831
|
nationalLanguage: string;
|
|
798
832
|
nationalCountry: string;
|
|
799
833
|
}
|
|
834
|
+
|
|
800
835
|
export declare type GeoHours = '12' | '24';
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
*/
|
|
836
|
+
|
|
837
|
+
/** Geo context instance. */
|
|
804
838
|
export declare class GeoInstance {
|
|
805
839
|
constructor();
|
|
806
840
|
get(): GeoItemFull;
|
|
@@ -822,9 +856,8 @@ export declare class GeoInstance {
|
|
|
822
856
|
set(code: string, save?: boolean): void;
|
|
823
857
|
setTimezone(timezone: number): void;
|
|
824
858
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
*/
|
|
859
|
+
|
|
860
|
+
/** Internationalization API wrapper. */
|
|
828
861
|
export declare class GeoIntl {
|
|
829
862
|
static isItem(code?: string): boolean;
|
|
830
863
|
static getLocation(code?: string): string;
|
|
@@ -856,6 +889,7 @@ export declare class GeoIntl {
|
|
|
856
889
|
time(value: NumberOrStringOrDate): string;
|
|
857
890
|
sort<T>(data: T[], compareFn?: (a: T, b: T) => [string, string]): T[];
|
|
858
891
|
}
|
|
892
|
+
|
|
859
893
|
export declare interface GeoItem {
|
|
860
894
|
country: string;
|
|
861
895
|
countryAlternative?: string[];
|
|
@@ -868,13 +902,13 @@ export declare interface GeoItem {
|
|
|
868
902
|
phoneMask?: string | string[];
|
|
869
903
|
nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
|
|
870
904
|
}
|
|
905
|
+
|
|
871
906
|
export declare interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
872
907
|
standard: string;
|
|
873
908
|
firstDay: string;
|
|
874
909
|
}
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
*/
|
|
910
|
+
|
|
911
|
+
/** Phone mask and country code info. */
|
|
878
912
|
export declare class GeoPhone {
|
|
879
913
|
static get(code: string): GeoPhoneValue | undefined;
|
|
880
914
|
static getByPhone(phone: string): GeoPhoneMapInfo;
|
|
@@ -884,6 +918,7 @@ export declare class GeoPhone {
|
|
|
884
918
|
static toMask(phone: string, masks?: string[]): string | undefined;
|
|
885
919
|
static removeZero(phone: string): string;
|
|
886
920
|
}
|
|
921
|
+
|
|
887
922
|
export declare interface GeoPhoneMap {
|
|
888
923
|
items: GeoPhoneValue[];
|
|
889
924
|
info: GeoPhoneValue | undefined;
|
|
@@ -892,102 +927,131 @@ export declare interface GeoPhoneMap {
|
|
|
892
927
|
maskFull: string[];
|
|
893
928
|
next: Record<string, GeoPhoneMap>;
|
|
894
929
|
}
|
|
930
|
+
|
|
895
931
|
export declare interface GeoPhoneMapInfo {
|
|
896
932
|
item?: GeoPhoneMap;
|
|
897
933
|
phone?: string;
|
|
898
934
|
}
|
|
935
|
+
|
|
899
936
|
export declare interface GeoPhoneValue {
|
|
900
937
|
phone: number;
|
|
901
938
|
within: number;
|
|
902
939
|
mask: string[];
|
|
903
940
|
value: string;
|
|
904
941
|
}
|
|
942
|
+
|
|
905
943
|
export declare type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
|
|
906
|
-
|
|
944
|
+
|
|
945
|
+
/** Split string for highlight rendering. */
|
|
907
946
|
export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
|
|
947
|
+
|
|
908
948
|
/** Get element attributes. */
|
|
909
949
|
export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
|
|
950
|
+
|
|
910
951
|
/** Get clipboard text. */
|
|
911
952
|
export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
|
|
912
|
-
|
|
953
|
+
|
|
954
|
+
/** Get values of a specific column. */
|
|
913
955
|
export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>, column: K): (T[K] | undefined)[];
|
|
914
|
-
|
|
956
|
+
|
|
957
|
+
/** Get current formatted date.
|
|
958
|
+
* @remarks Client-only for SSR stability.
|
|
959
|
+
*/
|
|
915
960
|
export declare function getCurrentDate(format?: GeoDate): string;
|
|
916
|
-
|
|
961
|
+
|
|
962
|
+
/** Get timestamp. @remarks SSR warning: hydration mismatch likely. */
|
|
917
963
|
export declare function getCurrentTime(): number;
|
|
918
|
-
|
|
964
|
+
|
|
965
|
+
/** Get element by selector. */
|
|
919
966
|
export declare function getElement<E extends ElementOrWindow, R extends Exclude<E, Window>>(element?: ElementOrString<E>): R | undefined;
|
|
920
|
-
|
|
967
|
+
|
|
968
|
+
/** Get or generate element ID. */
|
|
921
969
|
export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
|
|
922
|
-
|
|
970
|
+
|
|
971
|
+
/** Get HTMLImageElement from source. */
|
|
923
972
|
export declare function getElementImage(image: HTMLImageElement | string): HTMLImageElement | undefined;
|
|
924
|
-
|
|
973
|
+
|
|
974
|
+
/** Get element property value. */
|
|
925
975
|
export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>, index: K | string, defaultValue?: D): T[K] | D | undefined;
|
|
926
|
-
|
|
976
|
+
|
|
927
977
|
export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
|
|
928
|
-
|
|
978
|
+
|
|
979
|
+
/** Generate hydration script tag. */
|
|
929
980
|
export declare function getElementSafeScript(id: string, data: any): string;
|
|
930
|
-
|
|
981
|
+
|
|
982
|
+
/** Exact phrase RegExp. */
|
|
931
983
|
export declare function getExactSearchExp(search: string): RegExp;
|
|
932
|
-
|
|
984
|
+
|
|
985
|
+
/** Pattern-based RegExp creator. */
|
|
933
986
|
export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
|
|
934
|
-
|
|
987
|
+
|
|
988
|
+
/** Parse hydration JSON from script tag. */
|
|
935
989
|
export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
|
|
936
|
-
|
|
990
|
+
|
|
991
|
+
/** Get value from object by path. */
|
|
937
992
|
export declare function getItemByPath<T extends Record<string, any>, R = string>(item: T, path: string): R | undefined;
|
|
938
|
-
|
|
993
|
+
|
|
994
|
+
/** Get KeyboardEvent key. */
|
|
939
995
|
export declare function getKey(event: KeyboardEvent): string;
|
|
940
|
-
|
|
996
|
+
|
|
941
997
|
export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
|
|
942
|
-
|
|
998
|
+
|
|
943
999
|
export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
|
|
944
|
-
|
|
1000
|
+
|
|
945
1001
|
export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
|
|
946
|
-
|
|
1002
|
+
|
|
1003
|
+
/** Get mouse/touch coordinates. */
|
|
947
1004
|
export declare function getMouseClient(event: MouseEvent & TouchEvent): ImageCoordinator;
|
|
948
|
-
/** Mouse X coordinate. */
|
|
949
1005
|
export declare function getMouseClientX(event: MouseEvent & TouchEvent): number;
|
|
950
|
-
/** Mouse Y coordinate. */
|
|
951
1006
|
export declare function getMouseClientY(event: MouseEvent & TouchEvent): number;
|
|
952
|
-
|
|
1007
|
+
|
|
1008
|
+
/** Pick object keys. */
|
|
953
1009
|
export declare function getObjectByKeys<T extends Record<string, any>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
|
|
954
|
-
|
|
1010
|
+
|
|
1011
|
+
/** Remove properties by value. */
|
|
955
1012
|
export declare function getObjectNoUndefined<T extends Record<string | number, any>>(data: T, exception?: any): T;
|
|
1013
|
+
|
|
956
1014
|
/** Ensure value is object. */
|
|
957
1015
|
export declare function getObjectOrNone<T>(value: T): T & Record<string, any>;
|
|
958
|
-
|
|
1016
|
+
|
|
1017
|
+
/** Strip non-alphanumeric. */
|
|
959
1018
|
export declare function getOnlyText(text: any): string;
|
|
960
|
-
|
|
1019
|
+
|
|
1020
|
+
/** Random text generator. */
|
|
961
1021
|
export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
|
|
962
|
-
|
|
1022
|
+
|
|
1023
|
+
/** Convert object to key-value string. */
|
|
963
1024
|
export declare function getRequestString(request: Record<string, any> | any[], sign?: string, separator?: string, subKey?: string): string;
|
|
964
|
-
|
|
1025
|
+
|
|
1026
|
+
/** Multi-word search RegExp. */
|
|
965
1027
|
export declare function getSearchExp(search: string, limit?: number): RegExp;
|
|
966
|
-
|
|
1028
|
+
|
|
1029
|
+
/** Word-separating search RegExp. */
|
|
967
1030
|
export declare function getSeparatingSearchExp(search: string | RegExp, limit?: number): RegExp;
|
|
968
|
-
|
|
1031
|
+
|
|
969
1032
|
export declare function getStepPercent(min: number | undefined, max: number): number;
|
|
970
|
-
|
|
1033
|
+
|
|
971
1034
|
export declare function getStepValue(min: number | undefined, max: number): number;
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
*/
|
|
1035
|
+
|
|
1036
|
+
/** Application-wide global storage. */
|
|
975
1037
|
export declare class Global {
|
|
976
1038
|
static getItem(): Record<string, any>;
|
|
977
1039
|
static get<R = any>(name: string): R;
|
|
978
1040
|
static add(data: Record<string, any>): void;
|
|
979
1041
|
}
|
|
980
|
-
|
|
1042
|
+
|
|
1043
|
+
/** Scroll container to element. */
|
|
981
1044
|
export declare function goScroll(selector: string, elementTo: HTMLElement | undefined, elementCenter?: HTMLElement): void;
|
|
1045
|
+
|
|
982
1046
|
/** Smooth scroll to element. */
|
|
983
1047
|
export declare function goScrollSmooth<E extends HTMLElement>(element: E, options?: ScrollIntoViewOptions, shift?: number): void;
|
|
984
|
-
|
|
1048
|
+
|
|
985
1049
|
export declare function goScrollTo(element?: HTMLElement, elementTo?: HTMLElement, behavior?: ScrollBehavior): void;
|
|
1050
|
+
|
|
986
1051
|
/** Web Share API wrapper. */
|
|
987
1052
|
export declare function handleShare(data: ShareData): Promise<boolean>;
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
*/
|
|
1053
|
+
|
|
1054
|
+
/** URL Hash storage. */
|
|
991
1055
|
export declare class Hash {
|
|
992
1056
|
static getItem(): HashInstance;
|
|
993
1057
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
@@ -996,6 +1060,8 @@ export declare class Hash {
|
|
|
996
1060
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
997
1061
|
static reload(): void;
|
|
998
1062
|
}
|
|
1063
|
+
|
|
1064
|
+
/** Hash state instance. */
|
|
999
1065
|
export declare class HashInstance {
|
|
1000
1066
|
get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
1001
1067
|
set<T>(name: string, callback: T | (() => T)): this;
|
|
@@ -1003,16 +1069,17 @@ export declare class HashInstance {
|
|
|
1003
1069
|
removeWatch<T>(name: string, callback: (value: T) => void): this;
|
|
1004
1070
|
reload(): this;
|
|
1005
1071
|
}
|
|
1072
|
+
|
|
1006
1073
|
export declare type HighlightMatchItem = {
|
|
1007
1074
|
text: string;
|
|
1008
1075
|
isMatch: boolean;
|
|
1009
1076
|
};
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
*/
|
|
1077
|
+
|
|
1078
|
+
/** Icon registry and loader. */
|
|
1013
1079
|
export declare class Icons {
|
|
1014
1080
|
static is(index: string): boolean;
|
|
1015
1081
|
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
1082
|
+
static getAsync(index: string, url?: string): string;
|
|
1016
1083
|
static getNameList(): string[];
|
|
1017
1084
|
static getUrlGlobal(): string;
|
|
1018
1085
|
static add(index: string, file: IconsItem): void;
|
|
@@ -1022,85 +1089,88 @@ export declare class Icons {
|
|
|
1022
1089
|
static setUrl(url: string): void;
|
|
1023
1090
|
static setConfig(config: IconsConfig): void;
|
|
1024
1091
|
}
|
|
1092
|
+
|
|
1025
1093
|
export declare type IconsConfig = {
|
|
1026
1094
|
url?: string;
|
|
1027
1095
|
list?: Record<string, IconsItem>;
|
|
1028
1096
|
};
|
|
1097
|
+
|
|
1029
1098
|
export declare type IconsItem = string | Promise<string | any> | (() => Promise<string | any>);
|
|
1099
|
+
|
|
1030
1100
|
export declare type ImageCoordinator = {
|
|
1031
1101
|
x: number;
|
|
1032
1102
|
y: number;
|
|
1033
1103
|
};
|
|
1034
|
-
|
|
1104
|
+
|
|
1035
1105
|
export declare function inArray<T>(array: T[], value: T): boolean;
|
|
1036
|
-
|
|
1106
|
+
|
|
1107
|
+
/** Init element ID listener for SSR context. */
|
|
1037
1108
|
export declare function initGetElementId(newListener: () => string | number): void;
|
|
1038
|
-
|
|
1109
|
+
|
|
1039
1110
|
export declare function initScrollbarOffset(): Promise<void>;
|
|
1040
|
-
|
|
1111
|
+
|
|
1112
|
+
/** Compute key intersection. */
|
|
1041
1113
|
export declare function intersectKey<T, KT extends keyof T, C, KC extends keyof C>(data?: T, comparison?: C): Record<KT & KC, T[KT]>;
|
|
1042
|
-
|
|
1114
|
+
|
|
1115
|
+
/** Check API success flag. */
|
|
1043
1116
|
export declare const isApiSuccess: <T>(data: ApiData<T>) => boolean;
|
|
1044
|
-
|
|
1117
|
+
|
|
1045
1118
|
export declare function isArray<T, R>(value: T): value is Extract<T, R[]>;
|
|
1046
|
-
|
|
1119
|
+
|
|
1047
1120
|
export declare function isDifferent<T>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
|
|
1048
|
-
|
|
1121
|
+
|
|
1049
1122
|
export declare function isDomData(): boolean;
|
|
1050
|
-
|
|
1123
|
+
|
|
1124
|
+
/** Check for window object. */
|
|
1051
1125
|
export declare function isDomRuntime(): boolean;
|
|
1052
|
-
|
|
1126
|
+
|
|
1127
|
+
/** Check element visibility (not display: none). */
|
|
1053
1128
|
export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
|
|
1054
|
-
|
|
1129
|
+
|
|
1130
|
+
/** Check Enter/Space key. */
|
|
1055
1131
|
export declare const isEnter: (event: KeyboardEvent, isInputElement?: boolean) => boolean;
|
|
1056
|
-
|
|
1132
|
+
|
|
1133
|
+
/** Check if value is not empty. */
|
|
1057
1134
|
export declare function isFilled<T>(value: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
|
|
1058
|
-
|
|
1135
|
+
|
|
1059
1136
|
export declare function isFloat(value: any): boolean;
|
|
1060
|
-
|
|
1137
|
+
|
|
1061
1138
|
export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionArgs<any, any>>;
|
|
1062
|
-
|
|
1139
|
+
|
|
1140
|
+
/** Check if element is in DOM. */
|
|
1063
1141
|
export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
|
|
1064
|
-
|
|
1142
|
+
|
|
1143
|
+
/** Check if input/editable element. */
|
|
1065
1144
|
export declare const isInput: (element: HTMLElement | EventTarget | null) => boolean;
|
|
1066
|
-
|
|
1145
|
+
|
|
1067
1146
|
export declare function isIntegerBetween(value: number, between: number): boolean;
|
|
1068
|
-
|
|
1147
|
+
|
|
1069
1148
|
export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
|
|
1070
|
-
|
|
1149
|
+
|
|
1071
1150
|
export declare function isNumber(value: any): boolean;
|
|
1072
|
-
|
|
1151
|
+
|
|
1073
1152
|
export declare function isObject<T>(value: T): value is Extract<T, Record<any, any>>;
|
|
1074
|
-
|
|
1153
|
+
|
|
1075
1154
|
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, Record<any, any>>, any[] | undefined | null>;
|
|
1076
|
-
|
|
1155
|
+
|
|
1077
1156
|
export declare function isOnLine(): boolean;
|
|
1078
|
-
|
|
1157
|
+
|
|
1079
1158
|
export declare function isSelected<T, S>(value: T, selected: T | T[] | S): boolean;
|
|
1080
|
-
|
|
1159
|
+
|
|
1081
1160
|
export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
|
|
1082
|
-
|
|
1161
|
+
|
|
1083
1162
|
export declare function isShare(): boolean;
|
|
1084
|
-
|
|
1163
|
+
|
|
1085
1164
|
export declare function isString<T>(value: T): value is Extract<T, string>;
|
|
1086
|
-
|
|
1165
|
+
|
|
1087
1166
|
export declare function isWindow<E>(element: E): element is Extract<E, Window>;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
value: V;
|
|
1091
|
-
};
|
|
1167
|
+
|
|
1168
|
+
export declare type Item<V> = { index: string; value: V; };
|
|
1092
1169
|
export declare type ItemList<T = any> = Record<string, T>;
|
|
1093
|
-
export declare type ItemName<V> = {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
export declare type ItemValue<V> = {
|
|
1098
|
-
label: string;
|
|
1099
|
-
value: V;
|
|
1100
|
-
};
|
|
1101
|
-
/**
|
|
1102
|
-
* Global loading tracking.
|
|
1103
|
-
*/
|
|
1170
|
+
export declare type ItemName<V> = { name: string | number; value: V; };
|
|
1171
|
+
export declare type ItemValue<V> = { label: string; value: V; };
|
|
1172
|
+
|
|
1173
|
+
/** Global loading indicator. */
|
|
1104
1174
|
export declare class Loading {
|
|
1105
1175
|
static is(): boolean;
|
|
1106
1176
|
static get(): number;
|
|
@@ -1110,9 +1180,10 @@ export declare class Loading {
|
|
|
1110
1180
|
static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1111
1181
|
static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1112
1182
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1183
|
+
|
|
1184
|
+
export declare type LoadingDetail = { loading: boolean; };
|
|
1185
|
+
|
|
1186
|
+
/** Loader context instance. */
|
|
1116
1187
|
export declare class LoadingInstance {
|
|
1117
1188
|
constructor(eventName?: string);
|
|
1118
1189
|
is(): boolean;
|
|
@@ -1122,14 +1193,14 @@ export declare class LoadingInstance {
|
|
|
1122
1193
|
registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1123
1194
|
unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1124
1195
|
}
|
|
1196
|
+
|
|
1125
1197
|
export declare type LoadingRegistrationItem = {
|
|
1126
1198
|
item: EventItem<Window, CustomEvent, LoadingDetail>;
|
|
1127
1199
|
listener: EventListenerDetail<CustomEvent, LoadingDetail>;
|
|
1128
1200
|
element?: ElementOrString<HTMLElement>;
|
|
1129
1201
|
};
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
*/
|
|
1202
|
+
|
|
1203
|
+
/** Unified SEO Meta tag manager. */
|
|
1133
1204
|
export declare class Meta extends MetaManager<MetaTag[]> {
|
|
1134
1205
|
constructor();
|
|
1135
1206
|
getOg(): MetaOg;
|
|
@@ -1154,10 +1225,12 @@ export declare class Meta extends MetaManager<MetaTag[]> {
|
|
|
1154
1225
|
setLocale(locale: string): this;
|
|
1155
1226
|
setSuffix(suffix?: string): void;
|
|
1156
1227
|
html(): string;
|
|
1228
|
+
htmlTitle(): string;
|
|
1157
1229
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1230
|
+
|
|
1231
|
+
export declare type MetaList<T extends readonly string[]> = { [K in T[number]]?: string; };
|
|
1232
|
+
|
|
1233
|
+
/** Meta tag base manager. */
|
|
1161
1234
|
export declare class MetaManager<T extends readonly string[], Key extends keyof MetaList<T> = keyof MetaList<T>> {
|
|
1162
1235
|
constructor(listMeta: T, isProperty?: boolean);
|
|
1163
1236
|
getListMeta(): T;
|
|
@@ -1167,7 +1240,8 @@ export declare class MetaManager<T extends readonly string[], Key extends keyof
|
|
|
1167
1240
|
set(name: Key, content: string): this;
|
|
1168
1241
|
setByList(metaList: MetaList<T>): this;
|
|
1169
1242
|
}
|
|
1170
|
-
|
|
1243
|
+
|
|
1244
|
+
/** Open Graph manager. */
|
|
1171
1245
|
export declare class MetaOg extends MetaManager<MetaOpenGraphTag[]> {
|
|
1172
1246
|
constructor();
|
|
1173
1247
|
getTitle(): string;
|
|
@@ -1185,6 +1259,13 @@ export declare class MetaOg extends MetaManager<MetaOpenGraphTag[]> {
|
|
|
1185
1259
|
setLocale(locale: string): this;
|
|
1186
1260
|
setSiteName(siteName: string): this;
|
|
1187
1261
|
}
|
|
1262
|
+
|
|
1263
|
+
export declare enum MetaOpenGraphAge { newborn = "newborn", infant = "infant", toddler = "toddler", kids = "kids", adult = "adult" }
|
|
1264
|
+
export declare enum MetaOpenGraphAvailability { inStock = "in stock", outOfStock = "out of stock", preorder = "preorder", backorder = "backorder", discontinued = "discontinued", pending = "pending" }
|
|
1265
|
+
export declare enum MetaOpenGraphCondition { new = "new", used = "used", refurbished = "refurbished" }
|
|
1266
|
+
export declare enum MetaOpenGraphGender { female = "female", male = "male", unisex = "unisex" }
|
|
1267
|
+
|
|
1268
|
+
/** Common OG tags. */
|
|
1188
1269
|
export declare enum MetaOpenGraphTag {
|
|
1189
1270
|
title = "og:title",
|
|
1190
1271
|
type = "og:type",
|
|
@@ -1193,73 +1274,17 @@ export declare enum MetaOpenGraphTag {
|
|
|
1193
1274
|
description = "og:description",
|
|
1194
1275
|
locale = "og:locale",
|
|
1195
1276
|
siteName = "og:site_name",
|
|
1196
|
-
localeAlternate = "og:locale:alternate",
|
|
1197
1277
|
imageUrl = "og:image:url",
|
|
1198
1278
|
imageSecureUrl = "og:image:secure_url",
|
|
1199
1279
|
imageType = "og:image:type",
|
|
1200
1280
|
imageWidth = "og:image:width",
|
|
1201
1281
|
imageHeight = "og:image:height",
|
|
1202
|
-
imageAlt = "og:image:alt",
|
|
1203
|
-
video = "og:video",
|
|
1204
|
-
videoUrl = "og:video:url",
|
|
1205
|
-
videoSecureUrl = "og:video:secure_url",
|
|
1206
|
-
videoType = "og:video:type",
|
|
1207
|
-
videoWidth = "og:video:width",
|
|
1208
|
-
videoHeight = "og:video:height",
|
|
1209
|
-
audio = "og:audio",
|
|
1210
|
-
audioSecureUrl = "og:audio:secure_url",
|
|
1211
|
-
audioType = "og:audio:type",
|
|
1212
1282
|
articlePublishedTime = "article:published_time",
|
|
1213
1283
|
articleModifiedTime = "article:modified_time",
|
|
1214
|
-
articleExpirationTime = "article:expiration_time",
|
|
1215
|
-
articleAuthor = "article:author",
|
|
1216
|
-
articleSection = "article:section",
|
|
1217
|
-
articleTag = "article:tag",
|
|
1218
|
-
bookAuthor = "book:author",
|
|
1219
|
-
bookIsbn = "book:isbn",
|
|
1220
|
-
bookReleaseDate = "book:release_date",
|
|
1221
|
-
bookTag = "book:tag",
|
|
1222
|
-
musicDuration = "music:duration",
|
|
1223
|
-
musicAlbum = "music:album",
|
|
1224
|
-
musicAlbumDisc = "music:album:disc",
|
|
1225
|
-
musicAlbumTrack = "music:album:track",
|
|
1226
|
-
musicMusician = "music:musician",
|
|
1227
|
-
musicSong = "music:song",
|
|
1228
|
-
musicSongDisc = "music:song:disc",
|
|
1229
|
-
musicSongTrack = "music:song:track",
|
|
1230
|
-
musicReleaseDate = "music:release_date",
|
|
1231
|
-
musicCreator = "music:creator",
|
|
1232
|
-
videoActor = "video:actor",
|
|
1233
|
-
videoActorRole = "video:actor:role",
|
|
1234
|
-
videoDirector = "video:director",
|
|
1235
|
-
videoWriter = "video:writer",
|
|
1236
|
-
videoDuration = "video:duration",
|
|
1237
|
-
videoReleaseDate = "video:release_date",
|
|
1238
|
-
videoTag = "video:tag",
|
|
1239
|
-
videoSeries = "video:series",
|
|
1240
|
-
profileFirstName = "profile:first_name",
|
|
1241
|
-
profileLastName = "profile:last_name",
|
|
1242
|
-
profileUsername = "profile:username",
|
|
1243
|
-
profileGender = "profile:gender",
|
|
1244
|
-
productBrand = "product:brand",
|
|
1245
|
-
productAvailability = "product:availability",
|
|
1246
|
-
productCondition = "product:condition",
|
|
1247
1284
|
productPriceAmount = "product:price:amount",
|
|
1248
|
-
productPriceCurrency = "product:price:currency"
|
|
1249
|
-
productRetailerItemId = "product:retailer_item_id",
|
|
1250
|
-
productCategory = "product:category",
|
|
1251
|
-
productEan = "product:ean",
|
|
1252
|
-
productIsbn = "product:isbn",
|
|
1253
|
-
productMfrPartNo = "product:mfr_part_no",
|
|
1254
|
-
productUpc = "product:upc",
|
|
1255
|
-
productWeightValue = "product:weight:value",
|
|
1256
|
-
productWeightUnits = "product:weight:units",
|
|
1257
|
-
productColor = "product:color",
|
|
1258
|
-
productMaterial = "product:material",
|
|
1259
|
-
productPattern = "product:pattern",
|
|
1260
|
-
productAgeGroup = "product:age_group",
|
|
1261
|
-
productGender = "product:gender"
|
|
1285
|
+
productPriceCurrency = "product:price:currency"
|
|
1262
1286
|
}
|
|
1287
|
+
|
|
1263
1288
|
export declare enum MetaOpenGraphType {
|
|
1264
1289
|
website = "website",
|
|
1265
1290
|
article = "article",
|
|
@@ -1270,31 +1295,24 @@ export declare enum MetaOpenGraphType {
|
|
|
1270
1295
|
musicAlbum = "music.album",
|
|
1271
1296
|
musicPlaylist = "music.playlist",
|
|
1272
1297
|
musicSong = "music.song",
|
|
1273
|
-
musicRadioStation = "music.radio_station",
|
|
1274
|
-
app = "app",
|
|
1275
1298
|
product = "product",
|
|
1276
|
-
business = "business.business",
|
|
1277
|
-
place = "place",
|
|
1278
|
-
event = "event",
|
|
1279
1299
|
profile = "profile",
|
|
1280
1300
|
book = "book"
|
|
1281
1301
|
}
|
|
1302
|
+
|
|
1282
1303
|
export declare enum MetaRobots {
|
|
1283
1304
|
indexFollow = "index, follow",
|
|
1284
1305
|
noIndexFollow = "noindex, follow",
|
|
1285
1306
|
indexNoFollow = "index, nofollow",
|
|
1286
1307
|
noIndexNoFollow = "noindex, nofollow",
|
|
1287
1308
|
noArchive = "noarchive",
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
notranslate = "notranslate",
|
|
1292
|
-
nopreview = "nopreview",
|
|
1293
|
-
textOnly = "textonly",
|
|
1294
|
-
noIndexSubpages = "noindex, noarchive",
|
|
1309
|
+
noSnippet = "nosnippet",
|
|
1310
|
+
noImageIndex = "noimageindex",
|
|
1311
|
+
noTranslate = "notranslate",
|
|
1295
1312
|
none = "none"
|
|
1296
1313
|
}
|
|
1297
|
-
|
|
1314
|
+
|
|
1315
|
+
/** Static SEO manager singleton. */
|
|
1298
1316
|
export declare class MetaStatic {
|
|
1299
1317
|
static getItem(): Meta;
|
|
1300
1318
|
static getOg(): MetaOg;
|
|
@@ -1319,7 +1337,9 @@ export declare class MetaStatic {
|
|
|
1319
1337
|
static setLocale(locale: string): typeof MetaStatic;
|
|
1320
1338
|
static setSuffix(suffix?: string): typeof MetaStatic;
|
|
1321
1339
|
static html(): string;
|
|
1340
|
+
static htmlTitle(): string;
|
|
1322
1341
|
}
|
|
1342
|
+
|
|
1323
1343
|
export declare enum MetaTag {
|
|
1324
1344
|
title = "title",
|
|
1325
1345
|
description = "description",
|
|
@@ -1328,9 +1348,9 @@ export declare enum MetaTag {
|
|
|
1328
1348
|
robots = "robots",
|
|
1329
1349
|
author = "author"
|
|
1330
1350
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1351
|
+
|
|
1352
|
+
/** Twitter Card manager. */
|
|
1353
|
+
export declare class MetaTwitter {
|
|
1334
1354
|
getCard(): MetaTwitterCard;
|
|
1335
1355
|
getSite(): string;
|
|
1336
1356
|
getCreator(): string;
|
|
@@ -1346,18 +1366,15 @@ export declare class MetaTwitter extends MetaManager<MetaTwitterTag[]> {
|
|
|
1346
1366
|
setDescription(description: string): this;
|
|
1347
1367
|
setImage(image: string): this;
|
|
1348
1368
|
}
|
|
1369
|
+
|
|
1349
1370
|
export declare enum MetaTwitterCard {
|
|
1350
1371
|
summary = "summary",
|
|
1351
1372
|
summaryLargeImage = "summary_large_image",
|
|
1352
1373
|
app = "app",
|
|
1353
|
-
player = "player"
|
|
1354
|
-
product = "product",
|
|
1355
|
-
gallery = "gallery",
|
|
1356
|
-
photo = "photo",
|
|
1357
|
-
leadGeneration = "lead_generation",
|
|
1358
|
-
audio = "audio",
|
|
1359
|
-
poll = "poll"
|
|
1374
|
+
player = "player"
|
|
1360
1375
|
}
|
|
1376
|
+
|
|
1377
|
+
/** Twitter Card tags. */
|
|
1361
1378
|
export declare enum MetaTwitterTag {
|
|
1362
1379
|
card = "twitter:card",
|
|
1363
1380
|
site = "twitter:site",
|
|
@@ -1366,29 +1383,11 @@ export declare enum MetaTwitterTag {
|
|
|
1366
1383
|
title = "twitter:title",
|
|
1367
1384
|
description = "twitter:description",
|
|
1368
1385
|
image = "twitter:image",
|
|
1369
|
-
imageAlt = "twitter:image:alt",
|
|
1370
|
-
imageSrc = "twitter:image:src",
|
|
1371
|
-
imageWidth = "twitter:image:width",
|
|
1372
|
-
imageHeight = "twitter:image:height",
|
|
1373
|
-
label1 = "twitter:label1",
|
|
1374
|
-
data1 = "twitter:data1",
|
|
1375
|
-
label2 = "twitter:label2",
|
|
1376
|
-
data2 = "twitter:data2",
|
|
1377
|
-
appNameIphone = "twitter:app:name:iphone",
|
|
1378
|
-
appIdIphone = "twitter:app:id:iphone",
|
|
1379
|
-
appUrlIphone = "twitter:app:url:iphone",
|
|
1380
|
-
appNameIpad = "twitter:app:name:ipad",
|
|
1381
|
-
appIdIpad = "twitter:app:id:ipad",
|
|
1382
|
-
appUrlIpad = "twitter:app:url:ipad",
|
|
1383
|
-
appNameGooglePlay = "twitter:app:name:googleplay",
|
|
1384
|
-
appIdGooglePlay = "twitter:app:id:googleplay",
|
|
1385
|
-
appUrlGooglePlay = "twitter:app:url:googleplay",
|
|
1386
1386
|
player = "twitter:player",
|
|
1387
1387
|
playerWidth = "twitter:player:width",
|
|
1388
|
-
playerHeight = "twitter:player:height"
|
|
1389
|
-
playerStream = "twitter:player:stream",
|
|
1390
|
-
playerStreamContentType = "twitter:player:stream:content_type"
|
|
1388
|
+
playerHeight = "twitter:player:height"
|
|
1391
1389
|
}
|
|
1390
|
+
|
|
1392
1391
|
export declare type NormalOrArray<T = NumberOrString> = T | T[];
|
|
1393
1392
|
export declare type NormalOrPromise<T> = T | Promise<T>;
|
|
1394
1393
|
export declare type NumberOrString = number | string;
|
|
@@ -1396,22 +1395,27 @@ export declare type NumberOrStringOrBoolean = number | string | boolean;
|
|
|
1396
1395
|
export declare type NumberOrStringOrDate = NumberOrString | Date;
|
|
1397
1396
|
export declare type ObjectItem<T = any> = Record<string, T>;
|
|
1398
1397
|
export declare type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
|
|
1398
|
+
|
|
1399
1399
|
/** Random integer. */
|
|
1400
1400
|
export declare function random(min: number, max: number): number;
|
|
1401
|
-
|
|
1401
|
+
|
|
1402
|
+
/** Remove prefix from string. */
|
|
1402
1403
|
export declare function removeCommonPrefix(mainStr: string, prefix: string): string;
|
|
1403
|
-
|
|
1404
|
+
|
|
1404
1405
|
export declare const replaceComponentName: (text: string | undefined, name: string, componentName: string) => string | undefined;
|
|
1406
|
+
|
|
1405
1407
|
/** Recursive object merge. */
|
|
1406
1408
|
export declare function replaceRecursive<I>(array: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
|
|
1407
|
-
|
|
1409
|
+
|
|
1410
|
+
/** Template replacement. */
|
|
1408
1411
|
export declare function replaceTemplate(value: string, replaces: Record<string, string | FunctionReturn<string>>): string;
|
|
1409
|
-
|
|
1412
|
+
|
|
1413
|
+
/** Resize image by constraints. */
|
|
1410
1414
|
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
|
|
1415
|
+
|
|
1411
1416
|
declare type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
*/
|
|
1417
|
+
|
|
1418
|
+
/** Pausable/resumable timer. */
|
|
1415
1419
|
export declare class ResumableTimer {
|
|
1416
1420
|
constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
|
|
1417
1421
|
resume(): this;
|
|
@@ -1419,37 +1423,27 @@ export declare class ResumableTimer {
|
|
|
1419
1423
|
reset(): this;
|
|
1420
1424
|
clear(): this;
|
|
1421
1425
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
*/
|
|
1426
|
+
|
|
1427
|
+
/** Scrollbar width measurement. */
|
|
1425
1428
|
export declare class ScrollbarWidth {
|
|
1426
1429
|
static is(): Promise<boolean>;
|
|
1427
1430
|
static get(): Promise<number>;
|
|
1428
1431
|
static getStorage(): DataStorage<number>;
|
|
1429
1432
|
static getCalculate(): boolean;
|
|
1430
1433
|
}
|
|
1434
|
+
|
|
1431
1435
|
export declare type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
|
|
1432
|
-
export declare type SearchCacheItem<T extends SearchItem> = {
|
|
1433
|
-
|
|
1434
|
-
value: string;
|
|
1435
|
-
};
|
|
1436
|
-
export declare type SearchColumn<T extends SearchItem> = {
|
|
1437
|
-
[K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
|
|
1438
|
-
}[keyof T];
|
|
1436
|
+
export declare type SearchCacheItem<T extends SearchItem> = { item: T; value: string; };
|
|
1437
|
+
export declare type SearchColumn<T extends SearchItem> = { [K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K; }[keyof T];
|
|
1439
1438
|
export declare type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
|
|
1440
1439
|
export declare type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
|
|
1441
1440
|
export declare type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
|
|
1442
|
-
export declare type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
|
|
1443
|
-
[K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
|
|
1444
|
-
} & {
|
|
1445
|
-
searchActive?: boolean;
|
|
1446
|
-
};
|
|
1441
|
+
export declare type SearchFormatItem<T extends SearchItem, KT extends string[]> = { [K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string; } & { searchActive?: boolean; };
|
|
1447
1442
|
export declare type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
|
|
1448
1443
|
export declare type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
|
|
1449
1444
|
export declare type SearchItem = Record<string, any>;
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
*/
|
|
1445
|
+
|
|
1446
|
+
/** Searchable list manager. */
|
|
1453
1447
|
export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
|
|
1454
1448
|
constructor(list: SearchListValue<T>, columns?: K, value?: string, options?: SearchOptions);
|
|
1455
1449
|
getData(): SearchListData<T, K>;
|
|
@@ -1464,15 +1458,12 @@ export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>
|
|
|
1464
1458
|
setOptions(options: SearchOptions): this;
|
|
1465
1459
|
to(): SearchFormatList<T, K>;
|
|
1466
1460
|
}
|
|
1461
|
+
|
|
1462
|
+
/** Internal search data processor. */
|
|
1467
1463
|
export declare class SearchListData<T extends SearchItem, K extends SearchColumns<T>> {
|
|
1468
1464
|
constructor(list: SearchListValue<T>, columns: K | undefined, item: SearchListItem, options: SearchListOptions);
|
|
1469
|
-
is(): this is this & {
|
|
1470
|
-
|
|
1471
|
-
columns: string[];
|
|
1472
|
-
};
|
|
1473
|
-
isList(): this is this & {
|
|
1474
|
-
list: T[];
|
|
1475
|
-
};
|
|
1465
|
+
is(): this is this & { list: T[]; columns: string[]; };
|
|
1466
|
+
isList(): this is this & { list: T[]; };
|
|
1476
1467
|
getList(): SearchListValue<T>;
|
|
1477
1468
|
getColumns(): K | undefined;
|
|
1478
1469
|
setList(list: SearchListValue<T>): this;
|
|
@@ -1481,15 +1472,17 @@ export declare class SearchListData<T extends SearchItem, K extends SearchColumn
|
|
|
1481
1472
|
forEach(callback: (item: SearchCacheItem<T>['item'], value: SearchCacheItem<T>['value']) => SearchFormatItem<T, K> | undefined): SearchFormatList<T, K>;
|
|
1482
1473
|
toFormatItem(item: T, selection: boolean): SearchFormatItem<T, K>;
|
|
1483
1474
|
}
|
|
1475
|
+
|
|
1476
|
+
/** Individual search item state. */
|
|
1484
1477
|
export declare class SearchListItem {
|
|
1485
1478
|
constructor(value: string | undefined, options: SearchListOptions);
|
|
1486
|
-
is(): this is this & {
|
|
1487
|
-
value: string;
|
|
1488
|
-
};
|
|
1479
|
+
is(): this is this & { value: string; };
|
|
1489
1480
|
isSearch(): boolean;
|
|
1490
1481
|
get(): string;
|
|
1491
1482
|
set(value?: string): this;
|
|
1492
1483
|
}
|
|
1484
|
+
|
|
1485
|
+
/** Logic for matching strings in search. */
|
|
1493
1486
|
export declare class SearchListMatcher {
|
|
1494
1487
|
constructor(item: SearchListItem, options: SearchListOptions);
|
|
1495
1488
|
is(): boolean;
|
|
@@ -1497,6 +1490,8 @@ export declare class SearchListMatcher {
|
|
|
1497
1490
|
get(): RegExp | undefined;
|
|
1498
1491
|
update(): void;
|
|
1499
1492
|
}
|
|
1493
|
+
|
|
1494
|
+
/** Search options manager. */
|
|
1500
1495
|
export declare class SearchListOptions {
|
|
1501
1496
|
constructor(options?: SearchOptions | undefined);
|
|
1502
1497
|
getOptions(): SearchOptions;
|
|
@@ -1507,6 +1502,7 @@ export declare class SearchListOptions {
|
|
|
1507
1502
|
getClassName(): string;
|
|
1508
1503
|
setOptions(options: SearchOptions): this;
|
|
1509
1504
|
}
|
|
1505
|
+
|
|
1510
1506
|
export declare type SearchListValue<T extends SearchItem> = T[] | undefined;
|
|
1511
1507
|
export declare type SearchOptions = {
|
|
1512
1508
|
limit?: number;
|
|
@@ -1515,13 +1511,13 @@ export declare type SearchOptions = {
|
|
|
1515
1511
|
findExactMatch?: boolean;
|
|
1516
1512
|
classSearchName?: string;
|
|
1517
1513
|
};
|
|
1518
|
-
|
|
1514
|
+
|
|
1515
|
+
/** Seconds to HH:MM:SS string. */
|
|
1519
1516
|
export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
*/
|
|
1517
|
+
|
|
1518
|
+
/** Context-isolated server storage for SSR. */
|
|
1523
1519
|
export declare class ServerStorage {
|
|
1524
|
-
static init(listener: () => Record<string, any>): typeof ServerStorage;
|
|
1520
|
+
static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
|
|
1525
1521
|
static reset(): void;
|
|
1526
1522
|
static has(key: string): boolean;
|
|
1527
1523
|
static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
@@ -1530,25 +1526,28 @@ export declare class ServerStorage {
|
|
|
1530
1526
|
static remove(key: string): void;
|
|
1531
1527
|
static toString(): string;
|
|
1532
1528
|
}
|
|
1533
|
-
|
|
1529
|
+
|
|
1530
|
+
/** Set element property by index. */
|
|
1534
1531
|
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;
|
|
1535
|
-
|
|
1532
|
+
|
|
1533
|
+
/** Dynamic value state modifier for multiple/maxlength support. */
|
|
1536
1534
|
export declare function setValues<T>(selected: T | T[] | undefined, value: any, { multiple, maxlength, alwaysChange, notEmpty }: {
|
|
1537
1535
|
multiple?: boolean | undefined;
|
|
1538
1536
|
maxlength?: number | undefined;
|
|
1539
1537
|
alwaysChange?: boolean | undefined;
|
|
1540
1538
|
notEmpty?: boolean | undefined;
|
|
1541
1539
|
}): T | T[] | undefined;
|
|
1540
|
+
|
|
1542
1541
|
/** Delay execution. */
|
|
1543
1542
|
export declare function sleep(ms: number): Promise<void>;
|
|
1544
|
-
|
|
1543
|
+
|
|
1544
|
+
/** Copy object properties into another by start index. */
|
|
1545
1545
|
export declare function splice<I>(array: ObjectItem<I>, replacement?: ObjectItem<I> | I, indexStart?: string): ObjectItem<I>;
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
*/
|
|
1546
|
+
|
|
1547
|
+
/** Callback registry for storage changes. */
|
|
1549
1548
|
export declare class StorageCallback<T = any, Callback = (value: T) => void | Promise<void>> {
|
|
1550
|
-
static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
|
|
1551
1549
|
constructor(name: string, group?: string);
|
|
1550
|
+
static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
|
|
1552
1551
|
isLoading(): boolean;
|
|
1553
1552
|
getName(): string;
|
|
1554
1553
|
getLoading(): boolean;
|
|
@@ -1557,36 +1556,45 @@ export declare class StorageCallback<T = any, Callback = (value: T) => void | Pr
|
|
|
1557
1556
|
preparation(): this;
|
|
1558
1557
|
run(value: T): Promise<this>;
|
|
1559
1558
|
}
|
|
1560
|
-
|
|
1559
|
+
|
|
1560
|
+
/** Repeat string count times. */
|
|
1561
1561
|
export declare function strFill(value: string, count: number): string;
|
|
1562
|
-
|
|
1562
|
+
|
|
1563
|
+
/** Split string with limit (last element contains remainder). */
|
|
1563
1564
|
export declare function strSplit(value: number | string, separator: string, limit?: number): string[];
|
|
1564
|
-
|
|
1565
|
+
|
|
1566
|
+
/** Force value to array. */
|
|
1565
1567
|
export declare function toArray<T>(value: T): T extends any[] ? T : [T];
|
|
1566
|
-
|
|
1568
|
+
|
|
1569
|
+
/** String to camelCase. */
|
|
1567
1570
|
export declare function toCamelCase(value: string): string;
|
|
1568
|
-
|
|
1571
|
+
|
|
1572
|
+
/** String to CamelCase. */
|
|
1569
1573
|
export declare function toCamelCaseFirst(value: string): string;
|
|
1570
|
-
|
|
1574
|
+
|
|
1575
|
+
/** Convert to Date object. */
|
|
1571
1576
|
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
1572
|
-
|
|
1577
|
+
|
|
1578
|
+
/** String to kebab-case. */
|
|
1573
1579
|
export declare function toKebabCase(value: string): string;
|
|
1574
|
-
|
|
1580
|
+
|
|
1581
|
+
/** Parse string/number to float. SSR safe. */
|
|
1575
1582
|
export declare function toNumber(value?: NumberOrString): number;
|
|
1576
|
-
|
|
1583
|
+
|
|
1584
|
+
/** Parse number with max constraint. */
|
|
1577
1585
|
export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
|
|
1578
|
-
|
|
1586
|
+
|
|
1579
1587
|
export declare function toPercent(maxValue: number, value: number): number;
|
|
1580
|
-
/** Percentage of max * 100. */
|
|
1581
1588
|
export declare function toPercentBy100(maxValue: number, value: number): number;
|
|
1582
|
-
|
|
1589
|
+
|
|
1590
|
+
/** Value to string. */
|
|
1583
1591
|
declare function toString_2<T>(value: T): string;
|
|
1584
1592
|
export { toString_2 as toString }
|
|
1585
|
-
|
|
1593
|
+
|
|
1594
|
+
/** Type transformation (detects boolean, number, null, object, function). */
|
|
1586
1595
|
export declare function transformation(value: any, isFunction?: boolean): any;
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
*/
|
|
1596
|
+
|
|
1597
|
+
/** Translation manager. */
|
|
1590
1598
|
export declare class Translate {
|
|
1591
1599
|
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
1592
1600
|
static getItem(): TranslateInstance;
|
|
@@ -1603,20 +1611,17 @@ export declare class Translate {
|
|
|
1603
1611
|
static setReadApi(value: boolean): void;
|
|
1604
1612
|
static setConfig(config: TranslateConfig): void;
|
|
1605
1613
|
}
|
|
1614
|
+
|
|
1606
1615
|
export declare const TRANSLATE_GLOBAL_PREFIX = "global";
|
|
1607
1616
|
export declare const TRANSLATE_TIME_OUT = 160;
|
|
1617
|
+
|
|
1608
1618
|
export declare type TranslateCode = string | string[];
|
|
1609
|
-
export declare type TranslateConfig = {
|
|
1610
|
-
url?: string;
|
|
1611
|
-
propsName?: string;
|
|
1612
|
-
readApi?: boolean;
|
|
1613
|
-
};
|
|
1619
|
+
export declare type TranslateConfig = { url?: string; propsName?: string; readApi?: boolean; };
|
|
1614
1620
|
export declare type TranslateDataFile = Record<string, TranslateDataFileItem>;
|
|
1615
1621
|
export declare type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
|
|
1616
1622
|
export declare type TranslateDataFileList = Record<string, string>;
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
*/
|
|
1623
|
+
|
|
1624
|
+
/** Localized translation file manager. */
|
|
1620
1625
|
export declare class TranslateFile {
|
|
1621
1626
|
constructor(data?: TranslateDataFile, language?: string | (() => string), location?: string | (() => string));
|
|
1622
1627
|
isFile(): boolean;
|
|
@@ -1625,9 +1630,8 @@ export declare class TranslateFile {
|
|
|
1625
1630
|
getList(): Promise<TranslateDataFileList | undefined>;
|
|
1626
1631
|
add(data: TranslateDataFile): void;
|
|
1627
1632
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
*/
|
|
1633
|
+
|
|
1634
|
+
/** Translation context instance. */
|
|
1631
1635
|
export declare class TranslateInstance {
|
|
1632
1636
|
constructor(url?: string, propsName?: string, files?: TranslateFile);
|
|
1633
1637
|
get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
@@ -1643,14 +1647,17 @@ export declare class TranslateInstance {
|
|
|
1643
1647
|
setPropsName(name: string): this;
|
|
1644
1648
|
setReadApi(value: boolean): this;
|
|
1645
1649
|
}
|
|
1650
|
+
|
|
1646
1651
|
export declare type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
|
|
1647
|
-
export declare type TranslateList<T extends TranslateCode[]> = {
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
/** Uint8Array to Base64. */
|
|
1652
|
+
export declare type TranslateList<T extends TranslateCode[]> = { [K in T[number] as K extends readonly string[] ? K[0] : K]: string; };
|
|
1653
|
+
|
|
1654
|
+
/** Binary data to base64. */
|
|
1651
1655
|
export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
|
|
1656
|
+
|
|
1652
1657
|
export declare type Undefined = undefined | null;
|
|
1653
|
-
|
|
1658
|
+
|
|
1659
|
+
/** Remove array duplicates. */
|
|
1654
1660
|
export declare function uniqueArray<T>(value: T[]): T[];
|
|
1655
|
-
|
|
1661
|
+
|
|
1662
|
+
/** Write text to clipboard. */
|
|
1656
1663
|
export declare function writeClipboardData(text: string): Promise<void>;
|