@dxtmisha/functional-basic 1.8.6 → 1.8.9
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 +27 -0
- package/ai-description.md +14 -18
- package/ai-mcp-resources.json +5 -5
- package/ai-resources/prompts.json +8 -0
- package/ai-types.md +1720 -1045
- package/dist/classes/ApiCache.d.ts +2 -2
- package/dist/classes/ApiErrorStorage.d.ts +9 -1
- package/dist/classes/ApiHydration.d.ts +1 -0
- package/dist/classes/ApiInstance.d.ts +1 -0
- package/dist/classes/ApiStatus.d.ts +1 -0
- package/dist/classes/BroadcastMessage.d.ts +1 -0
- package/dist/classes/Cache.d.ts +1 -0
- package/dist/classes/CacheItem.d.ts +3 -0
- package/dist/classes/CookieBlock.d.ts +1 -1
- package/dist/classes/CookieBlockInstance.d.ts +2 -1
- package/dist/classes/CookieStorage.d.ts +2 -1
- package/dist/classes/DataStorage.d.ts +1 -1
- package/dist/classes/Datetime.d.ts +5 -4
- package/dist/classes/EventItem.d.ts +7 -28
- package/dist/classes/Formatters.d.ts +6 -10
- package/dist/classes/GeoFlag.d.ts +1 -1
- package/dist/classes/GeoInstance.d.ts +1 -0
- package/dist/classes/GeoIntl.d.ts +23 -36
- package/dist/classes/GeoPhone.d.ts +2 -0
- package/dist/classes/Global.d.ts +1 -1
- package/dist/classes/Hash.d.ts +1 -1
- package/dist/classes/Icons.d.ts +8 -8
- package/dist/classes/Loading.d.ts +8 -12
- package/dist/classes/LoadingInstance.d.ts +10 -22
- package/dist/classes/Meta.d.ts +4 -1
- package/dist/classes/MetaManager.d.ts +2 -0
- package/dist/classes/MetaOg.d.ts +7 -2
- package/dist/classes/MetaTwitter.d.ts +7 -2
- package/dist/classes/Query.d.ts +1 -1
- package/dist/classes/ResumableTimer.d.ts +4 -0
- package/dist/classes/ScrollbarWidth.d.ts +1 -0
- package/dist/classes/SearchList.d.ts +4 -0
- package/dist/classes/SearchListData.d.ts +3 -2
- package/dist/classes/SearchListMatcher.d.ts +3 -2
- package/dist/classes/ServerStorage.d.ts +5 -2
- package/dist/classes/StorageCallback.d.ts +2 -0
- package/dist/classes/Translate.d.ts +6 -8
- package/dist/classes/TranslateInstance.d.ts +4 -7
- package/dist/classes/UrlInstanceAbstract.d.ts +4 -0
- package/dist/functions/getMouseClient.d.ts +1 -1
- package/dist/functions/getMouseClientX.d.ts +1 -1
- package/dist/functions/getMouseClientY.d.ts +1 -1
- package/dist/library.js +11 -9
- package/package.json +4 -4
package/ai-types.md
CHANGED
|
@@ -1,119 +1,186 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional-basic library.
|
|
1
|
+
All these methods are in the @dxtmisha/functional-basic (v1.8.9) library.
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** Check if server runs on localhost @keywords api, localhost */
|
|
4
4
|
export declare class Api {
|
|
5
|
+
/** Check if server is running on localhost. @keywords api, localhost */
|
|
5
6
|
static isLocalhost(): boolean;
|
|
7
|
+
/** Get ApiInstance singleton. @keywords api, instance */
|
|
6
8
|
static getItem(): ApiInstance;
|
|
9
|
+
/** Get last request status. @keywords api, status */
|
|
7
10
|
static getStatus(): ApiStatus;
|
|
11
|
+
/** Get response handler. @keywords api, response */
|
|
8
12
|
static getResponse(): ApiResponse;
|
|
13
|
+
/** Get hydration handler. @keywords api, hydration */
|
|
9
14
|
static getHydration(): ApiHydration;
|
|
15
|
+
/** Get hydration data script string. @keywords api, hydration, script */
|
|
10
16
|
static getHydrationScript(): string;
|
|
17
|
+
/** Get base origin URL. @keywords api, origin, url */
|
|
11
18
|
static getOrigin(): string;
|
|
19
|
+
/** Get full request URL. @keywords api, url */
|
|
12
20
|
static getUrl(path: string, api?: boolean): string;
|
|
13
|
-
/**
|
|
21
|
+
/** Get request body data. @keywords api, body, request */
|
|
14
22
|
static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
|
|
15
|
-
/**
|
|
23
|
+
/** Get query string for GET requests. @keywords api, query, get */
|
|
16
24
|
static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
|
|
25
|
+
/** Set default headers. @keywords api, headers */
|
|
17
26
|
static setHeaders(headers: ApiHeadersValue): void;
|
|
27
|
+
/** Set default request data. @keywords api, request, default */
|
|
18
28
|
static setRequestDefault(request: ApiDefaultValue): void;
|
|
29
|
+
/** Set base URL. @keywords api, url */
|
|
19
30
|
static setUrl(url: string): void;
|
|
31
|
+
/** Set preparation callback. @keywords api, preparation */
|
|
20
32
|
static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
|
|
33
|
+
/** Set end callback. @keywords api, end */
|
|
21
34
|
static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
|
|
35
|
+
/** Set request timeout. @keywords api, timeout */
|
|
22
36
|
static setTimeout(timeout: number): void;
|
|
37
|
+
/** Set base origin. @keywords api, origin */
|
|
23
38
|
static setOrigin(origin: string): void;
|
|
39
|
+
/** Set request wrapper function. @keywords api, wrapper */
|
|
24
40
|
static setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): void;
|
|
41
|
+
/** Set API configuration. @keywords api, config */
|
|
25
42
|
static setConfig(config?: ApiConfig): void;
|
|
43
|
+
/** Execute HTTP request. @keywords api, request */
|
|
26
44
|
static request<T>(pathRequest: string | ApiFetch): Promise<T>;
|
|
45
|
+
/** Execute GET request. @keywords api, get, request */
|
|
27
46
|
static get<T>(request: ApiFetch): Promise<T>;
|
|
47
|
+
/** Execute POST request. @keywords api, post, request */
|
|
28
48
|
static post<T>(request: ApiFetch): Promise<T>;
|
|
49
|
+
/** Execute PUT request. @keywords api, put, request */
|
|
29
50
|
static put<T>(request: ApiFetch): Promise<T>;
|
|
51
|
+
/** Execute PATCH request. @keywords api, patch, request */
|
|
30
52
|
static patch<T>(request: ApiFetch): Promise<T>;
|
|
53
|
+
/** Execute DELETE request. @keywords api, delete, request */
|
|
31
54
|
static delete<T>(request: ApiFetch): Promise<T>;
|
|
32
55
|
}
|
|
33
|
-
|
|
56
|
+
|
|
57
|
+
/** Manages API response caching. @keywords api cache storage */
|
|
34
58
|
export declare class ApiCache {
|
|
35
|
-
|
|
36
|
-
protected static setListener?: (key: string, value: ApiCacheItem) => Promise<boolean>;
|
|
37
|
-
protected static removeListener?: (key: string) => Promise<boolean>;
|
|
38
|
-
/** Initializes storage listeners and sets the data retrieval count before cache cleaning */
|
|
59
|
+
/** Initializes storage with custom listeners and options. @keywords init listeners */
|
|
39
60
|
static init(getListener: (key: string) => Promise<ApiCacheItem | undefined>, setListener: (key: string, value: ApiCacheItem) => Promise<boolean>, removeListener: (key: string) => Promise<boolean>, cacheStepAgeClearOld?: number): void;
|
|
61
|
+
/** Resets the cache by clearing memory items and listeners. @keywords reset cache */
|
|
40
62
|
static reset(): void;
|
|
63
|
+
/** Gets data from cache by key. @keywords get cache */
|
|
41
64
|
static get<T>(key: string): Promise<T | undefined>;
|
|
65
|
+
/** Gets data from cache using fetch options. @keywords fetch cache */
|
|
42
66
|
static getByFetch<T>(fetch: ApiFetch): Promise<T | undefined>;
|
|
67
|
+
/** Saves data to cache by key. @keywords set cache */
|
|
43
68
|
static set<T>(key: string, value: T, age?: number): Promise<void>;
|
|
69
|
+
/** Saves data to cache using fetch options. @keywords set fetch cache */
|
|
44
70
|
static setByFetch<T>(fetch: ApiFetch, value: T): Promise<void>;
|
|
71
|
+
/** Removes data from cache by key. @keywords remove cache */
|
|
45
72
|
static remove(key: string): Promise<void>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
protected static generateKey(fetch: ApiFetch): string;
|
|
50
|
-
protected static getItemOrListener(key: string): Promise<ApiCacheItem | undefined>;
|
|
51
|
-
protected static getList(): ApiCacheList;
|
|
52
|
-
protected static setItemOrListener(key: string, value: ApiCacheItem): Promise<void>;
|
|
53
|
-
protected static removeItemOrListener(key: string): Promise<void>;
|
|
54
|
-
protected static clearOld(): Promise<void>;
|
|
55
|
-
}
|
|
56
|
-
/** Formats and processes API response raw data */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Processes and formats API response data @keywords api, response, data, transform */
|
|
57
76
|
export declare class ApiDataReturn<T = any> {
|
|
77
|
+
/** Creates ApiDataReturn instance @keywords constructor, api */
|
|
58
78
|
constructor(apiFetch: ApiFetch, query: Response, end: ApiPreparationEnd, error?: ApiErrorItem | undefined);
|
|
79
|
+
/** Initializes response data @keywords init, parse */
|
|
59
80
|
init(): Promise<this>;
|
|
81
|
+
/** Returns processed data @keywords get, data */
|
|
60
82
|
get(): ApiData<T>;
|
|
83
|
+
/** Returns processed data with status object @keywords get, status */
|
|
61
84
|
getAndStatus(status: ApiStatus): ApiData<T>;
|
|
85
|
+
/** Returns raw API data @keywords get, raw, data */
|
|
62
86
|
getData(): ApiData<T> | undefined;
|
|
63
|
-
protected readData<T>(): Promise<ApiData<T>>;
|
|
64
|
-
protected initData(): ApiData<T>;
|
|
65
|
-
/** Initializes result and merges metadata from raw response data */
|
|
66
|
-
protected initItem(data: Record<string, any>): ApiData<T>;
|
|
67
87
|
}
|
|
68
|
-
|
|
88
|
+
|
|
89
|
+
/** Manages default request data and parameters. @keywords api default request parameters */
|
|
69
90
|
export declare class ApiDefault {
|
|
91
|
+
/** Checks if default request data is defined. @keywords api check default */
|
|
70
92
|
is(): boolean;
|
|
93
|
+
/** Gets default request data. @keywords api get default */
|
|
71
94
|
get(): Record<string, any> | undefined;
|
|
95
|
+
/** Merges default data into request. @keywords api request merge */
|
|
72
96
|
request(request: ApiFetch['request']): ApiFetch['request'];
|
|
97
|
+
/** Sets default request data. @keywords api set default */
|
|
73
98
|
set(request: ApiDefaultValue): this;
|
|
99
|
+
/** Adds default data to FormData. @keywords api form data add */
|
|
74
100
|
protected addByFormData(request: FormData, value: ApiDefaultValue): this;
|
|
75
101
|
}
|
|
76
|
-
|
|
102
|
+
|
|
103
|
+
/** Manages API error storage and error items. @keywords api error storage handler */
|
|
77
104
|
export declare class ApiError {
|
|
105
|
+
/** Gets the API error storage instance. @keywords get storage error */
|
|
78
106
|
static getStorage(): ApiErrorStorage;
|
|
107
|
+
/** Adds error items to storage. @keywords add error item */
|
|
79
108
|
static add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): void;
|
|
80
|
-
/**
|
|
109
|
+
/** Gets structured error item from response. @keywords get error item response */
|
|
81
110
|
static getItem(method: ApiMethodItem, response: Response): Promise<ApiErrorItem>;
|
|
82
111
|
}
|
|
83
|
-
|
|
112
|
+
|
|
113
|
+
/** Retrieves or manages API error response details. @keywords api error item response status */
|
|
84
114
|
export declare class ApiErrorItem {
|
|
115
|
+
/** Creates an instance of ApiErrorItem. @keywords create constructor api error item */
|
|
85
116
|
constructor(method: ApiMethodItem, response: Response, error: ApiErrorStorageItem);
|
|
117
|
+
/** Gets the HTTP request method. @keywords get method http */
|
|
86
118
|
getMethod(): ApiMethodItem;
|
|
119
|
+
/** Gets the raw fetch response object. @keywords get response fetch */
|
|
87
120
|
getResponse(): Response;
|
|
121
|
+
/** Gets the matched error storage item. @keywords get error storage item */
|
|
88
122
|
getError(): ApiErrorStorageItem;
|
|
123
|
+
/** Gets the error code. @keywords get error code */
|
|
89
124
|
getCode(): string | undefined;
|
|
125
|
+
/** Gets the error message. @keywords get error message */
|
|
90
126
|
getMessage(): string | undefined;
|
|
127
|
+
/** Gets the HTTP response status code. @keywords get status code */
|
|
91
128
|
getStatus(): number;
|
|
92
129
|
}
|
|
93
|
-
|
|
130
|
+
|
|
131
|
+
/** Manager for handling and identifying API error states @keywords api error storage matcher */
|
|
94
132
|
export declare class ApiErrorStorage {
|
|
133
|
+
/** Finds a matching error item in the storage by analyzing the response @keywords find api error */
|
|
95
134
|
find(method: ApiMethodItem, response: Response): Promise<ApiErrorStorageItem>;
|
|
135
|
+
/** Adds error items or lists to internal storage @keywords add api error */
|
|
96
136
|
add(item: Partial<ApiErrorStorageItem> | Partial<ApiErrorStorageItem>[], url?: string | RegExp, method?: ApiMethodItem): this;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
/** API request headers manager */
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Manages HTTP request headers.
|
|
141
|
+
* @keywords api headers request content-type
|
|
142
|
+
*/
|
|
105
143
|
export declare class ApiHeaders {
|
|
144
|
+
/**
|
|
145
|
+
* Retrieves request headers.
|
|
146
|
+
* @keywords get headers content-type
|
|
147
|
+
*/
|
|
106
148
|
get(value?: Record<string, string> | null, type?: string | undefined | null): Record<string, string> | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves headers based on request data.
|
|
151
|
+
* @keywords get headers request content-type
|
|
152
|
+
*/
|
|
107
153
|
getByRequest(request: ApiFetch['request'], value?: Record<string, string> | null, type?: string): Record<string, string> | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Sets default headers.
|
|
156
|
+
* @keywords set headers defaults
|
|
157
|
+
*/
|
|
108
158
|
set(headers: ApiHeadersValue): this;
|
|
109
159
|
}
|
|
110
|
-
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Manages API response hydration for server-side rendering (SSR).
|
|
163
|
+
* @keywords api, hydration, ssr, client, cache
|
|
164
|
+
*/
|
|
111
165
|
export declare class ApiHydration {
|
|
166
|
+
/**
|
|
167
|
+
* Initializes response collection from client data.
|
|
168
|
+
* @keywords init, response, hydration
|
|
169
|
+
*/
|
|
112
170
|
initResponse(response: ApiResponse): void;
|
|
171
|
+
/**
|
|
172
|
+
* Stores API fetch and response pair for client hydration.
|
|
173
|
+
* @keywords to, client, hydration, save
|
|
174
|
+
*/
|
|
113
175
|
toClient<T>(apiFetch: ApiFetch, response: T): void;
|
|
176
|
+
/**
|
|
177
|
+
* Serializes hydration data into a script string.
|
|
178
|
+
* @keywords to, string, serialize, html
|
|
179
|
+
*/
|
|
114
180
|
toString(): string;
|
|
115
|
-
protected getListByClient(): ApiHydrationList;
|
|
116
181
|
}
|
|
182
|
+
|
|
183
|
+
/** Options for the API instance @keywords api,options,config */
|
|
117
184
|
export type ApiInstanceOptions = {
|
|
118
185
|
headersClass?: typeof ApiHeaders;
|
|
119
186
|
requestDefaultClass?: typeof ApiDefault;
|
|
@@ -125,156 +192,272 @@ export type ApiInstanceOptions = {
|
|
|
125
192
|
hydrationClass?: typeof ApiHydration;
|
|
126
193
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
127
194
|
};
|
|
128
|
-
|
|
195
|
+
|
|
196
|
+
/** Core class for managing HTTP requests using the Fetch API. @keywords api,client,fetch,request */
|
|
129
197
|
export declare class ApiInstance {
|
|
130
198
|
protected wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
199
|
+
/** @keywords constructor,init */
|
|
131
200
|
constructor(url?: string, options?: ApiInstanceOptions);
|
|
201
|
+
/** Checks if the server is running on localhost. @keywords localhost,env */
|
|
132
202
|
isLocalhost(): boolean;
|
|
203
|
+
/** Returns the status of the last request. @keywords status,state */
|
|
133
204
|
getStatus(): ApiStatus;
|
|
205
|
+
/** Gets the response handler. @keywords response,handler */
|
|
134
206
|
getResponse(): ApiResponse;
|
|
207
|
+
/** Gets the hydration handler. @keywords hydration,ssr */
|
|
135
208
|
getHydration(): ApiHydration;
|
|
209
|
+
/** Gets the base origin URL combined with the API path. @keywords origin,url */
|
|
136
210
|
getOrigin(): string;
|
|
211
|
+
/** Gets the full path to the request script. @keywords url,path */
|
|
137
212
|
getUrl(path: string, api?: boolean): string;
|
|
213
|
+
/** Gets data for the request body. @keywords body,payload */
|
|
138
214
|
getBody(request?: ApiFetch['request'], method?: ApiMethod): string | FormData | undefined;
|
|
215
|
+
/** Gets query string for GET method requests. @keywords query,params,get */
|
|
139
216
|
getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethod): string;
|
|
217
|
+
/** Returns a string representation of the hydration data for the client. @keywords hydration,script */
|
|
140
218
|
getHydrationScript(): string;
|
|
219
|
+
/** Modifies the default header data. @keywords headers,config */
|
|
141
220
|
setHeaders(headers: ApiHeadersValue): this;
|
|
221
|
+
/** Modifies the default request data. @keywords request,default */
|
|
142
222
|
setRequestDefault(request: ApiDefaultValue): this;
|
|
223
|
+
/** Changes the base path to the script. @keywords url,base */
|
|
143
224
|
setUrl(url: string): this;
|
|
225
|
+
/** Modifies the function to be called before the request. @keywords preparation,hook */
|
|
144
226
|
setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): this;
|
|
227
|
+
/** Modifies the function to be called after the request. @keywords end,hook */
|
|
145
228
|
setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
|
|
229
|
+
/** Changes the timeout for the request in milliseconds. @keywords timeout,delay */
|
|
146
230
|
setTimeout(timeout: number): this;
|
|
231
|
+
/** Changes the origin (protocol and domain) for the base URL. @keywords origin,domain */
|
|
147
232
|
setOrigin(origin: string): this;
|
|
233
|
+
/** Sets the wrapper function for requests. @keywords wrapper,middleware */
|
|
148
234
|
setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): this;
|
|
235
|
+
/** Executes a request with the given path or configuration. @keywords request,fetch */
|
|
149
236
|
request<T>(pathRequest: string | ApiFetch): Promise<T>;
|
|
237
|
+
/** Sends a GET method request. @keywords get,request */
|
|
150
238
|
get<T>(request: ApiFetch): Promise<T>;
|
|
239
|
+
/** Sends a POST method request. @keywords post,request */
|
|
151
240
|
post<T>(request: ApiFetch): Promise<T>;
|
|
241
|
+
/** Sends a PUT method request. @keywords put,request */
|
|
152
242
|
put<T>(request: ApiFetch): Promise<T>;
|
|
243
|
+
/** Sends a PATCH method request. @keywords patch,request */
|
|
153
244
|
patch<T>(request: ApiFetch): Promise<T>;
|
|
245
|
+
/** Sends a DELETE method request. @keywords delete,request */
|
|
154
246
|
delete<T>(request: ApiFetch): Promise<T>;
|
|
247
|
+
/** Gets retry delay with jitter. @keywords retry,delay */
|
|
155
248
|
protected getRetryDelay(retryCount: number, retryDelay: number): number;
|
|
249
|
+
/** Execute API request with retry support. @keywords fetch,retry */
|
|
156
250
|
protected fetch<T>(apiFetch: ApiFetch, retryCount?: number): Promise<T>;
|
|
251
|
+
/** Executing the HTTP request. @keywords makeQuery,fetch */
|
|
157
252
|
protected makeQuery(apiFetch: ApiFetch, pathToApi: string): Promise<{
|
|
158
253
|
query: Response;
|
|
159
254
|
timeoutId: any;
|
|
160
255
|
}>;
|
|
256
|
+
/** Processing an error. @keywords error,handle */
|
|
161
257
|
protected makeError(error: Record<string, any> & {
|
|
162
258
|
name: string;
|
|
163
259
|
}, group?: string): void;
|
|
260
|
+
/** Processes an error response. @keywords error,query */
|
|
164
261
|
protected makeErrorQuery(error: ApiErrorItem | Response): void;
|
|
262
|
+
/** Initialize controller for request with timeout support. @keywords controller,timeout */
|
|
165
263
|
protected initController(apiFetch: ApiFetch, fetchInit: RequestInit): any;
|
|
166
264
|
}
|
|
167
|
-
|
|
265
|
+
|
|
266
|
+
/** Class for preparing requests. @keywords api, preparation, request */
|
|
168
267
|
export declare class ApiPreparation {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
268
|
+
/** Executes preparation before the request. @keywords api, make, preparation */
|
|
269
|
+
make(active: boolean, apiFetch: ApiFetch): Promise<void>;
|
|
270
|
+
/** Analyzes the request after execution. @keywords api, makeEnd, response */
|
|
271
|
+
makeEnd(active: boolean, query: Response, apiFetch: ApiFetch): Promise<ApiPreparationEnd>;
|
|
272
|
+
/** Modifies the function to be called before the request. @keywords api, set, callback */
|
|
273
|
+
set(callback: (apiFetch: ApiFetch) => Promise<void>): this;
|
|
274
|
+
/** Modifies the function to be called after the request. @keywords api, setEnd, callback */
|
|
275
|
+
setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): this;
|
|
176
276
|
}
|
|
177
|
-
|
|
277
|
+
|
|
278
|
+
/** Class for working with API responses. @keywords api, response, emulator */
|
|
178
279
|
export declare class ApiResponse {
|
|
280
|
+
/** Constructor @keywords constructor */
|
|
179
281
|
constructor(requestDefault: ApiDefault);
|
|
282
|
+
/** Checks for global cached request and returns it if found. @keywords get, cache, response */
|
|
180
283
|
get(path: string | undefined, method: ApiMethod, request?: ApiFetch['request'], devMode?: boolean): ApiResponseItem | undefined;
|
|
284
|
+
/** Returns list of cached API responses excluding global ones. @keywords list, cache, response */
|
|
181
285
|
getList(): (ApiResponseItem & Record<string, any>)[];
|
|
286
|
+
/** Adds cached requests. @keywords add, cache, response */
|
|
182
287
|
add(response: ApiResponseItem | ApiResponseItem[]): this;
|
|
288
|
+
/** Sets developer mode flag. @keywords set, devMode, developer */
|
|
183
289
|
setDevMode(devMode: boolean): this;
|
|
290
|
+
/** Executes emulator if available. @keywords emulator, fetch, async */
|
|
184
291
|
emulator<T>(apiFetch: ApiFetch): Promise<T | undefined>;
|
|
292
|
+
/** Executes emulator synchronously if available. @keywords emulator, sync, fetch */
|
|
185
293
|
emulatorAsync<T>(apiFetch: ApiFetch): T | undefined;
|
|
294
|
+
/** Checks if cached item is disabled. @keywords check, disable, item */
|
|
186
295
|
protected isDisable(item: ApiResponseItem): boolean;
|
|
296
|
+
/** Checks if path matches cached one. @keywords check, path, match */
|
|
187
297
|
protected isPath(item: ApiResponseItem, path: string): boolean;
|
|
298
|
+
/** Checks if developer mode is active. @keywords check, devMode, mode */
|
|
188
299
|
protected isDevMode(devMode?: boolean): boolean;
|
|
300
|
+
/** Checks if request is first. @keywords check, first, request */
|
|
189
301
|
protected isFirst(item: ApiResponseItem, devMode?: boolean): boolean;
|
|
302
|
+
/** Checks if request matches cached one. @keywords check, response, match */
|
|
190
303
|
protected isResponse(item: ApiResponseItem, request?: ApiFetch['request']): boolean;
|
|
304
|
+
/** Reads cached data configuration. @keywords read, data, cache */
|
|
191
305
|
protected readData(apiFetch: ApiFetch): {
|
|
192
306
|
response: ApiResponseItem;
|
|
193
307
|
request: string | Record<string, any> | FormData | undefined;
|
|
194
308
|
} | undefined;
|
|
309
|
+
/** Emulates execution request. @keywords fetch, emulate, request */
|
|
195
310
|
protected fetch<T>(response: ApiResponseItem, request?: ApiFetch['request']): Promise<T>;
|
|
311
|
+
/** Emulates execution request synchronously. @keywords fetch, emulate, sync */
|
|
196
312
|
protected fetchAsync<T>(response: ApiResponseItem): T;
|
|
313
|
+
/** Enables loading for request emulation. @keywords start, loading, response */
|
|
197
314
|
protected startResponseLoading(): void;
|
|
315
|
+
/** Disables loading for request emulation. @keywords stop, loading, response */
|
|
198
316
|
protected stopResponseLoading(): void;
|
|
199
317
|
}
|
|
200
|
-
|
|
318
|
+
|
|
319
|
+
/** Manages API request status and tracking. @keywords api status tracker */
|
|
201
320
|
export declare class ApiStatus {
|
|
321
|
+
/** Gets the current API status data. @keywords get status */
|
|
202
322
|
get(): ApiStatusItem | undefined;
|
|
323
|
+
/** Gets the HTTP response status code. @keywords get status code */
|
|
203
324
|
getStatus(): number | undefined;
|
|
325
|
+
/** Gets the HTTP response status text. @keywords get status text */
|
|
204
326
|
getStatusText(): string | undefined;
|
|
327
|
+
/** Gets the last status type. @keywords get status type */
|
|
205
328
|
getStatusType(): ApiStatusType | undefined;
|
|
329
|
+
/** Gets the last error code. @keywords get code */
|
|
206
330
|
getCode(): string | undefined;
|
|
331
|
+
/** Gets the current error string. @keywords get error */
|
|
207
332
|
getError(): string | undefined;
|
|
333
|
+
/** Gets the last response data payload. @keywords get response data */
|
|
208
334
|
getResponse<T>(): T | undefined;
|
|
335
|
+
/** Gets the last response message string. @keywords get message */
|
|
209
336
|
getMessage(): string;
|
|
337
|
+
/** Sets full status data object. @keywords set status data */
|
|
210
338
|
set(data: ApiStatusItem): this;
|
|
339
|
+
/** Sets HTTP status code and optional text. @keywords set status */
|
|
211
340
|
setStatus(status?: number, statusText?: string): this;
|
|
341
|
+
/** Sets the error message state. @keywords set error */
|
|
212
342
|
setError(error?: string): this;
|
|
343
|
+
/** Sets the last response and extracts metadata. @keywords set last response */
|
|
213
344
|
setLastResponse(response?: any): this;
|
|
345
|
+
/** Sets the last status type. @keywords set last status */
|
|
214
346
|
setLastStatus(status?: ApiStatusType): this;
|
|
347
|
+
/** Sets the last execution code. @keywords set last code */
|
|
215
348
|
setLastCode(code?: string): this;
|
|
349
|
+
/** Sets the last response message. @keywords set last message */
|
|
216
350
|
setLastMessage(message?: string): this;
|
|
217
|
-
protected setValue<K extends keyof ApiStatusItem>(name: K, value?: ApiStatusItem[K]): void;
|
|
218
351
|
}
|
|
219
|
-
|
|
352
|
+
|
|
353
|
+
/** BroadcastChannel message handler utility @keywords broadcast, channel, message, worker */
|
|
220
354
|
export declare class BroadcastMessage<Message = any> {
|
|
221
|
-
|
|
222
|
-
protected callbackError?: ((event: MessageEvent<Message>) => void) | undefined;
|
|
355
|
+
/** @keywords constructor, init, channel */
|
|
223
356
|
constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
|
|
357
|
+
/** Gets the underlying BroadcastChannel instance @keywords get, channel, broadcast */
|
|
224
358
|
getChannel(): BroadcastChannel | undefined;
|
|
359
|
+
/** Posts a message to the channel @keywords post, send, message */
|
|
225
360
|
post(message: Message): this;
|
|
361
|
+
/** Sets the message reception callback @keywords set, callback, message */
|
|
226
362
|
setCallback(callback: (event: MessageEvent<Message>) => void): this;
|
|
363
|
+
/** Sets the message error callback @keywords set, callback, error */
|
|
227
364
|
setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
|
|
365
|
+
/** Destroys the channel connection @keywords destroy, close, channel */
|
|
228
366
|
destroy(): this;
|
|
229
|
-
protected readonly update: (event: MessageEvent<Message>) => this;
|
|
230
|
-
protected readonly updateError: (event: MessageEvent<Message>) => this;
|
|
231
367
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
*/
|
|
368
|
+
|
|
369
|
+
/** Simple in-memory cache class for computed values @keywords cache, memory, compute */
|
|
235
370
|
export declare class Cache {
|
|
371
|
+
/** Gets cached value or computes and stores it @keywords get, cache, value */
|
|
236
372
|
get<T>(name: string, callback: () => T, comparison?: any[]): T;
|
|
373
|
+
/** Asynchronously gets cached value or computes and stores it @keywords get, async, cache */
|
|
237
374
|
getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
|
|
238
375
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*/
|
|
376
|
+
|
|
377
|
+
/** Manages cached value with dependency tracking @keywords cache, item, memory, memoize */
|
|
242
378
|
export declare class CacheItem<T> {
|
|
379
|
+
/** Creates a CacheItem instance @keywords constructor, create */
|
|
243
380
|
constructor(callback: () => T);
|
|
381
|
+
/** Gets cached value, recomputing if dependencies change @keywords get, cache, memoize */
|
|
244
382
|
getCache(comparison: any[]): T;
|
|
383
|
+
/** Gets previous cached value before last update @keywords get, cache, old, previous */
|
|
245
384
|
getCacheOld(): T | undefined;
|
|
385
|
+
/** Asynchronously gets cached value, recomputing if dependencies change @keywords get, cache, async */
|
|
246
386
|
getCacheAsync(comparison: any[]): Promise<T>;
|
|
247
387
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*/
|
|
388
|
+
|
|
389
|
+
/** Static cache class using ServerStorage. @keywords cache static storage */
|
|
251
390
|
export declare class CacheStatic {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
391
|
+
/** Retrieves the Cache instance. @keywords get item storage */
|
|
392
|
+
protected static getItem(): Cache;
|
|
393
|
+
/** Returns cached value or computes it via callback. @keywords get cache value */
|
|
394
|
+
static get<T>(name: string, callback: () => T, comparison?: any[]): T;
|
|
395
|
+
/** Asynchronously returns cached value or computes it via callback. @keywords get async cache */
|
|
396
|
+
static getAsync<T>(name: string, callback: () => T, comparison?: any[]): Promise<T>;
|
|
255
397
|
}
|
|
256
|
-
|
|
398
|
+
|
|
399
|
+
/** Cookie options definition @keywords cookie_options, options */
|
|
400
|
+
export type CookieOptions = {
|
|
401
|
+
/** Max age in seconds @keywords max_age, age */
|
|
402
|
+
age?: number;
|
|
403
|
+
/** SameSite policy @keywords same_site, policy */
|
|
404
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
405
|
+
/** Cookie path @keywords path */
|
|
406
|
+
path?: string;
|
|
407
|
+
/** Cookie domain @keywords domain */
|
|
408
|
+
domain?: string;
|
|
409
|
+
/** Secure flag @keywords secure */
|
|
410
|
+
secure?: boolean;
|
|
411
|
+
/** HttpOnly flag @keywords httponly */
|
|
412
|
+
httpOnly?: boolean;
|
|
413
|
+
/** Partitioned flag @keywords partitioned */
|
|
414
|
+
partitioned?: boolean;
|
|
415
|
+
/** Additional cookie arguments @keywords arguments */
|
|
416
|
+
arguments?: Record<string, any> | string[];
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/** Class for working with cookies @keywords cookie, storage, browser */
|
|
257
420
|
export declare class Cookie<T> {
|
|
421
|
+
/** Cookie value @keywords value */
|
|
422
|
+
value: string | T | undefined;
|
|
423
|
+
/** Cookie options @keywords options */
|
|
424
|
+
options: CookieOptions;
|
|
425
|
+
/** Cookie name @keywords name */
|
|
426
|
+
name: string;
|
|
427
|
+
/** Returns an instance of the class according to the specified cookie name @keywords get_instance, cookie */
|
|
258
428
|
static getInstance<T>(name: string): Cookie<T>;
|
|
429
|
+
/** Creates a cookie instance @keywords constructor, cookie */
|
|
259
430
|
constructor(name: string);
|
|
431
|
+
/** Gets cookie data or sets default value if undefined @keywords get, cookie */
|
|
260
432
|
get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): string | T | undefined;
|
|
433
|
+
/** Sets cookie value and options @keywords set, cookie */
|
|
261
434
|
set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
|
|
435
|
+
/** Removes the cookie @keywords remove, delete, cookie */
|
|
262
436
|
remove(): void;
|
|
437
|
+
/** Updates the cookie with current value and options @keywords update, cookie */
|
|
438
|
+
update(): void;
|
|
263
439
|
}
|
|
264
|
-
|
|
440
|
+
|
|
441
|
+
/** Class for changing cookie access status. @keywords cookie, block, status */
|
|
265
442
|
export declare class CookieBlock {
|
|
443
|
+
/** Returns a request-isolated instance of CookieBlockInstance. @keywords instance, get, item */
|
|
266
444
|
static getItem(): CookieBlockInstance;
|
|
445
|
+
/** Obtaining status. @keywords get, status, blocked */
|
|
267
446
|
static get(): boolean;
|
|
447
|
+
/** Changing status. @keywords set, status, block */
|
|
268
448
|
static set(value: boolean): void;
|
|
269
449
|
}
|
|
270
|
-
|
|
450
|
+
|
|
451
|
+
/** Cookie block instance class @keywords cookie, block, status */
|
|
271
452
|
export declare class CookieBlockInstance {
|
|
453
|
+
/** Gets cookie block status @keywords get, cookie, block */
|
|
272
454
|
get(): boolean;
|
|
455
|
+
/** Sets cookie block status @keywords set, cookie, block */
|
|
273
456
|
set(value: boolean): void;
|
|
274
457
|
}
|
|
275
|
-
|
|
458
|
+
|
|
276
459
|
export type CookieSameSite = 'strict' | 'lax';
|
|
277
|
-
|
|
460
|
+
|
|
278
461
|
export type CookieOptions = {
|
|
279
462
|
age?: number;
|
|
280
463
|
sameSite?: CookieSameSite;
|
|
@@ -285,1541 +468,1915 @@ export type CookieOptions = {
|
|
|
285
468
|
partitioned?: boolean;
|
|
286
469
|
arguments?: string[] | Record<string, string | number | boolean>;
|
|
287
470
|
};
|
|
471
|
+
|
|
288
472
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
473
|
+
* Cookie storage management class with DOM and SSR support.
|
|
474
|
+
* @keywords cookie storage manager web storage
|
|
291
475
|
*/
|
|
292
476
|
export declare class CookieStorage {
|
|
293
477
|
protected static getListener?: (key: string) => any | undefined;
|
|
294
478
|
protected static getListenerRaw?: () => string;
|
|
295
479
|
protected static setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Initializes storage listeners.
|
|
483
|
+
* @keywords cookie init storage
|
|
484
|
+
*/
|
|
296
485
|
static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Resets storage state and clears items.
|
|
489
|
+
* @keywords cookie reset storage
|
|
490
|
+
*/
|
|
297
491
|
static reset(): void;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Gets cookie value by name.
|
|
495
|
+
* @keywords cookie get value
|
|
496
|
+
*/
|
|
298
497
|
static get<T>(name: string, defaultValue?: T | (() => T)): T | undefined;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Sets cookie value.
|
|
501
|
+
* @keywords cookie set value
|
|
502
|
+
*/
|
|
299
503
|
static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Removes cookie by name.
|
|
507
|
+
* @keywords cookie remove delete
|
|
508
|
+
*/
|
|
300
509
|
static remove(name: string): void;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Updates cookies from DOM.
|
|
513
|
+
* @keywords cookie update
|
|
514
|
+
*/
|
|
301
515
|
static update(): void;
|
|
516
|
+
|
|
302
517
|
protected static format(name: string, value: string, options?: CookieOptions): string;
|
|
518
|
+
|
|
303
519
|
protected static hasDom(): boolean;
|
|
520
|
+
|
|
304
521
|
protected static parse(cookie: string): Record<string, any>;
|
|
522
|
+
|
|
305
523
|
protected static initItems(): Record<string, any>;
|
|
524
|
+
|
|
306
525
|
protected static toMaxAge(stringValue: string, age?: CookieOptions['age']): string;
|
|
526
|
+
|
|
307
527
|
protected static toSameSite(sameSite?: CookieOptions['sameSite']): string;
|
|
528
|
+
|
|
308
529
|
protected static toPath(path?: CookieOptions['path']): string;
|
|
530
|
+
|
|
309
531
|
protected static toDomain(domain?: CookieOptions['domain']): string | undefined;
|
|
532
|
+
|
|
310
533
|
protected static toSecure(secure?: CookieOptions['secure']): string | undefined;
|
|
534
|
+
|
|
311
535
|
protected static toHttpOnly(httpOnly?: CookieOptions['httpOnly']): string | undefined;
|
|
536
|
+
|
|
312
537
|
protected static toPartitioned(partitioned?: CookieOptions['partitioned']): string | undefined;
|
|
538
|
+
|
|
313
539
|
protected static toArguments(args?: CookieOptions['arguments']): string[];
|
|
314
540
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
* Includes support for prefixes, expiration time, and request isolation in SSR.
|
|
318
|
-
*/
|
|
541
|
+
|
|
542
|
+
/** Class for managing localStorage and sessionStorage with prefix, expiration, and SSR isolation support. @keywords storage local session cache */
|
|
319
543
|
export declare class DataStorage<T> {
|
|
544
|
+
/** Sets a custom prefix for storage keys. @keywords prefix key */
|
|
320
545
|
static setPrefix(newPrefix: string): void;
|
|
546
|
+
/** Initializes a storage instance. @keywords constructor storage */
|
|
321
547
|
constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
|
|
548
|
+
/** Retrieves value from storage with optional cache duration and default fallback. @keywords get read storage */
|
|
322
549
|
get(defaultValue?: T | (() => T), cache?: number): T | undefined;
|
|
550
|
+
/** Sets a value in storage. @keywords set write storage */
|
|
323
551
|
set(value?: T | (() => T)): T | undefined;
|
|
552
|
+
/** Removes the item from storage. @keywords remove delete storage */
|
|
324
553
|
remove(): this;
|
|
554
|
+
/** Updates or reloads storage data. @keywords update refresh storage */
|
|
325
555
|
update(): this;
|
|
326
556
|
}
|
|
557
|
+
|
|
327
558
|
/**
|
|
328
559
|
* A class for working with dates.
|
|
329
|
-
*
|
|
330
|
-
* @remarks
|
|
331
|
-
* Creating a `Datetime` instance without a specific date (using the current time)
|
|
332
|
-
* for rendering in SSR may lead to hydration mismatches because the time or time zone
|
|
333
|
-
* on the server may differ from the time on the client.
|
|
560
|
+
* @keywords date datetime calendar timezone format
|
|
334
561
|
*/
|
|
335
562
|
export declare class Datetime {
|
|
336
563
|
protected watch?: (date: Date, type: GeoDate, hour24: boolean) => void;
|
|
337
564
|
constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
|
|
565
|
+
/** Returns an object for working with formatting. */
|
|
338
566
|
getIntl(): GeoIntl;
|
|
567
|
+
/** Returns a Date object. */
|
|
339
568
|
getDate(): Date;
|
|
569
|
+
/** Returns the type of data output. */
|
|
340
570
|
getType(): GeoDate;
|
|
571
|
+
/** Returns the format of hours. */
|
|
341
572
|
getHoursType(): GeoHours;
|
|
573
|
+
/** Whether to use 24-hour time format. */
|
|
342
574
|
getHour24(): boolean;
|
|
575
|
+
/** Returns the time zone offset in minutes. */
|
|
343
576
|
getTimeZoneOffset(): number;
|
|
577
|
+
/** Returns the time zone as a string. */
|
|
344
578
|
getTimeZone(style?: GeoTimeZoneStyle): string;
|
|
579
|
+
/** Returns the code of the first day of the week. */
|
|
345
580
|
getFirstDayCode(): GeoFirstDay;
|
|
581
|
+
/** Returns the year of the specified date. */
|
|
346
582
|
getYear(): number;
|
|
583
|
+
/** Returns the month of the specified date (1-12). */
|
|
347
584
|
getMonth(): number;
|
|
585
|
+
/** Returns the day of the month (1-31). */
|
|
348
586
|
getDay(): number;
|
|
587
|
+
/** Returns the hour (0-23). */
|
|
349
588
|
getHour(): number;
|
|
589
|
+
/** Returns the minutes (0-59). */
|
|
350
590
|
getMinute(): number;
|
|
591
|
+
/** Returns the seconds (0-59). */
|
|
351
592
|
getSecond(): number;
|
|
593
|
+
/** Returns the last day of the month (28-31). */
|
|
352
594
|
getMaxDay(): number;
|
|
595
|
+
/** Formats date and time according to locale. */
|
|
353
596
|
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
|
|
597
|
+
/** Returns the formatted year. */
|
|
354
598
|
localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
|
|
599
|
+
/** Returns the formatted month. */
|
|
355
600
|
localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
|
|
601
|
+
/** Returns the formatted day. */
|
|
356
602
|
localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
|
|
603
|
+
/** Returns the formatted hour. */
|
|
357
604
|
localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
|
|
605
|
+
/** Returns the formatted minute. */
|
|
358
606
|
localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
|
|
607
|
+
/** Returns the formatted second. */
|
|
359
608
|
localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
|
|
609
|
+
/** Returns standard date format string. */
|
|
360
610
|
standard(timeZone?: boolean): string;
|
|
611
|
+
/** Sets the date completely. */
|
|
361
612
|
setDate(value: NumberOrStringOrDate): this;
|
|
613
|
+
/** Sets the type of data output. */
|
|
362
614
|
setType(value: GeoDate): this;
|
|
615
|
+
/** Sets whether to use 24-hour time format. */
|
|
363
616
|
setHour24(value: boolean): this;
|
|
617
|
+
/** Sets the location code. */
|
|
364
618
|
setCode(code: string): this;
|
|
619
|
+
/** Sets the update watch callback. */
|
|
365
620
|
setWatch(watch: (date: Date, type: GeoDate, hour24: boolean) => void): this;
|
|
621
|
+
/** Sets the full year. */
|
|
366
622
|
setYear(value: number): this;
|
|
623
|
+
/** Sets the month (1-12). */
|
|
367
624
|
setMonth(value: number): this;
|
|
625
|
+
/** Sets the day of the month. */
|
|
368
626
|
setDay(value: number): this;
|
|
627
|
+
/** Sets the hours. */
|
|
369
628
|
setHour(value: number): this;
|
|
629
|
+
/** Sets the minutes. */
|
|
370
630
|
setMinute(value: number): this;
|
|
631
|
+
/** Sets the seconds. */
|
|
371
632
|
setSecond(value: number): this;
|
|
633
|
+
/** Shifts the date by years. */
|
|
372
634
|
moveByYear(value: number): this;
|
|
635
|
+
/** Shifts the date by months. */
|
|
373
636
|
moveByMonth(value: number): this;
|
|
637
|
+
/** Shifts the date by days. */
|
|
374
638
|
moveByDay(value: number): this;
|
|
639
|
+
/** Shifts the date by hours. */
|
|
375
640
|
moveByHour(value: number): this;
|
|
641
|
+
/** Shifts the date by minutes. */
|
|
376
642
|
moveByMinute(value: number): this;
|
|
643
|
+
/** Shifts the date by seconds. */
|
|
377
644
|
moveBySecond(value: number): this;
|
|
645
|
+
/** Moves to January of the current year. */
|
|
378
646
|
moveMonthFirst(): this;
|
|
647
|
+
/** Moves to December of the current year. */
|
|
379
648
|
moveMonthLast(): this;
|
|
649
|
+
/** Moves to the first day of the next month. */
|
|
380
650
|
moveMonthNext(): this;
|
|
651
|
+
/** Moves to the first day of the previous month. */
|
|
381
652
|
moveMonthPrevious(): this;
|
|
653
|
+
/** Moves to the first day of the week. */
|
|
382
654
|
moveWeekdayFirst(): this;
|
|
655
|
+
/** Moves to the last day of the week. */
|
|
383
656
|
moveWeekdayLast(): this;
|
|
657
|
+
/** Moves to the first weekday of the month. */
|
|
384
658
|
moveWeekdayFirstByMonth(): this;
|
|
659
|
+
/** Moves to the last weekday of the month. */
|
|
385
660
|
moveWeekdayLastByMonth(): this;
|
|
661
|
+
/** Moves to the next week. */
|
|
386
662
|
moveWeekdayNext(): this;
|
|
663
|
+
/** Moves to the previous week. */
|
|
387
664
|
moveWeekdayPrevious(): this;
|
|
665
|
+
/** Moves to the first day of the month. */
|
|
388
666
|
moveDayFirst(): this;
|
|
667
|
+
/** Moves to the last day of the month. */
|
|
389
668
|
moveDayLast(): this;
|
|
669
|
+
/** Moves to the next day. */
|
|
390
670
|
moveDayNext(): this;
|
|
671
|
+
/** Moves to the previous day. */
|
|
391
672
|
moveDayPrevious(): this;
|
|
673
|
+
/** Clones the Date object. */
|
|
392
674
|
clone(): Date;
|
|
675
|
+
/** Clones the Datetime instance. */
|
|
393
676
|
cloneClass(): Datetime;
|
|
677
|
+
/** Clones and moves to the first month. */
|
|
394
678
|
cloneMonthFirst(): Datetime;
|
|
679
|
+
/** Clones and moves to the last month. */
|
|
395
680
|
cloneMonthLast(): Datetime;
|
|
681
|
+
/** Clones and moves to the next month. */
|
|
396
682
|
cloneMonthNext(): Datetime;
|
|
683
|
+
/** Clones and moves to the previous month. */
|
|
397
684
|
cloneMonthPrevious(): Datetime;
|
|
685
|
+
/** Clones and moves to the first day of the week. */
|
|
398
686
|
cloneWeekdayFirst(): Datetime;
|
|
687
|
+
/** Clones and moves to the last day of the week. */
|
|
399
688
|
cloneWeekdayLast(): Datetime;
|
|
689
|
+
/** Clones and moves to the first weekday of the month. */
|
|
400
690
|
cloneWeekdayFirstByMonth(): Datetime;
|
|
691
|
+
/** Clones and moves to the last weekday of the month. */
|
|
401
692
|
cloneWeekdayLastByMonth(): Datetime;
|
|
693
|
+
/** Clones and moves to the next week. */
|
|
402
694
|
cloneWeekdayNext(): Datetime;
|
|
695
|
+
/** Clones and moves to the previous week. */
|
|
403
696
|
cloneWeekdayPrevious(): Datetime;
|
|
697
|
+
/** Clones and moves to the first day of the month. */
|
|
404
698
|
cloneDayFirst(): Datetime;
|
|
699
|
+
/** Clones and moves to the last day of the month. */
|
|
405
700
|
cloneDayLast(): Datetime;
|
|
701
|
+
/** Clones and moves to the next day. */
|
|
406
702
|
cloneDayNext(): Datetime;
|
|
703
|
+
/** Clones and moves to the previous day. */
|
|
407
704
|
cloneDayPrevious(): Datetime;
|
|
408
705
|
protected toTimeZoneHourFormat(hour: number): string;
|
|
409
706
|
protected update(): this;
|
|
410
707
|
}
|
|
411
|
-
|
|
708
|
+
|
|
709
|
+
/** Error management and storage class @keywords error center handler */
|
|
412
710
|
export declare class ErrorCenter {
|
|
711
|
+
/** Returns request-isolated ErrorCenterInstance @keywords get item instance */
|
|
413
712
|
static getItem(): ErrorCenterInstance;
|
|
713
|
+
/** Checks if error cause exists @keywords has check error */
|
|
414
714
|
static has(code: string, group?: string): boolean;
|
|
715
|
+
/** Gets specific error cause @keywords get error cause */
|
|
415
716
|
static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
|
|
717
|
+
/** Adds error cause @keywords add error cause */
|
|
416
718
|
static add(cause: ErrorCenterCauseItem): void;
|
|
719
|
+
/** Adds list of error causes @keywords add list causes */
|
|
417
720
|
static addList(causes: ErrorCenterCauseList): void;
|
|
721
|
+
/** Registers error handler @keywords add handler */
|
|
418
722
|
static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
|
|
723
|
+
/** Registers list of error handlers @keywords add handler list */
|
|
419
724
|
static addHandlerList(handlers: ErrorCenterHandlerList): void;
|
|
725
|
+
/** Adds global error callback @keywords add callback */
|
|
420
726
|
static addCallback(callback: ErrorCenterHandlerCallback): void;
|
|
727
|
+
/** Sets console output configuration @keywords set console */
|
|
421
728
|
static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
|
|
729
|
+
/** Triggers error event handling @keywords on error */
|
|
422
730
|
static on(cause: ErrorCenterCauseItem): void;
|
|
423
731
|
}
|
|
424
|
-
|
|
732
|
+
|
|
733
|
+
/** ErrorCenterHandler class for managing and triggering error handlers. @keywords error center handler */
|
|
425
734
|
export declare class ErrorCenterHandler {
|
|
735
|
+
/** Constructor @keywords constructor error handler */
|
|
426
736
|
constructor(handlers?: ErrorCenterHandlerList, isConsole?: ErrorCenterHandlerIsConsole);
|
|
737
|
+
/** Checks if handlers exist for a group. @keywords has error group */
|
|
427
738
|
has(group: ErrorCenterGroup): boolean;
|
|
739
|
+
/** Gets handlers for a group. @keywords get error group */
|
|
428
740
|
get(group: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
|
|
741
|
+
/** Adds a handler for a specific group. @keywords add error handler */
|
|
429
742
|
add(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
|
|
743
|
+
/** Adds a list of group-based handlers. @keywords add error handler list */
|
|
430
744
|
addList(handlers: ErrorCenterHandlerList): this;
|
|
745
|
+
/** Adds a callback to be executed on any error. @keywords add error callback */
|
|
431
746
|
addCallback(callback: ErrorCenterHandlerCallback): this;
|
|
747
|
+
/** Sets console output flag or filter function. @keywords set error console */
|
|
432
748
|
setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
|
|
749
|
+
/** Triggers handlers for a group and logs to console. @keywords trigger error on */
|
|
433
750
|
on(cause: ErrorCenterCauseItem): this;
|
|
434
|
-
protected toConsole(cause: ErrorCenterCauseItem): this;
|
|
435
751
|
}
|
|
436
|
-
|
|
752
|
+
|
|
753
|
+
/** Manage error storage and handling within an instance @keywords error_center instance handler */
|
|
437
754
|
export declare class ErrorCenterInstance {
|
|
755
|
+
/** @keywords constructor init */
|
|
438
756
|
constructor(causes?: ErrorCenterCauseList, handler?: ErrorCenterHandler);
|
|
757
|
+
/** Check if error cause exists @keywords check exists error cause */
|
|
439
758
|
has(code: string, group?: string): boolean;
|
|
759
|
+
/** Get specific error cause item @keywords get error cause */
|
|
440
760
|
get(code: string, group?: string): ErrorCenterCauseItem | undefined;
|
|
761
|
+
/** Add error cause to storage @keywords add error cause */
|
|
441
762
|
add(cause: ErrorCenterCauseItem): this;
|
|
763
|
+
/** Add list of error causes to storage @keywords add error cause list */
|
|
442
764
|
addList(causes: ErrorCenterCauseList): this;
|
|
765
|
+
/** Register new error handler @keywords add error handler */
|
|
443
766
|
addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): this;
|
|
767
|
+
/** Register list of error handlers @keywords add error handler list */
|
|
444
768
|
addHandlerList(handlers: ErrorCenterHandlerList): this;
|
|
769
|
+
/** Add global error callback @keywords add error callback */
|
|
445
770
|
addCallback(callback: ErrorCenterHandlerCallback): this;
|
|
771
|
+
/** Set console output option @keywords set console output */
|
|
446
772
|
setIsConsole(isConsole: ErrorCenterHandlerIsConsole): this;
|
|
773
|
+
/** Trigger error handling @keywords trigger handle error */
|
|
447
774
|
on(cause: ErrorCenterCauseItem): this;
|
|
775
|
+
/** Merge cause with stored data @keywords assign merge error cause */
|
|
448
776
|
protected assign(cause: ErrorCenterCauseItem): ErrorCenterCauseItem;
|
|
449
777
|
}
|
|
778
|
+
|
|
450
779
|
/**
|
|
451
|
-
* Advanced wrapper for managing event listeners on DOM elements or
|
|
452
|
-
*
|
|
453
|
-
* `EventItem` simplifies the entire event lifecycle (start, stop, toggle, reset), provides
|
|
454
|
-
* built-in optimizations for high-frequency events, and ensures DOM safety by automatically
|
|
455
|
-
* checking if elements are still in the document.
|
|
456
|
-
*
|
|
457
|
-
* ### Key Features:
|
|
458
|
-
* - **Lifecycle Control**: Easily `start`, `stop`, `toggle`, or `reset` event listeners.
|
|
459
|
-
* - **DOM Safety**: Automatically halts the event if the target element is removed from the DOM.
|
|
460
|
-
* - **Specialized Optimizations**:
|
|
461
|
-
* - `resize`: Uses `ResizeObserver` for any HTML element (not limited to `window`).
|
|
462
|
-
* - `scroll-sync`: High-performance scroll tracking using `requestAnimationFrame`.
|
|
463
|
-
* - **Dynamic Configuration**: Chained setters for target element, event type, listener, and options.
|
|
464
|
-
* - **Custom Event Dispatching**: Built-in support for triggering events with custom data via `dispatch`.
|
|
465
|
-
* - **Strict Typing**: Generic support for elements, event objects, and custom detail data.
|
|
466
|
-
*
|
|
467
|
-
* ### Usage Examples:
|
|
468
|
-
*
|
|
469
|
-
* #### 1. Basic Listener
|
|
470
|
-
* ```typescript
|
|
471
|
-
* const clickEvent = new EventItem('.btn', 'click', (e) => console.log('Clicked!'));
|
|
472
|
-
* clickEvent.start();
|
|
473
|
-
* ```
|
|
474
|
-
*
|
|
475
|
-
* #### 2. Specialized 'resize' and 'scroll-sync'
|
|
476
|
-
* ```typescript
|
|
477
|
-
* // Tracks any element's size
|
|
478
|
-
* const resizeEvent = new EventItem('.box', 'resize', (entry) => console.log('New size:', entry));
|
|
479
|
-
*
|
|
480
|
-
* // Performance-optimized scroll
|
|
481
|
-
* const scrollEvent = new EventItem(window, 'scroll-sync', () => console.log('Scrolling...'));
|
|
482
|
-
*
|
|
483
|
-
* resizeEvent.start();
|
|
484
|
-
* scrollEvent.start();
|
|
485
|
-
* ```
|
|
486
|
-
*
|
|
487
|
-
* #### 3. Custom Data and Dispatching
|
|
488
|
-
* ```typescript
|
|
489
|
-
* interface UserData { id: number }
|
|
490
|
-
* const emitter = new EventItem<Window, CustomEvent, UserData>(window, 'user-update');
|
|
491
|
-
*
|
|
492
|
-
* emitter.setListener((e, detail) => {
|
|
493
|
-
* console.log('Update received for ID:', detail?.id);
|
|
494
|
-
* });
|
|
495
|
-
*
|
|
496
|
-
* emitter.start();
|
|
497
|
-
*
|
|
498
|
-
* // Trigger manually with data
|
|
499
|
-
* emitter.dispatch({ id: 456 });
|
|
500
|
-
* ```
|
|
501
|
-
*
|
|
502
|
-
* #### 4. Chaining and Dynamic Updates
|
|
503
|
-
* ```typescript
|
|
504
|
-
* const tracker = new EventItem('.item-1', 'mousemove', (e) => console.log(e.clientX));
|
|
505
|
-
*
|
|
506
|
-
* // Switch element on the fly
|
|
507
|
-
* tracker.start().setElement('.item-2');
|
|
508
|
-
* ```
|
|
780
|
+
* Advanced wrapper for managing event listeners on DOM elements or window.
|
|
781
|
+
* @keywords event_item dom_events event_listener resize scroll
|
|
509
782
|
*/
|
|
510
783
|
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> {
|
|
784
|
+
/** Event listener callback wrapper */
|
|
511
785
|
protected listenerRecent: (event?: O | ResizeObserverEntry) => void;
|
|
786
|
+
/**
|
|
787
|
+
* Create an EventItem instance.
|
|
788
|
+
* @keywords constructor
|
|
789
|
+
*/
|
|
512
790
|
constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
|
|
791
|
+
/** Check whether event listening is currently enabled @keywords is_active */
|
|
513
792
|
isActive(): boolean;
|
|
793
|
+
/** Return the target element @keywords get_element */
|
|
514
794
|
getElement(): E | undefined;
|
|
795
|
+
/** Change of an element for tracking @keywords set_element */
|
|
515
796
|
setElement(elementSelector?: ElementOrString<E>): this;
|
|
797
|
+
/** Modify the control element for DOM safety checks @keywords set_element_control */
|
|
516
798
|
setElementControl<EC extends HTMLElement>(elementSelector?: ElementOrString<EC>): this;
|
|
799
|
+
/** Change the type of the handled event @keywords set_type */
|
|
517
800
|
setType(type: string | string[]): this;
|
|
801
|
+
/** Modify the listener function @keywords set_listener */
|
|
518
802
|
setListener(listener: EventListenerDetail<O, D>): this;
|
|
803
|
+
/** Modify the options object that defines event listener characteristics @keywords set_options */
|
|
519
804
|
setOptions(options?: EventOptions): this;
|
|
805
|
+
/** Modify additional data provided to the listener @keywords set_detail */
|
|
520
806
|
setDetail(detail?: D): this;
|
|
807
|
+
/** Trigger events on the target element @keywords dispatch custom_event */
|
|
521
808
|
dispatch(detail?: D | undefined): this;
|
|
809
|
+
/** Start event listening @keywords start */
|
|
522
810
|
start(): this;
|
|
811
|
+
/** Stop event listening @keywords stop */
|
|
523
812
|
stop(): this;
|
|
813
|
+
/** Toggle event handler state @keywords toggle */
|
|
524
814
|
toggle(activity: boolean): this;
|
|
815
|
+
/** Reset listening events @keywords reset */
|
|
525
816
|
reset(): this;
|
|
817
|
+
/** Check if ResizeObserver exists @keywords is_observer */
|
|
526
818
|
protected isObserver(): boolean;
|
|
819
|
+
/** Implementation of resize event @keywords make_resize */
|
|
527
820
|
protected makeResize(): boolean;
|
|
821
|
+
/** Implementation of scroll event @keywords make_scroll */
|
|
528
822
|
protected makeScroll(): boolean;
|
|
529
823
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
* @template List type of the list of items (can be an array or a single item).
|
|
533
|
-
* @template Item type of a single item in the list.
|
|
534
|
-
*/
|
|
824
|
+
|
|
825
|
+
/** @keywords formatters, format_data, formatting */
|
|
535
826
|
export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
* @param options additional options for the specific formatter
|
|
571
|
-
* @protected
|
|
572
|
-
* @returns Formatted string
|
|
573
|
-
*/
|
|
574
|
-
protected transformation<Type extends FormattersType>(valueOriginal: any, item: any, type?: Type, options?: FormattersOptionsInformation<Type>): string;
|
|
575
|
-
/** Formats a value as currency.
|
|
576
|
-
* @param value value to format
|
|
577
|
-
* @param item item context
|
|
578
|
-
* @param options currency formatting options
|
|
579
|
-
* @protected
|
|
580
|
-
* @returns Formatted currency string
|
|
581
|
-
*/
|
|
582
|
-
protected formatCurrency(value: any, item: Item, options?: FormattersOptionsCurrency): string;
|
|
583
|
-
/** Formats a value as a date.
|
|
584
|
-
* @param value value to format
|
|
585
|
-
* @param options date formatting options
|
|
586
|
-
* @protected
|
|
587
|
-
* @returns Formatted date string
|
|
588
|
-
*/
|
|
589
|
-
protected formatDate(value: any, options?: FormattersOptionsDate): string;
|
|
590
|
-
/** Formats full name from multiple property names.
|
|
591
|
-
* @param item item context containing name components
|
|
592
|
-
* @param options name formatting options (prop names for first, last, surname)
|
|
593
|
-
* @protected
|
|
594
|
-
* @returns Formatted name string or empty string if components are missing
|
|
595
|
-
*/
|
|
596
|
-
protected formatName(item: Item, options?: FormattersOptionsName): string;
|
|
597
|
-
/** Formats a value as a number.
|
|
598
|
-
* @param value value to format
|
|
599
|
-
* @param options number formatting options
|
|
600
|
-
* @protected
|
|
601
|
-
* @returns Formatted number string
|
|
602
|
-
*/
|
|
603
|
-
protected formatNumber(value: any, options?: FormattersOptionsNumber): string;
|
|
604
|
-
/** Formats a value based on plural rules.
|
|
605
|
-
* @param value numeric value for pluralization
|
|
606
|
-
* @param options plural formatting options (words and rules)
|
|
607
|
-
* @protected
|
|
608
|
-
* @returns Formatted plural string
|
|
609
|
-
*/
|
|
610
|
-
protected formatPlural(value: any, options?: FormattersOptionsPlural): string;
|
|
611
|
-
/** Formats a value with a specific unit.
|
|
612
|
-
* @param value value to format
|
|
613
|
-
* @param options unit formatting options
|
|
614
|
-
* @protected
|
|
615
|
-
* @returns Formatted unit string
|
|
616
|
-
*/
|
|
617
|
-
protected formatUnit(value: any, options?: FormattersOptionsUnit): string;
|
|
827
|
+
/** @keywords constructor, init */
|
|
828
|
+
constructor(options: Options, list?: List | undefined);
|
|
829
|
+
/** @keywords is, check, exists */
|
|
830
|
+
is(): boolean;
|
|
831
|
+
/** @keywords is_array, check */
|
|
832
|
+
isArray(): this is this & {
|
|
833
|
+
list: FormattersList<Item>;
|
|
834
|
+
};
|
|
835
|
+
/** @keywords length, count */
|
|
836
|
+
length(): number;
|
|
837
|
+
/** @keywords get_list, array */
|
|
838
|
+
getList(): FormattersList<Item>;
|
|
839
|
+
/** @keywords get_options, config */
|
|
840
|
+
getOptions(): Options;
|
|
841
|
+
/** @keywords set_list, update */
|
|
842
|
+
setList(list?: List): this;
|
|
843
|
+
/** @keywords to, format, transform */
|
|
844
|
+
to(): FormattersReturn<List, Options>;
|
|
845
|
+
/** @keywords get_format_data, record */
|
|
846
|
+
protected getFormatData(item: Item): Record<string, string>;
|
|
847
|
+
/** @keywords transformation, format */
|
|
848
|
+
protected transformation<Type extends FormattersType>(valueOriginal: any, item: any, type?: Type, options?: FormattersOptionsInformation<Type>): string;
|
|
849
|
+
/** @keywords format_currency, money */
|
|
850
|
+
protected formatCurrency(value: any, item: Item, options?: FormattersOptionsCurrency): string;
|
|
851
|
+
/** @keywords format_date, time */
|
|
852
|
+
protected formatDate(value: any, options?: FormattersOptionsDate): string;
|
|
853
|
+
/** @keywords format_name, person */
|
|
854
|
+
protected formatName(item: Item, options?: FormattersOptionsName): string;
|
|
855
|
+
/** @keywords format_number, digit */
|
|
856
|
+
protected formatNumber(value: any, options?: FormattersOptionsNumber): string;
|
|
857
|
+
/** @keywords format_plural, words */
|
|
858
|
+
protected formatPlural(value: any, options?: FormattersOptionsPlural): string;
|
|
859
|
+
/** @keywords format_unit, measurement */
|
|
860
|
+
protected formatUnit(value: any, options?: FormattersOptionsUnit): string;
|
|
618
861
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
*/
|
|
862
|
+
|
|
863
|
+
/** @keywords Geo, localization, country, timezone, language */
|
|
622
864
|
export declare class Geo {
|
|
623
|
-
/**
|
|
624
|
-
static getObject():
|
|
625
|
-
/**
|
|
865
|
+
/** @keywords getObject, instance */
|
|
866
|
+
static getObject(): GeoItemInstance;
|
|
867
|
+
/** @keywords get, current, geo */
|
|
626
868
|
static get(): GeoItemFull;
|
|
627
|
-
/**
|
|
869
|
+
/** @keywords getCountry, country */
|
|
628
870
|
static getCountry(): string;
|
|
629
|
-
/**
|
|
871
|
+
/** @keywords getLanguage, language */
|
|
630
872
|
static getLanguage(): string;
|
|
631
|
-
/**
|
|
873
|
+
/** @keywords getStandard, standard, locale */
|
|
632
874
|
static getStandard(): string;
|
|
633
|
-
/**
|
|
875
|
+
/** @keywords getFirstDay, week */
|
|
634
876
|
static getFirstDay(): string;
|
|
635
|
-
/**
|
|
877
|
+
/** @keywords getLocation, location */
|
|
636
878
|
static getLocation(): string;
|
|
637
|
-
/**
|
|
879
|
+
/** @keywords getLocationCountry, country */
|
|
638
880
|
static getLocationCountry(): string;
|
|
639
|
-
/**
|
|
881
|
+
/** @keywords getLocationLanguage, language */
|
|
640
882
|
static getLocationLanguage(): string;
|
|
641
|
-
/**
|
|
883
|
+
/** @keywords getItem, geo */
|
|
642
884
|
static getItem(): GeoItemFull;
|
|
643
|
-
/**
|
|
885
|
+
/** @keywords getList, countries, regions */
|
|
644
886
|
static getList(): GeoItem[];
|
|
645
|
-
/**
|
|
646
|
-
* @param code country or language code
|
|
647
|
-
*/
|
|
887
|
+
/** @keywords getByCode, geo */
|
|
648
888
|
static getByCode(code?: string): GeoItemFull;
|
|
649
|
-
/**
|
|
650
|
-
* @param code full locale string
|
|
651
|
-
*/
|
|
889
|
+
/** @keywords getByCodeFull, locale */
|
|
652
890
|
static getByCodeFull(code: string): GeoItem | undefined;
|
|
653
|
-
/**
|
|
654
|
-
* @param country country code
|
|
655
|
-
*/
|
|
891
|
+
/** @keywords getByCountry, country */
|
|
656
892
|
static getByCountry(country: string): GeoItem | undefined;
|
|
657
|
-
/**
|
|
658
|
-
* @param language language code
|
|
659
|
-
*/
|
|
893
|
+
/** @keywords getByLanguage, language */
|
|
660
894
|
static getByLanguage(language: string): GeoItem | undefined;
|
|
661
|
-
/**
|
|
895
|
+
/** @keywords getTimezone, timezone */
|
|
662
896
|
static getTimezone(): number;
|
|
663
|
-
/**
|
|
897
|
+
/** @keywords getTimezoneFormat, timezone */
|
|
664
898
|
static getTimezoneFormat(): string;
|
|
665
|
-
/**
|
|
666
|
-
* @param code country or language code
|
|
667
|
-
*/
|
|
899
|
+
/** @keywords find, geo */
|
|
668
900
|
static find(code: string): GeoItemFull;
|
|
669
|
-
/**
|
|
670
|
-
* @param item geo item data
|
|
671
|
-
*/
|
|
901
|
+
/** @keywords toStandard, geo */
|
|
672
902
|
static toStandard(item: GeoItem): string;
|
|
673
|
-
/**
|
|
674
|
-
* @param code location code
|
|
675
|
-
* @param save whether to persist the change in storage
|
|
676
|
-
*/
|
|
903
|
+
/** @keywords set, location */
|
|
677
904
|
static set(code: string, save?: boolean): void;
|
|
678
|
-
/**
|
|
679
|
-
* @param timezone timezone offset in minutes
|
|
680
|
-
*/
|
|
905
|
+
/** @keywords setTimezone, timezone */
|
|
681
906
|
static setTimezone(timezone: number): void;
|
|
682
|
-
/**
|
|
683
|
-
* @param code default code value
|
|
684
|
-
*/
|
|
907
|
+
/** @keywords setValueDefault, default */
|
|
685
908
|
static setValueDefault(code?: string | (() => string)): void;
|
|
686
909
|
}
|
|
910
|
+
|
|
687
911
|
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
688
|
-
/**
|
|
689
|
-
* Provides methods for retrieving country names, languages, and flag icons.
|
|
690
|
-
*/
|
|
912
|
+
/** GeoFlag helper for country codes and flag icons. @keywords geo, flag, country, language */
|
|
691
913
|
export declare class GeoFlag {
|
|
692
|
-
/**
|
|
693
|
-
* @param code country and language code
|
|
694
|
-
*/
|
|
914
|
+
/** @keywords constructor */
|
|
695
915
|
constructor(code?: string);
|
|
696
|
-
/**
|
|
697
|
-
* @param code country code
|
|
698
|
-
*/
|
|
916
|
+
/** Gets country item and flag. @keywords get, flag, country */
|
|
699
917
|
get(code?: string): GeoFlagItem | undefined;
|
|
700
|
-
/**
|
|
701
|
-
* @param code country code
|
|
702
|
-
*/
|
|
918
|
+
/** Gets language item and flag. @keywords get, language, flag */
|
|
703
919
|
getLanguage(code?: string): GeoFlagItem | undefined;
|
|
704
|
-
/**
|
|
920
|
+
/** Gets current flag code. @keywords get, code */
|
|
705
921
|
getCode(): string;
|
|
706
|
-
/**
|
|
707
|
-
* @param code country code
|
|
708
|
-
*/
|
|
922
|
+
/** Gets flag icon name. @keywords get, flag, icon */
|
|
709
923
|
getFlag(code?: string): string | undefined;
|
|
710
|
-
/**
|
|
711
|
-
* If no codes are provided, returns all available countries.
|
|
712
|
-
* @param codes array of country codes
|
|
713
|
-
* @param sort whether to sort the list
|
|
714
|
-
*/
|
|
924
|
+
/** Gets country list. @keywords get, list, country */
|
|
715
925
|
getList(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
716
|
-
/**
|
|
717
|
-
* If no codes are provided, returns all available languages.
|
|
718
|
-
* @param codes array of country codes
|
|
719
|
-
* @param sort whether to sort the list
|
|
720
|
-
*/
|
|
926
|
+
/** Gets language list. @keywords get, list, language */
|
|
721
927
|
getListLanguage(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
722
|
-
/**
|
|
723
|
-
* @param codes array of country codes
|
|
724
|
-
* @param sort whether to sort the list
|
|
725
|
-
*/
|
|
928
|
+
/** Gets national country list. @keywords get, national, country */
|
|
726
929
|
getNational(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
727
|
-
/**
|
|
728
|
-
* @param codes array of country codes
|
|
729
|
-
* @param sort whether to sort the list
|
|
730
|
-
*/
|
|
930
|
+
/** Gets national language list. @keywords get, national, language */
|
|
731
931
|
getNationalLanguage(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
732
|
-
/**
|
|
733
|
-
* @param code country and language code
|
|
734
|
-
*/
|
|
932
|
+
/** Sets current code. @keywords set, code */
|
|
735
933
|
setCode(code: string): this;
|
|
736
|
-
/**
|
|
737
|
-
* @protected
|
|
738
|
-
*/
|
|
934
|
+
/** Gets GeoIntl instance. @keywords get, location, intl */
|
|
739
935
|
protected getLocation(): GeoIntl;
|
|
740
|
-
/**
|
|
741
|
-
* @param codes optional array of codes
|
|
742
|
-
* @protected
|
|
743
|
-
*/
|
|
936
|
+
/** Gets codes array. @keywords get, codes */
|
|
744
937
|
protected getCodes(codes?: string[]): string[];
|
|
745
|
-
/**
|
|
746
|
-
* @param data object with information of data
|
|
747
|
-
*/
|
|
938
|
+
/** Gets language name. @keywords get, language, name */
|
|
748
939
|
protected getLanguageName(data: GeoItemFull): string;
|
|
749
|
-
/**
|
|
750
|
-
* @param data object with information of data
|
|
751
|
-
*/
|
|
940
|
+
/** Gets country name. @keywords get, country, name */
|
|
752
941
|
protected getCountry(data: GeoItemFull): string;
|
|
753
942
|
}
|
|
754
|
-
|
|
943
|
+
|
|
755
944
|
export declare const UI_GEO_COOKIE_KEY = "ui-geo-code";
|
|
756
|
-
/**
|
|
757
|
-
*
|
|
945
|
+
/**
|
|
946
|
+
* Base class for working with geographic data.
|
|
947
|
+
* @keywords geo location country language timezone
|
|
758
948
|
*/
|
|
759
949
|
export declare class GeoInstance {
|
|
950
|
+
/**
|
|
951
|
+
* Initializes the location and related data.
|
|
952
|
+
* @keywords constructor geo instance
|
|
953
|
+
*/
|
|
760
954
|
constructor();
|
|
955
|
+
/**
|
|
956
|
+
* Getting information about the current country.
|
|
957
|
+
* @keywords get geo item
|
|
958
|
+
*/
|
|
761
959
|
get(): GeoItemFull;
|
|
960
|
+
/**
|
|
961
|
+
* Getting the current country code.
|
|
962
|
+
* @keywords get country code
|
|
963
|
+
*/
|
|
762
964
|
getCountry(): string;
|
|
965
|
+
/**
|
|
966
|
+
* Getting the current language code.
|
|
967
|
+
* @keywords get language code
|
|
968
|
+
*/
|
|
763
969
|
getLanguage(): string;
|
|
970
|
+
/**
|
|
971
|
+
* Getting the full format according to the standard (language-country).
|
|
972
|
+
* @keywords get standard string
|
|
973
|
+
*/
|
|
764
974
|
getStandard(): string;
|
|
975
|
+
/**
|
|
976
|
+
* Getting the first day of the week for the current country.
|
|
977
|
+
* @keywords get first day week
|
|
978
|
+
*/
|
|
765
979
|
getFirstDay(): string;
|
|
980
|
+
/**
|
|
981
|
+
* Getting the current location string.
|
|
982
|
+
* @keywords get location string
|
|
983
|
+
*/
|
|
766
984
|
getLocation(): string;
|
|
985
|
+
/**
|
|
986
|
+
* Getting the country code from the location.
|
|
987
|
+
* @keywords get location country
|
|
988
|
+
*/
|
|
767
989
|
getLocationCountry(): string;
|
|
990
|
+
/**
|
|
991
|
+
* Getting the language code from the location.
|
|
992
|
+
* @keywords get location language
|
|
993
|
+
*/
|
|
768
994
|
getLocationLanguage(): string;
|
|
995
|
+
/**
|
|
996
|
+
* Getting processed data including the current language.
|
|
997
|
+
* @keywords get geo item full
|
|
998
|
+
*/
|
|
769
999
|
getItem(): GeoItemFull;
|
|
1000
|
+
/**
|
|
1001
|
+
* Returns the full list of available countries.
|
|
1002
|
+
* @keywords get list countries
|
|
1003
|
+
*/
|
|
770
1004
|
getList(): GeoItem[];
|
|
1005
|
+
/**
|
|
1006
|
+
* Returns data about the country by its code.
|
|
1007
|
+
* @keywords get by code geo
|
|
1008
|
+
*/
|
|
771
1009
|
getByCode(code?: string): GeoItemFull;
|
|
1010
|
+
/**
|
|
1011
|
+
* Returns full data by language and country combination.
|
|
1012
|
+
* @keywords get by code full
|
|
1013
|
+
*/
|
|
772
1014
|
getByCodeFull(code: string): GeoItem | undefined;
|
|
1015
|
+
/**
|
|
1016
|
+
* Returns full data by country code.
|
|
1017
|
+
* @keywords get by country
|
|
1018
|
+
*/
|
|
773
1019
|
getByCountry(country: string): GeoItem | undefined;
|
|
1020
|
+
/**
|
|
1021
|
+
* Returns full data by language code.
|
|
1022
|
+
* @keywords get by language
|
|
1023
|
+
*/
|
|
774
1024
|
getByLanguage(language: string): GeoItem | undefined;
|
|
1025
|
+
/**
|
|
1026
|
+
* Returns the current time zone offset in minutes.
|
|
1027
|
+
* @keywords get timezone offset
|
|
1028
|
+
*/
|
|
775
1029
|
getTimezone(): number;
|
|
1030
|
+
/**
|
|
1031
|
+
* Returns the current time zone offset in a formatted string.
|
|
1032
|
+
* @keywords get timezone format
|
|
1033
|
+
*/
|
|
776
1034
|
getTimezoneFormat(): string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Finds the country data by its code or name.
|
|
1037
|
+
* @keywords find geo
|
|
1038
|
+
*/
|
|
777
1039
|
find(code: string): GeoItemFull;
|
|
1040
|
+
/**
|
|
1041
|
+
* Converts a geo item to its standard string representation.
|
|
1042
|
+
* @keywords to standard geo
|
|
1043
|
+
*/
|
|
778
1044
|
toStandard(item: GeoItem, language?: string): string;
|
|
1045
|
+
/**
|
|
1046
|
+
* Updates the current location and related data.
|
|
1047
|
+
* @keywords set geo location
|
|
1048
|
+
*/
|
|
779
1049
|
set(code: string, save?: boolean): void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Updates the default time zone offset.
|
|
1052
|
+
* @keywords set timezone
|
|
1053
|
+
*/
|
|
780
1054
|
setTimezone(timezone: number): void;
|
|
1055
|
+
/**
|
|
1056
|
+
* Sets the default value for the country code.
|
|
1057
|
+
* @keywords set value default
|
|
1058
|
+
*/
|
|
781
1059
|
setValueDefault(code?: string | (() => string)): void;
|
|
782
1060
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
* to the internationalization constructors and other language sensitive functions. Collectively,
|
|
786
|
-
* they comprise the ECMAScript Internationalization API, which provides language sensitive
|
|
787
|
-
* string comparison, number formatting, date and time formatting, and more
|
|
788
|
-
*/
|
|
1061
|
+
|
|
1062
|
+
/** Intl internationalization and localization helper class. @keywords geo, intl, format, locale */
|
|
789
1063
|
export declare class GeoIntl {
|
|
1064
|
+
/** Checks if an instance exists for the specified country code. @keywords geo, intl, check */
|
|
790
1065
|
static isItem(code?: string): boolean;
|
|
1066
|
+
/** Returns the standard location code. @keywords geo, intl, location */
|
|
791
1067
|
static getLocation(code?: string): string;
|
|
1068
|
+
/** Returns an instance of the class for the specified country code. @keywords geo, intl, instance */
|
|
792
1069
|
static getInstance(code?: string): GeoIntl;
|
|
793
1070
|
constructor(code?: string, errorCenter?: ErrorCenterInstance);
|
|
1071
|
+
/** Returns the location code. @keywords intl, location */
|
|
794
1072
|
getLocation(): string;
|
|
1073
|
+
/** Returns the first day of the week. @keywords intl, first_day, calendar */
|
|
795
1074
|
getFirstDay(): string;
|
|
1075
|
+
/** Translates language, region, and script display names. @keywords intl, display, name */
|
|
796
1076
|
display(value?: string, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): string;
|
|
1077
|
+
/** Get display names of language. @keywords intl, language, name */
|
|
797
1078
|
languageName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
1079
|
+
/** Get display names of region. @keywords intl, country, region, name */
|
|
798
1080
|
countryName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
1081
|
+
/** Returns a string containing the full name in a specific format. @keywords intl, full_name, person */
|
|
799
1082
|
fullName(last: string, first: string, surname?: string, short?: boolean): string;
|
|
1083
|
+
/** Formats a number using locale options. @keywords intl, number, format */
|
|
800
1084
|
number(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1085
|
+
/** Returns the decimal point symbol. @keywords intl, decimal, symbol */
|
|
801
1086
|
decimal(): string;
|
|
1087
|
+
/** Formats a currency value. @keywords intl, currency, money */
|
|
802
1088
|
currency(value: NumberOrString, currencyOptions?: string | Intl.NumberFormatOptions, numberOnly?: boolean): string;
|
|
1089
|
+
/** Returns the currency symbol or code. @keywords intl, currency, symbol */
|
|
803
1090
|
currencySymbol(currency: string, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): string;
|
|
1091
|
+
/** Formats a unit value. @keywords intl, unit, format */
|
|
804
1092
|
unit(value: NumberOrString, unitOptions?: string | Intl.NumberFormatOptions): string;
|
|
1093
|
+
/** Formats a file size value. @keywords intl, file_size, unit */
|
|
805
1094
|
sizeFile(value: NumberOrString, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): string;
|
|
1095
|
+
/** Formats a number as a percentage. @keywords intl, percent, number */
|
|
806
1096
|
percent(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1097
|
+
/** Formats a number as a percentage by 100. @keywords intl, percent, number */
|
|
807
1098
|
percentBy100(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1099
|
+
/** Formats text with plural rules and language specifics. @keywords intl, plural, rules */
|
|
808
1100
|
plural(value: NumberOrString, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): string;
|
|
1101
|
+
/** Formats date and time. @keywords intl, date, time, format */
|
|
809
1102
|
date(value: NumberOrStringOrDate, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): string;
|
|
1103
|
+
/** Formats relative time. @keywords intl, relative, time */
|
|
810
1104
|
relative(value: NumberOrStringOrDate, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): string;
|
|
1105
|
+
/** Formats relative time with a limit fallback to standard date. @keywords intl, relative, limit, date */
|
|
811
1106
|
relativeLimit(value: NumberOrStringOrDate, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): string;
|
|
1107
|
+
/** Formats relative time by numerical value and unit. @keywords intl, relative, value, unit */
|
|
812
1108
|
relativeByValue(value: NumberOrString, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): string;
|
|
1109
|
+
/** Returns the formatted name of a month. @keywords intl, month, name */
|
|
813
1110
|
month(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['month']): string;
|
|
1111
|
+
/** Returns an array of months. @keywords intl, months, list */
|
|
814
1112
|
months(style?: Intl.DateTimeFormatOptions['month']): ItemValue<number | undefined>[];
|
|
1113
|
+
/** Returns the formatted name of a weekday. @keywords intl, weekday, name */
|
|
815
1114
|
weekday(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['weekday']): string;
|
|
1115
|
+
/** Returns an array of weekdays. @keywords intl, weekdays, list */
|
|
816
1116
|
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ItemValue<number | undefined>[];
|
|
1117
|
+
/** Formats time. @keywords intl, time, format */
|
|
817
1118
|
time(value: NumberOrStringOrDate): string;
|
|
1119
|
+
/** Sorts an array of items considering locale rules. @keywords intl, sort, collator */
|
|
818
1120
|
sort<T>(data: T[], compareFn?: (a: T, b: T) => [string, string]): T[];
|
|
819
1121
|
}
|
|
820
|
-
|
|
1122
|
+
|
|
1123
|
+
/** Stores and processes phone number masks @keywords geophone phone mask country code */
|
|
821
1124
|
export declare class GeoPhone {
|
|
1125
|
+
/** Retrieves phone info by country code @keywords get phone info country */
|
|
822
1126
|
static get(code: string): GeoPhoneValue | undefined;
|
|
1127
|
+
/** Retrieves phone info by phone number @keywords get by phone number */
|
|
823
1128
|
static getByPhone(phone: string): GeoPhoneMapInfo;
|
|
1129
|
+
/** Retrieves mask data by country code @keywords get by code country */
|
|
824
1130
|
static getByCode(code: string): GeoPhoneMap | undefined;
|
|
1131
|
+
/** Retrieves list of all phone values @keywords get list phone values */
|
|
825
1132
|
static getList(): GeoPhoneValue[];
|
|
1133
|
+
/** Retrieves tree map sorted by code @keywords get map tree */
|
|
826
1134
|
static getMap(): Record<string, GeoPhoneMap>;
|
|
1135
|
+
/** Converts number to phone mask @keywords to mask format */
|
|
827
1136
|
static toMask(phone: string, masks?: string[]): string | undefined;
|
|
1137
|
+
/** Removes country code from phone number @keywords remove zero prefix */
|
|
828
1138
|
static removeZero(phone: string): string;
|
|
829
|
-
protected static getWithinSymbol(within: number | string): string;
|
|
830
|
-
protected static getUnnecessaryLength(mask: string): number;
|
|
831
|
-
protected static makeList(): void;
|
|
832
|
-
protected static makeMap(): void;
|
|
833
|
-
protected static toNumber(value: string): string[];
|
|
834
|
-
protected static toStandard(phone: string, mask: string): string;
|
|
835
|
-
protected static toWithin(mask: string, within: number | string): string;
|
|
836
1139
|
}
|
|
1140
|
+
|
|
837
1141
|
/**
|
|
838
1142
|
* Class for localized unit formatting and automatic conversions.
|
|
839
|
-
*
|
|
840
|
-
* (like ounce, foot) for non-metric regions (US, MM, LR) and formats them.
|
|
1143
|
+
* @keywords geo unit format convert metric imperial
|
|
841
1144
|
*/
|
|
842
1145
|
export declare class GeoUnit {
|
|
1146
|
+
/** Returns a request-isolated instance of GeoUnit or cached instance. @keywords get instance geo unit */
|
|
843
1147
|
static getInstance(code?: string): GeoUnit;
|
|
1148
|
+
/** Constructor. @keywords constructor geo unit */
|
|
844
1149
|
constructor(code?: string);
|
|
1150
|
+
/** Returns the standard location code. @keywords get location standard */
|
|
845
1151
|
getLocation(): string;
|
|
1152
|
+
/** Formats millimeter value, converting to inches if overridden by locale unit settings. @keywords format millimeter inch */
|
|
846
1153
|
millimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1154
|
+
/** Formats centimeter value, converting to inches if overridden by locale unit settings. @keywords format centimeter inch */
|
|
847
1155
|
centimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1156
|
+
/** Formats meter value, converting to feet if overridden by locale unit settings. @keywords format meter foot */
|
|
848
1157
|
meter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1158
|
+
/** Formats kilometer value, converting to miles if overridden by locale unit settings. @keywords format kilometer mile */
|
|
849
1159
|
kilometer(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1160
|
+
/** Formats square meter value, converting to square feet if overridden by locale unit settings. @keywords format square meter foot */
|
|
850
1161
|
squareMeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1162
|
+
/** Formats hectare value, converting to acres if overridden by locale unit settings. @keywords format hectare acre */
|
|
851
1163
|
hectare(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1164
|
+
/** Formats gram value, converting to ounces if overridden by locale unit settings. @keywords format gram ounce */
|
|
852
1165
|
gram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1166
|
+
/** Formats kilogram value, converting to pounds if overridden by locale unit settings. @keywords format kilogram pound */
|
|
853
1167
|
kilogram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1168
|
+
/** Formats tonne value, converting to short tons if overridden by locale unit settings. @keywords format tonne ton */
|
|
854
1169
|
tonne(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1170
|
+
/** Formats milliliter value, converting to fluid ounces if overridden by locale unit settings. @keywords format milliliter fluid ounce */
|
|
855
1171
|
milliliter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1172
|
+
/** Formats liter value, converting to gallons if overridden by locale unit settings. @keywords format liter gallon */
|
|
856
1173
|
liter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1174
|
+
/** Formats celsius value, converting to fahrenheit if overridden by locale unit settings. @keywords format celsius fahrenheit temperature */
|
|
857
1175
|
celsius(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1176
|
+
/** Formats kilometer per hour value, converting to miles per hour if overridden by locale unit settings. @keywords format speed kmh mph */
|
|
858
1177
|
kilometerPerHour(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
1178
|
+
/** Formats the value for the specified unit, converting and formatting it according to the locale. @keywords format unit value */
|
|
859
1179
|
format(value: NumberOrString, unit: string, options?: Intl.NumberFormatOptions): string;
|
|
860
|
-
protected isCelsiusToFahrenheit(from: string, to: string): boolean;
|
|
861
|
-
protected getTargetUnit(sourceUnit: string): string;
|
|
862
|
-
protected formatUnit(value: NumberOrString, sourceUnit: string, options?: Intl.NumberFormatOptions): string;
|
|
863
|
-
protected convert(value: number, from: string, to: string): number;
|
|
864
|
-
protected celsiusToFahrenheit(value: number): number;
|
|
865
1180
|
}
|
|
866
|
-
|
|
1181
|
+
|
|
1182
|
+
/** Static utility class for storing application-wide global data. @keywords global, storage, data */
|
|
867
1183
|
export declare class Global {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1184
|
+
/** Returns the global data store instance. @keywords get, item, store */
|
|
1185
|
+
static getItem(): Record<string, any>;
|
|
1186
|
+
/** Returns a value by name. @keywords get, property, value */
|
|
1187
|
+
static get<R = any>(name: string): R;
|
|
1188
|
+
/** Adds global data once. @keywords add, data, set */
|
|
1189
|
+
static add(data: Record<string, any>): void;
|
|
871
1190
|
}
|
|
872
|
-
|
|
1191
|
+
|
|
1192
|
+
/** Static class for working with URL hash data. @keywords hash, url, parameters, state */
|
|
873
1193
|
export declare class Hash {
|
|
1194
|
+
/** Returns HashInstance item. @keywords get, instance, item */
|
|
874
1195
|
static getItem(): HashInstance;
|
|
1196
|
+
/** Gets value by name from hash. @keywords get, read, value */
|
|
875
1197
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
1198
|
+
/** Sets value by name in hash. @keywords set, write, update */
|
|
876
1199
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
1200
|
+
/** Adds watch callback for hash property. @keywords watch, event, listener, add */
|
|
877
1201
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
1202
|
+
/** Removes watch callback for hash property. @keywords watch, event, listener, remove */
|
|
878
1203
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
1204
|
+
/** Reloads hash state. @keywords reload, refresh, update */
|
|
879
1205
|
static reload(): void;
|
|
880
1206
|
}
|
|
881
|
-
|
|
1207
|
+
|
|
1208
|
+
import { UrlInstanceAbstract } from "@dxtmisha/media";
|
|
1209
|
+
|
|
1210
|
+
/** Class for working with URL hash data. @keywords hash, url, instance */
|
|
882
1211
|
export declare class HashInstance extends UrlInstanceAbstract {
|
|
1212
|
+
/** Initializes hash data and registers hashchange listener. @keywords init, hash */
|
|
883
1213
|
protected init(): this;
|
|
1214
|
+
/** Obtains data from the URL hash string. @keywords get, location, hash */
|
|
884
1215
|
protected getLocation(): Record<string, any>;
|
|
1216
|
+
/** Updates the hash string in the URL. @keywords update, hash */
|
|
885
1217
|
protected update(): this;
|
|
886
1218
|
}
|
|
1219
|
+
|
|
1220
|
+
/** @keywords icon item type */
|
|
887
1221
|
export type IconsItem = string | Promise<string | any> | (() => Promise<string | any>);
|
|
1222
|
+
|
|
1223
|
+
/** @keywords icon configuration */
|
|
888
1224
|
export type IconsConfig = {
|
|
889
|
-
/** URL to the icons storage / URL к хранилищу иконок */
|
|
890
1225
|
url?: string;
|
|
891
|
-
/** List of custom icons / Список пользовательских иконок */
|
|
892
1226
|
list?: Record<string, IconsItem>;
|
|
893
1227
|
};
|
|
894
|
-
|
|
1228
|
+
|
|
1229
|
+
/** @keywords icons manager, svg */
|
|
895
1230
|
export declare class Icons {
|
|
1231
|
+
/** @keywords check icon existence */
|
|
896
1232
|
static is(index: string): boolean;
|
|
1233
|
+
/** @keywords get icon value or promise */
|
|
897
1234
|
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
1235
|
+
/** @keywords get icon async */
|
|
898
1236
|
static getAsync(index: string, url?: string): string;
|
|
1237
|
+
/** @keywords get icon name list */
|
|
899
1238
|
static getNameList(): string[];
|
|
1239
|
+
/** @keywords get global url */
|
|
900
1240
|
static getUrlGlobal(): string;
|
|
1241
|
+
/** @keywords add icon */
|
|
901
1242
|
static add(index: string, file: IconsItem): void;
|
|
1243
|
+
/** @keywords add icon load */
|
|
902
1244
|
static addLoad(index: string): void;
|
|
1245
|
+
/** @keywords add global icon */
|
|
903
1246
|
static addGlobal(index: string, file: string): void;
|
|
1247
|
+
/** @keywords add icons by list */
|
|
904
1248
|
static addByList(list: Record<string, IconsItem>): void;
|
|
1249
|
+
/** @keywords set icons url */
|
|
905
1250
|
static setUrl(url: string): void;
|
|
1251
|
+
/** @keywords set icons config */
|
|
906
1252
|
static setConfig(config: IconsConfig): void;
|
|
907
|
-
protected static getName(index: string): string;
|
|
908
|
-
protected static getRaw(index: string, url?: string): IconsItem;
|
|
909
|
-
protected static wait(): Promise<void>;
|
|
910
1253
|
}
|
|
911
|
-
|
|
1254
|
+
|
|
1255
|
+
/** Class for working with global loading. @keywords loading loader global */
|
|
912
1256
|
export declare class Loading {
|
|
1257
|
+
/** Check if the loader is active. @keywords loading active check */
|
|
913
1258
|
static is(): boolean;
|
|
1259
|
+
/** Get current loading value. @keywords loading get count */
|
|
914
1260
|
static get(): number;
|
|
1261
|
+
/** Get LoadingInstance item. @keywords loading instance item */
|
|
915
1262
|
static getItem(): LoadingInstance;
|
|
1263
|
+
/** Show the loader. @keywords loading show start */
|
|
916
1264
|
static show(): void;
|
|
1265
|
+
/** Hide the loader. @keywords loading hide stop */
|
|
917
1266
|
static hide(): void;
|
|
1267
|
+
/** Register loading event. @keywords loading event register */
|
|
918
1268
|
static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1269
|
+
/** Unregister loading event. @keywords loading event unregister */
|
|
919
1270
|
static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
920
1271
|
}
|
|
921
|
-
|
|
922
|
-
* Data for the loading event.
|
|
923
|
-
*
|
|
924
|
-
* Данные для события загрузки.
|
|
925
|
-
*/
|
|
1272
|
+
|
|
926
1273
|
export type LoadingDetail = {
|
|
927
|
-
/** Loading status / Статус загрузки */
|
|
928
1274
|
loading: boolean;
|
|
929
1275
|
};
|
|
930
|
-
/**
|
|
931
|
-
* Registration item for the loading event.
|
|
932
|
-
*
|
|
933
|
-
* Элемент регистрации для события загрузки.
|
|
934
|
-
*/
|
|
935
1276
|
export type LoadingRegistrationItem = {
|
|
936
|
-
/** Event item / Элемент события */
|
|
937
1277
|
item: EventItem<Window, CustomEvent, LoadingDetail>;
|
|
938
|
-
/** Event listener / Слушатель события */
|
|
939
1278
|
listener: EventListenerDetail<CustomEvent, LoadingDetail>;
|
|
940
|
-
/** Element / Элемент */
|
|
941
1279
|
element?: ElementOrString<HTMLElement>;
|
|
942
1280
|
};
|
|
943
|
-
/**
|
|
1281
|
+
/** Loading instance manager class @keywords loading, loader, spinner, global */
|
|
944
1282
|
export declare class LoadingInstance {
|
|
1283
|
+
/** Create loading instance @keywords constructor, init */
|
|
945
1284
|
constructor(eventName?: string);
|
|
1285
|
+
/** Check if loading is active @keywords is, active, check */
|
|
946
1286
|
is(): boolean;
|
|
1287
|
+
/** Get current loading counter value @keywords get, count, value */
|
|
947
1288
|
get(): number;
|
|
1289
|
+
/** Show loading indicator @keywords show, start, loading */
|
|
948
1290
|
show(): void;
|
|
1291
|
+
/** Hide loading indicator @keywords hide, stop, loading */
|
|
949
1292
|
hide(): void;
|
|
1293
|
+
/** Register loading event listener @keywords register, event, listener */
|
|
950
1294
|
registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
1295
|
+
/** Unregister loading event listener @keywords unregister, remove, event */
|
|
951
1296
|
unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
952
|
-
protected dispatch(): void;
|
|
953
1297
|
}
|
|
954
|
-
|
|
1298
|
+
|
|
1299
|
+
/** Unified class for managing all types of meta tags. @keywords meta, seo, openGraph, twitter */
|
|
955
1300
|
export declare class Meta extends MetaManager<MetaTag[]> {
|
|
1301
|
+
/** Creates an instance of Meta with integrated Open Graph and Twitter Card support. @keywords meta, constructor */
|
|
956
1302
|
constructor();
|
|
1303
|
+
/** Gets the MetaOg instance for advanced Open Graph operations. @keywords og, openGraph */
|
|
957
1304
|
getOg(): MetaOg;
|
|
1305
|
+
/** Gets the MetaTwitter instance for advanced Twitter Card operations. @keywords twitter, card */
|
|
958
1306
|
getTwitter(): MetaTwitter;
|
|
1307
|
+
/** Gets the page title without suffix. @keywords title, get */
|
|
959
1308
|
getTitle(): string;
|
|
1309
|
+
/** Gets the keywords meta tag. @keywords keywords, seo */
|
|
960
1310
|
getKeywords(): string;
|
|
1311
|
+
/** Gets the description meta tag. @keywords description, seo */
|
|
961
1312
|
getDescription(): string;
|
|
1313
|
+
/** Gets the Open Graph image URL. @keywords image, og */
|
|
962
1314
|
getImage(): string;
|
|
1315
|
+
/** Gets the canonical URL. @keywords canonical, url */
|
|
963
1316
|
getCanonical(): string;
|
|
1317
|
+
/** Gets the robots meta tag value. @keywords robots, index */
|
|
964
1318
|
getRobots(): MetaRobots;
|
|
1319
|
+
/** Gets the author meta tag. @keywords author, meta */
|
|
965
1320
|
getAuthor(): string;
|
|
1321
|
+
/** Gets the Open Graph site name. @keywords siteName, og */
|
|
966
1322
|
getSiteName(): string;
|
|
1323
|
+
/** Gets the Open Graph locale. @keywords locale, og */
|
|
967
1324
|
getLocale(): string;
|
|
1325
|
+
/** Sets the page title (with suffix) and updates Open Graph and Twitter Card titles. @keywords title, set */
|
|
968
1326
|
setTitle(title: string): this;
|
|
1327
|
+
/** Sets the keywords meta tag. @keywords keywords, set */
|
|
969
1328
|
setKeywords(keywords: string | string[]): this;
|
|
1329
|
+
/** Sets the description meta tag. @keywords description, set */
|
|
970
1330
|
setDescription(description: string): this;
|
|
1331
|
+
/** Sets the image for Open Graph and Twitter Card. @keywords image, set */
|
|
971
1332
|
setImage(image: string): this;
|
|
1333
|
+
/** Sets the canonical URL and updates Open Graph and Twitter Card URLs. @keywords canonical, set */
|
|
972
1334
|
setCanonical(canonical: string): this;
|
|
1335
|
+
/** Sets the robots meta tag. @keywords robots, set */
|
|
973
1336
|
setRobots(robots: MetaRobots): this;
|
|
1337
|
+
/** Sets the author meta tag. @keywords author, set */
|
|
974
1338
|
setAuthor(author: string): this;
|
|
1339
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords siteName, set */
|
|
975
1340
|
setSiteName(siteName: string): this;
|
|
1341
|
+
/** Sets the locale for Open Graph. @keywords locale, set */
|
|
976
1342
|
setLocale(locale: string): this;
|
|
1343
|
+
/** Sets the suffix to append to page title. @keywords suffix, title */
|
|
977
1344
|
setSuffix(suffix?: string): void;
|
|
1345
|
+
/** Generates the complete HTML for all meta-tags including Open Graph and Twitter Card. @keywords html, render */
|
|
978
1346
|
html(): string;
|
|
1347
|
+
/** Generates the title as an HTML-safe string. @keywords html, title */
|
|
979
1348
|
htmlTitle(): string;
|
|
980
|
-
protected getSuffix(): string;
|
|
981
1349
|
}
|
|
1350
|
+
|
|
982
1351
|
type MetaList<T extends readonly string[]> = {
|
|
983
1352
|
[K in T[number]]?: string;
|
|
984
1353
|
};
|
|
985
|
-
/**
|
|
1354
|
+
/** @keywords MetaManager meta tags management */
|
|
986
1355
|
export declare class MetaManager<T extends readonly string[], Key extends keyof MetaList<T> = keyof MetaList<T>> {
|
|
1356
|
+
/** @keywords constructor MetaManager */
|
|
987
1357
|
constructor(listMeta: T, isProperty?: boolean);
|
|
1358
|
+
/** @keywords getListMeta meta list */
|
|
988
1359
|
getListMeta(): T;
|
|
1360
|
+
/** @keywords get meta value */
|
|
989
1361
|
get(name: Key): string;
|
|
1362
|
+
/** @keywords getItems all meta tags */
|
|
990
1363
|
getItems(): MetaList<T>;
|
|
1364
|
+
/** @keywords html render meta tags */
|
|
991
1365
|
html(): string;
|
|
1366
|
+
/** @keywords set meta value */
|
|
992
1367
|
set(name: Key, content: string): this;
|
|
1368
|
+
/** @keywords setByList multiple meta tags */
|
|
993
1369
|
setByList(metaList: MetaList<T>): this;
|
|
994
|
-
protected getAttributeName(): string;
|
|
995
|
-
protected findMetaElement(name: string): HTMLMetaElement | undefined;
|
|
996
|
-
protected setItem(name: Key, content: string): this;
|
|
997
|
-
protected setMeta(name: Key): this;
|
|
998
|
-
protected toHtmlString(name: Key): string;
|
|
999
|
-
protected toHtmlTitle(title: string): string;
|
|
1000
|
-
protected update(): this;
|
|
1001
1370
|
}
|
|
1002
1371
|
export {};
|
|
1003
|
-
|
|
1372
|
+
|
|
1004
1373
|
export declare class MetaOg extends MetaManager<MetaOpenGraphTag[]> {
|
|
1374
|
+
/** Creates MetaOg instance. @keywords constructor, open, graph */
|
|
1005
1375
|
constructor();
|
|
1376
|
+
/** Gets the Open Graph title. @keywords get, title, og */
|
|
1006
1377
|
getTitle(): string;
|
|
1378
|
+
/** Gets the Open Graph type. @keywords get, type, og */
|
|
1007
1379
|
getType(): MetaOpenGraphType;
|
|
1380
|
+
/** Gets the Open Graph URL. @keywords get, url, og */
|
|
1008
1381
|
getUrl(): string;
|
|
1382
|
+
/** Gets the Open Graph image URL. @keywords get, image, og */
|
|
1009
1383
|
getImage(): string;
|
|
1384
|
+
/** Gets the Open Graph description. @keywords get, description, og */
|
|
1010
1385
|
getDescription(): string;
|
|
1386
|
+
/** Gets the Open Graph locale. @keywords get, locale, og */
|
|
1011
1387
|
getLocale(): string;
|
|
1388
|
+
/** Gets the Open Graph site name. @keywords get, site, name, og */
|
|
1012
1389
|
getSiteName(): string;
|
|
1390
|
+
/** Sets the Open Graph title. @keywords set, title, og */
|
|
1013
1391
|
setTitle(title: string): this;
|
|
1392
|
+
/** Sets the Open Graph type. @keywords set, type, og */
|
|
1014
1393
|
setType(type: MetaOpenGraphType): this;
|
|
1394
|
+
/** Sets the Open Graph URL. @keywords set, url, og */
|
|
1015
1395
|
setUrl(url: string): this;
|
|
1396
|
+
/** Sets the Open Graph image URL. @keywords set, image, og */
|
|
1016
1397
|
setImage(url: string): this;
|
|
1398
|
+
/** Sets the Open Graph description. @keywords set, description, og */
|
|
1017
1399
|
setDescription(description: string): this;
|
|
1400
|
+
/** Sets the Open Graph locale. @keywords set, locale, og */
|
|
1018
1401
|
setLocale(locale: string): this;
|
|
1402
|
+
/** Sets the Open Graph site name. @keywords set, site, name, og */
|
|
1019
1403
|
setSiteName(siteName: string): this;
|
|
1020
1404
|
}
|
|
1021
|
-
|
|
1405
|
+
|
|
1406
|
+
/** Static class for managing page meta tags @keywords meta static manager tags */
|
|
1022
1407
|
export declare class MetaStatic {
|
|
1023
|
-
|
|
1024
|
-
static
|
|
1025
|
-
|
|
1408
|
+
/** Gets singleton instance @keywords meta singleton item */
|
|
1409
|
+
static getItem(): At;
|
|
1410
|
+
/** Gets Open Graph instance @keywords meta og get */
|
|
1411
|
+
static getOg(): Ot;
|
|
1412
|
+
/** Gets Twitter Card instance @keywords meta twitter get */
|
|
1413
|
+
static getTwitter(): kt;
|
|
1414
|
+
/** Gets page title @keywords meta title get */
|
|
1026
1415
|
static getTitle(): string;
|
|
1416
|
+
/** Gets meta keywords @keywords meta keywords get */
|
|
1027
1417
|
static getKeywords(): string;
|
|
1418
|
+
/** Gets meta description @keywords meta description get */
|
|
1028
1419
|
static getDescription(): string;
|
|
1420
|
+
/** Gets image URL @keywords meta image get */
|
|
1029
1421
|
static getImage(): string;
|
|
1422
|
+
/** Gets canonical URL @keywords meta canonical get */
|
|
1030
1423
|
static getCanonical(): string;
|
|
1424
|
+
/** Gets robots directive @keywords meta robots get */
|
|
1031
1425
|
static getRobots(): MetaRobots;
|
|
1426
|
+
/** Gets author name @keywords meta author get */
|
|
1032
1427
|
static getAuthor(): string;
|
|
1428
|
+
/** Gets site name @keywords meta sitename get */
|
|
1033
1429
|
static getSiteName(): string;
|
|
1430
|
+
/** Gets locale @keywords meta locale get */
|
|
1034
1431
|
static getLocale(): string;
|
|
1035
|
-
|
|
1036
|
-
static
|
|
1037
|
-
|
|
1038
|
-
static
|
|
1039
|
-
|
|
1040
|
-
static
|
|
1041
|
-
|
|
1042
|
-
static
|
|
1043
|
-
|
|
1044
|
-
static
|
|
1432
|
+
/** Sets page title @keywords meta title set */
|
|
1433
|
+
static setTitle(e: string): typeof MetaStatic;
|
|
1434
|
+
/** Sets meta keywords @keywords meta keywords set */
|
|
1435
|
+
static setKeywords(e: string | string[]): typeof MetaStatic;
|
|
1436
|
+
/** Sets meta description @keywords meta description set */
|
|
1437
|
+
static setDescription(e: string): typeof MetaStatic;
|
|
1438
|
+
/** Sets image URL @keywords meta image set */
|
|
1439
|
+
static setImage(e: string): typeof MetaStatic;
|
|
1440
|
+
/** Sets canonical URL @keywords meta canonical set */
|
|
1441
|
+
static setCanonical(e: string): typeof MetaStatic;
|
|
1442
|
+
/** Sets robots directive @keywords meta robots set */
|
|
1443
|
+
static setRobots(e: MetaRobots): typeof MetaStatic;
|
|
1444
|
+
/** Sets author name @keywords meta author set */
|
|
1445
|
+
static setAuthor(e: string): typeof MetaStatic;
|
|
1446
|
+
/** Sets site name @keywords meta sitename set */
|
|
1447
|
+
static setSiteName(e: string): typeof MetaStatic;
|
|
1448
|
+
/** Sets locale @keywords meta locale set */
|
|
1449
|
+
static setLocale(e: string): typeof MetaStatic;
|
|
1450
|
+
/** Sets title suffix @keywords meta suffix set */
|
|
1451
|
+
static setSuffix(e?: string): typeof MetaStatic;
|
|
1452
|
+
/** Generates meta tags HTML @keywords meta html generate */
|
|
1045
1453
|
static html(): string;
|
|
1454
|
+
/** Generates safe title HTML @keywords meta title html */
|
|
1046
1455
|
static htmlTitle(): string;
|
|
1047
1456
|
}
|
|
1048
|
-
|
|
1457
|
+
|
|
1458
|
+
/** Manage Twitter Card meta tags @keywords meta twitter card tags */
|
|
1049
1459
|
export declare class MetaTwitter extends MetaManager<MetaTwitterTag[]> {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1460
|
+
/** Initialize MetaTwitter instance @keywords constructor create */
|
|
1461
|
+
constructor();
|
|
1462
|
+
/** Get Twitter Card type @keywords get card type */
|
|
1463
|
+
getCard(): MetaTwitterCard;
|
|
1464
|
+
/** Get website or brand username @keywords get site username */
|
|
1465
|
+
getSite(): string;
|
|
1466
|
+
/** Get content creator username @keywords get creator username */
|
|
1467
|
+
getCreator(): string;
|
|
1468
|
+
/** Get page URL @keywords get url */
|
|
1469
|
+
getUrl(): string;
|
|
1470
|
+
/** Get card title @keywords get title */
|
|
1471
|
+
getTitle(): string;
|
|
1472
|
+
/** Get card description @keywords get description */
|
|
1473
|
+
getDescription(): string;
|
|
1474
|
+
/** Get card image URL @keywords get image */
|
|
1475
|
+
getImage(): string;
|
|
1476
|
+
/** Set Twitter Card type @keywords set card type */
|
|
1477
|
+
setCard(card: MetaTwitterCard): this;
|
|
1478
|
+
/** Set website or brand username @keywords set site username */
|
|
1479
|
+
setSite(site: string): this;
|
|
1480
|
+
/** Set content creator username @keywords set creator username */
|
|
1481
|
+
setCreator(creator: string): this;
|
|
1482
|
+
/** Set page URL @keywords set url */
|
|
1483
|
+
setUrl(url: string): this;
|
|
1484
|
+
/** Set card title @keywords set title */
|
|
1485
|
+
setTitle(title: string): this;
|
|
1486
|
+
/** Set card description @keywords set description */
|
|
1487
|
+
setDescription(description: string): this;
|
|
1488
|
+
/** Set card image URL @keywords set image */
|
|
1489
|
+
setImage(image: string): this;
|
|
1065
1490
|
}
|
|
1066
|
-
|
|
1491
|
+
|
|
1492
|
+
/** Static class for working with URL query parameters. @keywords query, url, parameters, search */
|
|
1067
1493
|
export declare class Query {
|
|
1494
|
+
/** Returns the QueryInstance item. @keywords query, instance, storage */
|
|
1068
1495
|
static getItem(): QueryInstance;
|
|
1496
|
+
/** Gets data from query parameters. @keywords query, get, read */
|
|
1069
1497
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
1498
|
+
/** Sets data in query parameters. @keywords query, set, update */
|
|
1070
1499
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
1500
|
+
/** Adds a change watcher for query parameters. @keywords query, watch, event */
|
|
1071
1501
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
1502
|
+
/** Removes a change watcher. @keywords query, unwatch, remove */
|
|
1072
1503
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
1504
|
+
/** Reloads query data from URL. @keywords query, reload, refresh */
|
|
1073
1505
|
static reload(): void;
|
|
1074
1506
|
}
|
|
1075
|
-
|
|
1507
|
+
|
|
1508
|
+
/** Class for working with data stored in URL query parameters. @keywords query, url, search_params */
|
|
1076
1509
|
export declare class QueryInstance extends UrlInstanceAbstract {
|
|
1510
|
+
/** Initializes query data and registers popstate listener. @keywords init, query, popstate */
|
|
1077
1511
|
protected init(): this;
|
|
1512
|
+
/** Obtains data from the URL string. @keywords get, location, query */
|
|
1078
1513
|
protected getLocation(): Record<string, any>;
|
|
1514
|
+
/** Updates query string in URL. @keywords update, url, query */
|
|
1079
1515
|
protected update(): this;
|
|
1080
1516
|
}
|
|
1081
|
-
|
|
1517
|
+
|
|
1518
|
+
/** Timer that can be paused and resumed @keywords timer resumable pause resume delay */
|
|
1082
1519
|
export declare class ResumableTimer {
|
|
1520
|
+
/** Creates a resumable timer */
|
|
1083
1521
|
constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
|
|
1522
|
+
/** Resumes the timer @keywords resume start timer */
|
|
1084
1523
|
resume(): this;
|
|
1524
|
+
/** Pauses the timer @keywords pause timer */
|
|
1085
1525
|
pause(): this;
|
|
1526
|
+
/** Resets and restarts the timer @keywords reset restart */
|
|
1086
1527
|
reset(): this;
|
|
1528
|
+
/** Clears the timer and resets state @keywords clear */
|
|
1087
1529
|
clear(): this;
|
|
1530
|
+
/** Gets the remaining time */
|
|
1088
1531
|
protected getRemaining(): number;
|
|
1532
|
+
/** Gets the start time */
|
|
1089
1533
|
protected getStartTime(): number;
|
|
1534
|
+
/** Executes the callback */
|
|
1090
1535
|
protected go(): this;
|
|
1536
|
+
/** Updates the remaining time */
|
|
1091
1537
|
protected updateRemaining(): this;
|
|
1538
|
+
/** Updates the start time */
|
|
1092
1539
|
protected updateStartTime(): this;
|
|
1540
|
+
/** Stops the timer */
|
|
1093
1541
|
protected stop(): this;
|
|
1094
1542
|
}
|
|
1095
|
-
|
|
1543
|
+
|
|
1544
|
+
/** Scrollbar width helper utility @keywords scrollbar, width, scroll */
|
|
1096
1545
|
export declare class ScrollbarWidth {
|
|
1546
|
+
/** Checks whether to enable scroll hiding @keywords scrollbar, hide, check */
|
|
1097
1547
|
static is(): Promise<boolean>;
|
|
1548
|
+
/** Returns the width of the scroll @keywords scrollbar, width, size */
|
|
1098
1549
|
static get(): Promise<number>;
|
|
1550
|
+
/** Returns the storage for scroll width @keywords scrollbar, storage */
|
|
1099
1551
|
static getStorage(): DataStorage<number>;
|
|
1552
|
+
/** Returns the calculation flag @keywords scrollbar, calculate, state */
|
|
1100
1553
|
static getCalculate(): boolean;
|
|
1554
|
+
/** Creates elements to check the width of the scroll @keywords scrollbar, element, create */
|
|
1555
|
+
static createElement(): HTMLElement | void;
|
|
1101
1556
|
}
|
|
1102
|
-
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Manages searchable list with options, state, and matching logic.
|
|
1560
|
+
* @keywords search, list, filter, match
|
|
1561
|
+
*/
|
|
1103
1562
|
export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
|
|
1563
|
+
/** @keywords constructor, init */
|
|
1104
1564
|
constructor(list: SearchListValue<T>, columns?: K, value?: string, options?: SearchOptions);
|
|
1565
|
+
/** Retrieves search data management instance. @keywords get, data */
|
|
1105
1566
|
getData(): SearchListData<T, K>;
|
|
1567
|
+
/** Retrieves current items list. @keywords get, list */
|
|
1106
1568
|
getList(): SearchListValue<T>;
|
|
1569
|
+
/** Retrieves current search columns. @keywords get, columns */
|
|
1107
1570
|
getColumns(): K | undefined;
|
|
1571
|
+
/** Retrieves search item instance. @keywords get, item */
|
|
1108
1572
|
getItem(): SearchListItem;
|
|
1573
|
+
/** Retrieves current search value string. @keywords get, value */
|
|
1109
1574
|
getValue(): string | undefined;
|
|
1575
|
+
/** Retrieves search options instance. @keywords get, options */
|
|
1110
1576
|
getOptions(): SearchListOptions;
|
|
1577
|
+
/** Updates item list and resets cache. @keywords set, list */
|
|
1111
1578
|
setList(list: SearchListValue<T>): this;
|
|
1579
|
+
/** Updates search columns and resets cache. @keywords set, columns */
|
|
1112
1580
|
setColumns(columns?: K): this;
|
|
1581
|
+
/** Updates search value and matcher. @keywords set, value */
|
|
1113
1582
|
setValue(value?: string): this;
|
|
1583
|
+
/** Updates search options and matcher. @keywords set, options */
|
|
1114
1584
|
setOptions(options: SearchOptions): this;
|
|
1585
|
+
/** Processes and formats items based on search state. @keywords process, format, to */
|
|
1115
1586
|
to(): SearchFormatList<T, K>;
|
|
1587
|
+
/** Processes item when search is active. @keywords callback, selection */
|
|
1116
1588
|
protected readonly callbackToSelection: (item: SearchCacheItem<T>["item"], value: SearchCacheItem<T>["value"]) => SearchFormatItem<T, K> | undefined;
|
|
1589
|
+
/** Processes item when search is inactive. @keywords callback, none */
|
|
1117
1590
|
protected readonly callbackToNone: (item: SearchCacheItem<T>["item"]) => SearchFormatItem<T, K>;
|
|
1118
1591
|
}
|
|
1119
|
-
|
|
1592
|
+
|
|
1593
|
+
/** @keywords search list data cache format */
|
|
1120
1594
|
export declare class SearchListData<T extends SearchItem, K extends SearchColumns<T>> {
|
|
1595
|
+
/** @keywords constructor init */
|
|
1121
1596
|
constructor(list: SearchListValue<T>, columns: K | undefined, item: SearchListItem, options: SearchListOptions);
|
|
1597
|
+
/** @keywords check ready */
|
|
1122
1598
|
is(): this is this & {
|
|
1123
1599
|
list: T[];
|
|
1124
1600
|
columns: string[];
|
|
1125
1601
|
};
|
|
1602
|
+
/** @keywords check list */
|
|
1126
1603
|
isList(): this is this & {
|
|
1127
1604
|
list: T[];
|
|
1128
1605
|
};
|
|
1606
|
+
/** @keywords get list */
|
|
1129
1607
|
getList(): SearchListValue<T>;
|
|
1608
|
+
/** @keywords get columns */
|
|
1130
1609
|
getColumns(): K | undefined;
|
|
1610
|
+
/** @keywords get cache */
|
|
1131
1611
|
protected getCache(): SearchCache<T>;
|
|
1612
|
+
/** @keywords set list */
|
|
1132
1613
|
setList(list: SearchListValue<T>): this;
|
|
1614
|
+
/** @keywords set columns */
|
|
1133
1615
|
setColumns(columns?: SearchColumns<T>): this;
|
|
1616
|
+
/** @keywords find cache item */
|
|
1134
1617
|
findCacheItem(item: T): SearchCacheItem<T> | undefined;
|
|
1618
|
+
/** @keywords iterate foreach */
|
|
1135
1619
|
forEach(callback: (item: SearchCacheItem<T>['item'], value: SearchCacheItem<T>['value']) => SearchFormatItem<T, K> | undefined): SearchFormatList<T, K>;
|
|
1620
|
+
/** @keywords format item */
|
|
1136
1621
|
toFormatItem(item: T, selection: boolean): SearchFormatItem<T, K>;
|
|
1622
|
+
/** @keywords get column name */
|
|
1137
1623
|
protected getColumnName(column: string): string;
|
|
1624
|
+
/** @keywords add tag highlight */
|
|
1138
1625
|
protected addTag(value: any): string;
|
|
1626
|
+
/** @keywords generate cache */
|
|
1139
1627
|
protected generateCache(): SearchCache<T>;
|
|
1628
|
+
/** @keywords init cache */
|
|
1140
1629
|
protected initCache(): void;
|
|
1630
|
+
/** @keywords reset cache */
|
|
1141
1631
|
protected resetCache(): void;
|
|
1142
1632
|
}
|
|
1143
|
-
|
|
1633
|
+
|
|
1634
|
+
/** Search item value and state @keywords search_item, value */
|
|
1144
1635
|
export declare class SearchListItem {
|
|
1636
|
+
/** Creates SearchListItem @keywords constructor, init */
|
|
1145
1637
|
constructor(value: string | undefined, options: SearchListOptions);
|
|
1638
|
+
/** Checks if value is filled @keywords check, exists */
|
|
1146
1639
|
is(): this is this & {
|
|
1147
1640
|
value: string;
|
|
1148
1641
|
};
|
|
1642
|
+
/** Checks if search length meets limit @keywords search, limit */
|
|
1149
1643
|
isSearch(): boolean;
|
|
1644
|
+
/** Returns current search value @keywords get, value */
|
|
1150
1645
|
get(): string;
|
|
1646
|
+
/** Sets new search value @keywords set, value */
|
|
1151
1647
|
set(value?: string): this;
|
|
1152
1648
|
}
|
|
1153
|
-
|
|
1649
|
+
|
|
1650
|
+
/** Matches search values against dataset using regex. @keywords search list matcher filter regex */
|
|
1154
1651
|
export declare class SearchListMatcher {
|
|
1652
|
+
/** Creates a search list matcher instance. */
|
|
1155
1653
|
constructor(item: SearchListItem, options: SearchListOptions);
|
|
1654
|
+
/** Checks if the matcher is initialized. */
|
|
1156
1655
|
is(): boolean;
|
|
1656
|
+
/** Checks if value matches search expression. */
|
|
1157
1657
|
isSelection(value: SearchCacheItem<any>['value']): boolean;
|
|
1658
|
+
/** Returns current regular expression matcher. */
|
|
1158
1659
|
get(): RegExp | undefined;
|
|
1660
|
+
/** Updates matcher based on current item and options. */
|
|
1159
1661
|
update(): void;
|
|
1662
|
+
/** Initializes or resets regular expression matcher. */
|
|
1160
1663
|
protected initMatcher(): void;
|
|
1161
1664
|
}
|
|
1162
|
-
|
|
1665
|
+
|
|
1666
|
+
/** Manage search list options @keywords search_list_options search_options */
|
|
1163
1667
|
export declare class SearchListOptions {
|
|
1668
|
+
/** @keywords constructor search_list_options */
|
|
1164
1669
|
constructor(options?: SearchOptions | undefined);
|
|
1670
|
+
/** Get current search options @keywords get_options search_options */
|
|
1165
1671
|
getOptions(): SearchOptions;
|
|
1672
|
+
/** Get minimum character limit for search @keywords get_limit search_limit */
|
|
1166
1673
|
getLimit(): number;
|
|
1674
|
+
/** Check if all items should be returned regardless of match @keywords get_return_everything search_all */
|
|
1167
1675
|
getReturnEverything(): boolean;
|
|
1676
|
+
/** Get search delay in milliseconds @keywords get_delay search_delay */
|
|
1168
1677
|
getDelay(): number;
|
|
1678
|
+
/** Check if exact match search is enabled @keywords get_find_exact_match exact_search */
|
|
1169
1679
|
getFindExactMatch(): boolean;
|
|
1680
|
+
/** Get CSS class name for match highlighting @keywords get_class_name search_highlight_class */
|
|
1170
1681
|
getClassName(): string;
|
|
1682
|
+
/** Set new search options @keywords set_options search_options */
|
|
1171
1683
|
setOptions(options: SearchOptions): this;
|
|
1172
1684
|
}
|
|
1173
|
-
|
|
1685
|
+
|
|
1174
1686
|
type ServerStorageItem = {
|
|
1175
1687
|
value: any;
|
|
1176
1688
|
hydration: boolean;
|
|
1177
1689
|
};
|
|
1178
1690
|
type ServerStorageList = Record<string, ServerStorageItem>;
|
|
1179
|
-
/**
|
|
1691
|
+
/** @keywords ServerStorage, SSR, storage, isolation */
|
|
1180
1692
|
export declare class ServerStorage {
|
|
1181
|
-
|
|
1693
|
+
/** @keywords init, context, listener */
|
|
1182
1694
|
static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
|
|
1695
|
+
/** @keywords reset, clear */
|
|
1183
1696
|
static reset(): void;
|
|
1697
|
+
/** @keywords has, check, key */
|
|
1184
1698
|
static has(key: string): boolean;
|
|
1699
|
+
/** @keywords get, retrieve, value */
|
|
1185
1700
|
static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
1701
|
+
/** @keywords set, save, store */
|
|
1186
1702
|
static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
1703
|
+
/** @keywords error, status, hide */
|
|
1187
1704
|
static setErrorStatus(hide: boolean): void;
|
|
1705
|
+
/** @keywords remove, delete */
|
|
1188
1706
|
static remove(key: string): void;
|
|
1707
|
+
/** @keywords toString, hydration, html */
|
|
1189
1708
|
static toString(): string;
|
|
1190
|
-
protected static getStorage(isInit?: boolean, status?: string): ServerStorageList;
|
|
1191
|
-
protected static getStorageDom(): ServerStorageList;
|
|
1192
|
-
protected static getDataForHydration(): Record<string, any>;
|
|
1193
1709
|
}
|
|
1194
1710
|
export {};
|
|
1195
|
-
|
|
1711
|
+
|
|
1712
|
+
/** Storage callback manager @keywords storage callback manager register run */
|
|
1196
1713
|
export declare class StorageCallback<T = any, Callback = (value: T) => void | Promise<void>> {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
*/
|
|
1215
|
-
isLoading(): boolean;
|
|
1216
|
-
/** Returns the storage name.
|
|
1217
|
-
* @returns storage name
|
|
1218
|
-
*/
|
|
1219
|
-
getName(): string;
|
|
1220
|
-
/** Returns the loading state.
|
|
1221
|
-
* @returns loading state
|
|
1222
|
-
*/
|
|
1223
|
-
getLoading(): boolean;
|
|
1224
|
-
/** Adds a callback to the list.
|
|
1225
|
-
* @param callback function for callbacks
|
|
1226
|
-
* @param isOnce whether the callback should only be called once
|
|
1227
|
-
*/
|
|
1228
|
-
addCallback(callback: Callback, isOnce?: boolean): this;
|
|
1229
|
-
/** Removes a callback from the list.
|
|
1230
|
-
* @param callback function for callbacks
|
|
1231
|
-
*/
|
|
1232
|
-
removeCallback(callback: Callback): this;
|
|
1233
|
-
/** Preparation of data before launch. */
|
|
1234
|
-
preparation(): this;
|
|
1235
|
-
/** Execution of all callbacks.
|
|
1236
|
-
* @param value storage data
|
|
1237
|
-
*/
|
|
1238
|
-
run(value: T): Promise<this>;
|
|
1714
|
+
/** Returns StorageCallback instance by name @keywords get instance storage callback */
|
|
1715
|
+
static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
|
|
1716
|
+
constructor(name: string, group?: string);
|
|
1717
|
+
/** Returns loading state @keywords is loading state */
|
|
1718
|
+
isLoading(): boolean;
|
|
1719
|
+
/** Returns storage name @keywords get name */
|
|
1720
|
+
getName(): string;
|
|
1721
|
+
/** Returns loading state @keywords get loading state */
|
|
1722
|
+
getLoading(): boolean;
|
|
1723
|
+
/** Adds callback to list @keywords add callback */
|
|
1724
|
+
addCallback(callback: Callback, isOnce?: boolean): this;
|
|
1725
|
+
/** Removes callback from list @keywords remove callback */
|
|
1726
|
+
removeCallback(callback: Callback): this;
|
|
1727
|
+
/** Prepares before run @keywords preparation */
|
|
1728
|
+
preparation(): this;
|
|
1729
|
+
/** Executes all callbacks @keywords run execute */
|
|
1730
|
+
run(value: T): Promise<this>;
|
|
1239
1731
|
}
|
|
1240
|
-
|
|
1732
|
+
|
|
1733
|
+
/** Class for getting the translated text. @keywords translate, i18n, localization */
|
|
1241
1734
|
export declare class Translate {
|
|
1242
|
-
/**
|
|
1243
|
-
* @param name code name
|
|
1244
|
-
* @param replacement If set, replaces the text with the specified values
|
|
1245
|
-
* @returns translation text
|
|
1246
|
-
*/
|
|
1735
|
+
/** Gets translated text by code. @keywords get, translate */
|
|
1247
1736
|
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
1248
|
-
/** Returns
|
|
1249
|
-
* @returns TranslateInstance instance
|
|
1250
|
-
*/
|
|
1737
|
+
/** Returns TranslateInstance singleton. @keywords get, instance, translate */
|
|
1251
1738
|
static getItem(): TranslateInstance;
|
|
1252
|
-
/**
|
|
1253
|
-
* @param name code name
|
|
1254
|
-
* @param first If set to false, returns an empty string if there is no text
|
|
1255
|
-
* @param replacement If set, replaces the text with the specified values
|
|
1256
|
-
* @returns translation text
|
|
1257
|
-
*/
|
|
1739
|
+
/** Gets translated text by code synchronously. @keywords get, sync, translate */
|
|
1258
1740
|
static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
1259
|
-
/**
|
|
1260
|
-
* @param names list of codes to get translations
|
|
1261
|
-
* @returns object with translations
|
|
1262
|
-
*/
|
|
1741
|
+
/** Gets a list of translations by codes. @keywords get, list, translate */
|
|
1263
1742
|
static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
1264
|
-
/**
|
|
1265
|
-
* @param names list of codes to get translations
|
|
1266
|
-
* @param first If set to false, returns an empty string if there is no text
|
|
1267
|
-
* @returns object with translations
|
|
1268
|
-
*/
|
|
1743
|
+
/** Gets a list of translations by codes synchronously. @keywords get, list, sync, translate */
|
|
1269
1744
|
static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
1270
|
-
/**
|
|
1271
|
-
* @param names list of codes to get translations
|
|
1272
|
-
*/
|
|
1745
|
+
/** Adds translations. @keywords add, translate */
|
|
1273
1746
|
static add(names: string | string[]): Promise<void>;
|
|
1274
|
-
/** Adds
|
|
1275
|
-
* @param data list of texts in the form of key-value
|
|
1276
|
-
*/
|
|
1747
|
+
/** Adds translations synchronously. @keywords add, sync, translate */
|
|
1277
1748
|
static addSync(data: Record<string, string>): void;
|
|
1278
|
-
/**
|
|
1279
|
-
* @param data list of texts in the form of key-value
|
|
1280
|
-
*/
|
|
1749
|
+
/** Adds translations normally or synchronously based on environment. @keywords add, normal, sync, translate */
|
|
1281
1750
|
static addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
1282
|
-
/** Adds
|
|
1283
|
-
* @param data list of texts by location
|
|
1284
|
-
*/
|
|
1751
|
+
/** Adds translations synchronously by location. @keywords add, location, sync, translate */
|
|
1285
1752
|
static addSyncByLocation(data: Record<string, Record<string, string>>): void;
|
|
1286
|
-
/** Adds
|
|
1287
|
-
* @param data file with translations
|
|
1288
|
-
*/
|
|
1753
|
+
/** Adds translations synchronously from file. @keywords add, file, sync, translate */
|
|
1289
1754
|
static addSyncByFile(data: TranslateDataFile): void;
|
|
1290
|
-
/**
|
|
1291
|
-
* @param url path to the script
|
|
1292
|
-
*/
|
|
1755
|
+
/** Sets the translation endpoint URL. @keywords set, url, translate */
|
|
1293
1756
|
static setUrl(url: string): void;
|
|
1294
|
-
/**
|
|
1295
|
-
* @param name property name
|
|
1296
|
-
*/
|
|
1757
|
+
/** Sets the property name for request payload. @keywords set, props, name, translate */
|
|
1297
1758
|
static setPropsName(name: string): void;
|
|
1298
|
-
/**
|
|
1299
|
-
* @param value read mode
|
|
1300
|
-
*/
|
|
1759
|
+
/** Enables or disables API reading mode. @keywords set, api, read, translate */
|
|
1301
1760
|
static setReadApi(value: boolean): void;
|
|
1302
|
-
/**
|
|
1303
|
-
* @param config configuration
|
|
1304
|
-
*/
|
|
1761
|
+
/** Sets the translation configuration. @keywords set, config, translate */
|
|
1305
1762
|
static setConfig(config: TranslateConfig): void;
|
|
1306
1763
|
}
|
|
1307
|
-
|
|
1764
|
+
|
|
1765
|
+
/** Manages translation files and loading data @keywords translate, file, localization */
|
|
1308
1766
|
export declare class TranslateFile {
|
|
1309
1767
|
protected language: string | (() => string);
|
|
1310
1768
|
protected location: string | (() => string);
|
|
1311
|
-
/**
|
|
1312
|
-
/** Creates an instance of the class.
|
|
1313
|
-
* @param data list of files
|
|
1314
|
-
* @param language language
|
|
1315
|
-
* @param location location
|
|
1316
|
-
*/
|
|
1769
|
+
/** Creates an instance of the class. @keywords constructor, translate */
|
|
1317
1770
|
constructor(data?: TranslateDataFile, language?: string | (() => string), location?: string | (() => string));
|
|
1318
|
-
/** Checks if
|
|
1771
|
+
/** Checks if files exist for the current location or language. @keywords isFile, check, translate */
|
|
1319
1772
|
isFile(): boolean;
|
|
1320
|
-
/** Returns the location. */
|
|
1773
|
+
/** Returns the current location. @keywords getLocation, location, translate */
|
|
1321
1774
|
getLocation(): string;
|
|
1322
|
-
/** Returns the language. */
|
|
1775
|
+
/** Returns the current language. @keywords getLanguage, language, translate */
|
|
1323
1776
|
getLanguage(): string;
|
|
1324
|
-
/** Returns
|
|
1325
|
-
* @returns promise with list of translations
|
|
1326
|
-
*/
|
|
1777
|
+
/** Returns translation list for the current location. @keywords getList, translations, load */
|
|
1327
1778
|
getList(): Promise<TranslateDataFileList | undefined>;
|
|
1328
|
-
/** Adds a list of files
|
|
1329
|
-
* @param data list of files
|
|
1330
|
-
*/
|
|
1779
|
+
/** Adds a list of translation files. @keywords add, files, translate */
|
|
1331
1780
|
add(data: TranslateDataFile): void;
|
|
1332
|
-
/** Returns the key for the current location from the list of files.
|
|
1333
|
-
* @returns file key or undefined
|
|
1334
|
-
*/
|
|
1335
|
-
protected getIndex(): string | undefined;
|
|
1336
|
-
/** Returns a list of translations from the cache.
|
|
1337
|
-
* @param index file key
|
|
1338
|
-
* @returns list of translations or undefined
|
|
1339
|
-
*/
|
|
1340
|
-
protected getByData(index: string): TranslateDataFileList | undefined;
|
|
1341
|
-
/** Returns a list of translations from the file and caches the result.
|
|
1342
|
-
* @param index file key
|
|
1343
|
-
* @returns promise with list of translations or undefined
|
|
1344
|
-
*/
|
|
1345
|
-
protected getByFile(index: string): Promise<TranslateDataFileList | undefined>;
|
|
1346
1781
|
}
|
|
1347
|
-
|
|
1782
|
+
|
|
1783
|
+
/** Class for managing translations and fetching localized text. @keywords translate translation i18n localization */
|
|
1348
1784
|
export declare class TranslateInstance {
|
|
1349
|
-
|
|
1785
|
+
/** @param url URL for getting translations @param propsName Property name for getting translations @param files List of files with translations */
|
|
1350
1786
|
constructor(url?: string, propsName?: string, files?: TranslateFile);
|
|
1787
|
+
/** Gets translated text by its code. @keywords translate text get */
|
|
1351
1788
|
get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
1789
|
+
/** Gets translated text synchronously by its code. @keywords translate text sync */
|
|
1352
1790
|
getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
1791
|
+
/** Gets a list of translations by an array of codes. @keywords translate list async */
|
|
1353
1792
|
getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
1793
|
+
/** Gets a list of translations synchronously by an array of codes. @keywords translate list sync */
|
|
1354
1794
|
getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
1795
|
+
/** Adds a list of translated texts. @keywords translate add */
|
|
1355
1796
|
add(names: string | string[]): Promise<void>;
|
|
1797
|
+
/** Adds texts in synchronous mode. @keywords translate add sync */
|
|
1356
1798
|
addSync(data: Record<string, string>): void;
|
|
1799
|
+
/** Adds data via query or directly based on runtime environment. @keywords translate add normal sync */
|
|
1357
1800
|
addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
1801
|
+
/** Adds texts synchronously by location. @keywords translate add location */
|
|
1358
1802
|
addSyncByLocation(data: Record<string, Record<string, string>>): void;
|
|
1803
|
+
/** Adds texts synchronously from a file. @keywords translate add file */
|
|
1359
1804
|
addSyncByFile(data: TranslateDataFile): void;
|
|
1805
|
+
/** Sets the translation endpoint URL. @keywords translate url set */
|
|
1360
1806
|
setUrl(url: string): this;
|
|
1807
|
+
/** Sets the translation property name. @keywords translate propsName set */
|
|
1361
1808
|
setPropsName(name: string): this;
|
|
1809
|
+
/** Sets the API read mode. @keywords translate readApi set */
|
|
1362
1810
|
setReadApi(value: boolean): this;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
protected getNameByLanguage(name: string): string;
|
|
1367
|
-
protected getNameByGlobal(name: string): string;
|
|
1368
|
-
protected getNamesNone(names: string | string[]): string[];
|
|
1369
|
-
protected getResponse(): Promise<Record<string, string>>;
|
|
1370
|
-
protected replacement(text: string, replacement?: string[] | Record<string, string | number>): any;
|
|
1371
|
-
protected make(): Promise<void>;
|
|
1372
|
-
protected makeList(list: Record<string, string>): void;
|
|
1373
|
-
}
|
|
1374
|
-
/** Base abstract class for working with URL-based states (Hash, Query) */
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
/** Base abstract class for URL-based state management. @keywords url_instance abstract state */
|
|
1375
1814
|
export declare abstract class UrlInstanceAbstract {
|
|
1815
|
+
/** Watchers map for URL state variables */
|
|
1376
1816
|
protected watch: Record<string, ((value: any) => void)[]>;
|
|
1817
|
+
/** Update block flag */
|
|
1818
|
+
protected block: boolean;
|
|
1819
|
+
/** Timeout identifier */
|
|
1820
|
+
protected time: any;
|
|
1821
|
+
/** Data record storage */
|
|
1822
|
+
protected data: Record<string, any> | undefined;
|
|
1823
|
+
/** Get data by name with optional default value. @keywords get data */
|
|
1377
1824
|
get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
1825
|
+
/** Set data value by name. @keywords set data */
|
|
1378
1826
|
set<T>(name: string, callback: T | (() => T)): this;
|
|
1827
|
+
/** Add a watch callback for a specific property. @keywords add watch event */
|
|
1379
1828
|
addWatch<T>(name: string, callback: (value: T) => void): this;
|
|
1829
|
+
/** Remove a watch callback. @keywords remove watch event */
|
|
1380
1830
|
removeWatch<T>(name: string, callback: (value: T) => void): this;
|
|
1831
|
+
/** Reload state data. @keywords reload data */
|
|
1381
1832
|
reload(): this;
|
|
1833
|
+
/** Get internal data record. @keywords get data record */
|
|
1382
1834
|
protected getData(): Record<string, any>;
|
|
1835
|
+
/** Initialize internal data. @keywords init data */
|
|
1383
1836
|
protected initData(): this;
|
|
1837
|
+
/** Trigger watch callbacks on change. @keywords make watch */
|
|
1384
1838
|
protected makeWatch(location: Record<string, any>): this;
|
|
1839
|
+
/** Initialize instance and listeners. @keywords init */
|
|
1385
1840
|
protected abstract init(): this;
|
|
1841
|
+
/** Get location data from URL. @keywords get location */
|
|
1386
1842
|
protected abstract getLocation(): Record<string, any>;
|
|
1843
|
+
/** Update URL state representation. @keywords update */
|
|
1387
1844
|
protected abstract update(): this;
|
|
1388
1845
|
}
|
|
1389
|
-
|
|
1846
|
+
|
|
1847
|
+
/** Isomorphic utility class for working with URLs. @keywords url, parse, query, params */
|
|
1390
1848
|
export declare class UrlItem {
|
|
1849
|
+
/** Returns a request-isolated instance of UrlItem. @keywords instance, singleton, url */
|
|
1391
1850
|
static getInstance(): UrlItem;
|
|
1851
|
+
/** Constructs a new UrlItem instance. @keywords constructor, url */
|
|
1392
1852
|
constructor(url?: string | URL);
|
|
1853
|
+
/** Full URL string. @keywords href, url */
|
|
1393
1854
|
get href(): string;
|
|
1855
|
+
/** Protocol including trailing colon. @keywords protocol, url */
|
|
1394
1856
|
get protocol(): string;
|
|
1857
|
+
/** Username. @keywords username, auth, url */
|
|
1395
1858
|
get username(): string;
|
|
1859
|
+
/** Password. @keywords password, auth, url */
|
|
1396
1860
|
get password(): string;
|
|
1861
|
+
/** Host (hostname and port). @keywords host, url */
|
|
1397
1862
|
get host(): string;
|
|
1863
|
+
/** Hostname (excluding port). @keywords hostname, url */
|
|
1398
1864
|
get hostname(): string;
|
|
1865
|
+
/** Port. @keywords port, url */
|
|
1399
1866
|
get port(): string;
|
|
1867
|
+
/** Path name. @keywords pathname, path, url */
|
|
1400
1868
|
get pathname(): string;
|
|
1869
|
+
/** Search string including leading question mark. @keywords search, query, url */
|
|
1401
1870
|
get search(): string;
|
|
1871
|
+
/** Readonly search params object. @keywords searchParams, query, url */
|
|
1402
1872
|
get searchParams(): URLSearchParams;
|
|
1873
|
+
/** Hash string including leading hash sign. @keywords hash, anchor, url */
|
|
1403
1874
|
get hash(): string;
|
|
1875
|
+
/** Origin of the URL. @keywords origin, url */
|
|
1404
1876
|
get origin(): string;
|
|
1877
|
+
/** Checks if the specified query parameter exists. @keywords hasParam, query, check */
|
|
1405
1878
|
hasParam(name: string): boolean;
|
|
1879
|
+
/** Returns the value of a query parameter. @keywords getParam, query, value */
|
|
1406
1880
|
getParam(name: string): string | undefined;
|
|
1881
|
+
/** Returns all query parameters as an object with transformed types. @keywords getParams, query, object */
|
|
1407
1882
|
getParams(): Record<string, any>;
|
|
1883
|
+
/** Updates the URL value. @keywords set, url */
|
|
1408
1884
|
set(url?: string | URL): this;
|
|
1885
|
+
/** Sets the value of a query parameter. @keywords setParam, query, update */
|
|
1409
1886
|
setParam(name: string, value: string): this;
|
|
1887
|
+
/** Replaces all query parameters with the specified object. @keywords setParams, query, replace */
|
|
1410
1888
|
setParams(params: Record<string, any>): this;
|
|
1889
|
+
/** Deletes a query parameter. @keywords deleteParam, query, remove */
|
|
1411
1890
|
deleteParam(name: string): this;
|
|
1891
|
+
/** Converts the Url instance to its string representation. @keywords toString, string, url */
|
|
1412
1892
|
toString(): string;
|
|
1893
|
+
/** Converts the Url instance to JSON string representation. @keywords toJSON, json, url */
|
|
1413
1894
|
toJSON(): string;
|
|
1414
1895
|
}
|
|
1415
|
-
|
|
1896
|
+
|
|
1897
|
+
/** Adds a tag to highlight matching text within a string. @keywords highlight match search wrap tag @param value target string @param search search query or pattern */
|
|
1416
1898
|
export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
|
|
1417
|
-
|
|
1899
|
+
|
|
1900
|
+
/** Converts a value to a string. @keywords convert, string, to_string */
|
|
1418
1901
|
export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
|
|
1419
|
-
|
|
1902
|
+
|
|
1903
|
+
/** Applies a template to text, replacing keys with values. @keywords apply template replace string format */
|
|
1420
1904
|
export declare const applyTemplate: (text: string, replacement?: Record<string, string | number | boolean> | string[]) => string;
|
|
1421
|
-
|
|
1905
|
+
|
|
1906
|
+
/** Creates an array of elements filled with the specified value. @keywords array fill generate repeat */
|
|
1422
1907
|
export declare function arrFill<T>(value: T, count: number): T[];
|
|
1423
|
-
|
|
1908
|
+
|
|
1909
|
+
/** Converts a Blob to a Base64 string. @keywords blob base64 convert */
|
|
1424
1910
|
export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
|
|
1425
|
-
|
|
1911
|
+
|
|
1912
|
+
/** Capitalizes the first letter of a string @keywords capitalize string formatting */
|
|
1426
1913
|
export declare function capitalize(value: string, isLocale?: boolean): string;
|
|
1427
|
-
|
|
1914
|
+
|
|
1915
|
+
/** Creates a deep copy of an object. @keywords copy clone object mutate */
|
|
1428
1916
|
export declare function copyObject<T>(value: T): T;
|
|
1429
|
-
|
|
1917
|
+
|
|
1918
|
+
/** Copies a simple object. @keywords copy object lite clone @param value Object for copying @param source Additional properties for copying */
|
|
1430
1919
|
export declare function copyObjectLite<T, R = T>(value: T, source?: any): R;
|
|
1920
|
+
|
|
1431
1921
|
/**
|
|
1432
|
-
*
|
|
1433
|
-
* @remarks
|
|
1434
|
-
* When running on the server, the function always returns `undefined`.
|
|
1435
|
-
* If you use it within a component's rendering logic, it may lead to hydration mismatches.
|
|
1436
|
-
* It is recommended to call this function only inside lifecycle hooks that run exclusively on the client (e.g., `onMounted` in Vue or `useEffect` in React).
|
|
1922
|
+
* Creates a DOM element with the specified tag name, attributes, and options. @keywords createElement dom html tag
|
|
1437
1923
|
*/
|
|
1438
1924
|
export declare function createElement<T extends HTMLElement>(parentElement?: HTMLElement, tagName?: string, options?: Partial<T> | Record<keyof T, T[keyof T]> | ((element: T) => void), referenceElement?: HTMLElement): T | undefined;
|
|
1439
|
-
|
|
1925
|
+
|
|
1926
|
+
/** Executes callback when DOM is loaded or immediately if already ready @keywords dom content loaded ready */
|
|
1440
1927
|
export declare function domContentLoaded<T = void>(callback: () => T | Promise<T>): Promise<T>;
|
|
1441
|
-
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* Selects the first element matching the specified selectors.
|
|
1931
|
+
* @keywords querySelector, dom, element, select
|
|
1932
|
+
*/
|
|
1442
1933
|
export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
|
|
1443
|
-
|
|
1934
|
+
|
|
1935
|
+
/** Selects all elements matching the given CSS selector. @keywords dom query selector all list elements */
|
|
1444
1936
|
export declare function domQuerySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E> | undefined;
|
|
1445
|
-
|
|
1937
|
+
|
|
1938
|
+
/** @keywords encode, attribute, html, escape */
|
|
1446
1939
|
export declare function encodeAttribute(text: string): string;
|
|
1447
|
-
|
|
1940
|
+
|
|
1941
|
+
/** Encodes special characters in a string for safe use in HTML attributes. @keywords encode, attribute, html, escape */
|
|
1448
1942
|
export declare function encodeLiteAttribute(text: string): string;
|
|
1449
|
-
|
|
1943
|
+
|
|
1944
|
+
/** Ensures maximum image size by resizing. @keywords image, resize, max, size, compress */
|
|
1450
1945
|
export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
|
|
1451
|
-
|
|
1946
|
+
|
|
1947
|
+
/** Escapes special regex characters in a string. @keywords escape, regex, regexp */
|
|
1452
1948
|
export declare function escapeExp(value: string): string;
|
|
1453
|
-
|
|
1949
|
+
|
|
1950
|
+
/** Stop event propagation and default behavior @keywords stop propagation event prevent default */
|
|
1454
1951
|
export declare function eventStopPropagation(event: Event): void;
|
|
1455
|
-
|
|
1952
|
+
|
|
1953
|
+
/** Executes the argument if it is a function, otherwise returns it as is. @keywords execute, function, callback */
|
|
1456
1954
|
export declare function executeFunction<T>(callback: T | FunctionArgs<any, T>, ...args: any[]): T;
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
* If the provided value is a static value or a synchronous function, it returns the result immediately wrapped in a Promise.
|
|
1460
|
-
*/
|
|
1955
|
+
|
|
1956
|
+
/** Safely executes a function and awaits its result if it returns a Promise. @keywords execute, promise, async, function */
|
|
1461
1957
|
export declare function executePromise<T>(callback: ((...args: any[]) => Promise<T>) | ((...args: any[]) => T) | T, ...args: any[]): Promise<T>;
|
|
1462
|
-
|
|
1958
|
+
|
|
1959
|
+
/** Executes a callback for each element in an object or collection and returns the results. @keywords foreach iterate collection map array object */
|
|
1463
1960
|
export declare function forEach<T, R, D extends T[] | Record<string, T> | Map<string, T> | Set<T> = T[] | Record<string, T> | Map<string, T> | Set<T>, K = D extends T[] ? number : string>(data: D & (T[] | Record<string, T> | Map<string, T> | Set<T>), callback: (item: T, key: K, dataMain: typeof data) => R, saveUndefined?: boolean): R[];
|
|
1464
|
-
|
|
1961
|
+
|
|
1962
|
+
/**
|
|
1963
|
+
* Cyclically calls requestAnimationFrame until next returns true.
|
|
1964
|
+
* @keywords frame animation requestAnimationFrame loop
|
|
1965
|
+
*/
|
|
1465
1966
|
export declare function frame(callback: () => void, next?: () => boolean, end?: () => void): void;
|
|
1466
|
-
|
|
1967
|
+
|
|
1968
|
+
/** Split a string into an array of objects to highlight matches. @keywords highlight match search array */
|
|
1467
1969
|
export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
|
|
1468
|
-
|
|
1970
|
+
|
|
1971
|
+
/**
|
|
1972
|
+
* Gets a list of attributes of an element.
|
|
1973
|
+
* @keywords get_attributes element dom
|
|
1974
|
+
*/
|
|
1469
1975
|
export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
|
|
1976
|
+
|
|
1470
1977
|
/**
|
|
1471
|
-
*
|
|
1472
|
-
*
|
|
1978
|
+
* Retrieves drag or clipboard text data.
|
|
1979
|
+
* @keywords clipboard, read, text, get
|
|
1473
1980
|
*/
|
|
1474
1981
|
export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
|
|
1475
|
-
|
|
1982
|
+
|
|
1983
|
+
/** Returns column values from an array or object. @keywords get_column, column, array */
|
|
1476
1984
|
export declare function getColumn<T, K extends keyof T>(array: ObjectOrArray<T>, column: K): (T[K] | undefined)[];
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
* @remarks
|
|
1480
|
-
* Using this function for rendering in SSR may lead to hydration mismatches
|
|
1481
|
-
* because the time or time zone on the server may differ from the time on the client.
|
|
1482
|
-
* It is recommended to use this function inside client-side hooks only (e.g., `onMounted` in Vue or `useEffect` in React).
|
|
1483
|
-
*/
|
|
1985
|
+
|
|
1986
|
+
/** Returns the current date in the specified format. @keywords getCurrentDate, date, time */
|
|
1484
1987
|
export declare function getCurrentDate(format?: GeoDate): string;
|
|
1988
|
+
|
|
1989
|
+
/** Returns the current time in milliseconds. @keywords getCurrentTime time milliseconds timestamp */
|
|
1990
|
+
export declare function getCurrentTime(): number;
|
|
1991
|
+
|
|
1485
1992
|
/**
|
|
1486
|
-
* Returns the
|
|
1487
|
-
* @
|
|
1488
|
-
* **Warning (SSR):** Using this function for rendering in SSR will almost certainly lead to hydration mismatches
|
|
1489
|
-
* because the timestamp on the server will differ from the timestamp on the client.
|
|
1993
|
+
* Returns the first Element matching the specified selector or element.
|
|
1994
|
+
* @keywords getElement querySelector dom element
|
|
1490
1995
|
*/
|
|
1491
|
-
export declare function getCurrentTime(): number;
|
|
1492
|
-
/** Returns the first Element in the document that matches the specified selector or the element */
|
|
1493
1996
|
export declare function getElement<E extends ElementOrWindow, R extends Exclude<E, Window>>(element?: ElementOrString<E>): R | undefined;
|
|
1494
|
-
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* Returns the identifier (ID) of the element or creates it if missing.
|
|
2000
|
+
* @keywords getElementId, element, id, dom
|
|
2001
|
+
* @param element element to get ID from
|
|
2002
|
+
* @param selector optional selector suffix
|
|
2003
|
+
*/
|
|
1495
2004
|
export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
|
|
2005
|
+
|
|
1496
2006
|
/**
|
|
1497
|
-
* Initializes the getElementId function with a listener
|
|
1498
|
-
* @
|
|
1499
|
-
* @
|
|
1500
|
-
* ```typescript
|
|
1501
|
-
* import { useId } from 'vue'
|
|
1502
|
-
* import { initGetElementId } from '@dxtmisha/functional-basic'
|
|
1503
|
-
*
|
|
1504
|
-
* initGetElementId(() => useId())
|
|
1505
|
-
* ```
|
|
2007
|
+
* Initializes the getElementId function with a custom listener.
|
|
2008
|
+
* @keywords initGetElementId, id, generator, ssr
|
|
2009
|
+
* @warning Initialization is mandatory for correct SSR functioning.
|
|
1506
2010
|
*/
|
|
1507
2011
|
export declare function initGetElementId(newListener: () => string | number): void;
|
|
1508
|
-
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* Get image element from HTMLImageElement or string source.
|
|
2015
|
+
* @keywords getElementImage, image, html, element
|
|
2016
|
+
*/
|
|
1509
2017
|
export declare function getElementImage(image: HTMLImageElement | string): HTMLImageElement | undefined;
|
|
1510
|
-
|
|
2018
|
+
|
|
2019
|
+
/**
|
|
2020
|
+
* Returns element property value or default value.
|
|
2021
|
+
* @keywords getElementItem, element property, value
|
|
2022
|
+
*/
|
|
1511
2023
|
export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>, index: K | string, defaultValue?: D): T[K] | D | undefined;
|
|
1512
|
-
|
|
2024
|
+
|
|
2025
|
+
/** Returns window or element @keywords element, window, match */
|
|
1513
2026
|
export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
|
|
1514
|
-
|
|
2027
|
+
|
|
2028
|
+
/** Generates a safe script tag for data hydration. @keywords hydration script tag data @param id script tag ID @param data data to be stored */
|
|
1515
2029
|
export declare function getElementSafeScript(id: string, data: any): string;
|
|
1516
|
-
|
|
2030
|
+
|
|
2031
|
+
/** Creates a case-insensitive regular expression for exact match of a phrase. @keywords exact search expression regular expression */
|
|
1517
2032
|
export declare function getExactSearchExp(search: string): RegExp;
|
|
1518
|
-
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* Creates a regular expression object to match text against a pattern.
|
|
2036
|
+
* @keywords regex, regular expression, pattern matching, getExp
|
|
2037
|
+
*/
|
|
1519
2038
|
export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
|
|
1520
|
-
|
|
2039
|
+
|
|
2040
|
+
/** Returns the first element of an array or object. @keywords get first element array object */
|
|
1521
2041
|
export declare function getFirst<T>(value: T | T[] | Record<string, T>): T | undefined;
|
|
1522
|
-
|
|
2042
|
+
|
|
2043
|
+
/** Retrieves and parses JSON data from a DOM script tag. @keywords hydration, json, script, dom */
|
|
1523
2044
|
export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
|
|
1524
|
-
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* Returns data by path.
|
|
2048
|
+
* @keywords get item by path, object path resolver
|
|
2049
|
+
*/
|
|
1525
2050
|
export declare function getItemByPath<T extends Record<string, any>, R = string>(item: T, path: string): R | undefined;
|
|
1526
|
-
|
|
2051
|
+
|
|
2052
|
+
/** Returns the pressed key from keyboard event. @keywords key, keyboard, event */
|
|
1527
2053
|
export declare function getKey(event: KeyboardEvent): string | number | undefined;
|
|
1528
|
-
|
|
1529
|
-
export declare function getLast<T>(value: T | T[] | Record<string, T>): T | undefined;
|
|
2054
|
+
|
|
1530
2055
|
/**
|
|
1531
|
-
* Returns the
|
|
1532
|
-
*
|
|
2056
|
+
* Returns the last element of an array or object.
|
|
2057
|
+
* @keywords last, element, array, object
|
|
2058
|
+
* @param value input value
|
|
1533
2059
|
*/
|
|
2060
|
+
export declare function getLast<T>(value: T | T[] | Record<string, T>): T | undefined;
|
|
2061
|
+
|
|
2062
|
+
/** Returns the length or size of various data types including Arrays, Objects, Maps, Sets, and Strings. @keywords length size count getLength */
|
|
1534
2063
|
export declare function getLength(value: any): number;
|
|
1535
|
-
|
|
2064
|
+
|
|
2065
|
+
/** Returns lengths of all elements in an array. @keywords getLengthOfAllArray array lengths */
|
|
1536
2066
|
export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
|
|
1537
|
-
|
|
2067
|
+
|
|
2068
|
+
/** Searches for the longest string in the array and returns its length. @keywords getMaxLengthAllArray max length array string */
|
|
1538
2069
|
export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1539
|
-
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Returns the minimum length among all string values in an object or array.
|
|
2073
|
+
* @keywords getMinLengthAllArray, min_length, array, length
|
|
2074
|
+
*/
|
|
1540
2075
|
export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
/** Returns
|
|
1546
|
-
export declare function
|
|
1547
|
-
|
|
2076
|
+
|
|
2077
|
+
/** Returns the position of the mouse cursor or click. @keywords getMouseClient mouse touch event coordinates */
|
|
2078
|
+
export declare function getMouseClient(event: MouseEvent | TouchEvent): ImageCoordinator;
|
|
2079
|
+
|
|
2080
|
+
/** Returns mouse X coordinate or click location. @keywords mouse client x coordinate */
|
|
2081
|
+
export declare function getMouseClientX(event: MouseEvent | TouchEvent): number;
|
|
2082
|
+
|
|
2083
|
+
/** Returns the Y coordinate of the mouse cursor or touch event. @keywords getMouseClientY mouse touch Y coordinate */
|
|
2084
|
+
export declare function getMouseClientY(event: MouseEvent | TouchEvent): number;
|
|
2085
|
+
|
|
2086
|
+
/** Filter object by keys @keywords getObjectByKeys pick keys */
|
|
1548
2087
|
export declare function getObjectByKeys<T extends Record<string, any>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
|
|
1549
|
-
|
|
2088
|
+
|
|
2089
|
+
/** Removes properties equal to the exception value from the object. @keywords object filter remove undefined */
|
|
1550
2090
|
export declare function getObjectNoUndefined<T extends Record<string | number, any>>(data: T, exception?: any): T;
|
|
1551
|
-
|
|
2091
|
+
|
|
2092
|
+
/** Returns the object if values are set, otherwise an empty object. @keywords object none check @param value The value to evaluate */
|
|
1552
2093
|
export declare function getObjectOrNone<T>(value: T): T & Record<string, any>;
|
|
1553
|
-
|
|
2094
|
+
|
|
2095
|
+
/** Returns only letters, numbers, and spaces from a string. @keywords get only text sanitize alphanumeric */
|
|
1554
2096
|
export declare function getOnlyText(text: any): string;
|
|
2097
|
+
|
|
1555
2098
|
/**
|
|
1556
2099
|
* Returns a random element from an array, object, or value.
|
|
1557
|
-
*
|
|
2100
|
+
* @keywords random element, get random, pick item
|
|
1558
2101
|
*/
|
|
1559
2102
|
export declare function getRandomItem<T>(value?: T | T[] | Record<string, T>): T | undefined;
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
*
|
|
1563
|
-
* @
|
|
1564
|
-
* @param lengthMin minimum word length
|
|
1565
|
-
* @param lengthMax maximum word length
|
|
1566
|
-
* @returns generated text
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* Generates random text.
|
|
2106
|
+
* @keywords generate text random string
|
|
1567
2107
|
*/
|
|
1568
2108
|
export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
* @param sign delimiter sign of key and value
|
|
1572
|
-
* @param separator variable delimiter sign
|
|
1573
|
-
* @param subKey nested key for array elements
|
|
1574
|
-
* @returns formatted request string
|
|
1575
|
-
*/
|
|
2109
|
+
|
|
2110
|
+
/** Returns a key-value request string @keywords request string query encode */
|
|
1576
2111
|
export declare function getRequestString(request: Record<string, any> | any[], sign?: string, separator?: string, subKey?: string): string;
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
*
|
|
1580
|
-
* @
|
|
1581
|
-
* @param
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* Builds a case-insensitive global RegExp for multi-word search matching all terms.
|
|
2115
|
+
* @keywords get_search_exp, regexp, search, filter
|
|
2116
|
+
* @param search Search string with space-separated words
|
|
2117
|
+
* @param limit Maximum search string length
|
|
1582
2118
|
*/
|
|
1583
2119
|
export declare function getSearchExp(search: string, limit?: number): RegExp;
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
* @param limit maximum search string length
|
|
1587
|
-
* @returns `RegExp` for search
|
|
1588
|
-
*/
|
|
2120
|
+
|
|
2121
|
+
/** Creates a separating search expression for word-based searching. @keywords search, regex, separator, words */
|
|
1589
2122
|
export declare function getSeparatingSearchExp(search: string | RegExp, limit?: number): RegExp;
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
* @param max maximum value
|
|
1593
|
-
* @returns step value in percent
|
|
1594
|
-
*/
|
|
2123
|
+
|
|
2124
|
+
/** Returns the percentage step value between min and max. @keywords getStepPercent step percent calculation */
|
|
1595
2125
|
export declare function getStepPercent(min: number | undefined, max: number): number;
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
* @param max maximum value
|
|
1599
|
-
* @returns step value
|
|
1600
|
-
*/
|
|
2126
|
+
|
|
2127
|
+
/** Returns the step value relative to the given minimum and maximum. @keywords getStepValue step value minimum maximum */
|
|
1601
2128
|
export declare function getStepValue(min: number | undefined, max: number): number;
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
* @param elementTo the element to which you need to scroll
|
|
1605
|
-
* @param elementCenter the element that needs to be centered
|
|
1606
|
-
*/
|
|
2129
|
+
|
|
2130
|
+
/** Quick scroll element to target. @keywords scroll, element */
|
|
1607
2131
|
export declare function goScroll(selector: string, elementTo: HTMLElement | undefined, elementCenter?: HTMLElement): void;
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
*
|
|
1611
|
-
* @
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* Smooth scrolling to the target element.
|
|
2135
|
+
* @keywords scroll, smooth, element, animation
|
|
1612
2136
|
*/
|
|
1613
2137
|
export declare function goScrollSmooth<E extends HTMLElement>(element: E, options?: ScrollIntoViewOptions, shift?: number): void;
|
|
1614
|
-
|
|
2138
|
+
|
|
2139
|
+
/** Scrolls the container to make the target element visible. @keywords scroll container target visible @param element container element @param elementTo target element @param behavior scroll behavior */
|
|
1615
2140
|
export declare function goScrollTo(element?: HTMLElement, elementTo?: HTMLElement, behavior?: ScrollBehavior): void;
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
* If the Web Share API is not supported by the browser or the data cannot be shared, the method returns false.
|
|
1619
|
-
*/
|
|
2141
|
+
|
|
2142
|
+
/** Invokes Web Share API native sharing mechanism. @keywords share api web_share */
|
|
1620
2143
|
export declare function handleShare(data: ShareData): Promise<boolean>;
|
|
1621
|
-
|
|
2144
|
+
|
|
2145
|
+
/** Checks if the value is in the current array. @keywords inArray array search contains */
|
|
1622
2146
|
export declare function inArray<T>(array: T[], value: T): boolean;
|
|
1623
|
-
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* Initialization of data for scroll control. @keywords init scrollbar offset layout ui
|
|
2150
|
+
*/
|
|
1624
2151
|
export declare function initScrollbarOffset(): Promise<void>;
|
|
1625
|
-
|
|
2152
|
+
|
|
2153
|
+
/** Computes the intersection of object keys. @keywords intersect key object */
|
|
1626
2154
|
export declare function intersectKey<T, KT extends keyof T, C, KC extends keyof C>(data?: T, comparison?: C): Record<KT & KC, T[KT]>;
|
|
1627
|
-
|
|
2155
|
+
|
|
2156
|
+
/** Checks if API response is successful @keywords api, success, validate */
|
|
1628
2157
|
export declare const isApiSuccess: <T>(data: ApiData<T>) => boolean;
|
|
1629
|
-
|
|
2158
|
+
|
|
2159
|
+
/** Checks if the value is an array @keywords isArray, array, type_check */
|
|
1630
2160
|
export declare function isArray<T, R>(value: T): value is Extract<T, R[]>;
|
|
1631
|
-
|
|
2161
|
+
|
|
2162
|
+
/** Checks if the values of two objects are different. @keywords isDifferent object compare */
|
|
1632
2163
|
export declare function isDifferent<T>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
|
|
1633
|
-
|
|
2164
|
+
|
|
2165
|
+
/** Checks if the current environment is a data URL. @keywords isDomData, data url, dom */
|
|
1634
2166
|
export declare function isDomData(): boolean;
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
* Returns `true` if `window` is defined, indicating the code is running in a browser.
|
|
1638
|
-
*/
|
|
2167
|
+
|
|
2168
|
+
/** Checks if code is running in a browser environment with window available. @keywords dom runtime browser window */
|
|
1639
2169
|
export declare function isDomRuntime(): boolean;
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
* An element can be off-screen and still be considered visible.
|
|
1643
|
-
*/
|
|
2170
|
+
|
|
2171
|
+
/** Checks if an element is visible in DOM and not hidden by CSS. @keywords isElementVisible visible element check dom */
|
|
1644
2172
|
export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
|
|
1645
|
-
|
|
2173
|
+
|
|
2174
|
+
/** Checks if the pressed key is Enter or Space. @keywords enter, space, keyboard, key */
|
|
1646
2175
|
export declare const isEnter: (event: KeyboardEvent, isInputElement?: boolean) => boolean;
|
|
1647
|
-
|
|
2176
|
+
|
|
2177
|
+
/** Checks if field is filled. @keywords isFilled, check, filled, empty */
|
|
1648
2178
|
export declare function isFilled<T>(value: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
|
|
1649
|
-
|
|
2179
|
+
|
|
2180
|
+
/** Checks if the value is an integer or floating-point number. @keywords isFloat number check */
|
|
1650
2181
|
export declare function isFloat(value: any): boolean;
|
|
1651
|
-
|
|
2182
|
+
|
|
2183
|
+
/** Checks if the value is a function. @keywords isFunction, function, callback */
|
|
1652
2184
|
export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionArgs<any, any>>;
|
|
1653
|
-
|
|
2185
|
+
|
|
2186
|
+
/**
|
|
2187
|
+
* Checks if an element is still in the DOM tree.
|
|
2188
|
+
* @keywords isInDom dom element check connected
|
|
2189
|
+
*/
|
|
1654
2190
|
export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
|
|
1655
|
-
|
|
2191
|
+
|
|
2192
|
+
/** Checks if the element is an input field or editable. @keywords isInput input editable form @param element The element to check */
|
|
1656
2193
|
export declare const isInput: (element: HTMLElement | EventTarget | null) => boolean;
|
|
1657
|
-
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Checks if the value is between integers. @keywords isIntegerBetween, integer, between, range, check */
|
|
1658
2197
|
export declare function isIntegerBetween(value: number, between: number): boolean;
|
|
1659
|
-
|
|
2198
|
+
|
|
2199
|
+
/** Checks if a key event contains active modifier/meta keys. @keywords meta_key modifier_key keyboard */
|
|
1660
2200
|
export declare const isMetaKey: (event: KeyboardEvent) => boolean;
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
2201
|
+
|
|
2202
|
+
/** Checks if value is null or undefined. @keywords isNull null undefined */
|
|
2203
|
+
export declare function isNull<T>(value: T): value is Extract<T, undefined>;
|
|
2204
|
+
|
|
2205
|
+
/** Checks if the value is a number. @keywords isNumber check number numeric */
|
|
1664
2206
|
export declare function isNumber(value: any): boolean;
|
|
1665
|
-
|
|
2207
|
+
|
|
2208
|
+
/** Checks if a value is an object. @keywords isObject object type check */
|
|
1666
2209
|
export declare function isObject<T>(value: T): value is Extract<T, Record<any, any>>;
|
|
1667
|
-
|
|
2210
|
+
|
|
2211
|
+
/** Checks if value is an object and not an array. @keywords isObjectNotArray object check */
|
|
1668
2212
|
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, Record<any, any>>, any[] | undefined | null>;
|
|
1669
|
-
|
|
2213
|
+
|
|
2214
|
+
/** Check if the device is online. @keywords online status connection network */
|
|
1670
2215
|
export declare function isOnLine(): boolean;
|
|
1671
|
-
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* Checks if value is selected within an array or equals a string.
|
|
2219
|
+
* @keywords isSelected, check, selected, value, match
|
|
2220
|
+
*/
|
|
1672
2221
|
export declare function isSelected<T, S>(value: T, selected: T | T[] | S): boolean;
|
|
1673
|
-
|
|
2222
|
+
|
|
2223
|
+
/** Checks if all values in the list are selected. @keywords isSelectedByList, select, match */
|
|
1674
2224
|
export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
|
|
1675
|
-
|
|
2225
|
+
|
|
2226
|
+
/** Checks if the Web Share API is supported in the current environment. @keywords share api support */
|
|
1676
2227
|
export declare function isShare(): boolean;
|
|
1677
|
-
|
|
2228
|
+
|
|
2229
|
+
/** Checks if value is a string. @keywords isString, string, type */
|
|
1678
2230
|
export declare function isString<T>(value: T): value is Extract<T, string>;
|
|
1679
|
-
|
|
2231
|
+
|
|
2232
|
+
/** Checks if the pressed key is Tab. @keywords tab key keyboard event */
|
|
1680
2233
|
export declare const isTab: (event: KeyboardEvent) => boolean;
|
|
1681
|
-
|
|
2234
|
+
|
|
2235
|
+
/** Checks if object is Window. @keywords isWindow window dom */
|
|
1682
2236
|
export declare function isWindow<E>(element: E): element is Extract<E, Window>;
|
|
1683
|
-
|
|
2237
|
+
|
|
2238
|
+
/** Generate a random integer. @keywords random integer number */
|
|
1684
2239
|
export declare function random(min: number, max: number): number;
|
|
1685
|
-
|
|
2240
|
+
|
|
2241
|
+
/** Removes common prefix from string. @keywords remove_prefix string */
|
|
1686
2242
|
export declare function removeCommonPrefix(mainStr: string, prefix: string): string;
|
|
1687
|
-
|
|
2243
|
+
|
|
2244
|
+
/** Replaces component name in text @keywords replace component name */
|
|
1688
2245
|
export declare const replaceComponentName: (text: string | undefined, name: string, componentName: string) => string | undefined;
|
|
1689
|
-
|
|
2246
|
+
|
|
2247
|
+
/** Recursively merges objects and arrays. @keywords merge, replace, object, array */
|
|
1690
2248
|
export declare function replaceRecursive<I>(array: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
|
|
1691
|
-
|
|
2249
|
+
|
|
2250
|
+
/** Replaces template placeholders with values. @keywords replace template string */
|
|
1692
2251
|
export declare function replaceTemplate(value: string, replaces: Record<string, string | FunctionReturn<string>>): string;
|
|
1693
|
-
|
|
2252
|
+
|
|
2253
|
+
/** Resize type for image scaling. @keywords resize, image, scale, max */
|
|
1694
2254
|
type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1695
|
-
/** Resizes an image to fit within a maximum size constraint */
|
|
2255
|
+
/** Resizes an image to fit within a maximum size constraint. @keywords resize, image, scale, max, dimensions */
|
|
1696
2256
|
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
|
|
1697
2257
|
export {};
|
|
1698
|
-
|
|
2258
|
+
|
|
2259
|
+
/** Converts seconds into a time string. @keywords time, seconds, format, clock @param second specified seconds @param hasHour whether to include hours */
|
|
1699
2260
|
export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
|
|
1700
|
-
|
|
2261
|
+
|
|
2262
|
+
/** Modifies the value of an element identified by its key. @keywords set element property value */
|
|
1701
2263
|
export declare function setElementItem<E extends ElementOrWindow, K extends keyof E, V extends E[K] = E[K]>(element: ElementOrString<E>, index: K, value: V | Record<string, V>): E | undefined;
|
|
1702
|
-
|
|
2264
|
+
|
|
2265
|
+
/** Modifies data according to its type and settings. @keywords set values modify multiple */
|
|
1703
2266
|
export declare function setValues<T>(selected: T | T[] | undefined, value: any, { multiple, maxlength, alwaysChange, notEmpty }: {
|
|
1704
2267
|
multiple?: boolean | undefined;
|
|
1705
2268
|
maxlength?: number | undefined;
|
|
1706
2269
|
alwaysChange?: boolean | undefined;
|
|
1707
2270
|
notEmpty?: boolean | undefined;
|
|
1708
2271
|
}): T | T[] | undefined;
|
|
1709
|
-
|
|
2272
|
+
|
|
2273
|
+
/** Pause execution for specified milliseconds. @keywords sleep delay timer timeout */
|
|
1710
2274
|
export declare function sleep(ms: number): Promise<void>;
|
|
1711
|
-
|
|
2275
|
+
|
|
2276
|
+
/** Sorts an array of items by specified columns or custom comparison function. @keywords sort, order, array */
|
|
1712
2277
|
export declare function sortList<T = any>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
* In priority according to the processing list.
|
|
1716
|
-
*/
|
|
2278
|
+
|
|
2279
|
+
/** Copies enumerable properties from source to target object. @keywords splice, object, copy, merge */
|
|
1717
2280
|
export declare function splice<I>(array: ObjectItem<I>, replacement?: ObjectItem<I> | I, indexStart?: string): ObjectItem<I>;
|
|
1718
|
-
|
|
1719
|
-
export declare function strFill(value: string, count: number): string;
|
|
2281
|
+
|
|
1720
2282
|
/**
|
|
1721
|
-
*
|
|
1722
|
-
|
|
1723
|
-
|
|
2283
|
+
* The method creates a string of length count, consisting of the characters value. @keywords string fill repeat characters @param value character for filling @param count length of the string */
|
|
2284
|
+
export declare function strFill(value: string, count: number): string;
|
|
2285
|
+
|
|
2286
|
+
/** Splits a string by a separator with an optional limit. @keywords string split divide limit */
|
|
1724
2287
|
export declare function strSplit(value: number | string, separator: string, limit?: number): string[];
|
|
2288
|
+
|
|
1725
2289
|
/**
|
|
1726
2290
|
* Converts a value to an array.
|
|
1727
|
-
*
|
|
1728
|
-
* Otherwise, it wraps the value in an array.
|
|
2291
|
+
* @keywords toArray array convert wrap
|
|
1729
2292
|
*/
|
|
1730
2293
|
export declare function toArray<T>(value: T): T extends any[] ? T : [T];
|
|
1731
|
-
|
|
2294
|
+
|
|
2295
|
+
/** Convert a string to Upper Camel Case. @keywords toCamelCase upper camel case format case */
|
|
1732
2296
|
export declare function toCamelCase(value: string): string;
|
|
1733
|
-
|
|
2297
|
+
|
|
2298
|
+
/** Convert string to camel case with first letter uppercase @keywords to_camel_case_first, camelcase, string */
|
|
1734
2299
|
export declare function toCamelCaseFirst(value: string): string;
|
|
1735
|
-
|
|
1736
|
-
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
2300
|
+
|
|
1737
2301
|
/**
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
2302
|
+
* Conversion to Date object.
|
|
2303
|
+
* @keywords toDate, date, parse, time, transform
|
|
1740
2304
|
*/
|
|
2305
|
+
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
2306
|
+
|
|
2307
|
+
/** Converts a string to kebab-case format. @keywords kebab case dash string format */
|
|
1741
2308
|
export declare function toKebabCase(value: string): string;
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
* Handles various separators (spaces, commas, dots) and strips non-numeric characters.
|
|
1745
|
-
* Safe for use in SSR (Server-Side Rendering) environments.
|
|
1746
|
-
* @example
|
|
1747
|
-
* toNumber("1 234,56") // 1234.56
|
|
1748
|
-
* toNumber("1,234.56") // 1234.56
|
|
1749
|
-
* toNumber("1,234") // 1.234
|
|
1750
|
-
*/
|
|
2309
|
+
|
|
2310
|
+
/** Converts a value to a finite number @keywords number, parse, float, toNumber */
|
|
1751
2311
|
export declare function toNumber(value?: NumberOrString): number;
|
|
1752
|
-
|
|
2312
|
+
|
|
2313
|
+
/** Converts data to a number considering the maximum value. @keywords toNumberByMax, limit, number */
|
|
1753
2314
|
export declare function toNumberByMax(value: string | number, max?: string | number, formatting?: boolean, language?: string): string | number;
|
|
1754
|
-
|
|
2315
|
+
|
|
2316
|
+
/** Converts a value to a positive finite number (> 0), or returns default value if invalid. @keywords toNumberPositive positive number validate */
|
|
1755
2317
|
export declare function toNumberPositive(value?: number | string | null, defaultValue?: number): number;
|
|
1756
|
-
|
|
2318
|
+
|
|
2319
|
+
/** Converts values to percentages @keywords toPercent percent ratio calculate */
|
|
1757
2320
|
export declare function toPercent(maxValue: number, value: number): number;
|
|
1758
|
-
|
|
2321
|
+
|
|
2322
|
+
/** Convert values to percentages with 100 multiplier @keywords percentage percent math value */
|
|
1759
2323
|
export declare function toPercentBy100(maxValue: number, value: number): number;
|
|
1760
|
-
|
|
2324
|
+
|
|
2325
|
+
/** Converts the value to a string. @keywords to_string convert string */
|
|
1761
2326
|
export declare function toString<T>(value: T): string;
|
|
2327
|
+
|
|
2328
|
+
/** Transforms a string or value into its corresponding data type. @keywords transformation, parse, cast, data_type */
|
|
2329
|
+
export declare function transformation(value: any, isFunction?: boolean): any;
|
|
2330
|
+
|
|
1762
2331
|
/**
|
|
1763
|
-
*
|
|
1764
|
-
*
|
|
1765
|
-
* `null`, `true`, `false`, object, number, or function.
|
|
2332
|
+
* Converts a Uint8Array to a base64 encoded string.
|
|
2333
|
+
* @keywords uint8array, base64, encode, binary
|
|
1766
2334
|
*/
|
|
1767
|
-
export declare function transformation(value: any, isFunction?: boolean): any;
|
|
1768
|
-
/** Converts a Uint8Array to a base64 encoded string */
|
|
1769
2335
|
export declare function uint8ArrayToBase64(bytes: Uint8Array): string;
|
|
1770
|
-
|
|
2336
|
+
|
|
2337
|
+
/**
|
|
2338
|
+
* Removes duplicate entries in an array.
|
|
2339
|
+
* @keywords unique array duplicates remove
|
|
2340
|
+
*/
|
|
1771
2341
|
export declare function uniqueArray<T>(value: T[]): T[];
|
|
1772
|
-
|
|
2342
|
+
|
|
2343
|
+
/** Writes data to the clipboard. @keywords write clipboard text copy */
|
|
1773
2344
|
export declare function writeClipboardData(text: string): Promise<void>;
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
|
|
2348
|
+
/** Error cause list configuration array. @keywords error, cause, list, configuration */
|
|
1774
2349
|
export declare const errorCauseList: ErrorCenterCauseList;
|
|
1775
|
-
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* Supported HTTP methods for API requests.
|
|
2353
|
+
* Поддерживаемые HTTP-методы для API-запросов.
|
|
2354
|
+
*/
|
|
1776
2355
|
export declare enum ApiMethodItem {
|
|
1777
|
-
/** HTTP DELETE — used to delete resources */
|
|
1778
2356
|
delete = "DELETE",
|
|
1779
|
-
/** HTTP GET — used to retrieve resources (no request body) */
|
|
1780
2357
|
get = "GET",
|
|
1781
|
-
/** HTTP POST — used to create resources or send data */
|
|
1782
2358
|
post = "POST",
|
|
1783
|
-
/** HTTP PUT — used to update/replace resources */
|
|
1784
2359
|
put = "PUT",
|
|
1785
|
-
/** HTTP PATCH — used to partially update resources */
|
|
1786
2360
|
patch = "PATCH"
|
|
1787
2361
|
}
|
|
1788
|
-
/** Saved value in cache */
|
|
1789
2362
|
export type ApiCacheItem<T = any> = {
|
|
1790
|
-
/** Saved value */
|
|
1791
2363
|
value: T;
|
|
1792
|
-
/** Age of the cache */
|
|
1793
2364
|
age?: number;
|
|
1794
|
-
/** Cache age in seconds */
|
|
1795
2365
|
cacheAge: number;
|
|
1796
2366
|
};
|
|
1797
|
-
/** List of saved values in cache */
|
|
1798
2367
|
export type ApiCacheList = Record<string, ApiCacheItem>;
|
|
1799
|
-
/** API configuration */
|
|
1800
2368
|
export type ApiConfig = {
|
|
1801
|
-
/** Base URL for API requests */
|
|
1802
2369
|
urlRoot?: string;
|
|
1803
|
-
/** Base origin for API requests (protocol and domain) */
|
|
1804
2370
|
origin?: string;
|
|
1805
|
-
/** Default headers for API requests */
|
|
1806
2371
|
headers?: ApiHeadersValue;
|
|
1807
|
-
/** Default request data for API requests */
|
|
1808
2372
|
requestDefault?: ApiDefaultValue;
|
|
1809
|
-
/** Function to call before request */
|
|
1810
2373
|
preparation?: (apiFetch: ApiFetch) => Promise<void>;
|
|
1811
|
-
/** Function to call after request */
|
|
1812
2374
|
end?: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>;
|
|
1813
|
-
/** Timeout for the request in milliseconds */
|
|
1814
2375
|
timeout?: number;
|
|
1815
|
-
/** Enable development logging */
|
|
1816
2376
|
devMode?: boolean;
|
|
1817
|
-
/** Wrapper function for requests */
|
|
1818
2377
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1819
2378
|
};
|
|
1820
|
-
/** Shape of API response data wrapper */
|
|
1821
2379
|
export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
|
|
1822
|
-
/** API response validation result */
|
|
1823
2380
|
export type ApiDataValidation = {
|
|
1824
2381
|
status?: ApiStatusType;
|
|
1825
2382
|
code?: string | number;
|
|
@@ -1829,203 +2386,208 @@ export type ApiDataValidation = {
|
|
|
1829
2386
|
message?: string;
|
|
1830
2387
|
};
|
|
1831
2388
|
};
|
|
1832
|
-
/** Type of API response data item */
|
|
1833
2389
|
export type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
1834
|
-
/** Primary payload */
|
|
1835
2390
|
data?: T;
|
|
1836
2391
|
success?: boolean;
|
|
1837
2392
|
statusObject?: ApiStatusItem;
|
|
1838
2393
|
errorObject?: ApiErrorItem;
|
|
1839
2394
|
};
|
|
1840
|
-
/** Type for API request headers */
|
|
1841
2395
|
export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
|
|
1842
|
-
/** Default API request data type */
|
|
1843
2396
|
export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
|
|
1844
|
-
/** Options for making API requests */
|
|
1845
2397
|
export type ApiFetch = {
|
|
1846
|
-
/** Use base API URL */
|
|
1847
2398
|
api?: boolean;
|
|
1848
|
-
/** Endpoint path relative to base URL */
|
|
1849
2399
|
path?: string;
|
|
1850
|
-
/** Complete URL (overrides api + path) */
|
|
1851
2400
|
pathFull?: string;
|
|
1852
2401
|
method?: ApiMethod;
|
|
1853
|
-
/** Request body data or query parameters */
|
|
1854
2402
|
request?: FormData | Record<string, any> | string;
|
|
1855
|
-
/** Include authentication headers */
|
|
1856
2403
|
auth?: boolean;
|
|
1857
|
-
/** Custom headers */
|
|
1858
2404
|
headers?: Record<string, string> | null;
|
|
1859
|
-
/** Content-Type header value */
|
|
1860
2405
|
type?: string;
|
|
1861
|
-
/** Extract 'data' field from response */
|
|
1862
2406
|
toData?: boolean;
|
|
1863
|
-
/** Use global response cache */
|
|
1864
2407
|
global?: boolean;
|
|
1865
2408
|
devMode?: boolean;
|
|
1866
2409
|
hideError?: boolean;
|
|
1867
2410
|
hideLoading?: boolean;
|
|
1868
2411
|
retry?: number;
|
|
1869
2412
|
retryDelay?: number;
|
|
1870
|
-
/** Custom response processor */
|
|
1871
2413
|
queryReturn?: (query: Response) => Promise<any | ApiDataValidation>;
|
|
1872
|
-
/** Run global preparation hooks */
|
|
1873
2414
|
globalPreparation?: boolean;
|
|
1874
|
-
/** Run global end hooks */
|
|
1875
2415
|
globalEnd?: boolean;
|
|
1876
|
-
/** Additional fetch() options */
|
|
1877
2416
|
init?: RequestInit;
|
|
1878
2417
|
initError?: boolean;
|
|
1879
2418
|
timeout?: number;
|
|
1880
2419
|
controller?: AbortController;
|
|
1881
|
-
/** Cache age in seconds */
|
|
1882
2420
|
cache?: number;
|
|
1883
2421
|
enableClientCache?: boolean;
|
|
1884
|
-
/** Cache ID for grouping */
|
|
1885
2422
|
cacheId?: number | string;
|
|
1886
|
-
/** Limit of end reset */
|
|
1887
2423
|
endResetLimit?: number;
|
|
1888
|
-
/** Wrapper function for requests */
|
|
1889
2424
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1890
2425
|
};
|
|
1891
|
-
/** Type of API hydration item */
|
|
1892
2426
|
export type ApiHydrationItem = {
|
|
1893
|
-
/** Path string or RegExp to match request URL */
|
|
1894
2427
|
path: string;
|
|
1895
2428
|
method: ApiMethod;
|
|
1896
|
-
/** Expected request payload or special marker '*any' */
|
|
1897
2429
|
request?: ApiFetch['request'];
|
|
1898
|
-
/** Static response or factory function */
|
|
1899
2430
|
response: any;
|
|
1900
2431
|
};
|
|
1901
|
-
/** List of API hydration items */
|
|
1902
2432
|
export type ApiHydrationList = ApiHydrationItem[];
|
|
1903
|
-
/** Item for API error storage */
|
|
1904
2433
|
export type ApiErrorStorageItem = Record<string, any> & {
|
|
1905
|
-
/** URL string or RegExp to match request URL */
|
|
1906
2434
|
url: string | RegExp;
|
|
1907
2435
|
method: ApiMethodItem;
|
|
1908
2436
|
code?: string;
|
|
1909
2437
|
status?: number;
|
|
1910
|
-
/** Validation function */
|
|
1911
2438
|
validation?: (response: Response) => boolean;
|
|
1912
|
-
/** Error message or function that returns message */
|
|
1913
2439
|
message?: string | ((response?: Response) => string);
|
|
1914
2440
|
};
|
|
1915
|
-
/** List of API error storage items */
|
|
1916
2441
|
export type ApiErrorStorageList = ApiErrorStorageItem[];
|
|
1917
|
-
/** Supported HTTP methods type */
|
|
1918
2442
|
export type ApiMethod = string | ApiMethodItem;
|
|
1919
|
-
/** Result of global preparation/end hooks */
|
|
1920
2443
|
export type ApiPreparationEnd = {
|
|
1921
|
-
/** Reset flag to indicate state reset */
|
|
1922
2444
|
reset?: boolean;
|
|
1923
|
-
/** Arbitrary data returned by hook */
|
|
1924
2445
|
data?: any;
|
|
1925
2446
|
};
|
|
1926
|
-
/** Mock API response descriptor */
|
|
1927
2447
|
export type ApiResponseItem = {
|
|
1928
|
-
/** Path string or RegExp to match request URL */
|
|
1929
2448
|
path: string | RegExp;
|
|
1930
2449
|
method: ApiMethod;
|
|
1931
|
-
/** Expected request payload or special marker '*any' */
|
|
1932
2450
|
request?: ApiFetch['request'] | '*any';
|
|
1933
|
-
/** Static response or factory function */
|
|
1934
2451
|
response: any | ((request?: ApiFetch['request']) => any);
|
|
1935
|
-
/** Disable this mock */
|
|
1936
2452
|
disable?: any;
|
|
1937
|
-
/** Mark as global mock */
|
|
1938
2453
|
isForGlobal?: boolean;
|
|
1939
|
-
/** Simulate network lag */
|
|
1940
2454
|
lag?: any;
|
|
1941
2455
|
};
|
|
1942
2456
|
export type ApiStatusItem = {
|
|
1943
2457
|
status?: number;
|
|
1944
2458
|
statusText?: string;
|
|
1945
2459
|
error?: string;
|
|
1946
|
-
/** Last response */
|
|
1947
2460
|
lastResponse?: any;
|
|
1948
|
-
/** Last status */
|
|
1949
2461
|
lastStatus?: ApiStatusType;
|
|
1950
|
-
/** Last code */
|
|
1951
2462
|
lastCode?: string;
|
|
1952
|
-
/** Last message */
|
|
1953
2463
|
lastMessage?: string;
|
|
1954
2464
|
};
|
|
1955
|
-
/** API status type */
|
|
1956
2465
|
export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
|
|
1957
|
-
|
|
2466
|
+
|
|
1958
2467
|
export type Undefined = undefined | null;
|
|
1959
|
-
/** Union type for all "empty" values including falsy primitives and string representations */
|
|
1960
2468
|
export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
|
|
1961
|
-
/** Union type for numeric and string values */
|
|
1962
2469
|
export type NumberOrString = number | string;
|
|
1963
|
-
/** Union type for numeric, string, and boolean values */
|
|
1964
2470
|
export type NumberOrStringOrBoolean = number | string | boolean;
|
|
1965
|
-
/** Union type for numeric, string, and Date values */
|
|
1966
2471
|
export type NumberOrStringOrDate = NumberOrString | Date;
|
|
1967
|
-
/** Generic type that can be either a single value or an array of values */
|
|
1968
2472
|
export type NormalOrArray<T = NumberOrString> = T | T[];
|
|
1969
|
-
/** Generic type that can be either a direct value or a Promise resolving to that value */
|
|
1970
2473
|
export type NormalOrPromise<T> = T | Promise<T>;
|
|
1971
|
-
/** Generic record/object type with string keys */
|
|
1972
2474
|
export type ObjectItem<T = any> = Record<string, T>;
|
|
1973
|
-
/** Generic type that can be either an array or an object */
|
|
1974
2475
|
export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
|
|
1975
|
-
/** Converts an array type to an item type (extracts the item type from an array) */
|
|
1976
2476
|
export type ArrayToItem<T> = T extends any[] ? T[number] : T;
|
|
1977
|
-
/** Function type that returns a value of type R */
|
|
1978
2477
|
export type FunctionReturn<R = any> = () => R;
|
|
1979
|
-
/** Function type that returns void */
|
|
1980
2478
|
export type FunctionVoid = () => void;
|
|
1981
|
-
/** Function type that accepts multiple arguments of type T and returns type R */
|
|
1982
2479
|
export type FunctionArgs<T, R> = (...args: T[]) => R;
|
|
1983
|
-
/** Most generic function type that accepts any arguments and returns any value */
|
|
1984
2480
|
export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
|
|
1985
|
-
/** Generic record type for lists with string keys */
|
|
1986
2481
|
export type ItemList<T = any> = Record<string, T>;
|
|
1987
|
-
/** Generic item type with index and value properties */
|
|
1988
2482
|
export type Item<V> = {
|
|
1989
|
-
/** Unique string identifier for the item */
|
|
1990
2483
|
index: string;
|
|
1991
|
-
/** The actual value of the item */
|
|
1992
2484
|
value: V;
|
|
1993
2485
|
};
|
|
1994
|
-
/** Generic item type with label and value properties */
|
|
1995
2486
|
export type ItemValue<V> = {
|
|
1996
|
-
/** Display text for the item */
|
|
1997
2487
|
label: string;
|
|
1998
|
-
/** The actual value of the item */
|
|
1999
2488
|
value: V;
|
|
2000
2489
|
};
|
|
2001
|
-
/** Generic item type with name and value properties */
|
|
2002
2490
|
export type ItemName<V> = {
|
|
2003
2491
|
name: string | number;
|
|
2004
2492
|
value: V;
|
|
2005
2493
|
};
|
|
2006
|
-
/** Union type for HTML elements and Window object */
|
|
2007
2494
|
export type ElementOrWindow = HTMLElement | Window;
|
|
2008
|
-
/** Generic type that can be either an element or a string selector */
|
|
2009
2495
|
export type ElementOrString<E extends ElementOrWindow> = E | string;
|
|
2010
|
-
/** Type for event listener options */
|
|
2011
2496
|
export type EventOptions = AddEventListenerOptions | boolean | undefined;
|
|
2012
|
-
/** Generic event listener function type with additional detail parameter */
|
|
2013
2497
|
export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
|
|
2014
|
-
/** Type for tracking active event listeners and observers */
|
|
2015
2498
|
export type EventActivityItem<E extends ElementOrWindow> = {
|
|
2016
2499
|
element: E | undefined;
|
|
2017
2500
|
type: string;
|
|
2018
2501
|
listener?: (event: any | Event) => void;
|
|
2019
2502
|
observer?: ResizeObserver;
|
|
2020
2503
|
};
|
|
2021
|
-
/** Type for 2D coordinates */
|
|
2022
2504
|
export type ImageCoordinator = {
|
|
2023
2505
|
x: number;
|
|
2024
2506
|
y: number;
|
|
2025
2507
|
};
|
|
2026
|
-
|
|
2508
|
+
|
|
2509
|
+
/** Manages error groups, codes, handlers, and console reporting. @keywords error_center, handler, management */
|
|
2510
|
+
export declare class ErrorCenterHandler {
|
|
2511
|
+
/** List of error handlers grouped by category. @keywords error_handlers, group */
|
|
2512
|
+
handlers: ErrorCenterHandlerItem[];
|
|
2513
|
+
/** Global callbacks executed on any error. @keywords error_callbacks, global */
|
|
2514
|
+
callbacks: ErrorCenterHandlerCallback[];
|
|
2515
|
+
/** Configuration for console logging. @keywords console_logging, config */
|
|
2516
|
+
isConsole: ErrorCenterHandlerIsConsole;
|
|
2517
|
+
/** Initializes error center handler with optional initial list and console setting. @keywords constructor, init */
|
|
2518
|
+
constructor(e?: ErrorCenterHandlerList, t?: ErrorCenterHandlerIsConsole);
|
|
2519
|
+
/** Checks if a handler group exists. @keywords has_group, check */
|
|
2520
|
+
has(e: ErrorCenterGroup): boolean;
|
|
2521
|
+
/** Retrieves handler item by group. @keywords get_handler, lookup */
|
|
2522
|
+
get(e: ErrorCenterGroup): ErrorCenterHandlerItem | undefined;
|
|
2523
|
+
/** Adds a callback handler for a specific group. @keywords add_handler, register */
|
|
2524
|
+
add(e: ErrorCenterGroup, t: ErrorCenterHandlerCallback): this;
|
|
2525
|
+
/** Adds a list of handlers. @keywords add_list, batch */
|
|
2526
|
+
addList(e: ErrorCenterHandlerList): this;
|
|
2527
|
+
/** Adds a global error callback. @keywords add_callback, global */
|
|
2528
|
+
addCallback(e: ErrorCenterHandlerCallback): this;
|
|
2529
|
+
/** Sets console logging behavior. @keywords set_console, config */
|
|
2530
|
+
setIsConsole(e: ErrorCenterHandlerIsConsole): this;
|
|
2531
|
+
/** Triggers error handling for a given cause. @keywords trigger_error, dispatch */
|
|
2532
|
+
on(e: ErrorCenterCauseItem): this;
|
|
2533
|
+
/** Outputs error details to the console if enabled. @keywords log_console, print */
|
|
2534
|
+
toConsole(e: ErrorCenterCauseItem): this;
|
|
2535
|
+
}
|
|
2536
|
+
/** Manages causes and error handling pipelines. @keywords error_cause_manager, pipeline */
|
|
2537
|
+
export declare class ErrorCenterInstance {
|
|
2538
|
+
/** Internal error handler instance. @keywords handler_instance, error_center */
|
|
2539
|
+
handler: ErrorCenterHandler;
|
|
2540
|
+
/** List of known error causes. @keywords causes_list, errors */
|
|
2541
|
+
causes: ErrorCenterCauseList;
|
|
2542
|
+
/** Initializes error instance with causes and handler. @keywords constructor, init */
|
|
2543
|
+
constructor(e?: ErrorCenterCauseList, t?: ErrorCenterHandler);
|
|
2544
|
+
/** Checks if a specific error cause exists. @keywords has_cause, check */
|
|
2545
|
+
has(e: string, t?: ErrorCenterGroup): boolean;
|
|
2546
|
+
/** Retrieves a specific error cause item. @keywords get_cause, lookup */
|
|
2547
|
+
get(e: string, t?: ErrorCenterGroup): ErrorCenterCauseItem | undefined;
|
|
2548
|
+
/** Adds a new error cause. @keywords add_cause, register */
|
|
2549
|
+
add(e: ErrorCenterCauseItem): this;
|
|
2550
|
+
/** Adds a list of error causes. @keywords add_causes, batch */
|
|
2551
|
+
addList(e: ErrorCenterCauseList): this;
|
|
2552
|
+
/** Adds an error handler for a group. @keywords add_handler, register */
|
|
2553
|
+
addHandler(e: ErrorCenterGroup, t: ErrorCenterHandlerCallback): this;
|
|
2554
|
+
/** Adds a list of error handlers. @keywords add_handlers, batch */
|
|
2555
|
+
addHandlerList(e: ErrorCenterHandlerList): this;
|
|
2556
|
+
/** Adds a global error callback. @keywords add_callback, global */
|
|
2557
|
+
addCallback(e: ErrorCenterHandlerCallback): this;
|
|
2558
|
+
/** Sets console logging behavior. @keywords set_console, config */
|
|
2559
|
+
setIsConsole(e: ErrorCenterHandlerIsConsole): this;
|
|
2560
|
+
/** Dispatches an error through the handler pipeline. @keywords trigger_error, dispatch */
|
|
2561
|
+
on(e: ErrorCenterCauseItem): this;
|
|
2562
|
+
/** Assigns or merges error details with a registered cause template. @keywords assign_cause, merge */
|
|
2563
|
+
assign(e: ErrorCenterCauseItem): ErrorCenterCauseItem;
|
|
2564
|
+
}
|
|
2565
|
+
/** Static accessor for global error management. @keywords error_center_static, global */
|
|
2566
|
+
export declare class ErrorCenter {
|
|
2567
|
+
/** Retrieves the global error instance. @keywords get_item, instance */
|
|
2568
|
+
static getItem(): ErrorCenterInstance;
|
|
2569
|
+
/** Checks if a specific error cause exists globally. @keywords has_cause, check */
|
|
2570
|
+
static has(e: string, t?: ErrorCenterGroup): boolean;
|
|
2571
|
+
/** Retrieves a global error cause item. @keywords get_cause, lookup */
|
|
2572
|
+
static get(e: string, t?: ErrorCenterGroup): ErrorCenterCauseItem | undefined;
|
|
2573
|
+
/** Adds a global error cause. @keywords add_cause, register */
|
|
2574
|
+
static add(e: ErrorCenterCauseItem): void;
|
|
2575
|
+
/** Adds a list of global error causes. @keywords add_causes, batch */
|
|
2576
|
+
static addList(e: ErrorCenterCauseList): void;
|
|
2577
|
+
/** Adds a global error handler. @keywords add_handler, register */
|
|
2578
|
+
static addHandler(e: ErrorCenterGroup, t: ErrorCenterHandlerCallback): void;
|
|
2579
|
+
/** Adds a list of global error handlers. @keywords add_handlers, batch */
|
|
2580
|
+
static addHandlerList(e: ErrorCenterHandlerList): void;
|
|
2581
|
+
/** Adds a global error callback. @keywords add_callback, global */
|
|
2582
|
+
static addCallback(e: ErrorCenterHandlerCallback): void;
|
|
2583
|
+
/** Sets global console logging behavior. @keywords set_console, config */
|
|
2584
|
+
static setIsConsole(e: ErrorCenterHandlerIsConsole): void;
|
|
2585
|
+
/** Dispatches a global error. @keywords trigger_error, dispatch */
|
|
2586
|
+
static on(e: ErrorCenterCauseItem): void;
|
|
2587
|
+
}
|
|
2588
|
+
/** Error group identifier / Идентификатор группы ошибок */
|
|
2027
2589
|
export type ErrorCenterGroup = string | undefined;
|
|
2028
|
-
/** Interface for an error item */
|
|
2590
|
+
/** Interface for an error item / Интерфейс для элемента ошибки */
|
|
2029
2591
|
export type ErrorCenterCauseItem<D = any> = {
|
|
2030
2592
|
group?: ErrorCenterGroup;
|
|
2031
2593
|
code: string;
|
|
@@ -2034,110 +2596,123 @@ export type ErrorCenterCauseItem<D = any> = {
|
|
|
2034
2596
|
message?: string;
|
|
2035
2597
|
details?: D;
|
|
2036
2598
|
};
|
|
2037
|
-
/** List of error items */
|
|
2599
|
+
/** List of error items / Список элементов ошибок */
|
|
2038
2600
|
export type ErrorCenterCauseList = ErrorCenterCauseItem[];
|
|
2039
|
-
/** Callback function for error handling */
|
|
2601
|
+
/** Callback function for error handling / Функция обратного вызова для обработки ошибок */
|
|
2040
2602
|
export type ErrorCenterHandlerCallback = (cause: ErrorCenterCauseItem) => void;
|
|
2041
|
-
/** Interface for error handler storage */
|
|
2603
|
+
/** Interface for error handler storage / Интерфейс для хранения обработчика ошибок */
|
|
2042
2604
|
export type ErrorCenterHandlerItem = {
|
|
2043
2605
|
group?: ErrorCenterGroup;
|
|
2044
2606
|
handlers: ErrorCenterHandlerCallback[];
|
|
2045
2607
|
};
|
|
2046
|
-
/** List of error handlers */
|
|
2608
|
+
/** List of error handlers / Список обработчиков ошибок */
|
|
2047
2609
|
export type ErrorCenterHandlerList = ErrorCenterHandlerItem[];
|
|
2048
|
-
/** Callback function to check whether to log error to console */
|
|
2610
|
+
/** Callback function to check whether to log error to console / Функция обратного вызова для проверки вывода ошибки в консоль */
|
|
2049
2611
|
export type ErrorCenterHandlerIsConsoleCallback = (cause: ErrorCenterCauseItem) => boolean;
|
|
2050
|
-
/** Type for console logging configuration */
|
|
2612
|
+
/** Type for console logging configuration / Тип для конфигурации вывода в консоль */
|
|
2051
2613
|
export type ErrorCenterHandlerIsConsole = boolean | ErrorCenterHandlerIsConsoleCallback;
|
|
2052
|
-
|
|
2614
|
+
|
|
2053
2615
|
export declare enum FormattersType {
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
}
|
|
2061
|
-
/** Options for currency formatting */
|
|
2616
|
+
currency = "currency",
|
|
2617
|
+
date = "date",
|
|
2618
|
+
name = "name",
|
|
2619
|
+
number = "number",
|
|
2620
|
+
plural = "plural",
|
|
2621
|
+
unit = "unit"
|
|
2622
|
+
}
|
|
2062
2623
|
export type FormattersOptionsCurrency = {
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2624
|
+
currencyPropName?: string;
|
|
2625
|
+
options?: string | Intl.NumberFormatOptions;
|
|
2626
|
+
numberOnly?: boolean;
|
|
2066
2627
|
};
|
|
2067
|
-
/** Options for date formatting */
|
|
2068
2628
|
export type FormattersOptionsDate = {
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2629
|
+
type?: GeoDate;
|
|
2630
|
+
options?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions;
|
|
2631
|
+
hour24?: boolean;
|
|
2072
2632
|
};
|
|
2073
|
-
/** Options for name formatting */
|
|
2074
2633
|
export type FormattersOptionsName = {
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2634
|
+
lastPropName?: string;
|
|
2635
|
+
firstPropName?: string;
|
|
2636
|
+
surname?: string;
|
|
2637
|
+
short?: boolean;
|
|
2079
2638
|
};
|
|
2080
|
-
/** Options for number formatting */
|
|
2081
2639
|
export type FormattersOptionsNumber = {
|
|
2082
|
-
|
|
2640
|
+
options?: Intl.NumberFormatOptions;
|
|
2083
2641
|
};
|
|
2084
|
-
/** Options for plural forms formatting */
|
|
2085
2642
|
export type FormattersOptionsPlural = {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2643
|
+
words: string;
|
|
2644
|
+
options?: Intl.PluralRulesOptions;
|
|
2645
|
+
optionsNumber?: Intl.NumberFormatOptions;
|
|
2089
2646
|
};
|
|
2090
|
-
/** Options for unit formatting */
|
|
2091
2647
|
export type FormattersOptionsUnit = {
|
|
2092
|
-
|
|
2648
|
+
unit: string | Intl.NumberFormatOptions;
|
|
2093
2649
|
};
|
|
2094
|
-
/** Mapping of formatter types to their respective option types.
|
|
2095
|
-
* @template Type - The formatter type.
|
|
2096
|
-
*/
|
|
2097
2650
|
export type FormattersOptionsInformation<Type extends FormattersType> = Type extends FormattersType.currency ? FormattersOptionsCurrency : Type extends FormattersType.date ? FormattersOptionsDate : Type extends FormattersType.name ? FormattersOptionsName : Type extends FormattersType.number ? FormattersOptionsNumber : Type extends FormattersType.plural ? FormattersOptionsPlural : Type extends FormattersType.unit ? FormattersOptionsUnit : Record<string, any>;
|
|
2098
|
-
/** Configuration for a single property formatter */
|
|
2099
2651
|
export type FormattersOptionsItem<Type extends FormattersType = FormattersType, R = string> = {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2652
|
+
type?: Type;
|
|
2653
|
+
transformation?: (valueOriginal: any, item: any, options?: FormattersOptionsInformation<Type>) => R;
|
|
2654
|
+
options?: FormattersOptionsInformation<Type>;
|
|
2103
2655
|
};
|
|
2104
|
-
/** A dictionary mapping property paths to their formatting configurations */
|
|
2105
2656
|
export type FormattersOptionsList = Record<string, FormattersOptionsItem>;
|
|
2106
|
-
/** Represents a single data item as a key-value record */
|
|
2107
2657
|
export type FormattersListItem = Record<string, any>;
|
|
2108
|
-
/** An array of data items to be formatted */
|
|
2109
2658
|
export type FormattersList<Item extends FormattersListItem> = Item[];
|
|
2110
|
-
/** Utility type to capitalize a camelCase or dot-notated string */
|
|
2111
2659
|
export type FormattersCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<FormattersCapitalize<Rest>>}` : K;
|
|
2112
|
-
/** Utility type to extract column keys from formatting options */
|
|
2113
2660
|
export type FormattersColumns<T extends FormattersOptionsList> = (keyof T & string)[];
|
|
2114
|
-
/** Utility type to generate a formatted property key */
|
|
2115
2661
|
export type FormattersKey<K, A extends string = 'Format'> = K extends string ? `${FormattersCapitalize<K>}${A}` : never;
|
|
2116
|
-
/** Represents a data item with additional formatted properties */
|
|
2117
2662
|
export type FormattersDataItem<T extends FormattersListItem, KT extends string[]> = {
|
|
2118
|
-
|
|
2663
|
+
[K in keyof T | FormattersKey<KT[number]>]: K extends keyof T ? T[K] : string;
|
|
2119
2664
|
};
|
|
2120
|
-
/** An array of data items with additional formatted properties */
|
|
2121
2665
|
export type FormattersListFormat<T extends FormattersListItem, K extends string[]> = FormattersDataItem<T, K>[];
|
|
2122
|
-
/** A single data item formatted based on the provided options list */
|
|
2123
2666
|
export type FormattersListColumnItem<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersDataItem<T, FormattersColumns<O>>;
|
|
2124
|
-
/** A list of data items formatted based on the provided options list */
|
|
2125
2667
|
export type FormattersListColumns<T extends FormattersListItem, O extends FormattersOptionsList> = FormattersListFormat<T, FormattersColumns<O>>;
|
|
2126
|
-
/** Possible formats for input data: either a single item or a list of items */
|
|
2127
2668
|
export type FormattersListProp = FormattersList<FormattersListItem> | FormattersListItem;
|
|
2128
|
-
/** Extracts the single item type from a single item or a list of items */
|
|
2129
2669
|
export type FormattersItemProp<List extends FormattersListProp> = ArrayToItem<List>;
|
|
2130
|
-
/** The return type of the formatter, matching the structure of the input data */
|
|
2131
2670
|
export type FormattersReturn<List extends FormattersListProp, Options extends FormattersOptionsList = FormattersOptionsList, Item extends FormattersItemProp<List> = FormattersItemProp<List>> = List extends any[] ? FormattersListColumns<Item, Options> : (FormattersListColumnItem<Item, Options> | undefined);
|
|
2132
|
-
/**
|
|
2671
|
+
/** Formatters utility class for transforming data lists and items. @keywords formatters transform data ui */
|
|
2672
|
+
export declare class Formatters {
|
|
2673
|
+
/** @keywords constructor init */
|
|
2674
|
+
constructor(options: FormattersOptionsList, list: FormattersListProp);
|
|
2675
|
+
/** @keywords is list available */
|
|
2676
|
+
is(): boolean;
|
|
2677
|
+
/** @keywords check if list is array */
|
|
2678
|
+
isArray(): boolean;
|
|
2679
|
+
/** @keywords get list length */
|
|
2680
|
+
length(): number;
|
|
2681
|
+
/** @keywords get list array */
|
|
2682
|
+
getList(): FormattersListItem[];
|
|
2683
|
+
/** @keywords get options */
|
|
2684
|
+
getOptions(): FormattersOptionsList;
|
|
2685
|
+
/** @keywords set list data */
|
|
2686
|
+
setList(e: FormattersListProp): this;
|
|
2687
|
+
/** @keywords apply formatting */
|
|
2688
|
+
to(): any;
|
|
2689
|
+
/** @keywords get format data */
|
|
2690
|
+
getFormatData(e: any): Record<string, any>;
|
|
2691
|
+
/** @keywords transform value */
|
|
2692
|
+
transformation(e: any, t: any, n?: FormattersType, r?: any): any;
|
|
2693
|
+
/** @keywords format currency */
|
|
2694
|
+
formatCurrency(e: any, t: any, n?: FormattersOptionsCurrency): string;
|
|
2695
|
+
/** @keywords format date */
|
|
2696
|
+
formatDate(e: any, t?: FormattersOptionsDate): string;
|
|
2697
|
+
/** @keywords format name */
|
|
2698
|
+
formatName(e: any, t?: FormattersOptionsName): string;
|
|
2699
|
+
/** @keywords format number */
|
|
2700
|
+
formatNumber(e: any, t?: Intl.NumberFormatOptions): string;
|
|
2701
|
+
/** @keywords format plural */
|
|
2702
|
+
formatPlural(e: any, t?: FormattersOptionsPlural): string;
|
|
2703
|
+
/** @keywords format unit */
|
|
2704
|
+
formatUnit(e: any, t?: FormattersOptionsUnit): string;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
/** @keywords geo, date, format, types */
|
|
2133
2708
|
export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
|
|
2134
|
-
/**
|
|
2709
|
+
/** @keywords geo, weekday, first, day */
|
|
2135
2710
|
export type GeoFirstDay = 1 | 6 | 0;
|
|
2136
|
-
/**
|
|
2711
|
+
/** @keywords geo, hours, time, format */
|
|
2137
2712
|
export type GeoHours = '12' | '24';
|
|
2138
|
-
/**
|
|
2713
|
+
/** @keywords geo, timezone, style, format */
|
|
2139
2714
|
export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
|
|
2140
|
-
/**
|
|
2715
|
+
/** @keywords geo, item, country, language */
|
|
2141
2716
|
export interface GeoItem {
|
|
2142
2717
|
country: string;
|
|
2143
2718
|
countryAlternative?: string[];
|
|
@@ -2165,7 +2740,7 @@ export interface GeoItem {
|
|
|
2165
2740
|
'kilometer-per-hour'?: string;
|
|
2166
2741
|
};
|
|
2167
2742
|
}
|
|
2168
|
-
/**
|
|
2743
|
+
/** @keywords geo, item, full, standard */
|
|
2169
2744
|
export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
2170
2745
|
standard: string;
|
|
2171
2746
|
firstDay: string;
|
|
@@ -2173,7 +2748,7 @@ export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
|
2173
2748
|
locationCountry: string;
|
|
2174
2749
|
locationLanguage: string;
|
|
2175
2750
|
}
|
|
2176
|
-
/**
|
|
2751
|
+
/** @keywords geo, flag, item, country */
|
|
2177
2752
|
export interface GeoFlagItem {
|
|
2178
2753
|
language: string;
|
|
2179
2754
|
languageCode: string;
|
|
@@ -2185,20 +2760,20 @@ export interface GeoFlagItem {
|
|
|
2185
2760
|
value: string;
|
|
2186
2761
|
phoneCode?: string;
|
|
2187
2762
|
}
|
|
2188
|
-
/**
|
|
2763
|
+
/** @keywords geo, flag, national, language */
|
|
2189
2764
|
export interface GeoFlagNational extends GeoFlagItem {
|
|
2190
2765
|
description: string;
|
|
2191
2766
|
nationalLanguage: string;
|
|
2192
2767
|
nationalCountry: string;
|
|
2193
2768
|
}
|
|
2194
|
-
/**
|
|
2769
|
+
/** @keywords geo, phone, value, metadata */
|
|
2195
2770
|
export interface GeoPhoneValue {
|
|
2196
2771
|
phone: number;
|
|
2197
2772
|
within: number;
|
|
2198
2773
|
mask: string[];
|
|
2199
2774
|
value: string;
|
|
2200
2775
|
}
|
|
2201
|
-
/**
|
|
2776
|
+
/** @keywords geo, phone, map, trie */
|
|
2202
2777
|
export interface GeoPhoneMap {
|
|
2203
2778
|
items: GeoPhoneValue[];
|
|
2204
2779
|
info: GeoPhoneValue | undefined;
|
|
@@ -2207,119 +2782,215 @@ export interface GeoPhoneMap {
|
|
|
2207
2782
|
maskFull: string[];
|
|
2208
2783
|
next: Record<string, GeoPhoneMap>;
|
|
2209
2784
|
}
|
|
2210
|
-
/**
|
|
2785
|
+
/** @keywords geo, phone, map, info */
|
|
2211
2786
|
export interface GeoPhoneMapInfo {
|
|
2212
2787
|
item?: GeoPhoneMap;
|
|
2213
2788
|
phone?: string;
|
|
2214
2789
|
}
|
|
2215
|
-
|
|
2790
|
+
|
|
2791
|
+
/** Standard HTML meta tags @keywords meta_tag title description keywords robots author */
|
|
2216
2792
|
export declare enum MetaTag {
|
|
2793
|
+
/** Page title */
|
|
2217
2794
|
title = "title",
|
|
2795
|
+
/** Page description */
|
|
2218
2796
|
description = "description",
|
|
2797
|
+
/** Keywords */
|
|
2219
2798
|
keywords = "keywords",
|
|
2799
|
+
/** Canonical URL */
|
|
2220
2800
|
canonical = "canonical",
|
|
2801
|
+
/** Search engine instructions */
|
|
2221
2802
|
robots = "robots",
|
|
2803
|
+
/** Content author */
|
|
2222
2804
|
author = "author"
|
|
2223
2805
|
}
|
|
2806
|
+
|
|
2807
|
+
/** Search engine crawler directives @keywords robots_directive index follow archive snippet */
|
|
2224
2808
|
export declare enum MetaRobots {
|
|
2809
|
+
/** Allow indexing and following links */
|
|
2225
2810
|
indexFollow = "index, follow",
|
|
2811
|
+
/** Do not index the page, but follow its links */
|
|
2226
2812
|
noIndexFollow = "noindex, follow",
|
|
2813
|
+
/** Index the page, but do not follow its links */
|
|
2227
2814
|
indexNoFollow = "index, nofollow",
|
|
2815
|
+
/** Do not index the page and do not follow its links */
|
|
2228
2816
|
noIndexNoFollow = "noindex, nofollow",
|
|
2817
|
+
/** Prevent caching of the page */
|
|
2229
2818
|
noArchive = "noarchive",
|
|
2819
|
+
/** Do not show a snippet or description in search results */
|
|
2230
2820
|
noSnippet = "nosnippet",
|
|
2821
|
+
/** Do not display image preview in search results */
|
|
2231
2822
|
noImageIndex = "noimageindex",
|
|
2823
|
+
/** Allow indexing images only */
|
|
2232
2824
|
images = "images",
|
|
2825
|
+
/** Do not show cached version or translation link */
|
|
2233
2826
|
noTranslate = "notranslate",
|
|
2827
|
+
/** Prevent page being shown in preview */
|
|
2234
2828
|
noPreview = "nopreview",
|
|
2829
|
+
/** Allow only text content indexing */
|
|
2235
2830
|
textOnly = "textonly",
|
|
2831
|
+
/** Do not index subpages or parameters */
|
|
2236
2832
|
noIndexSubpages = "noindex, noarchive",
|
|
2833
|
+
/** Use meta directives from HTTP headers */
|
|
2237
2834
|
none = "none"
|
|
2238
2835
|
}
|
|
2239
|
-
|
|
2836
|
+
|
|
2837
|
+
/** Open Graph metadata tags @keywords open_graph og_tag social_meta */
|
|
2240
2838
|
export declare enum MetaOpenGraphTag {
|
|
2839
|
+
/** Page title */
|
|
2241
2840
|
title = "og:title",
|
|
2841
|
+
/** Content type */
|
|
2242
2842
|
type = "og:type",
|
|
2843
|
+
/** Canonical URL of the page */
|
|
2243
2844
|
url = "og:url",
|
|
2845
|
+
/** Preview image URL */
|
|
2244
2846
|
image = "og:image",
|
|
2847
|
+
/** Brief page description */
|
|
2245
2848
|
description = "og:description",
|
|
2849
|
+
/** Page language */
|
|
2246
2850
|
locale = "og:locale",
|
|
2851
|
+
/** Site name */
|
|
2247
2852
|
siteName = "og:site_name",
|
|
2853
|
+
/** Alternative language versions */
|
|
2248
2854
|
localeAlternate = "og:locale:alternate",
|
|
2855
|
+
/** Alternative form of image */
|
|
2249
2856
|
imageUrl = "og:image:url",
|
|
2857
|
+
/** HTTPS version of the image */
|
|
2250
2858
|
imageSecureUrl = "og:image:secure_url",
|
|
2859
|
+
/** Image MIME type */
|
|
2251
2860
|
imageType = "og:image:type",
|
|
2861
|
+
/** Image width in pixels */
|
|
2252
2862
|
imageWidth = "og:image:width",
|
|
2863
|
+
/** Image height in pixels */
|
|
2253
2864
|
imageHeight = "og:image:height",
|
|
2865
|
+
/** Alternative image text */
|
|
2254
2866
|
imageAlt = "og:image:alt",
|
|
2867
|
+
/** Video URL */
|
|
2255
2868
|
video = "og:video",
|
|
2869
|
+
/** Alternative video URL */
|
|
2256
2870
|
videoUrl = "og:video:url",
|
|
2871
|
+
/** HTTPS version of video */
|
|
2257
2872
|
videoSecureUrl = "og:video:secure_url",
|
|
2873
|
+
/** Video MIME type */
|
|
2258
2874
|
videoType = "og:video:type",
|
|
2875
|
+
/** Video width */
|
|
2259
2876
|
videoWidth = "og:video:width",
|
|
2877
|
+
/** Video height */
|
|
2260
2878
|
videoHeight = "og:video:height",
|
|
2879
|
+
/** Audio file URL */
|
|
2261
2880
|
audio = "og:audio",
|
|
2881
|
+
/** HTTPS version of audio */
|
|
2262
2882
|
audioSecureUrl = "og:audio:secure_url",
|
|
2883
|
+
/** Audio MIME type */
|
|
2263
2884
|
audioType = "og:audio:type",
|
|
2885
|
+
/** Publication date */
|
|
2264
2886
|
articlePublishedTime = "article:published_time",
|
|
2887
|
+
/** Last update date */
|
|
2265
2888
|
articleModifiedTime = "article:modified_time",
|
|
2889
|
+
/** Expiration date */
|
|
2266
2890
|
articleExpirationTime = "article:expiration_time",
|
|
2891
|
+
/** Author */
|
|
2267
2892
|
articleAuthor = "article:author",
|
|
2893
|
+
/** Article category */
|
|
2268
2894
|
articleSection = "article:section",
|
|
2895
|
+
/** Tags or keywords */
|
|
2269
2896
|
articleTag = "article:tag",
|
|
2897
|
+
/** Book author */
|
|
2270
2898
|
bookAuthor = "book:author",
|
|
2899
|
+
/** Book ISBN */
|
|
2271
2900
|
bookIsbn = "book:isbn",
|
|
2901
|
+
/** Book publication date */
|
|
2272
2902
|
bookReleaseDate = "book:release_date",
|
|
2903
|
+
/** Topics or tags */
|
|
2273
2904
|
bookTag = "book:tag",
|
|
2905
|
+
/** Track duration in seconds */
|
|
2274
2906
|
musicDuration = "music:duration",
|
|
2907
|
+
/** Album URL */
|
|
2275
2908
|
musicAlbum = "music:album",
|
|
2909
|
+
/** Disc number */
|
|
2276
2910
|
musicAlbumDisc = "music:album:disc",
|
|
2911
|
+
/** Track number in album */
|
|
2277
2912
|
musicAlbumTrack = "music:album:track",
|
|
2913
|
+
/** Musician */
|
|
2278
2914
|
musicMusician = "music:musician",
|
|
2915
|
+
/** Song URL */
|
|
2279
2916
|
musicSong = "music:song",
|
|
2917
|
+
/** Disc number where the song is */
|
|
2280
2918
|
musicSongDisc = "music:song:disc",
|
|
2919
|
+
/** Track number in song */
|
|
2281
2920
|
musicSongTrack = "music:song:track",
|
|
2921
|
+
/** Release date */
|
|
2282
2922
|
musicReleaseDate = "music:release_date",
|
|
2923
|
+
/** Content creator */
|
|
2283
2924
|
musicCreator = "music:creator",
|
|
2925
|
+
/** Actor */
|
|
2284
2926
|
videoActor = "video:actor",
|
|
2927
|
+
/** Actor's role */
|
|
2285
2928
|
videoActorRole = "video:actor:role",
|
|
2929
|
+
/** Director */
|
|
2286
2930
|
videoDirector = "video:director",
|
|
2931
|
+
/** Screenwriter */
|
|
2287
2932
|
videoWriter = "video:writer",
|
|
2933
|
+
/** Video duration in seconds */
|
|
2288
2934
|
videoDuration = "video:duration",
|
|
2935
|
+
/** Video release date */
|
|
2289
2936
|
videoReleaseDate = "video:release_date",
|
|
2937
|
+
/** Tags or topics */
|
|
2290
2938
|
videoTag = "video:tag",
|
|
2939
|
+
/** Series to which the episode belongs */
|
|
2291
2940
|
videoSeries = "video:series",
|
|
2941
|
+
/** First name */
|
|
2292
2942
|
profileFirstName = "profile:first_name",
|
|
2943
|
+
/** Last name */
|
|
2293
2944
|
profileLastName = "profile:last_name",
|
|
2945
|
+
/** Username or login */
|
|
2294
2946
|
profileUsername = "profile:username",
|
|
2947
|
+
/** Gender */
|
|
2295
2948
|
profileGender = "profile:gender",
|
|
2949
|
+
/** Brand name */
|
|
2296
2950
|
productBrand = "product:brand",
|
|
2951
|
+
/** Product availability */
|
|
2297
2952
|
productAvailability = "product:availability",
|
|
2953
|
+
/** Product condition */
|
|
2298
2954
|
productCondition = "product:condition",
|
|
2955
|
+
/** Price amount */
|
|
2299
2956
|
productPriceAmount = "product:price:amount",
|
|
2957
|
+
/** Currency code */
|
|
2300
2958
|
productPriceCurrency = "product:price:currency",
|
|
2959
|
+
/** Internal product ID */
|
|
2301
2960
|
productRetailerItemId = "product:retailer_item_id",
|
|
2961
|
+
/** Product category */
|
|
2302
2962
|
productCategory = "product:category",
|
|
2963
|
+
/** EAN code */
|
|
2303
2964
|
productEan = "product:ean",
|
|
2965
|
+
/** ISBN if product is a book */
|
|
2304
2966
|
productIsbn = "product:isbn",
|
|
2967
|
+
/** Manufacturer part number */
|
|
2305
2968
|
productMfrPartNo = "product:mfr_part_no",
|
|
2969
|
+
/** UPC code */
|
|
2306
2970
|
productUpc = "product:upc",
|
|
2971
|
+
/** Weight value */
|
|
2307
2972
|
productWeightValue = "product:weight:value",
|
|
2973
|
+
/** Weight units */
|
|
2308
2974
|
productWeightUnits = "product:weight:units",
|
|
2975
|
+
/** Product color */
|
|
2309
2976
|
productColor = "product:color",
|
|
2977
|
+
/** Product material */
|
|
2310
2978
|
productMaterial = "product:material",
|
|
2979
|
+
/** Pattern or design */
|
|
2311
2980
|
productPattern = "product:pattern",
|
|
2981
|
+
/** Age group */
|
|
2312
2982
|
productAgeGroup = "product:age_group",
|
|
2313
|
-
/** Gender
|
|
2983
|
+
/** Gender target */
|
|
2314
2984
|
productGender = "product:gender"
|
|
2315
2985
|
}
|
|
2316
|
-
|
|
2986
|
+
|
|
2987
|
+
/** Open Graph content types @keywords og_type website article video product */
|
|
2317
2988
|
export declare enum MetaOpenGraphType {
|
|
2318
2989
|
/** Regular web page or article */
|
|
2319
2990
|
website = "website",
|
|
2320
|
-
/** News article
|
|
2991
|
+
/** News article or blog post */
|
|
2321
2992
|
article = "article",
|
|
2322
|
-
/** Video
|
|
2993
|
+
/** Video content */
|
|
2323
2994
|
video = "video.other",
|
|
2324
2995
|
/** Entire TV series */
|
|
2325
2996
|
videoTvShow = "video.tv_show",
|
|
@@ -2331,78 +3002,83 @@ export declare enum MetaOpenGraphType {
|
|
|
2331
3002
|
musicAlbum = "music.album",
|
|
2332
3003
|
/** Music playlist */
|
|
2333
3004
|
musicPlaylist = "music.playlist",
|
|
2334
|
-
/** Individual track
|
|
3005
|
+
/** Individual track or song */
|
|
2335
3006
|
musicSong = "music.song",
|
|
2336
3007
|
/** Radio station or audio stream */
|
|
2337
3008
|
musicRadioStation = "music.radio_station",
|
|
2338
|
-
/** Application
|
|
3009
|
+
/** Application */
|
|
2339
3010
|
app = "app",
|
|
2340
|
-
/** Product or item
|
|
3011
|
+
/** Product or item */
|
|
2341
3012
|
product = "product",
|
|
2342
|
-
/** Brand, company, organization */
|
|
3013
|
+
/** Brand, company, or organization */
|
|
2343
3014
|
business = "business.business",
|
|
2344
|
-
/** Place
|
|
3015
|
+
/** Place or geolocation */
|
|
2345
3016
|
place = "place",
|
|
2346
|
-
/** Event
|
|
3017
|
+
/** Event or meeting */
|
|
2347
3018
|
event = "event",
|
|
2348
|
-
/** User profile
|
|
3019
|
+
/** User profile */
|
|
2349
3020
|
profile = "profile",
|
|
2350
3021
|
/** Book page */
|
|
2351
3022
|
book = "book"
|
|
2352
3023
|
}
|
|
2353
|
-
|
|
3024
|
+
|
|
3025
|
+
/** Product availability states @keywords availability stock preorder */
|
|
2354
3026
|
export declare enum MetaOpenGraphAvailability {
|
|
2355
|
-
/** In stock
|
|
3027
|
+
/** In stock and available */
|
|
2356
3028
|
inStock = "in stock",
|
|
2357
|
-
/** Out of stock
|
|
3029
|
+
/** Out of stock */
|
|
2358
3030
|
outOfStock = "out of stock",
|
|
2359
3031
|
/** Available for pre-order */
|
|
2360
3032
|
preorder = "preorder",
|
|
2361
|
-
/** Backordered
|
|
3033
|
+
/** Backordered and temporarily out of stock */
|
|
2362
3034
|
backorder = "backorder",
|
|
2363
|
-
/** Discontinued
|
|
3035
|
+
/** Discontinued and no longer available */
|
|
2364
3036
|
discontinued = "discontinued",
|
|
2365
3037
|
/** Pending availability status */
|
|
2366
3038
|
pending = "pending"
|
|
2367
3039
|
}
|
|
2368
|
-
|
|
3040
|
+
|
|
3041
|
+
/** Product condition states @keywords condition new used refurbished */
|
|
2369
3042
|
export declare enum MetaOpenGraphCondition {
|
|
2370
|
-
/** Brand new product
|
|
3043
|
+
/** Brand new product */
|
|
2371
3044
|
new = "new",
|
|
2372
|
-
/** Used product
|
|
3045
|
+
/** Used product */
|
|
2373
3046
|
used = "used",
|
|
2374
|
-
/** Refurbished
|
|
3047
|
+
/** Refurbished product */
|
|
2375
3048
|
refurbished = "refurbished"
|
|
2376
3049
|
}
|
|
2377
|
-
|
|
3050
|
+
|
|
3051
|
+
/** Product age groups @keywords age_group newborn infant toddler kids adult */
|
|
2378
3052
|
export declare enum MetaOpenGraphAge {
|
|
2379
|
-
/** For newborns
|
|
3053
|
+
/** For newborns */
|
|
2380
3054
|
newborn = "newborn",
|
|
2381
|
-
/** For infants
|
|
3055
|
+
/** For infants */
|
|
2382
3056
|
infant = "infant",
|
|
2383
|
-
/** For toddlers
|
|
3057
|
+
/** For toddlers */
|
|
2384
3058
|
toddler = "toddler",
|
|
2385
|
-
/** For kids
|
|
3059
|
+
/** For kids */
|
|
2386
3060
|
kids = "kids",
|
|
2387
3061
|
/** For adults */
|
|
2388
3062
|
adult = "adult"
|
|
2389
3063
|
}
|
|
2390
|
-
|
|
3064
|
+
|
|
3065
|
+
/** Product gender categories @keywords gender female male unisex */
|
|
2391
3066
|
export declare enum MetaOpenGraphGender {
|
|
2392
3067
|
/** For women */
|
|
2393
3068
|
female = "female",
|
|
2394
3069
|
/** For men */
|
|
2395
3070
|
male = "male",
|
|
2396
|
-
/** Universal
|
|
3071
|
+
/** Universal for everyone */
|
|
2397
3072
|
unisex = "unisex"
|
|
2398
3073
|
}
|
|
2399
|
-
|
|
3074
|
+
|
|
3075
|
+
/** Twitter Card meta-properties @keywords twitter_tag card site creator */
|
|
2400
3076
|
export declare enum MetaTwitterTag {
|
|
2401
|
-
/** Type of card
|
|
3077
|
+
/** Type of card */
|
|
2402
3078
|
card = "twitter:card",
|
|
2403
|
-
/** Website or brand
|
|
3079
|
+
/** Website or brand username */
|
|
2404
3080
|
site = "twitter:site",
|
|
2405
|
-
/** Content creator
|
|
3081
|
+
/** Content creator username */
|
|
2406
3082
|
creator = "twitter:creator",
|
|
2407
3083
|
/** Page URL */
|
|
2408
3084
|
url = "twitter:url",
|
|
@@ -2412,39 +3088,39 @@ export declare enum MetaTwitterTag {
|
|
|
2412
3088
|
description = "twitter:description",
|
|
2413
3089
|
/** Main image for the card */
|
|
2414
3090
|
image = "twitter:image",
|
|
2415
|
-
/** Alternative text for the image
|
|
3091
|
+
/** Alternative text for the image */
|
|
2416
3092
|
imageAlt = "twitter:image:alt",
|
|
2417
|
-
/** Alternative
|
|
3093
|
+
/** Alternative image source */
|
|
2418
3094
|
imageSrc = "twitter:image:src",
|
|
2419
|
-
/** Image width
|
|
3095
|
+
/** Image width */
|
|
2420
3096
|
imageWidth = "twitter:image:width",
|
|
2421
|
-
/** Image height
|
|
3097
|
+
/** Image height */
|
|
2422
3098
|
imageHeight = "twitter:image:height",
|
|
2423
|
-
/** Custom label 1
|
|
3099
|
+
/** Custom label 1 */
|
|
2424
3100
|
label1 = "twitter:label1",
|
|
2425
|
-
/** Custom value 1
|
|
3101
|
+
/** Custom value 1 */
|
|
2426
3102
|
data1 = "twitter:data1",
|
|
2427
|
-
/** Custom label 2
|
|
3103
|
+
/** Custom label 2 */
|
|
2428
3104
|
label2 = "twitter:label2",
|
|
2429
|
-
/** Custom value 2
|
|
3105
|
+
/** Custom value 2 */
|
|
2430
3106
|
data2 = "twitter:data2",
|
|
2431
3107
|
/** iPhone app name */
|
|
2432
3108
|
appNameIphone = "twitter:app:name:iphone",
|
|
2433
|
-
/** iPhone app ID
|
|
3109
|
+
/** iPhone app ID */
|
|
2434
3110
|
appIdIphone = "twitter:app:id:iphone",
|
|
2435
|
-
/** iPhone app URL
|
|
3111
|
+
/** iPhone app URL */
|
|
2436
3112
|
appUrlIphone = "twitter:app:url:iphone",
|
|
2437
3113
|
/** iPad app name */
|
|
2438
3114
|
appNameIpad = "twitter:app:name:ipad",
|
|
2439
|
-
/** iPad app ID
|
|
3115
|
+
/** iPad app ID */
|
|
2440
3116
|
appIdIpad = "twitter:app:id:ipad",
|
|
2441
|
-
/** iPad app URL
|
|
3117
|
+
/** iPad app URL */
|
|
2442
3118
|
appUrlIpad = "twitter:app:url:ipad",
|
|
2443
3119
|
/** Google Play app name */
|
|
2444
3120
|
appNameGooglePlay = "twitter:app:name:googleplay",
|
|
2445
|
-
/** Google Play app ID
|
|
3121
|
+
/** Google Play app ID */
|
|
2446
3122
|
appIdGooglePlay = "twitter:app:id:googleplay",
|
|
2447
|
-
/** Google Play app URL
|
|
3123
|
+
/** Google Play app URL */
|
|
2448
3124
|
appUrlGooglePlay = "twitter:app:url:googleplay",
|
|
2449
3125
|
/** Player iframe URL */
|
|
2450
3126
|
player = "twitter:player",
|
|
@@ -2452,59 +3128,61 @@ export declare enum MetaTwitterTag {
|
|
|
2452
3128
|
playerWidth = "twitter:player:width",
|
|
2453
3129
|
/** Player height */
|
|
2454
3130
|
playerHeight = "twitter:player:height",
|
|
2455
|
-
/** Direct media stream URL
|
|
3131
|
+
/** Direct media stream URL */
|
|
2456
3132
|
playerStream = "twitter:player:stream",
|
|
2457
3133
|
/** MIME type of the media stream */
|
|
2458
3134
|
playerStreamContentType = "twitter:player:stream:content_type"
|
|
2459
3135
|
}
|
|
2460
|
-
|
|
3136
|
+
|
|
3137
|
+
/** Twitter Card types @keywords twitter_card summary large_image app player */
|
|
2461
3138
|
export declare enum MetaTwitterCard {
|
|
2462
|
-
/** Summary card
|
|
3139
|
+
/** Summary card with small image */
|
|
2463
3140
|
summary = "summary",
|
|
2464
|
-
/** Summary card with large image
|
|
3141
|
+
/** Summary card with large image */
|
|
2465
3142
|
summaryLargeImage = "summary_large_image",
|
|
2466
|
-
/** App card
|
|
3143
|
+
/** App card for mobile applications */
|
|
2467
3144
|
app = "app",
|
|
2468
|
-
/** Player card
|
|
3145
|
+
/** Player card for rich media */
|
|
2469
3146
|
player = "player",
|
|
2470
|
-
/** Product card
|
|
3147
|
+
/** Product card for e-commerce */
|
|
2471
3148
|
product = "product",
|
|
2472
|
-
/** Gallery card
|
|
3149
|
+
/** Gallery card for multiple images */
|
|
2473
3150
|
gallery = "gallery",
|
|
2474
|
-
/** Photo card
|
|
3151
|
+
/** Photo card */
|
|
2475
3152
|
photo = "photo",
|
|
2476
|
-
/** Lead generation card
|
|
3153
|
+
/** Lead generation card */
|
|
2477
3154
|
leadGeneration = "lead_generation",
|
|
2478
|
-
/** Audio card
|
|
3155
|
+
/** Audio card */
|
|
2479
3156
|
audio = "audio",
|
|
2480
|
-
/** Poll card
|
|
3157
|
+
/** Poll card */
|
|
2481
3158
|
poll = "poll"
|
|
2482
3159
|
}
|
|
2483
|
-
|
|
3160
|
+
|
|
3161
|
+
/** Search item type @keywords search item, record */
|
|
2484
3162
|
export type SearchItem = Record<string, any>;
|
|
2485
|
-
/** Type for generating a column path */
|
|
3163
|
+
/** Type for generating a column path @keywords search column path */
|
|
2486
3164
|
export type SearchColumnPath<K, P> = K extends string ? P extends string ? `${K}.${P}` : never : never;
|
|
2487
|
-
/** Type for getting a column */
|
|
3165
|
+
/** Type for getting a column @keywords search column */
|
|
2488
3166
|
export type SearchColumn<T extends SearchItem> = {
|
|
2489
3167
|
[K in keyof T]-?: NonNullable<T[K]> extends object ? K | SearchColumnPath<K, keyof NonNullable<T[K]>> : K;
|
|
2490
3168
|
}[keyof T];
|
|
2491
|
-
/** Type for a list of columns */
|
|
3169
|
+
/** Type for a list of columns @keywords search columns */
|
|
2492
3170
|
export type SearchColumns<T extends SearchItem> = (SearchColumn<T> & string)[];
|
|
2493
|
-
/** Type for formatting the key */
|
|
3171
|
+
/** Type for formatting the key @keywords search format capitalize */
|
|
2494
3172
|
export type SearchFormatCapitalize<K extends string> = K extends `${infer First}.${infer Rest}` ? `${First}${Capitalize<SearchFormatCapitalize<Rest>>}` : K;
|
|
2495
|
-
/** Type for generating a search key */
|
|
3173
|
+
/** Type for generating a search key @keywords search format key */
|
|
2496
3174
|
export type SearchFormatKey<K> = K extends string ? `${SearchFormatCapitalize<K>}Search` : never;
|
|
2497
|
-
/** Type for a formatted search item */
|
|
3175
|
+
/** Type for a formatted search item @keywords search format item */
|
|
2498
3176
|
export type SearchFormatItem<T extends SearchItem, KT extends string[]> = {
|
|
2499
3177
|
[K in keyof T | SearchFormatKey<KT[number]>]: K extends keyof T ? T[K] : string;
|
|
2500
3178
|
} & {
|
|
2501
3179
|
searchActive?: boolean;
|
|
2502
3180
|
};
|
|
2503
|
-
/** Type for a list of formatted search items */
|
|
3181
|
+
/** Type for a list of formatted search items @keywords search format list */
|
|
2504
3182
|
export type SearchFormatList<T extends SearchItem, K extends string[]> = SearchFormatItem<T, K>[];
|
|
2505
|
-
/** Search list value */
|
|
3183
|
+
/** Search list value @keywords search list value */
|
|
2506
3184
|
export type SearchListValue<T extends SearchItem> = T[] | undefined;
|
|
2507
|
-
/** Search options */
|
|
3185
|
+
/** Search options @keywords search options, limit, delay */
|
|
2508
3186
|
export type SearchOptions = {
|
|
2509
3187
|
limit?: number;
|
|
2510
3188
|
returnEverything?: boolean;
|
|
@@ -2512,48 +3190,45 @@ export type SearchOptions = {
|
|
|
2512
3190
|
findExactMatch?: boolean;
|
|
2513
3191
|
classSearchName?: string;
|
|
2514
3192
|
};
|
|
2515
|
-
/** Search cache item */
|
|
3193
|
+
/** Search cache item @keywords search cache item */
|
|
2516
3194
|
export type SearchCacheItem<T extends SearchItem> = {
|
|
2517
3195
|
item: T;
|
|
2518
3196
|
value: string;
|
|
2519
3197
|
};
|
|
2520
|
-
/** Search cache list */
|
|
3198
|
+
/** Search cache list @keywords search cache */
|
|
2521
3199
|
export type SearchCache<T extends SearchItem> = SearchCacheItem<T>[];
|
|
2522
|
-
/** Highlight match item type */
|
|
3200
|
+
/** Highlight match item type @keywords highlight match item */
|
|
2523
3201
|
export type HighlightMatchItem = {
|
|
2524
3202
|
text: string;
|
|
2525
3203
|
isMatch: boolean;
|
|
2526
3204
|
};
|
|
2527
|
-
|
|
3205
|
+
|
|
3206
|
+
/** Sort direction @keywords sort direction asc desc */
|
|
2528
3207
|
export type SortDir = 'asc' | 'desc';
|
|
2529
|
-
/** Single column sorting specification item */
|
|
3208
|
+
/** Single column sorting specification item @keywords sort column item */
|
|
2530
3209
|
export type SortColumnItem = {
|
|
3210
|
+
/** Column or property key for sorting @keywords sort column property */
|
|
2531
3211
|
column?: string;
|
|
3212
|
+
/** Sorting direction @keywords sort dir */
|
|
2532
3213
|
dir?: SortDir;
|
|
2533
3214
|
};
|
|
2534
|
-
/** Custom sort function signature */
|
|
3215
|
+
/** Custom sort function signature @keywords custom sort function */
|
|
2535
3216
|
export type SortFunction<T = any> = (a: T, b: T, column?: string, dir?: SortDir) => number;
|
|
2536
|
-
|
|
3217
|
+
|
|
2537
3218
|
export type TranslateConfig = {
|
|
2538
3219
|
url?: string;
|
|
2539
3220
|
propsName?: string;
|
|
2540
3221
|
readApi?: boolean;
|
|
2541
3222
|
};
|
|
2542
|
-
/** Translation code or a list of translation codes for template replacement */
|
|
2543
3223
|
export type TranslateCode = string | string[];
|
|
2544
|
-
/** Object with translated strings, where the keys are the names of the translation codes */
|
|
2545
3224
|
export type TranslateList<T extends TranslateCode[]> = {
|
|
2546
3225
|
[K in T[number] as K extends readonly string[] ? K[0] : K]: string;
|
|
2547
3226
|
};
|
|
2548
|
-
/** Return type for translation retrieval: an object if a list was requested, or a string for a single key */
|
|
2549
3227
|
export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
|
|
2550
|
-
/** A simple key-value record of translations from a file */
|
|
2551
3228
|
export type TranslateDataFileList = Record<string, string>;
|
|
2552
|
-
/** Asynchronous loader function for a translation file */
|
|
2553
3229
|
export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
|
|
2554
|
-
/** A mapping of locale strings to their respective translation file loaders */
|
|
2555
3230
|
export type TranslateDataFile = Record<string, TranslateDataFileItem>;
|
|
2556
|
-
/**
|
|
3231
|
+
/** Global translation prefix @keywords prefix, global, translate */
|
|
2557
3232
|
export declare const TRANSLATE_GLOBAL_PREFIX = "global";
|
|
2558
|
-
/** Request timeout for batch loading
|
|
3233
|
+
/** Request timeout for batch loading @keywords timeout, delay, translate */
|
|
2559
3234
|
export declare const TRANSLATE_TIME_OUT = 160;
|