@dxtmisha/functional-basic 1.11.2 → 2.0.0
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 +401 -0
- package/ai-description.md +3 -3
- package/ai-doc.md +1 -1
- package/ai-mcp-resources.json +1 -1
- package/ai-resources/api-reference.md +16 -0
- package/ai-types.md +1056 -806
- package/dist/library.d.ts +2975 -1818
- package/dist/library.js +2466 -1830
- package/package.json +1 -1
package/ai-types.md
CHANGED
|
@@ -1,111 +1,117 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional-basic (
|
|
1
|
+
All these methods are in the @dxtmisha/functional-basic (v2.0.0) library.
|
|
2
2
|
|
|
3
3
|
```typescript
|
|
4
|
-
/**
|
|
4
|
+
/** HTTP client manager for making requests and configuring API settings. @keywords http, client, api, request, fetch */
|
|
5
5
|
export declare class Api {
|
|
6
|
-
/** Checks
|
|
6
|
+
/** Checks whether the server environment is running on localhost. @keywords localhost, environment, server, check */
|
|
7
7
|
static isLocalhost(): boolean;
|
|
8
|
-
/** Returns the singleton
|
|
8
|
+
/** Returns the singleton ApiInstance. @keywords instance, singleton, api */
|
|
9
9
|
static getItem(): ApiInstance;
|
|
10
|
-
/**
|
|
10
|
+
/** Retrieves the status handler of the last executed request. @keywords status, response, state */
|
|
11
11
|
static getStatus(): ApiStatus;
|
|
12
|
-
/**
|
|
12
|
+
/** Retrieves the API response handler instance. @keywords response, handler */
|
|
13
13
|
static getResponse(): ApiResponse;
|
|
14
|
-
/**
|
|
14
|
+
/** Retrieves the hydration handler instance. @keywords hydration, state, ssr */
|
|
15
15
|
static getHydration(): ApiHydration;
|
|
16
|
-
/**
|
|
16
|
+
/** Generates an HTML script element string containing hydration data. @keywords hydration, script, ssr, html */
|
|
17
17
|
static getHydrationScript(): string;
|
|
18
|
-
/**
|
|
18
|
+
/** Retrieves the base origin URL combined with the API path. @keywords origin, base-url, endpoint */
|
|
19
19
|
static getOrigin(): string;
|
|
20
|
-
/**
|
|
20
|
+
/** Resolves the complete URL for a request path. @keywords url, path, resolve, endpoint */
|
|
21
21
|
static getUrl(path: string, api?: boolean): string;
|
|
22
|
-
/** Formats
|
|
22
|
+
/** Formats the payload into an appropriate HTTP request body. @keywords body, payload, formdata, request */
|
|
23
23
|
static getBody(request?: ApiFetch['request'], method?: ApiMethodItem): string | FormData | undefined;
|
|
24
|
-
/**
|
|
24
|
+
/** Generates a query string URL for GET requests. @keywords query, query-string, get, params */
|
|
25
25
|
static getBodyForGet(request: ApiFetch['request'], path?: string, method?: ApiMethodItem): string;
|
|
26
|
-
/**
|
|
26
|
+
/** Sets default request headers. @keywords headers, config, default */
|
|
27
27
|
static setHeaders(headers: ApiHeadersValue): void;
|
|
28
|
-
/** Sets default request
|
|
28
|
+
/** Sets default request payload data. @keywords default, payload, request */
|
|
29
29
|
static setRequestDefault(request: ApiDefaultValue): void;
|
|
30
|
-
/** Sets the
|
|
30
|
+
/** Sets the base API path URL. @keywords url, base-path, config */
|
|
31
31
|
static setUrl(url: string): void;
|
|
32
|
-
/** Sets
|
|
32
|
+
/** Sets an interceptor callback executed before each request. @keywords middleware, interceptor, preparation, pre-request */
|
|
33
33
|
static setPreparation(callback: (apiFetch: ApiFetch) => Promise<void>): void;
|
|
34
|
-
/** Sets
|
|
34
|
+
/** Sets an interceptor callback executed after each request. @keywords middleware, interceptor, post-request, response */
|
|
35
35
|
static setEnd(callback: (query: Response, apiFetch: ApiFetch) => Promise<ApiPreparationEnd>): void;
|
|
36
|
-
/** Sets global request timeout in milliseconds. @keywords timeout,
|
|
36
|
+
/** Sets the global request timeout duration in milliseconds. @keywords timeout, duration, abort */
|
|
37
37
|
static setTimeout(timeout: number): void;
|
|
38
|
-
/** Sets the
|
|
38
|
+
/** Sets the default origin protocol and domain. @keywords origin, host, domain */
|
|
39
39
|
static setOrigin(origin: string): void;
|
|
40
|
-
/** Sets a
|
|
40
|
+
/** Sets a higher-order wrapper function around API requests. @keywords wrapper, interceptor, proxy */
|
|
41
41
|
static setWrapper(wrapper: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>): void;
|
|
42
|
-
/** Applies multiple API configuration
|
|
42
|
+
/** Applies multiple global API configuration settings. @keywords config, options, setup */
|
|
43
43
|
static setConfig(config?: ApiConfig): void;
|
|
44
|
-
/** Executes an HTTP request using a path string or
|
|
44
|
+
/** Executes an HTTP request using a path string or configuration object. @keywords request, execute, http */
|
|
45
45
|
static request<T>(pathRequest: string | ApiFetch): Promise<T>;
|
|
46
|
-
/**
|
|
46
|
+
/** Executes an HTTP GET request. @keywords get, http, fetch */
|
|
47
47
|
static get<T>(request: ApiFetch): Promise<T>;
|
|
48
|
-
/**
|
|
48
|
+
/** Executes an HTTP POST request. @keywords post, http, fetch */
|
|
49
49
|
static post<T>(request: ApiFetch): Promise<T>;
|
|
50
|
-
/**
|
|
50
|
+
/** Executes an HTTP PUT request. @keywords put, http, fetch */
|
|
51
51
|
static put<T>(request: ApiFetch): Promise<T>;
|
|
52
|
-
/**
|
|
52
|
+
/** Executes an HTTP PATCH request. @keywords patch, http, fetch */
|
|
53
53
|
static patch<T>(request: ApiFetch): Promise<T>;
|
|
54
|
-
/**
|
|
54
|
+
/** Executes an HTTP DELETE request. @keywords delete, http, fetch */
|
|
55
55
|
static delete<T>(request: ApiFetch): Promise<T>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/** Manages
|
|
59
|
-
export declare class BroadcastMessage<Message =
|
|
60
|
-
/** Initializes the broadcast channel with handlers. @keywords broadcast, channel, init */
|
|
58
|
+
/** Manages inter-context communication via BroadcastChannel API. @keywords broadcast channel, messaging, cross-tab, ipc */
|
|
59
|
+
export declare class BroadcastMessage<Message = unknown> {
|
|
60
|
+
/** Initializes the broadcast channel with optional message/error handlers. @keywords broadcast, channel, init, listener */
|
|
61
61
|
constructor(name: string, callback?: ((event: MessageEvent<Message>) => void) | undefined, callbackError?: ((event: MessageEvent<Message>) => void) | undefined, errorCenter?: ErrorCenterInstance);
|
|
62
|
-
/**
|
|
62
|
+
/** Returns the active BroadcastChannel instance if available in the environment. @keywords channel instance, dom, get */
|
|
63
63
|
getChannel(): BroadcastChannel | undefined;
|
|
64
|
-
/**
|
|
65
|
-
post(message: Message): this;
|
|
66
|
-
/** Sets the message reception callback handler. @keywords onmessage, listener, callback */
|
|
64
|
+
/** Sets the callback executed when a message is received. @keywords onmessage, listener, handler, callback */
|
|
67
65
|
setCallback(callback: (event: MessageEvent<Message>) => void): this;
|
|
68
|
-
/** Sets the
|
|
66
|
+
/** Sets the callback executed on message errors. @keywords messageerror, error handler, callback */
|
|
69
67
|
setCallbackError(callbackError: (event: MessageEvent<Message>) => void): this;
|
|
70
|
-
/**
|
|
68
|
+
/** Sends a message to all listening contexts on the channel. @keywords send, postMessage, emit, publish */
|
|
69
|
+
post(message: Message): this;
|
|
70
|
+
/** Closes the channel and stops listening for messages. @keywords close, cleanup, unbind, destroy */
|
|
71
71
|
destroy(): this;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/** In-memory key
|
|
74
|
+
/** In-memory cache storing computed values by key. @warning Obsolete and should not be used. @keywords in-memory cache, memoize, key-value */
|
|
75
75
|
export declare class Cache {
|
|
76
|
-
/** Retrieves or computes a
|
|
77
|
-
get<T>(name: string, callback: () => T, comparison?:
|
|
78
|
-
/** Asynchronously retrieves or computes a
|
|
79
|
-
getAsync<T>(name: string, callback: () => T, comparison?:
|
|
76
|
+
/** Retrieves or computes and caches a synchronous value by key with optional dependency invalidation. @keywords cache get, memoize, sync cache */
|
|
77
|
+
get<T>(name: string, callback: () => T, comparison?: unknown[]): T;
|
|
78
|
+
/** Asynchronously retrieves or computes and caches a value by key with optional dependency invalidation. @keywords async cache, memoize promise, async get */
|
|
79
|
+
getAsync<T>(name: string, callback: () => T, comparison?: unknown[]): Promise<T>;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/** Cookie
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
/** Resolves the return type of Cookie.get based on generic type and default fallback. @keywords cookie, return type, fallback */
|
|
83
|
+
export type CookieGet<T, D = undefined> = [D] extends [undefined] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : (T | (D extends () => infer R ? R : D));
|
|
84
|
+
/** Cookie manager for reading, writing, and deleting browser cookies. @keywords cookie, storage, browser */
|
|
85
|
+
export declare class Cookie<T = unknown> {
|
|
86
|
+
/** Initializes a Cookie instance for the specified cookie name. @keywords cookie, init, constructor */
|
|
87
|
+
constructor(name: string);
|
|
88
|
+
/** Retrieves a Cookie instance by the specified cookie name. @keywords cookie, getInstance, factory */
|
|
89
|
+
static getInstance<T = unknown>(name: string): Cookie<T>;
|
|
90
|
+
/** Retrieves the cookie value or sets and returns a default value if not set. @keywords cookie, get, read, fallback */
|
|
91
|
+
get<D extends T | string | (() => (T | string)) | undefined = undefined>(defaultValue?: D, options?: CookieOptions): CookieGet<T, D>;
|
|
92
|
+
/** Updates the cookie value with optional configuration parameters. @keywords cookie, set, write, update */
|
|
93
|
+
set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
|
|
94
|
+
/** Deletes the cookie. @keywords cookie, remove, delete, clear */
|
|
95
|
+
remove(): void;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
/** Manages cookie access
|
|
98
|
+
/** Manages cookie access and blocking status. @keywords cookie, block, access, permissions */
|
|
97
99
|
export declare class CookieBlock {
|
|
98
|
-
/**
|
|
99
|
-
static getItem(): CookieBlockInstance;
|
|
100
|
-
/** Retrieves the current cookie block status. @keywords cookie, block, status, get */
|
|
100
|
+
/** Retrieves current cookie blocking status. @keywords cookie, block, status, check */
|
|
101
101
|
static get(): boolean;
|
|
102
|
-
/** Sets
|
|
102
|
+
/** Sets cookie blocking status. @keywords cookie, block, status, toggle */
|
|
103
103
|
static set(value: boolean): void;
|
|
104
|
+
/** Gets request-isolated CookieBlockInstance. @keywords cookie, block, instance, request */
|
|
105
|
+
static getItem(): CookieBlockInstance;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
export type CookieSameSite = 'strict' | 'lax';
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
export type CookieSameSite = 'strict' | 'lax' | 'none';
|
|
109
|
+
/** Resolves return type of CookieStorage.get based on fallback value. @keywords cookie return type */
|
|
110
|
+
export type CookieStorageGet<T, D = undefined> = [
|
|
111
|
+
D
|
|
112
|
+
] extends [
|
|
113
|
+
undefined
|
|
114
|
+
] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : T;
|
|
109
115
|
export type CookieOptions = {
|
|
110
116
|
age?: number;
|
|
111
117
|
sameSite?: CookieSameSite;
|
|
@@ -114,870 +120,982 @@ export type CookieOptions = {
|
|
|
114
120
|
secure?: boolean;
|
|
115
121
|
httpOnly?: boolean;
|
|
116
122
|
partitioned?: boolean;
|
|
117
|
-
arguments?: string[] | Record<string,
|
|
123
|
+
arguments?: string[] | Record<string, unknown>;
|
|
118
124
|
};
|
|
119
|
-
|
|
120
|
-
/** Manages cookie storage with custom listeners across DOM and SSR environments. @keywords cookie, storage, ssr, browser, persistence */
|
|
125
|
+
/** Manages cookies with support for DOM, SSR, and custom storage listeners. @keywords cookie storage ssr browser */
|
|
121
126
|
export declare class CookieStorage {
|
|
122
|
-
/**
|
|
123
|
-
static
|
|
124
|
-
/**
|
|
125
|
-
static
|
|
126
|
-
/**
|
|
127
|
-
static
|
|
128
|
-
/**
|
|
129
|
-
static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
130
|
-
/** Removes a cookie by name from storage. @keywords remove, delete, clear */
|
|
131
|
-
static remove(name: string): void;
|
|
132
|
-
/** Synchronizes and updates in-memory storage cache from current cookies. @keywords update, sync, refresh */
|
|
127
|
+
/** Retrieves a cookie value or returns the default fallback. @keywords cookie get read storage */
|
|
128
|
+
static get<T = unknown, D extends T | (() => T) | undefined = undefined>(name: string, defaultValue?: D, options?: CookieOptions): CookieStorageGet<T, D>;
|
|
129
|
+
/** Writes a cookie value with optional attributes. @keywords cookie set save write */
|
|
130
|
+
static set<T = unknown>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
131
|
+
/** Deletes a cookie from storage. @keywords cookie remove delete */
|
|
132
|
+
static remove(name: string, options?: CookieOptions): void;
|
|
133
|
+
/** Synchronizes and updates cache from current cookie sources. @keywords cookie update refresh sync */
|
|
133
134
|
static update(): void;
|
|
135
|
+
/** Clears in-memory items and resets listeners to default state. @keywords cookie reset clear */
|
|
136
|
+
static reset(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Initializes storage listeners and hooks for custom or SSR runtimes.
|
|
139
|
+
* @remarks When omitted, DOM runtime defaults to `document.cookie`, while non-DOM/SSR falls back to in-memory caching.
|
|
140
|
+
* @keywords cookie init setup listeners ssr
|
|
141
|
+
*/
|
|
142
|
+
static init(getListener?: (key: string) => unknown, getListenerRaw?: () => string, setListener?: (key: string, value: string, cookie: string, options?: CookieOptions) => void): void;
|
|
134
143
|
}
|
|
135
144
|
|
|
136
|
-
/**
|
|
137
|
-
export
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
/** Resolution type for DataStorage.get return value with fallback handling. @keywords storage, return type */
|
|
146
|
+
export type DataStorageGet<T, D = undefined> = [
|
|
147
|
+
D
|
|
148
|
+
] extends [
|
|
149
|
+
undefined
|
|
150
|
+
] ? (T | undefined) : unknown extends T ? (D extends () => infer R ? R : D) : T;
|
|
151
|
+
/** Manages localStorage and sessionStorage with prefixing, expiration caching, and SSR request isolation. @keywords storage, localStorage, sessionStorage, cache, ssr */
|
|
152
|
+
export declare class DataStorage<T = unknown> {
|
|
153
|
+
/** Initializes storage instance with key name, storage target, and error handler. @keywords storage, constructor, session */
|
|
141
154
|
constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
|
|
142
|
-
/** Retrieves
|
|
143
|
-
get
|
|
144
|
-
/**
|
|
155
|
+
/** Retrieves item from storage with optional default fallback and cache TTL in seconds. @keywords storage, get, read, cache */
|
|
156
|
+
get<D extends T | (() => T) | undefined = undefined>(defaultValue?: D, cache?: number): DataStorageGet<T, D>;
|
|
157
|
+
/** Writes value or generator result to storage. @keywords storage, set, write */
|
|
145
158
|
set(value?: T | (() => T)): T | undefined;
|
|
146
|
-
/**
|
|
159
|
+
/** Returns fully-qualified storage key including prefix. @keywords storage, key, index, prefix */
|
|
160
|
+
getIndex(): string;
|
|
161
|
+
/** Sets process-wide key prefix for bootstrapping. @note Applies globally to entire runtime process in SSR. @keywords storage, prefix, config */
|
|
162
|
+
static setPrefix(newPrefix: string): void;
|
|
163
|
+
/** Deletes item from storage. @keywords storage, remove, delete, clear */
|
|
147
164
|
remove(): this;
|
|
148
|
-
/** Synchronizes data from
|
|
165
|
+
/** Synchronizes and refreshes data from storage. @keywords storage, sync, update, refresh */
|
|
149
166
|
update(): this;
|
|
150
167
|
}
|
|
151
168
|
|
|
152
169
|
/**
|
|
153
|
-
*
|
|
154
|
-
* @remarks Creating a `Datetime` instance without a specific date (using the current time) for SSR
|
|
155
|
-
* @keywords datetime date time
|
|
170
|
+
* Class for working with dates, time, and internationalized calendar calculations.
|
|
171
|
+
* @remarks Creating a `Datetime` instance without a specific date (using the current time) for rendering in SSR may lead to hydration mismatches because the time or time zone on the server may differ from the time on the client.
|
|
172
|
+
* @keywords datetime, date, calendar, time, timezone, intl
|
|
156
173
|
*/
|
|
157
174
|
export declare class Datetime {
|
|
158
|
-
/**
|
|
175
|
+
/** Initializes a Datetime instance with date, format type, and locale. @keywords init, constructor */
|
|
159
176
|
constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
|
|
160
|
-
/** Returns the GeoIntl
|
|
177
|
+
/** Returns the GeoIntl internationalization helper instance. @keywords intl, localization, format */
|
|
161
178
|
getIntl(): GeoIntl;
|
|
162
|
-
/** Returns the underlying native Date
|
|
179
|
+
/** Returns the underlying native Date instance. @keywords date, native */
|
|
163
180
|
getDate(): Date;
|
|
164
|
-
/** Returns the
|
|
181
|
+
/** Returns the date output format type. @keywords type, format */
|
|
165
182
|
getType(): GeoDate;
|
|
166
|
-
/** Returns the hour format type. @keywords hours format */
|
|
183
|
+
/** Returns the hour display format type. @keywords hours, format */
|
|
167
184
|
getHoursType(): GeoHours;
|
|
168
|
-
/**
|
|
185
|
+
/** Checks whether the 24-hour time format is enabled. @keywords 24-hour, time format */
|
|
169
186
|
getHour24(): boolean;
|
|
170
|
-
/** Returns the
|
|
187
|
+
/** Returns the country and language locale code. @keywords locale, language, country, code */
|
|
188
|
+
getCode(): string;
|
|
189
|
+
/** Returns the time zone offset in minutes relative to UTC. @keywords timezone, offset, utc */
|
|
171
190
|
getTimeZoneOffset(): number;
|
|
172
|
-
/** Returns the time zone string. @keywords timezone */
|
|
191
|
+
/** Returns the formatted time zone string. @keywords timezone, tz */
|
|
173
192
|
getTimeZone(style?: GeoTimeZoneStyle): string;
|
|
174
|
-
/** Returns the
|
|
193
|
+
/** Returns the first day of the week code for the current locale. @keywords first day, week, weekday */
|
|
175
194
|
getFirstDayCode(): GeoFirstDay;
|
|
176
|
-
/** Returns the
|
|
195
|
+
/** Returns the full year according to local time. @keywords year, local time */
|
|
177
196
|
getYear(): number;
|
|
178
|
-
/** Returns the 1-based month
|
|
197
|
+
/** Returns the 1-based month (1-12) according to local time. @keywords month */
|
|
179
198
|
getMonth(): number;
|
|
180
|
-
/** Returns the day of the month (1-31) according to local time. @keywords day month
|
|
199
|
+
/** Returns the day of the month (1-31) according to local time. @keywords day, day of month */
|
|
181
200
|
getDay(): number;
|
|
182
|
-
/** Returns the
|
|
201
|
+
/** Returns the day of the week (0-6) according to local time. @keywords weekday, day of week */
|
|
202
|
+
getWeekday(): number;
|
|
203
|
+
/** Returns the hour (0-23) according to local time. @keywords hour, time */
|
|
183
204
|
getHour(): number;
|
|
184
|
-
/** Returns the
|
|
205
|
+
/** Returns the minutes (0-59) according to local time. @keywords minute, time */
|
|
185
206
|
getMinute(): number;
|
|
186
|
-
/** Returns the
|
|
207
|
+
/** Returns the seconds (0-59) according to local time. @keywords second, time */
|
|
187
208
|
getSecond(): number;
|
|
188
|
-
/** Returns the total number of days
|
|
209
|
+
/** Returns the total number of days in the current month (28-31). @keywords max day, days in month */
|
|
189
210
|
getMaxDay(): number;
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
|
|
194
|
-
/** Formats the month according to the current locale. @keywords locale month format */
|
|
195
|
-
localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
|
|
196
|
-
/** Formats the day according to the current locale. @keywords locale day format */
|
|
197
|
-
localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
|
|
198
|
-
/** Formats the hour according to the current locale. @keywords locale hour format */
|
|
199
|
-
localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
|
|
200
|
-
/** Formats the minute according to the current locale. @keywords locale minute format */
|
|
201
|
-
localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
|
|
202
|
-
/** Formats the second according to the current locale. @keywords locale second format */
|
|
203
|
-
localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
|
|
204
|
-
/** Returns the date in standard ISO-like format. @keywords standard format iso */
|
|
205
|
-
standard(timeZone?: boolean): string;
|
|
206
|
-
/** Sets the date value from a number, string, or Date instance. @keywords set date */
|
|
207
|
-
setDate(value: NumberOrStringOrDate): this;
|
|
208
|
-
/** Sets the date display format type. @keywords set format type */
|
|
211
|
+
/** Sets the date value completely. @keywords set date */
|
|
212
|
+
setDate(value?: NumberOrStringOrDate): this;
|
|
213
|
+
/** Sets the date format output type. @keywords set type, format */
|
|
209
214
|
setType(value: GeoDate): this;
|
|
210
|
-
/**
|
|
215
|
+
/** Configures whether to use the 24-hour time format. @keywords 24-hour, format */
|
|
211
216
|
setHour24(value: boolean): this;
|
|
212
|
-
/**
|
|
213
|
-
setCode(code
|
|
214
|
-
/** Registers a callback invoked
|
|
215
|
-
setWatch(watch
|
|
216
|
-
/** Sets the full year
|
|
217
|
+
/** Updates the locale code and triggers watcher notification. @keywords set locale, code */
|
|
218
|
+
setCode(code?: string): this;
|
|
219
|
+
/** Registers a callback invoked whenever date values update. @keywords watch, listener, callback */
|
|
220
|
+
setWatch(watch?: (date: Date, type: GeoDate, hour24: boolean) => void): this;
|
|
221
|
+
/** Sets the full year in local time, clamping day to avoid month overflow. @keywords set year */
|
|
217
222
|
setYear(value: number): this;
|
|
218
|
-
/** Sets the 1-based month (1-12)
|
|
223
|
+
/** Sets the 1-based month (1-12) in local time, clamping day to avoid overflow. @keywords set month */
|
|
219
224
|
setMonth(value: number): this;
|
|
220
|
-
/** Sets the day of the month
|
|
225
|
+
/** Sets the day of the month in local time. @keywords set day */
|
|
221
226
|
setDay(value: number): this;
|
|
222
|
-
/** Sets the hour
|
|
227
|
+
/** Sets the hour in local time. @keywords set hour */
|
|
223
228
|
setHour(value: number): this;
|
|
224
|
-
/** Sets the
|
|
229
|
+
/** Sets the minutes in local time. @keywords set minute */
|
|
225
230
|
setMinute(value: number): this;
|
|
226
|
-
/** Sets the
|
|
231
|
+
/** Sets the seconds in local time. @keywords set second */
|
|
227
232
|
setSecond(value: number): this;
|
|
228
|
-
/**
|
|
233
|
+
/** Formats date and time according to locale and format options. @keywords locale, format, intl */
|
|
234
|
+
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
|
|
235
|
+
/** Formats the year according to locale options. @keywords format year, locale */
|
|
236
|
+
localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
|
|
237
|
+
/** Formats the month according to locale options. @keywords format month, locale */
|
|
238
|
+
localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
|
|
239
|
+
/** Formats the day according to locale options. @keywords format day, locale */
|
|
240
|
+
localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
|
|
241
|
+
/** Formats the hour according to locale options. @keywords format hour, locale */
|
|
242
|
+
localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
|
|
243
|
+
/** Formats the minute according to locale options. @keywords format minute, locale */
|
|
244
|
+
localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
|
|
245
|
+
/** Formats the second according to locale options. @keywords format second, locale */
|
|
246
|
+
localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
|
|
247
|
+
/** Outputs date in standard format with optional timezone offset. @keywords standard, iso, format */
|
|
248
|
+
standard(timeZone?: boolean): string;
|
|
249
|
+
/** Shifts the date by a given number of years. @keywords move year, shift, offset */
|
|
229
250
|
moveByYear(value: number): this;
|
|
230
|
-
/** Shifts the date by
|
|
251
|
+
/** Shifts the date by a given number of months. @keywords move month, shift, offset */
|
|
231
252
|
moveByMonth(value: number): this;
|
|
232
|
-
/** Shifts the date by
|
|
253
|
+
/** Shifts the date by a given number of days. @keywords move day, shift, offset */
|
|
233
254
|
moveByDay(value: number): this;
|
|
234
|
-
/** Shifts the date by
|
|
255
|
+
/** Shifts the date by a given number of hours. @keywords move hour, shift, offset */
|
|
235
256
|
moveByHour(value: number): this;
|
|
236
|
-
/** Shifts the date by
|
|
257
|
+
/** Shifts the date by a given number of minutes. @keywords move minute, shift, offset */
|
|
237
258
|
moveByMinute(value: number): this;
|
|
238
|
-
/** Shifts the date by
|
|
259
|
+
/** Shifts the date by a given number of seconds. @keywords move second, shift, offset */
|
|
239
260
|
moveBySecond(value: number): this;
|
|
240
|
-
/** Sets the month to January. @keywords january first month */
|
|
261
|
+
/** Sets the month to January. @keywords january, first month */
|
|
241
262
|
moveMonthFirst(): this;
|
|
242
|
-
/** Sets the month to December. @keywords december last month */
|
|
263
|
+
/** Sets the month to December. @keywords december, last month */
|
|
243
264
|
moveMonthLast(): this;
|
|
244
|
-
/**
|
|
265
|
+
/** Moves date to the first day of the next month. @keywords next month */
|
|
245
266
|
moveMonthNext(): this;
|
|
246
|
-
/** Moves
|
|
267
|
+
/** Moves date to the first day of the previous month. @keywords previous month */
|
|
247
268
|
moveMonthPrevious(): this;
|
|
248
|
-
/** Moves
|
|
269
|
+
/** Moves date to the first day of the current week. @keywords first day, week */
|
|
249
270
|
moveWeekdayFirst(): this;
|
|
250
|
-
/** Moves
|
|
271
|
+
/** Moves date to the last day of the current week. @keywords last day, week */
|
|
251
272
|
moveWeekdayLast(): this;
|
|
252
|
-
/** Moves
|
|
273
|
+
/** Moves date to the first day of the first week of the month. @keywords first week, calendar grid */
|
|
253
274
|
moveWeekdayFirstByMonth(): this;
|
|
254
|
-
/** Moves
|
|
275
|
+
/** Moves date to the last day of the last week of the month. @keywords last week, calendar grid */
|
|
255
276
|
moveWeekdayLastByMonth(): this;
|
|
256
|
-
/**
|
|
277
|
+
/** Shifts date to the next week. @keywords next week */
|
|
257
278
|
moveWeekdayNext(): this;
|
|
258
|
-
/**
|
|
279
|
+
/** Shifts date to the previous week. @keywords previous week */
|
|
259
280
|
moveWeekdayPrevious(): this;
|
|
260
|
-
/** Moves
|
|
281
|
+
/** Moves date to the first day of the month. @keywords start of month, day first */
|
|
261
282
|
moveDayFirst(): this;
|
|
262
|
-
/** Moves
|
|
283
|
+
/** Moves date to the last day of the month. @keywords end of month, day last */
|
|
263
284
|
moveDayLast(): this;
|
|
264
|
-
/**
|
|
285
|
+
/** Shifts date forward by one day. @keywords next day, tomorrow */
|
|
265
286
|
moveDayNext(): this;
|
|
266
|
-
/**
|
|
287
|
+
/** Shifts date backward by one day. @keywords previous day, yesterday */
|
|
267
288
|
moveDayPrevious(): this;
|
|
268
|
-
/**
|
|
289
|
+
/** Clones date as a native Date instance. @keywords clone date */
|
|
269
290
|
clone(): Date;
|
|
270
|
-
/**
|
|
291
|
+
/** Clones the Datetime instance. @keywords clone datetime */
|
|
271
292
|
cloneClass(): Datetime;
|
|
272
|
-
/** Clones
|
|
293
|
+
/** Clones Datetime instance and sets month to January. @keywords clone, january */
|
|
273
294
|
cloneMonthFirst(): Datetime;
|
|
274
|
-
/** Clones
|
|
295
|
+
/** Clones Datetime instance and sets month to December. @keywords clone, december */
|
|
275
296
|
cloneMonthLast(): Datetime;
|
|
276
|
-
/** Clones
|
|
297
|
+
/** Clones Datetime instance and shifts one month ahead. @keywords clone, next month */
|
|
277
298
|
cloneMonthNext(): Datetime;
|
|
278
|
-
/** Clones
|
|
299
|
+
/** Clones Datetime instance and shifts one month back. @keywords clone, previous month */
|
|
279
300
|
cloneMonthPrevious(): Datetime;
|
|
280
|
-
/** Clones
|
|
301
|
+
/** Clones Datetime instance set to the first day of the week. @keywords clone, start of week */
|
|
281
302
|
cloneWeekdayFirst(): Datetime;
|
|
282
|
-
/** Clones
|
|
303
|
+
/** Clones Datetime instance set to the last day of the week. @keywords clone, end of week */
|
|
283
304
|
cloneWeekdayLast(): Datetime;
|
|
284
|
-
/** Clones
|
|
305
|
+
/** Clones Datetime instance set to the first day of the first week of the month. @keywords clone, calendar start */
|
|
285
306
|
cloneWeekdayFirstByMonth(): Datetime;
|
|
286
|
-
/** Clones
|
|
307
|
+
/** Clones Datetime instance set to the last day of the last week of the month. @keywords clone, calendar end */
|
|
287
308
|
cloneWeekdayLastByMonth(): Datetime;
|
|
288
|
-
/** Clones
|
|
309
|
+
/** Clones Datetime instance shifted one week ahead. @keywords clone, next week */
|
|
289
310
|
cloneWeekdayNext(): Datetime;
|
|
290
|
-
/** Clones
|
|
311
|
+
/** Clones Datetime instance shifted one week back. @keywords clone, previous week */
|
|
291
312
|
cloneWeekdayPrevious(): Datetime;
|
|
292
|
-
/** Clones
|
|
313
|
+
/** Clones Datetime instance set to the first day of the month. @keywords clone, start of month */
|
|
293
314
|
cloneDayFirst(): Datetime;
|
|
294
|
-
/** Clones
|
|
315
|
+
/** Clones Datetime instance set to the last day of the month. @keywords clone, end of month */
|
|
295
316
|
cloneDayLast(): Datetime;
|
|
296
|
-
/** Clones
|
|
317
|
+
/** Clones Datetime instance shifted one day ahead. @keywords clone, next day */
|
|
297
318
|
cloneDayNext(): Datetime;
|
|
298
|
-
/** Clones
|
|
319
|
+
/** Clones Datetime instance shifted one day back. @keywords clone, previous day */
|
|
299
320
|
cloneDayPrevious(): Datetime;
|
|
300
321
|
}
|
|
301
322
|
|
|
302
|
-
/** Manages error storage
|
|
323
|
+
/** Manages error storage and dispatching. @keywords error management, handler, error center */
|
|
303
324
|
export declare class ErrorCenter {
|
|
304
|
-
/**
|
|
325
|
+
/** Retrieves a specific error cause by code and group. @keywords get error, find cause */
|
|
326
|
+
static get(code: string, group?: ErrorCenterGroup): ErrorCenterCauseItem | undefined;
|
|
327
|
+
/** Returns the error handler instance. @keywords error handler, get handler */
|
|
328
|
+
static getHandler(): ErrorCenterHandler;
|
|
329
|
+
/** Checks if an error cause exists for a code and group. @keywords check error, has cause */
|
|
330
|
+
static has(code: string, group?: ErrorCenterGroup): boolean;
|
|
331
|
+
/** Returns the global singleton instance of ErrorCenterInstance. @keywords singleton, instance */
|
|
305
332
|
static getItem(): ErrorCenterInstance;
|
|
306
|
-
/**
|
|
307
|
-
static
|
|
308
|
-
/**
|
|
309
|
-
static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
|
|
310
|
-
/** Adds an error cause item to storage. @keywords add error cause, register error */
|
|
333
|
+
/** Configures console logging flag or filter for errors. @keywords console log, filter, debug */
|
|
334
|
+
static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
|
|
335
|
+
/** Adds an error cause item to storage. @keywords add error, register cause */
|
|
311
336
|
static add(cause: ErrorCenterCauseItem): void;
|
|
312
|
-
/**
|
|
313
|
-
static
|
|
314
|
-
/** Registers
|
|
337
|
+
/** Registers a global callback executed on any error. @keywords global error callback, listener */
|
|
338
|
+
static addCallback(callback: ErrorCenterHandlerCallback): void;
|
|
339
|
+
/** Registers an error handler for a specific group. @keywords register handler, group error */
|
|
315
340
|
static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
|
|
316
|
-
/** Registers
|
|
341
|
+
/** Registers multiple error handlers simultaneously. @keywords batch handlers, handler list */
|
|
317
342
|
static addHandlerList(handlers: ErrorCenterHandlerList): void;
|
|
318
|
-
/** Adds a
|
|
319
|
-
static
|
|
320
|
-
/**
|
|
321
|
-
static
|
|
322
|
-
/**
|
|
343
|
+
/** Adds a list of error causes to storage. @keywords batch causes, error list */
|
|
344
|
+
static addList(causes: ErrorCenterCauseList): void;
|
|
345
|
+
/** Removes an error cause from storage by code and group. @keywords remove error, delete cause */
|
|
346
|
+
static remove(code: string, group?: ErrorCenterGroup): void;
|
|
347
|
+
/** Removes a specific handler or all handlers for a group. @keywords remove handler, unregister */
|
|
348
|
+
static removeHandler(group?: ErrorCenterGroup, handler?: ErrorCenterHandlerCallback): void;
|
|
349
|
+
/** Removes a registered global callback. @keywords remove callback, unbind */
|
|
350
|
+
static removeCallback(callback: ErrorCenterHandlerCallback): void;
|
|
351
|
+
/** Resets all registered handlers and callbacks. @keywords reset, clear handlers */
|
|
352
|
+
static reset(): void;
|
|
353
|
+
/** Dispatches error handling for a given cause. @keywords trigger error, dispatch, notify */
|
|
323
354
|
static on(cause: ErrorCenterCauseItem): void;
|
|
324
355
|
}
|
|
325
356
|
|
|
326
357
|
/**
|
|
327
|
-
* Advanced
|
|
328
|
-
* @keywords event
|
|
358
|
+
* Advanced lifecycle-managed event listener wrapper with DOM-safety checks and optimizations for resize and scroll.
|
|
359
|
+
* @keywords event-listener dom-events resize-observer scroll-sync event-dispatch
|
|
360
|
+
* @example
|
|
361
|
+
* const clickEvent = new EventItem('.btn', 'click', (e) => console.log('Clicked!'));
|
|
362
|
+
* clickEvent.start();
|
|
329
363
|
*/
|
|
330
|
-
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string,
|
|
331
|
-
/** Creates an EventItem instance. @keywords
|
|
364
|
+
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, unknown> = Record<string, unknown>> {
|
|
365
|
+
/** Creates an EventItem instance. @keywords constructor init */
|
|
332
366
|
constructor(elementSelector?: ElementOrString<E>, type?: string | string[], listener?: EventListenerDetail<O, D> | undefined, options?: EventOptions, detail?: D | undefined);
|
|
333
|
-
/** Checks whether event listening is active. @keywords
|
|
367
|
+
/** Checks whether event listening is currently active. @keywords active status listening */
|
|
334
368
|
isActive(): boolean;
|
|
335
|
-
/** Returns the target
|
|
369
|
+
/** Returns the resolved target element. @keywords target element getter */
|
|
336
370
|
getElement(): E | undefined;
|
|
337
|
-
/**
|
|
371
|
+
/** Updates the target element or selector. @keywords set-target element-bind */
|
|
338
372
|
setElement(elementSelector?: ElementOrString<E>): this;
|
|
339
|
-
/** Sets the control element for DOM safety checks. @keywords
|
|
373
|
+
/** Sets the control element used for DOM attachment safety checks. @keywords dom-safety control-element */
|
|
340
374
|
setElementControl<EC extends HTMLElement>(elementSelector?: ElementOrString<EC>): this;
|
|
341
|
-
/**
|
|
375
|
+
/** Updates the event type or types to listen to. @keywords set-type event-type */
|
|
342
376
|
setType(type: string | string[]): this;
|
|
343
|
-
/**
|
|
377
|
+
/** Updates the event listener callback. @keywords set-listener callback handler */
|
|
344
378
|
setListener(listener: EventListenerDetail<O, D>): this;
|
|
345
|
-
/**
|
|
379
|
+
/** Updates the event listener configuration options. @keywords options capture passive */
|
|
346
380
|
setOptions(options?: EventOptions): this;
|
|
347
|
-
/**
|
|
381
|
+
/** Updates the custom detail payload passed to listeners. @keywords set-detail payload custom-event */
|
|
348
382
|
setDetail(detail?: D): this;
|
|
349
|
-
/** Dispatches a CustomEvent
|
|
383
|
+
/** Dispatches a CustomEvent with optional payload across configured event types. @keywords dispatch trigger fire */
|
|
350
384
|
dispatch(detail?: D | undefined): this;
|
|
351
|
-
/**
|
|
385
|
+
/** Attaches and activates the event listeners. @keywords start listen attach */
|
|
352
386
|
start(): this;
|
|
353
|
-
/**
|
|
387
|
+
/** Detaches and stops the event listeners. @keywords stop remove detach */
|
|
354
388
|
stop(): this;
|
|
355
|
-
/** Toggles
|
|
389
|
+
/** Toggles the active listening state based on the given boolean. @keywords toggle state active */
|
|
356
390
|
toggle(activity: boolean): this;
|
|
357
|
-
/**
|
|
391
|
+
/** Resets the event listener lifecycle by restarting if currently active. @keywords reset reload restart */
|
|
358
392
|
reset(): this;
|
|
359
393
|
}
|
|
360
394
|
|
|
361
|
-
/** Formats a
|
|
395
|
+
/** Formats a dataset or single item using configured options. @keywords formatters, list format, data formatting */
|
|
362
396
|
export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
|
|
363
|
-
/** Initializes
|
|
397
|
+
/** Initializes formatter options and dataset. @keywords constructor, initialize */
|
|
364
398
|
constructor(options: Options, list?: List | undefined);
|
|
365
|
-
/** Checks
|
|
399
|
+
/** Checks whether the dataset is defined. @keywords is, has data, exists */
|
|
366
400
|
is(): boolean;
|
|
367
|
-
/** Type guard checking
|
|
401
|
+
/** Type guard checking whether the dataset is an array. @keywords isArray, type guard, array */
|
|
368
402
|
isArray(): this is this & {
|
|
369
403
|
list: FormattersList<Item>;
|
|
370
404
|
};
|
|
371
|
-
/** Returns
|
|
372
|
-
length(): number;
|
|
373
|
-
/** Returns the current list of items as an array. @keywords getList, items, array */
|
|
405
|
+
/** Returns current dataset normalized as an array. @keywords getList, list, array */
|
|
374
406
|
getList(): FormattersList<Item>;
|
|
375
|
-
/** Returns
|
|
407
|
+
/** Returns current formatting options configuration. @keywords getOptions, options, config */
|
|
376
408
|
getOptions(): Options;
|
|
377
|
-
/** Sets
|
|
409
|
+
/** Sets or updates the dataset to format. @keywords setList, update, dataset */
|
|
378
410
|
setList(list?: List): this;
|
|
379
|
-
/**
|
|
411
|
+
/** Returns the record count in the dataset. @keywords length, count, size */
|
|
412
|
+
length(): number;
|
|
413
|
+
/** Formats the dataset or single item and appends formatted values with 'Format' suffix. @keywords to, format, transform */
|
|
380
414
|
to(): FormattersReturn<List, Options>;
|
|
381
415
|
}
|
|
382
416
|
|
|
383
|
-
/** Static
|
|
417
|
+
/** Static class providing centralized interface for managing locale, country, and time zone data. @keywords geo, locale, country, timezone */
|
|
384
418
|
export declare class Geo {
|
|
385
|
-
/** Returns
|
|
386
|
-
static getObject(): GeoInstance;
|
|
387
|
-
/** Returns information about the current country and language. @keywords current, geo, locale */
|
|
419
|
+
/** Returns current country and language data. @keywords current, geo, country, language */
|
|
388
420
|
static get(): GeoItemFull;
|
|
389
|
-
/**
|
|
421
|
+
/** Sets current geographical location and updates instance state. @keywords set, location, locale */
|
|
422
|
+
static set(code?: string, save?: boolean): void;
|
|
423
|
+
/** Resolves geo data by country or language code from global database. @keywords lookup, code, country, language */
|
|
424
|
+
static getByCode(code?: string): GeoItemFull;
|
|
425
|
+
/** Resolves exact geo data by matching full locale string (e.g., 'en-US'). @keywords lookup, exact, full, locale */
|
|
426
|
+
static getByCodeFull(code?: string): GeoItem | undefined;
|
|
427
|
+
/** Resolves geo data for specific country code. @keywords country, code, lookup */
|
|
428
|
+
static getByCountry(country?: string): GeoItem | undefined;
|
|
429
|
+
/** Resolves geo data for specific language code. @keywords language, code, lookup */
|
|
430
|
+
static getByLanguage(language?: string): GeoItem | undefined;
|
|
431
|
+
/** Returns 2-letter code of current country. @keywords country, code, current */
|
|
390
432
|
static getCountry(): string;
|
|
391
|
-
/** Returns
|
|
392
|
-
static getLanguage(): string;
|
|
393
|
-
/** Returns the combined locale string in standard format (e.g., 'en-US'). @keywords locale, standard, format */
|
|
394
|
-
static getStandard(): string;
|
|
395
|
-
/** Returns the code for the first day of the week for the current locale. @keywords first-day, week, calendar */
|
|
433
|
+
/** Returns code for first day of the week for current locale. @keywords firstDay, week, locale */
|
|
396
434
|
static getFirstDay(): string;
|
|
397
|
-
/** Returns
|
|
398
|
-
static getLocation(): string;
|
|
399
|
-
/** Returns the country code extracted from the location string. @keywords location, country, code */
|
|
400
|
-
static getLocationCountry(): string;
|
|
401
|
-
/** Returns the language code extracted from the location string. @keywords location, language, code */
|
|
402
|
-
static getLocationLanguage(): string;
|
|
403
|
-
/** Returns fully processed geo data updated with the current language. @keywords geo, item, processed */
|
|
435
|
+
/** Returns fully processed geo data updated with current language. @note Deprecated: use get() @keywords item, current, language */
|
|
404
436
|
static getItem(): GeoItemFull;
|
|
405
|
-
/** Returns
|
|
437
|
+
/** Returns 2-letter code of current language. @keywords language, code, current */
|
|
438
|
+
static getLanguage(): string;
|
|
439
|
+
/** Returns complete list of available countries and regions. @keywords list, countries, regions */
|
|
406
440
|
static getList(): GeoItem[];
|
|
407
|
-
/** Returns
|
|
408
|
-
static
|
|
409
|
-
/** Returns
|
|
410
|
-
static
|
|
411
|
-
/** Returns
|
|
412
|
-
static
|
|
413
|
-
/** Returns
|
|
414
|
-
static
|
|
415
|
-
/** Returns
|
|
441
|
+
/** Returns current location string. @keywords location, current */
|
|
442
|
+
static getLocation(): string;
|
|
443
|
+
/** Returns country code extracted from current location string. @keywords location, country, code */
|
|
444
|
+
static getLocationLanguage(): string;
|
|
445
|
+
/** Returns language code extracted from current location string. @keywords location, language, code */
|
|
446
|
+
static getLocationCountry(): string;
|
|
447
|
+
/** Returns request-isolated instance of GeoInstance. @keywords instance, isolated, request */
|
|
448
|
+
static getObject(): GeoInstance;
|
|
449
|
+
/** Returns combined locale string in standard format (e.g., 'en-US'). @keywords standard, locale, format */
|
|
450
|
+
static getStandard(): string;
|
|
451
|
+
/** Returns timezone offset in minutes for current context. @keywords timezone, offset, minutes */
|
|
416
452
|
static getTimezone(): number;
|
|
417
|
-
/** Returns
|
|
453
|
+
/** Returns formatted timezone string (e.g., '+00:00') for current context. @keywords timezone, format, offset */
|
|
418
454
|
static getTimezoneFormat(): string;
|
|
419
|
-
/**
|
|
420
|
-
static find(code: string): GeoItemFull;
|
|
421
|
-
/** Returns a standard concatenated string for a geo item (e.g., 'en-US'). @keywords standard, format, locale */
|
|
422
|
-
static toStandard(item: GeoItem): string;
|
|
423
|
-
/** Sets the current geographical location and updates instance state. @keywords set, location, state */
|
|
424
|
-
static set(code: string, save?: boolean): void;
|
|
425
|
-
/** Sets a custom time zone offset in minutes for the current context. @keywords set, timezone, offset */
|
|
455
|
+
/** Sets custom timezone offset in minutes for current context. @keywords timezone, set, offset */
|
|
426
456
|
static setTimezone(timezone: number): void;
|
|
427
|
-
/** Sets
|
|
428
|
-
static setValueDefault(code?: string | (() => string)): void;
|
|
429
|
-
/** Adds or updates country geo data and merges with existing
|
|
430
|
-
static add(country: string, item
|
|
431
|
-
/** Adds or updates multiple countries in
|
|
432
|
-
static addList(list
|
|
457
|
+
/** Sets default value or resolver for country code. @keywords default, country, code */
|
|
458
|
+
static setValueDefault(code?: string | (() => string | undefined)): void;
|
|
459
|
+
/** Adds or updates country geo data and merges with existing records. @keywords add, country, update */
|
|
460
|
+
static add(country: string, item?: Partial<GeoItem>): GeoInstance;
|
|
461
|
+
/** Adds or updates multiple countries in geo list. @keywords add, batch, countries, list */
|
|
462
|
+
static addList(list?: Record<string, Partial<GeoItem>>): GeoInstance;
|
|
463
|
+
/** Resolves geo data for given code. Alias for getByCode. @note Deprecated: use getByCode() @keywords find, lookup, code */
|
|
464
|
+
static find(code?: string): GeoItemFull;
|
|
465
|
+
/** Formats geo item into standard concatenated locale string (e.g., 'en-US'). @keywords standard, locale, format */
|
|
466
|
+
static toStandard(item?: GeoItem, language?: string, raw?: boolean): string;
|
|
433
467
|
}
|
|
434
468
|
|
|
435
469
|
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
436
|
-
/**
|
|
470
|
+
/** Country, language, and flag icon geographic utility. @keywords geo flag country language locale icon */
|
|
437
471
|
export declare class GeoFlag {
|
|
438
|
-
/**
|
|
472
|
+
/** Country code to flag icon name mapping. @keywords flag icons mapping */
|
|
439
473
|
static flags: Record<string, string>;
|
|
440
|
-
/**
|
|
474
|
+
/** Creates a GeoFlag instance with an optional country/language code. @keywords constructor init */
|
|
441
475
|
constructor(code?: string);
|
|
442
|
-
/** Retrieves country
|
|
476
|
+
/** Retrieves country and flag details. @keywords get country flag */
|
|
443
477
|
get(code?: string): GeoFlagItem | undefined;
|
|
444
|
-
/** Retrieves language
|
|
478
|
+
/** Retrieves language and flag details. @keywords get language flag */
|
|
445
479
|
getLanguage(code?: string): GeoFlagItem | undefined;
|
|
446
|
-
/** Returns the active country code. @keywords
|
|
480
|
+
/** Returns the active country code. @keywords country code get */
|
|
447
481
|
getCode(): string;
|
|
448
|
-
/** Returns the flag icon identifier for a
|
|
482
|
+
/** Returns the flag icon identifier for a country code. @keywords flag icon code */
|
|
449
483
|
getFlag(code?: string): string | undefined;
|
|
450
|
-
/**
|
|
484
|
+
/** Returns country list, optionally filtered and sorted. @keywords list countries sort */
|
|
451
485
|
getList(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
452
|
-
/**
|
|
486
|
+
/** Returns language list, optionally filtered and sorted. @keywords list languages sort */
|
|
453
487
|
getListLanguage(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
454
|
-
/**
|
|
488
|
+
/** Returns country list with names in native languages. @keywords national countries native */
|
|
455
489
|
getNational(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
456
|
-
/**
|
|
490
|
+
/** Returns language list with names in native languages. @keywords national languages native */
|
|
457
491
|
getNationalLanguage(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
458
|
-
/** Updates the
|
|
492
|
+
/** Updates the active locale or country code. @keywords set code locale */
|
|
459
493
|
setCode(code: string): this;
|
|
460
494
|
}
|
|
461
495
|
|
|
462
|
-
/** Internationalization and localization utility
|
|
496
|
+
/** Internationalization and localization utility wrapper for ECMAScript Intl API. @keywords intl, i18n, l10n, localization, format */
|
|
463
497
|
export declare class GeoIntl {
|
|
464
|
-
/**
|
|
498
|
+
/** Creates a GeoIntl instance for a given country or locale code. @keywords constructor, locale, init */
|
|
499
|
+
constructor(code?: string, errorCenter?: ErrorCenterInstance);
|
|
500
|
+
/** Checks whether an instance exists for the specified country or locale code. @keywords exists, cache, check */
|
|
465
501
|
static isItem(code?: string): boolean;
|
|
466
|
-
/**
|
|
467
|
-
static getLocation(code?: string): string;
|
|
468
|
-
/** Returns a cached or new GeoIntl instance for the specified locale code. @keywords singleton instance factory */
|
|
502
|
+
/** Returns a cached or new GeoIntl instance for the specified code. @keywords singleton, instance, factory */
|
|
469
503
|
static getInstance(code?: string): GeoIntl;
|
|
470
|
-
/**
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
getLocation(): string;
|
|
474
|
-
/** Returns the first day of the week for the current locale. @keywords first day week calendar */
|
|
504
|
+
/** Returns the standard location code for a given country/locale. @keywords location, locale, code */
|
|
505
|
+
static getLocation(code?: string): string;
|
|
506
|
+
/** Returns the first day of the week for the locale. @keywords first day, week, start day */
|
|
475
507
|
getFirstDay(): string;
|
|
476
|
-
/**
|
|
508
|
+
/** Returns the current country and language locale code. @keywords location, locale, code */
|
|
509
|
+
getLocation(): string;
|
|
510
|
+
/** Translates language, region, or script display names. @keywords display, translate, intl */
|
|
477
511
|
display(value?: string, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): string;
|
|
478
|
-
/**
|
|
512
|
+
/** Returns localized display name of a language code. @keywords language, display name */
|
|
479
513
|
languageName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
480
|
-
/**
|
|
514
|
+
/** Returns localized display name of a region or country code. @keywords country, region, name */
|
|
481
515
|
countryName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
482
|
-
/**
|
|
516
|
+
/** Returns a formatted full name according to locale rules. @keywords fullName, person, format */
|
|
483
517
|
fullName(last: string, first: string, surname?: string, short?: boolean): string;
|
|
484
|
-
/** Formats
|
|
518
|
+
/** Formats a number, bigint, or string value according to locale rules. @keywords number, format, digits */
|
|
485
519
|
number(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
486
|
-
/**
|
|
520
|
+
/** Returns the decimal point separator symbol for the locale. @keywords decimal, point, separator */
|
|
487
521
|
decimal(): string;
|
|
488
|
-
/** Formats
|
|
522
|
+
/** Formats a numerical value as currency. @keywords currency, money, format */
|
|
489
523
|
currency(value: NumberOrString, currencyOptions?: string | Intl.NumberFormatOptions, numberOnly?: boolean): string;
|
|
490
|
-
/** Returns the currency symbol or code
|
|
524
|
+
/** Returns the currency symbol or currency code. @keywords currencySymbol, currency, sign */
|
|
491
525
|
currencySymbol(currency: string, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): string;
|
|
492
|
-
/** Formats a
|
|
526
|
+
/** Formats a value with a specific measurement unit. @keywords unit, measurement, format */
|
|
493
527
|
unit(value: NumberOrString, unitOptions?: string | Intl.NumberFormatOptions): string;
|
|
494
|
-
/**
|
|
528
|
+
/** Returns a localized formatted file size string. @keywords sizeFile, bytes, file size */
|
|
495
529
|
sizeFile(value: NumberOrString, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): string;
|
|
496
|
-
/** Formats a
|
|
530
|
+
/** Formats a number as a percentage. @keywords percent, percentage, ratio */
|
|
497
531
|
percent(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
498
|
-
/** Formats a 0-
|
|
532
|
+
/** Formats a fraction (0-1) as a percentage (0-100%). @keywords percentBy100, percentage, ratio */
|
|
499
533
|
percentBy100(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
500
|
-
/**
|
|
534
|
+
/** Applies plural-sensitive formatting and returns the appropriate word form. @keywords plural, rules, grammar */
|
|
501
535
|
plural(value: NumberOrString, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): string;
|
|
502
|
-
/** Formats date and time
|
|
536
|
+
/** Formats date and time according to locale rules. @keywords date, time, format */
|
|
503
537
|
date(value: NumberOrStringOrDate, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): string;
|
|
504
|
-
/** Formats
|
|
538
|
+
/** Formats relative time from a given date. @keywords relative, time, ago */
|
|
505
539
|
relative(value: NumberOrStringOrDate, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): string;
|
|
506
|
-
/** Formats relative time
|
|
540
|
+
/** Formats relative time within a limit, otherwise falls back to standard date format. @keywords relativeLimit, relative, limit */
|
|
507
541
|
relativeLimit(value: NumberOrStringOrDate, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): string;
|
|
508
|
-
/** Formats
|
|
542
|
+
/** Formats elapsed relative time for an explicit time unit. @keywords relativeByValue, relative, elapsed */
|
|
509
543
|
relativeByValue(value: NumberOrString, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): string;
|
|
510
|
-
/**
|
|
544
|
+
/** Returns the localized month name for a given date. @keywords month, name */
|
|
511
545
|
month(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['month']): string;
|
|
512
|
-
/** Returns
|
|
546
|
+
/** Returns a localized list of all months. @keywords months, list, select */
|
|
513
547
|
months(style?: Intl.DateTimeFormatOptions['month']): ItemValue<number | undefined>[];
|
|
514
|
-
/**
|
|
548
|
+
/** Returns the localized day-of-week name for a given date. @keywords weekday, day, name */
|
|
515
549
|
weekday(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['weekday']): string;
|
|
516
|
-
/** Returns
|
|
550
|
+
/** Returns a localized list of all days of the week. @keywords weekdays, list, select */
|
|
517
551
|
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ItemValue<number | undefined>[];
|
|
518
|
-
/** Formats the time portion of a date
|
|
552
|
+
/** Formats the time portion of a date. @keywords time, clock, format */
|
|
519
553
|
time(value: NumberOrStringOrDate): string;
|
|
520
|
-
/** Sorts
|
|
521
|
-
sort<T>(data: T[], compareFn?: (
|
|
554
|
+
/** Sorts an array of items using locale-sensitive string comparison. @keywords sort, collator, compare */
|
|
555
|
+
sort<T>(data: T[], compareFn?: (itemA: T, itemB: T) => [
|
|
556
|
+
string,
|
|
557
|
+
string
|
|
558
|
+
]): T[];
|
|
522
559
|
}
|
|
523
560
|
|
|
524
|
-
/**
|
|
561
|
+
/** Cookie key for storing the geo location code. @keywords cookie, geo, key */
|
|
562
|
+
export declare const UI_GEO_COOKIE_KEY = "ui-geo-code";
|
|
563
|
+
/** Manages and resolves the current location code, storage persistence, and DOM fallbacks. @keywords geo, location, locale, storage */
|
|
564
|
+
export declare class GeoLocation {
|
|
565
|
+
/** Initializes location state from storage, cookies, DOM, or defaults. @keywords constructor, init, geo */
|
|
566
|
+
constructor(valueDefault?: string | (() => string | undefined) | undefined);
|
|
567
|
+
/** Gets the current location code string. @keywords get, location, code */
|
|
568
|
+
get(): string;
|
|
569
|
+
/** Updates the current location code with optional storage and cookie persistence. @keywords set, update, persist */
|
|
570
|
+
set(code?: string, save?: boolean): this;
|
|
571
|
+
/** Gets the country code extracted from the current location. @keywords country, code */
|
|
572
|
+
getCountry(): string;
|
|
573
|
+
/** Gets the language code extracted from the current location. @keywords language, locale */
|
|
574
|
+
getLanguage(): string;
|
|
575
|
+
/** Sets the default location code value or dynamic resolver. @keywords default, fallback */
|
|
576
|
+
setValueDefault(code?: string | (() => string | undefined)): this;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/** Manages phone number masks, country codes, and formatting. @keywords phone mask country code parser */
|
|
525
580
|
export declare class GeoPhone {
|
|
526
|
-
/** Retrieves phone code and country
|
|
581
|
+
/** Retrieves phone code and country mask data by country or language code. @keywords phone mask country code lookup */
|
|
527
582
|
static get(code: string): GeoPhoneValue | undefined;
|
|
528
|
-
/** Retrieves
|
|
529
|
-
static getByPhone(phone: string): GeoPhoneMapInfo;
|
|
530
|
-
/** Retrieves complete phone mask data by country code. @keywords mask by code, country mask */
|
|
583
|
+
/** Retrieves full phone mask map item by country code. @keywords phone mask map country */
|
|
531
584
|
static getByCode(code: string): GeoPhoneMap | undefined;
|
|
532
|
-
/**
|
|
585
|
+
/** Identifies country and mask metadata from a phone number string. @keywords phone metadata identify lookup */
|
|
586
|
+
static getByPhone(phone: string): GeoPhoneMapInfo;
|
|
587
|
+
/** Retrieves a list of all available phone mask items. @keywords phone masks list all */
|
|
533
588
|
static getList(): GeoPhoneValue[];
|
|
534
|
-
/**
|
|
589
|
+
/** Retrieves a tree map of phone mask configurations indexed by code. @keywords phone mask tree map */
|
|
535
590
|
static getMap(): Record<string, GeoPhoneMap>;
|
|
536
|
-
/**
|
|
537
|
-
static toMask(phone: string, masks?: string[]): string | undefined;
|
|
538
|
-
/** Removes country prefixes or trunk zeroes from an input phone number. @keywords clean phone, strip prefix */
|
|
591
|
+
/** Strips leading zeros or country dialing prefix from a phone number. @keywords sanitize phone clean zero prefix */
|
|
539
592
|
static removeZero(phone: string): string;
|
|
593
|
+
/** Formats a phone number according to matching or provided masks. @keywords format phone mask formatter */
|
|
594
|
+
static toMask(phone: string, masks?: string[]): string | undefined;
|
|
540
595
|
}
|
|
541
596
|
|
|
542
|
-
/** Localized unit formatting and automatic conversions
|
|
597
|
+
/** Localized unit formatting and automatic conversions for metric and regional units. @keywords unit, localization, conversion, measurement, geo */
|
|
543
598
|
export declare class GeoUnit {
|
|
544
|
-
/**
|
|
545
|
-
static getInstance(code?: string): GeoUnit;
|
|
546
|
-
/** Creates a GeoUnit instance for a country or language code. @keywords constructor init */
|
|
599
|
+
/** Creates a GeoUnit instance for a locale or country code. @keywords constructor, locale */
|
|
547
600
|
constructor(code?: string);
|
|
548
|
-
/** Gets the
|
|
601
|
+
/** Gets a cached GeoUnit instance for the specified locale code. @keywords cache, instance, factory */
|
|
602
|
+
static getInstance(code?: string): GeoUnit;
|
|
603
|
+
/** Returns the resolved standard location code. @keywords location, country, locale */
|
|
549
604
|
getLocation(): string;
|
|
550
|
-
/** Formats
|
|
605
|
+
/** Formats millimeters, converting to inches if configured by locale. @keywords millimeter, length, distance, inch */
|
|
551
606
|
millimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
552
|
-
/** Formats
|
|
607
|
+
/** Formats centimeters, converting to inches if configured by locale. @keywords centimeter, length, distance, inch */
|
|
553
608
|
centimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
554
|
-
/** Formats
|
|
609
|
+
/** Formats meters, converting to feet if configured by locale. @keywords meter, length, distance, foot */
|
|
555
610
|
meter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
556
|
-
/** Formats
|
|
611
|
+
/** Formats kilometers, converting to miles if configured by locale. @keywords kilometer, distance, mile */
|
|
557
612
|
kilometer(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
558
|
-
/** Formats square
|
|
613
|
+
/** Formats square meters, converting to square feet if configured by locale. @keywords square meter, area, square foot */
|
|
559
614
|
squareMeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
560
|
-
/** Formats
|
|
615
|
+
/** Formats hectares, converting to acres if configured by locale. @keywords hectare, area, acre */
|
|
561
616
|
hectare(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
562
|
-
/** Formats
|
|
617
|
+
/** Formats grams, converting to ounces if configured by locale. @keywords gram, weight, mass, ounce */
|
|
563
618
|
gram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
564
|
-
/** Formats
|
|
619
|
+
/** Formats kilograms, converting to pounds if configured by locale. @keywords kilogram, weight, mass, pound */
|
|
565
620
|
kilogram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
566
|
-
/** Formats
|
|
621
|
+
/** Formats tonnes, converting to short tons if configured by locale. @keywords tonne, metric ton, mass, ton */
|
|
567
622
|
tonne(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
568
|
-
/** Formats
|
|
623
|
+
/** Formats milliliters, converting to fluid ounces if configured by locale. @keywords milliliter, volume, fluid ounce */
|
|
569
624
|
milliliter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
570
|
-
/** Formats
|
|
625
|
+
/** Formats liters, converting to gallons if configured by locale. @keywords liter, volume, gallon */
|
|
571
626
|
liter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
572
|
-
/** Formats
|
|
627
|
+
/** Formats celsius, converting to fahrenheit if configured by locale. @keywords celsius, temperature, fahrenheit */
|
|
573
628
|
celsius(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
574
|
-
/** Formats
|
|
629
|
+
/** Formats kilometers per hour, converting to miles per hour if configured by locale. @keywords speed, kilometer per hour, mph */
|
|
575
630
|
kilometerPerHour(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
576
|
-
/** Formats a numeric value for the specified unit according to locale
|
|
631
|
+
/** Formats a numeric value for the specified unit according to locale rules. @keywords format, unit, conversion */
|
|
577
632
|
format(value: NumberOrString, unit: string, options?: Intl.NumberFormatOptions): string;
|
|
578
633
|
}
|
|
579
634
|
|
|
580
|
-
/** Static utility class for storing and retrieving application-wide global data. @keywords global state storage
|
|
635
|
+
/** Static utility class for storing and retrieving application-wide global data. @keywords global state, storage, registry */
|
|
581
636
|
export declare class Global {
|
|
582
|
-
/**
|
|
583
|
-
static
|
|
584
|
-
/** Returns
|
|
585
|
-
static
|
|
586
|
-
/**
|
|
587
|
-
static add(data: Record<string,
|
|
637
|
+
/** Retrieves a global value by property name. @keywords get, lookup, retrieve, state */
|
|
638
|
+
static get<R = unknown>(name: string): R;
|
|
639
|
+
/** Returns the entire global data storage record. @keywords storage, state, get all, dictionary */
|
|
640
|
+
static getItem(): Record<string, unknown>;
|
|
641
|
+
/** Initializes global data once. @keywords add, initialize, set global */
|
|
642
|
+
static add(data: Record<string, unknown>): void;
|
|
588
643
|
}
|
|
589
644
|
|
|
590
|
-
/** Static
|
|
645
|
+
/** Static class managing data stored in the URL hash via HashInstance delegation. @keywords hash url state navigation routing */
|
|
591
646
|
export declare class Hash {
|
|
592
|
-
/** Returns a request-isolated HashInstance. @keywords instance
|
|
647
|
+
/** Returns a request-isolated HashInstance instance. @keywords hash instance isolate get */
|
|
593
648
|
static getItem(): HashInstance;
|
|
594
|
-
/** Retrieves a value from the URL hash. @keywords hash
|
|
649
|
+
/** Retrieves a stored value by name from the URL hash with an optional default. @keywords get hash value read query */
|
|
595
650
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
596
|
-
/** Sets or updates a value in the URL hash. @keywords hash
|
|
651
|
+
/** Sets or updates a value in the URL hash. @keywords set hash value update write */
|
|
597
652
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
598
|
-
/** Subscribes a listener callback to changes for a specific hash variable. @keywords watch
|
|
653
|
+
/** Subscribes a listener callback to changes for a specific hash variable. @keywords watch listener subscribe observe change */
|
|
599
654
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
600
|
-
/** Unsubscribes a listener callback from hash variable
|
|
655
|
+
/** Unsubscribes a listener callback from changes for a specific hash variable. @keywords unwatch unsubscribe remove listener */
|
|
601
656
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
602
|
-
/**
|
|
657
|
+
/** Synchronizes hash variables by reparsing the current URL string. @keywords reload sync refresh parse */
|
|
603
658
|
static reload(): void;
|
|
659
|
+
/** Resets the instance, clears state, and removes all active listeners. @keywords reset destroy clear teardown */
|
|
660
|
+
static reset(): void;
|
|
604
661
|
}
|
|
605
662
|
|
|
606
|
-
export type IconsItem = string | Promise<string |
|
|
663
|
+
export type IconsItem = string | Promise<string | unknown> | (() => Promise<string | unknown>);
|
|
607
664
|
export type IconsConfig = {
|
|
608
665
|
url?: string;
|
|
609
666
|
list?: Record<string, IconsItem>;
|
|
610
667
|
};
|
|
611
|
-
/** Icon manager
|
|
668
|
+
/** Icon manager for registering, caching, and retrieving icon assets. @keywords icon, icons, manager, registry */
|
|
612
669
|
export declare class Icons {
|
|
613
|
-
/** Checks
|
|
670
|
+
/** Checks whether an icon is registered by name. @keywords icon, check, exists, is */
|
|
614
671
|
static is(index: string): boolean;
|
|
615
|
-
/**
|
|
672
|
+
/** Asynchronously retrieves an icon by name or URL with optional timeout. @keywords icon, get, fetch, load, async */
|
|
616
673
|
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
617
|
-
/** Synchronously returns an icon if loaded or string
|
|
674
|
+
/** Synchronously returns an icon if loaded or retrieves from string source. @keywords icon, getAsync, sync, cache */
|
|
618
675
|
static getAsync(index: string, url?: string): string;
|
|
619
|
-
/**
|
|
676
|
+
/** Returns a list of all registered icon names. @keywords icon, list, names, keys */
|
|
620
677
|
static getNameList(): string[];
|
|
621
|
-
/**
|
|
678
|
+
/** Returns the global base URL for icon storage. @keywords icon, url, global, base */
|
|
622
679
|
static getUrlGlobal(): string;
|
|
623
|
-
/**
|
|
680
|
+
/** Updates the icon configuration. @keywords icon, config, configure, settings */
|
|
681
|
+
static setConfig(config: IconsConfig): void;
|
|
682
|
+
/** Sets the global base URL for icon storage. @keywords icon, url, set, base */
|
|
683
|
+
static setUrl(url: string): void;
|
|
684
|
+
/** Registers a custom icon by name with a path, promise, or loader function. @keywords icon, register, add, custom */
|
|
624
685
|
static add(index: string, file: IconsItem): void;
|
|
625
|
-
/** Registers
|
|
626
|
-
static addLoad(index: string): void;
|
|
627
|
-
/** Registers a global icon path. @keywords add-global, icon-url */
|
|
628
|
-
static addGlobal(index: string, file: string): void;
|
|
629
|
-
/** Registers multiple icons from a key-value record. @keywords batch-register, icon-list */
|
|
686
|
+
/** Registers multiple icons from a key-value map. @keywords icon, register, bulk, addByList, map */
|
|
630
687
|
static addByList(list: Record<string, IconsItem>): void;
|
|
631
|
-
/**
|
|
632
|
-
static
|
|
633
|
-
/**
|
|
634
|
-
static
|
|
688
|
+
/** Registers a global icon path by name. @keywords icon, global, register, addGlobal */
|
|
689
|
+
static addGlobal(index: string, file: string): void;
|
|
690
|
+
/** Marks an icon as being loaded. @keywords icon, load, loading, addLoad */
|
|
691
|
+
static addLoad(index: string): void;
|
|
692
|
+
/** Resets the icon registry to its default state. @keywords icon, reset, clear */
|
|
693
|
+
static reset(): void;
|
|
635
694
|
}
|
|
636
695
|
|
|
637
|
-
/**
|
|
696
|
+
/** Manages global loading state and loader events. @keywords global loading, loader, spinner, state */
|
|
638
697
|
export declare class Loading {
|
|
639
|
-
/**
|
|
640
|
-
static is(): boolean;
|
|
641
|
-
/** Gets the current loading count or value. @keywords loading count, status */
|
|
698
|
+
/** Gets the current loading counter value. @keywords loading value, counter, progress */
|
|
642
699
|
static get(): number;
|
|
643
|
-
/**
|
|
700
|
+
/** Checks if the loader is currently active. @keywords is loading, active loader, status */
|
|
701
|
+
static is(): boolean;
|
|
702
|
+
/** Returns a request-isolated LoadingInstance object. @keywords loading instance, isolated loader, context */
|
|
644
703
|
static getItem(): LoadingInstance;
|
|
645
|
-
/**
|
|
704
|
+
/** Increments the loading counter and displays the loader. @keywords show loader, start loading, display spinner */
|
|
646
705
|
static show(): void;
|
|
647
|
-
/**
|
|
706
|
+
/** Decrements the loading counter and hides the loader when zero. @keywords hide loader, stop loading, dismiss spinner */
|
|
648
707
|
static hide(): void;
|
|
649
|
-
/** Registers an event listener for loading state changes. @keywords loading event,
|
|
708
|
+
/** Registers an event listener for loading state changes. @keywords add event listener, loading event, watch */
|
|
650
709
|
static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
651
|
-
/** Unregisters a loading state event listener. @keywords remove listener, unsubscribe */
|
|
710
|
+
/** Unregisters a previously added loading state event listener. @keywords remove event listener, unsubscribe, loading event */
|
|
652
711
|
static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
653
712
|
}
|
|
654
713
|
|
|
655
|
-
/** Unified manager for standard HTML, Open Graph, and Twitter Card meta tags. @keywords meta,
|
|
714
|
+
/** Unified manager for standard HTML, Open Graph, and Twitter Card meta tags. @keywords meta, seo, open graph, twitter card, head */
|
|
656
715
|
export declare class Meta extends MetaManager<MetaTag[]> {
|
|
657
|
-
/**
|
|
716
|
+
/** Initializes Meta manager with integrated Open Graph and Twitter Card support. @keywords constructor, init */
|
|
658
717
|
constructor();
|
|
659
|
-
/** Gets the MetaOg instance for Open Graph operations. @keywords og,
|
|
718
|
+
/** Gets the MetaOg instance for Open Graph operations. @keywords og, open graph */
|
|
660
719
|
getOg(): MetaOg;
|
|
661
|
-
/** Gets the MetaTwitter instance for Twitter Card operations. @keywords twitter, card */
|
|
720
|
+
/** Gets the MetaTwitter instance for Twitter Card operations. @keywords twitter, twitter card */
|
|
662
721
|
getTwitter(): MetaTwitter;
|
|
663
|
-
/** Gets the page title without suffix. @keywords title, get */
|
|
722
|
+
/** Gets the page title without suffix. @keywords title, get title */
|
|
664
723
|
getTitle(): string;
|
|
665
|
-
/** Gets the keywords meta tag content. @keywords keywords,
|
|
724
|
+
/** Gets the keywords meta tag content. @keywords keywords, seo */
|
|
666
725
|
getKeywords(): string;
|
|
667
|
-
/** Gets the description meta tag content. @keywords description,
|
|
726
|
+
/** Gets the description meta tag content. @keywords description, seo */
|
|
668
727
|
getDescription(): string;
|
|
669
|
-
/** Gets the Open Graph image URL. @keywords image, og
|
|
728
|
+
/** Gets the Open Graph image URL. @keywords image, og image */
|
|
670
729
|
getImage(): string;
|
|
671
|
-
/** Gets the canonical URL. @keywords canonical, url
|
|
730
|
+
/** Gets the canonical URL. @keywords canonical, url */
|
|
672
731
|
getCanonical(): string;
|
|
673
|
-
/** Gets the robots meta tag directive. @keywords robots,
|
|
732
|
+
/** Gets the robots meta tag directive. @keywords robots, indexing, seo */
|
|
674
733
|
getRobots(): MetaRobots;
|
|
675
|
-
/** Gets the author meta tag content. @keywords author
|
|
734
|
+
/** Gets the author meta tag content. @keywords author */
|
|
676
735
|
getAuthor(): string;
|
|
677
|
-
/** Gets the Open Graph site name. @keywords
|
|
736
|
+
/** Gets the Open Graph site name. @keywords site name, og */
|
|
678
737
|
getSiteName(): string;
|
|
679
|
-
/** Gets the Open Graph locale. @keywords locale, og
|
|
738
|
+
/** Gets the Open Graph locale. @keywords locale, og */
|
|
680
739
|
getLocale(): string;
|
|
681
|
-
/** Sets the page title with suffix and updates Open Graph and Twitter Card titles. @keywords title,
|
|
740
|
+
/** Sets the page title with suffix and updates Open Graph and Twitter Card titles. @keywords set title, og title, twitter title */
|
|
682
741
|
setTitle(title: string): this;
|
|
683
|
-
/** Sets the keywords meta tag. @keywords keywords, set */
|
|
742
|
+
/** Sets the keywords meta tag from a string or string array. @keywords keywords, set keywords */
|
|
684
743
|
setKeywords(keywords: string | string[]): this;
|
|
685
|
-
/** Sets the description meta tag. @keywords description, set */
|
|
744
|
+
/** Sets the description meta tag. @keywords description, set description */
|
|
686
745
|
setDescription(description: string): this;
|
|
687
|
-
/** Sets the image for Open Graph and Twitter Card. @keywords image, og, twitter
|
|
746
|
+
/** Sets the image URL for Open Graph and Twitter Card. @keywords image, og image, twitter image */
|
|
688
747
|
setImage(image: string): this;
|
|
689
|
-
/** Sets the canonical URL and updates Open Graph and Twitter Card URLs. @keywords canonical, url
|
|
748
|
+
/** Sets the canonical URL and updates Open Graph and Twitter Card URLs. @keywords canonical, url */
|
|
690
749
|
setCanonical(canonical: string): this;
|
|
691
|
-
/** Sets the robots meta tag
|
|
750
|
+
/** Sets the robots meta directive tag. @keywords robots, indexing, crawler */
|
|
692
751
|
setRobots(robots: MetaRobots): this;
|
|
693
|
-
/** Sets the author meta tag. @keywords author
|
|
752
|
+
/** Sets the author meta tag. @keywords author */
|
|
694
753
|
setAuthor(author: string): this;
|
|
695
|
-
/** Sets the site name for Open Graph and Twitter Card. @keywords
|
|
754
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords site name, og */
|
|
696
755
|
setSiteName(siteName: string): this;
|
|
697
|
-
/** Sets the Open Graph
|
|
756
|
+
/** Sets the locale for Open Graph. @keywords locale, og locale */
|
|
698
757
|
setLocale(locale: string): this;
|
|
699
|
-
/** Sets the suffix to append to page title. @keywords suffix, title
|
|
700
|
-
setSuffix(suffix?: string):
|
|
701
|
-
/** Generates the complete HTML string for all meta tags. @keywords html, render,
|
|
758
|
+
/** Sets the suffix to append to the page title. @keywords suffix, title suffix */
|
|
759
|
+
setSuffix(suffix?: string): this;
|
|
760
|
+
/** Generates the complete HTML string for all meta tags. @keywords html, render, tags */
|
|
702
761
|
html(): string;
|
|
703
|
-
/** Generates the
|
|
762
|
+
/** Generates the HTML-safe page title string. @keywords html title, render title */
|
|
704
763
|
htmlTitle(): string;
|
|
705
764
|
}
|
|
706
765
|
|
|
707
|
-
/** Static
|
|
766
|
+
/** Static utility providing centralized access to URL query parameters delegating to QueryInstance. @keywords query, search-params, url */
|
|
708
767
|
export declare class Query {
|
|
709
|
-
/** Returns a request-isolated QueryInstance. @keywords instance,
|
|
768
|
+
/** Returns a request-isolated instance of QueryInstance. @keywords query-instance, get-item, context */
|
|
710
769
|
static getItem(): QueryInstance;
|
|
711
|
-
/** Retrieves a parameter value from the query
|
|
770
|
+
/** Retrieves a parameter value from the URL query with an optional default value or getter. @keywords get, query-param, read */
|
|
712
771
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
713
|
-
/** Sets or updates a parameter in the URL query
|
|
772
|
+
/** Sets or updates a parameter value in the URL query. @keywords set, query-param, update, write */
|
|
714
773
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
715
|
-
/**
|
|
774
|
+
/** Registers a listener callback for changes to a specific query parameter. @keywords add-watch, listener, observe, query-change */
|
|
716
775
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
717
|
-
/**
|
|
776
|
+
/** Unregisters an existing change listener callback for a query parameter. @keywords remove-watch, unwatch, unsubscribe */
|
|
718
777
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
719
|
-
/**
|
|
778
|
+
/** Re-parses and updates query variables from the current URL string. @keywords reload, refresh, sync-url */
|
|
720
779
|
static reload(): void;
|
|
780
|
+
/** Resets the instance and removes all attached listeners. @keywords reset, destroy, cleanup, clear */
|
|
721
781
|
}
|
|
722
782
|
|
|
723
|
-
/** Timer that can be paused, resumed, reset, and cleared. @keywords timer, pause, resume, timeout,
|
|
783
|
+
/** Timer that can be paused, resumed, reset, and cleared. @keywords timer, pause, resume, delay, timeout, schedule */
|
|
724
784
|
export declare class ResumableTimer {
|
|
725
|
-
/** Creates a resumable timer instance. @
|
|
785
|
+
/** Creates a new resumable timer instance. @keywords constructor, create, timer */
|
|
726
786
|
constructor(callback: FunctionVoid, delay?: number, blockStart?: boolean);
|
|
727
|
-
/**
|
|
728
|
-
resume(): this;
|
|
729
|
-
/** Pauses the timer and tracks remaining time. @keywords pause, stop, hold */
|
|
730
|
-
pause(): this;
|
|
731
|
-
/** Resets and restarts the timer with the original delay. @keywords reset, restart */
|
|
787
|
+
/** Resets and restarts the timer with the original delay. @keywords reset, restart, timer */
|
|
732
788
|
reset(): this;
|
|
733
|
-
/**
|
|
789
|
+
/** Clears the timer and resets its state. @keywords clear, stop, cancel, timer */
|
|
734
790
|
clear(): this;
|
|
791
|
+
/** Pauses the timer and preserves remaining time. @keywords pause, freeze, timer */
|
|
792
|
+
pause(): this;
|
|
793
|
+
/** Resumes a paused timer or starts it if not running. @keywords resume, start, unpause, timer */
|
|
794
|
+
resume(): this;
|
|
735
795
|
}
|
|
736
796
|
|
|
737
|
-
/** Utility
|
|
797
|
+
/** Utility for measuring and caching browser scrollbar width. @keywords scrollbar width measurement scroll */
|
|
738
798
|
export declare class ScrollbarWidth {
|
|
739
|
-
/** Checks whether scrollbar hiding should be enabled. @keywords scrollbar
|
|
799
|
+
/** Checks whether scrollbar hiding should be enabled. @keywords scrollbar check hide enabled */
|
|
740
800
|
static is(): Promise<boolean>;
|
|
741
|
-
/**
|
|
801
|
+
/** Gets the scrollbar width in pixels. @keywords scrollbar width size pixels measure */
|
|
742
802
|
static get(): Promise<number>;
|
|
743
|
-
/** Returns the storage instance
|
|
803
|
+
/** Returns the storage instance caching the scrollbar width. @keywords scrollbar storage cache */
|
|
744
804
|
static getStorage(): DataStorage<number>;
|
|
745
|
-
/** Checks if scrollbar width calculation is currently in progress. @keywords scrollbar
|
|
805
|
+
/** Checks if scrollbar width calculation is currently in progress. @keywords scrollbar calculate status flag */
|
|
746
806
|
static getCalculate(): boolean;
|
|
747
807
|
}
|
|
748
808
|
|
|
749
|
-
/** Manages searchable lists, coordinating options, item state, matching
|
|
809
|
+
/** Manages searchable lists, coordinating options, item state, matching, and data storage. @keywords search list, filter, match coordinator */
|
|
750
810
|
export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
|
|
751
|
-
/**
|
|
811
|
+
/** Creates a new SearchList instance. @keywords initialize, search list, constructor */
|
|
752
812
|
constructor(list: SearchListValue<T>, columns?: K, value?: string, options?: SearchOptions);
|
|
753
|
-
/**
|
|
754
|
-
getData(): SearchListData<T, K>;
|
|
755
|
-
/** Gets the current list of items. @keywords list, items, search list */
|
|
756
|
-
getList(): SearchListValue<T>;
|
|
757
|
-
/** Gets the active search columns. @keywords columns, fields, search columns */
|
|
813
|
+
/** Retrieves the configured search columns. @keywords get columns, search fields */
|
|
758
814
|
getColumns(): K | undefined;
|
|
759
|
-
/**
|
|
815
|
+
/** Retrieves the search data manager instance. @keywords get data, data manager */
|
|
816
|
+
getData(): SearchListData<T, K>;
|
|
817
|
+
/** Retrieves the search item manager instance. @keywords get item, item state */
|
|
760
818
|
getItem(): SearchListItem;
|
|
761
|
-
/**
|
|
762
|
-
|
|
763
|
-
/**
|
|
819
|
+
/** Retrieves the current list of items. @keywords get list, source items */
|
|
820
|
+
getList(): SearchListValue<T>;
|
|
821
|
+
/** Retrieves the search options instance. @keywords get options, search configuration */
|
|
764
822
|
getOptions(): SearchListOptions;
|
|
765
|
-
/**
|
|
766
|
-
|
|
767
|
-
/** Sets
|
|
823
|
+
/** Retrieves the active search query string. @keywords get value, search query */
|
|
824
|
+
getValue(): string | undefined;
|
|
825
|
+
/** Sets search columns and invalidates the cache. @keywords set columns, search fields */
|
|
768
826
|
setColumns(columns?: K): this;
|
|
769
|
-
/** Sets
|
|
770
|
-
|
|
771
|
-
/** Sets search options and updates the matcher. @keywords set options,
|
|
827
|
+
/** Sets a new list of items and invalidates the cache. @keywords set list, update items */
|
|
828
|
+
setList(list: SearchListValue<T>): this;
|
|
829
|
+
/** Sets search options and updates the matcher. @keywords set options, configure */
|
|
772
830
|
setOptions(options: SearchOptions): this;
|
|
773
|
-
/**
|
|
831
|
+
/** Sets a new search query and updates the matcher. @keywords set value, query filter */
|
|
832
|
+
setValue(value?: string): this;
|
|
833
|
+
/** Processes and returns the formatted list based on current search criteria. @keywords format, search results, execute */
|
|
774
834
|
to(): SearchFormatList<T, K>;
|
|
775
835
|
}
|
|
776
836
|
|
|
777
|
-
type ServerStorageItem = {
|
|
778
|
-
value:
|
|
837
|
+
export type ServerStorageItem = {
|
|
838
|
+
value: unknown;
|
|
779
839
|
hydration: boolean;
|
|
780
840
|
};
|
|
781
|
-
type ServerStorageList = Record<string, ServerStorageItem>;
|
|
782
|
-
/** Manages isolated data storage
|
|
841
|
+
export type ServerStorageList = Record<string, ServerStorageItem>;
|
|
842
|
+
/** Manages request-isolated data storage and client hydration during SSR. @keywords ssr, storage, hydration, context */
|
|
783
843
|
export declare class ServerStorage {
|
|
784
|
-
/**
|
|
785
|
-
static init(listener: () => Record<string, any> | undefined): typeof ServerStorage;
|
|
786
|
-
/** Resets the storage state. @keywords reset, clear */
|
|
787
|
-
static reset(): void;
|
|
788
|
-
/** Checks if a value exists in storage by key. @keywords has, exists, key */
|
|
844
|
+
/** Checks whether a key exists in storage. @keywords has, exists, check */
|
|
789
845
|
static has(key: string): boolean;
|
|
790
|
-
/** Retrieves a value or
|
|
791
|
-
static get<T =
|
|
792
|
-
/**
|
|
793
|
-
static set<T =
|
|
794
|
-
/** Sets
|
|
846
|
+
/** Retrieves a value from storage or initializes it with a fallback. @keywords get, read, default, hydration */
|
|
847
|
+
static get<T = unknown>(key: string, defaultValue?: (() => T) | T, hydration?: boolean): T;
|
|
848
|
+
/** Saves a value to storage with optional client hydration flag. @keywords set, store, write, hydration */
|
|
849
|
+
static set<T = unknown>(key: string, value: (() => T) | T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
850
|
+
/** Sets the visibility of error messages. @keywords error, status, logging */
|
|
795
851
|
static setErrorStatus(hide: boolean): void;
|
|
796
|
-
/** Removes a value from storage
|
|
852
|
+
/** Removes a key and its value from storage. @keywords remove, delete, purge */
|
|
797
853
|
static remove(key: string): void;
|
|
798
|
-
/**
|
|
854
|
+
/** Resets the storage state. @keywords reset, clear, flush */
|
|
855
|
+
static reset(): void;
|
|
856
|
+
/** Initializes storage with a per-request context provider. @keywords init, setup, context, listener */
|
|
857
|
+
static init(listener: () => Record<string, unknown> | undefined): typeof ServerStorage;
|
|
858
|
+
/** Serializes hydratable storage state into a script string. @keywords toString, serialize, hydration, script */
|
|
799
859
|
static toString(): string;
|
|
800
860
|
}
|
|
801
|
-
export {};
|
|
802
861
|
|
|
803
|
-
/** Manages storage callback lists and execution state. @keywords storage
|
|
804
|
-
export declare class StorageCallback<T =
|
|
805
|
-
/**
|
|
806
|
-
static getInstance<T>(name: string, group?: string): StorageCallback<T, (value: T) => void | Promise<void>>;
|
|
807
|
-
/** Initializes a new StorageCallback instance. @keywords constructor init */
|
|
862
|
+
/** Manages storage callback lists and execution state. @keywords storage, callbacks, listeners */
|
|
863
|
+
export declare class StorageCallback<T = unknown, Callback = (value: T) => void | Promise<void>> {
|
|
864
|
+
/** Initializes a storage callback manager. @keywords constructor, init */
|
|
808
865
|
constructor(name: string, group?: string);
|
|
809
|
-
/** Checks whether storage
|
|
866
|
+
/** Checks whether callbacks or storage are currently loading. @keywords loading, state, status */
|
|
810
867
|
isLoading(): boolean;
|
|
811
|
-
/**
|
|
812
|
-
|
|
813
|
-
/**
|
|
868
|
+
/** Returns or creates an instance by storage name and group. @keywords singleton, instance, lookup */
|
|
869
|
+
static getInstance<T>(name: string, group?: string): StorageCallback<T>;
|
|
870
|
+
/** Returns the current loading state. @keywords loading, state */
|
|
814
871
|
getLoading(): boolean;
|
|
815
|
-
/**
|
|
872
|
+
/** Returns the storage name identifier. @keywords name, identifier */
|
|
873
|
+
getName(): string;
|
|
874
|
+
/** Registers a callback listener to the list. @keywords add, listener, callback, subscribe */
|
|
816
875
|
addCallback(callback: Callback, isOnce?: boolean): this;
|
|
817
|
-
/**
|
|
876
|
+
/** Removes a callback listener from the list. @keywords remove, unsubscribe, callback */
|
|
818
877
|
removeCallback(callback: Callback): this;
|
|
819
|
-
/** Prepares
|
|
878
|
+
/** Prepares state and data before execution. @keywords prepare, setup, init */
|
|
820
879
|
preparation(): this;
|
|
821
|
-
/** Executes all registered callbacks
|
|
880
|
+
/** Executes all registered callbacks with the provided storage value. @keywords run, execute, notify, trigger */
|
|
822
881
|
run(value: T): Promise<this>;
|
|
823
882
|
}
|
|
824
883
|
|
|
825
|
-
/**
|
|
884
|
+
/** Global translation manager for retrieving and configuring localized text. @keywords translate, i18n, localization, l10n */
|
|
826
885
|
export declare class Translate {
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
886
|
+
/** Retrieves translated text asynchronously by code with optional replacements. @keywords get, translate, async, i18n */
|
|
887
|
+
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
888
|
+
/** Returns the global singleton instance of TranslateInstance. @keywords getItem, instance, singleton */
|
|
889
|
+
static getItem(): TranslateInstance;
|
|
890
|
+
/** Retrieves multiple translations asynchronously by an array of text codes. @keywords getList, batch, translate, async */
|
|
891
|
+
static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
892
|
+
/** Retrieves multiple translations synchronously by an array of text codes. @keywords getListSync, batch, translate, sync */
|
|
893
|
+
static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
894
|
+
/** Retrieves translated text synchronously by code with optional replacements. @keywords getSync, translate, sync */
|
|
895
|
+
static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
896
|
+
/** Sets global configuration for the translation service. @keywords setConfig, config, setup */
|
|
897
|
+
static setConfig(config: TranslateConfig): void;
|
|
898
|
+
/** Changes the property name used to retrieve translations. @keywords setPropsName, property, configuration */
|
|
899
|
+
static setPropsName(name: string): void;
|
|
900
|
+
/** Changes the API read mode for translations. @keywords setReadApi, api, mode */
|
|
901
|
+
static setReadApi(value: boolean): void;
|
|
902
|
+
/** Changes the URL path to the script for fetching translations. @keywords setUrl, endpoint, api */
|
|
903
|
+
static setUrl(url: string): void;
|
|
904
|
+
/** Registers a list of translation codes to be loaded. @keywords add, load, translations */
|
|
905
|
+
static add(names: string | string[]): Promise<void>;
|
|
906
|
+
/** Adds translation key-value pairs via request or directly depending on environment. @keywords addNormalOrSync, register, translations */
|
|
907
|
+
static addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
908
|
+
/** Adds translation key-value pairs synchronously into memory. @keywords addSync, register, sync */
|
|
909
|
+
static addSync(data: Record<string, string>): void;
|
|
910
|
+
/** Adds translations synchronously from a file data object. @keywords addSyncByFile, file, import */
|
|
911
|
+
static addSyncByFile(data: TranslateDataFile): void;
|
|
912
|
+
/** Adds translations grouped by location synchronously. @keywords addSyncByLocation, location, locale */
|
|
913
|
+
static addSyncByLocation(data: Record<string, Record<string, string>>): void;
|
|
855
914
|
}
|
|
856
915
|
|
|
857
|
-
/** Isomorphic utility class for URL parsing, manipulation, and
|
|
916
|
+
/** Isomorphic utility class for URL parsing, manipulation, and serialization @keywords url, parser, route, query */
|
|
858
917
|
export declare class UrlItem {
|
|
859
|
-
/**
|
|
860
|
-
static getInstance(): UrlItem;
|
|
861
|
-
/** Constructs a new UrlItem instance. @param url URL string or URL object @keywords constructor, create, init */
|
|
918
|
+
/** Creates a new UrlItem instance @keywords constructor, url, create */
|
|
862
919
|
constructor(url?: string | URL);
|
|
863
|
-
/**
|
|
920
|
+
/** Gets the serialized full URL string @keywords href, url, address */
|
|
864
921
|
get href(): string;
|
|
865
|
-
/**
|
|
922
|
+
/** Gets the protocol scheme including the trailing colon @keywords protocol, scheme, http, https */
|
|
866
923
|
get protocol(): string;
|
|
867
|
-
/**
|
|
924
|
+
/** Gets the username specified before the domain name @keywords username, auth, credentials */
|
|
868
925
|
get username(): string;
|
|
869
|
-
/**
|
|
926
|
+
/** Gets the password specified before the domain name @keywords password, auth, credentials */
|
|
870
927
|
get password(): string;
|
|
871
|
-
/**
|
|
928
|
+
/** Gets the host including hostname and port @keywords host, domain, port */
|
|
872
929
|
get host(): string;
|
|
873
|
-
/**
|
|
930
|
+
/** Gets the domain name or IP without the port @keywords hostname, domain */
|
|
874
931
|
get hostname(): string;
|
|
875
|
-
/**
|
|
932
|
+
/** Gets the port number portion of the URL @keywords port, network */
|
|
876
933
|
get port(): string;
|
|
877
|
-
/**
|
|
878
|
-
get pathname(): string;
|
|
879
|
-
/** Query string including leading question mark. @keywords search, querystring, query */
|
|
934
|
+
/** Gets the resource pathname @keywords pathname, path, route */
|
|
880
935
|
get search(): string;
|
|
881
|
-
/**
|
|
936
|
+
/** Gets the search query string including the leading question mark @keywords search, query, params */
|
|
937
|
+
get pathname(): string;
|
|
938
|
+
/** Gets the URLSearchParams object representing search parameters @keywords searchParams, query, urlsearchparams */
|
|
882
939
|
get searchParams(): URLSearchParams;
|
|
883
|
-
/**
|
|
940
|
+
/** Gets the fragment identifier hash string including the leading hash symbol @keywords hash, fragment, anchor */
|
|
884
941
|
get hash(): string;
|
|
885
|
-
/**
|
|
942
|
+
/** Gets the serialized origin of the URL @keywords origin, domain, protocol */
|
|
886
943
|
get origin(): string;
|
|
887
|
-
/**
|
|
944
|
+
/** Updates the internal URL value @keywords set, update, parse */
|
|
945
|
+
set(url?: string | URL): this;
|
|
946
|
+
/** Checks whether the specified query parameter exists @keywords hasParam, query, contains, exists */
|
|
888
947
|
hasParam(name: string): boolean;
|
|
889
|
-
/** Gets
|
|
948
|
+
/** Gets a request-isolated instance of UrlItem @keywords getInstance, singleton, request */
|
|
949
|
+
static getInstance(): UrlItem;
|
|
950
|
+
/** Gets the value of a specific query parameter @keywords getParam, query, search */
|
|
890
951
|
getParam(name: string): string | undefined;
|
|
891
|
-
/**
|
|
892
|
-
getParams(): Record<string,
|
|
893
|
-
/**
|
|
894
|
-
set(url?: string | URL): this;
|
|
895
|
-
/** Sets or updates the value of a query parameter. @param name Parameter name @param value Parameter value @keywords setParam, query, update */
|
|
952
|
+
/** Gets all query parameters as an object with converted types @keywords getParams, query, dictionary */
|
|
953
|
+
getParams(): Record<string, unknown>;
|
|
954
|
+
/** Sets the value of a query parameter @keywords setParam, query, search */
|
|
896
955
|
setParam(name: string, value: string): this;
|
|
897
|
-
/** Replaces all query parameters with
|
|
898
|
-
setParams(params: Record<string,
|
|
899
|
-
/**
|
|
956
|
+
/** Replaces all query parameters with values from the specified object @keywords setParams, query, batch */
|
|
957
|
+
setParams(params: Record<string, unknown>): this;
|
|
958
|
+
/** Removes a query parameter by name @keywords deleteParam, query, remove */
|
|
900
959
|
deleteParam(name: string): this;
|
|
901
|
-
/**
|
|
960
|
+
/** Converts the URL instance to its full string representation @keywords toString, stringify, serialize */
|
|
902
961
|
toString(): string;
|
|
903
|
-
/**
|
|
962
|
+
/** Converts the URL instance to its JSON string representation @keywords toJSON, json, serialize */
|
|
904
963
|
toJSON(): string;
|
|
905
964
|
}
|
|
906
965
|
|
|
907
|
-
|
|
908
|
-
|
|
966
|
+
export interface AddTagHighlightMatchOptions {
|
|
967
|
+
className?: string;
|
|
968
|
+
shouldEscape?: boolean;
|
|
969
|
+
shouldRemoveTag?: boolean;
|
|
970
|
+
}
|
|
971
|
+
/** Wraps matched substrings in an HTML tag for visual search highlighting. @keywords highlight, search, match, tag, mark, html */
|
|
972
|
+
export declare function addTagHighlightMatch(value?: string | number | null, search?: string | RegExp, options?: AddTagHighlightMatchOptions): string;
|
|
909
973
|
|
|
910
|
-
|
|
911
|
-
|
|
974
|
+
export interface AnyToStringOptions {
|
|
975
|
+
isArrayString?: boolean;
|
|
976
|
+
isBooleanString?: boolean;
|
|
977
|
+
trim?: boolean;
|
|
978
|
+
}
|
|
912
979
|
|
|
913
|
-
/**
|
|
914
|
-
|
|
980
|
+
/**
|
|
981
|
+
* Safely converts any value to a string with configurable array, boolean, and trimming rules.
|
|
982
|
+
* @keywords any to string, convert, cast, serialize, stringify
|
|
983
|
+
* @example
|
|
984
|
+
* anyToString(' Hello ') // => 'Hello'
|
|
985
|
+
* anyToString(' Hello ', { trim: false }) // => ' Hello '
|
|
986
|
+
* anyToString([1, 2, 3]) // => '1,2,3'
|
|
987
|
+
* anyToString([1, 2, 3], { isArrayString: false }) // => '[1,2,3]'
|
|
988
|
+
* anyToString({ a: 1 }) // => '{"a":1}'
|
|
989
|
+
* anyToString(true) // => '1'
|
|
990
|
+
* anyToString(false) // => '0'
|
|
991
|
+
* anyToString(true, { isBooleanString: true }) // => 'true'
|
|
992
|
+
* anyToString(false, { isBooleanString: true }) // => 'false'
|
|
993
|
+
* anyToString(null) // => ''
|
|
994
|
+
*/
|
|
995
|
+
export declare function anyToString<V = unknown>(value?: V, options?: AnyToStringOptions): string;
|
|
996
|
+
|
|
997
|
+
/** Replaces template placeholders in text with values from an object or array. @keywords template, replace, interpolate, string format, placeholders */
|
|
998
|
+
export declare function applyTemplate(text: unknown, replacement?: Record<string, unknown> | readonly unknown[]): string;
|
|
915
999
|
|
|
916
1000
|
/** Creates an array of specified length filled with the given value. @keywords array, fill, repeat, populate, initialize */
|
|
917
1001
|
export declare function arrFill<T>(value: T, count: number): T[];
|
|
918
1002
|
|
|
919
|
-
/** Converts a Blob to a Base64 string, optionally
|
|
920
|
-
export declare function blobToBase64(blob
|
|
1003
|
+
/** Converts a Blob to a Base64 string, optionally removing the data URL prefix. @keywords blob, base64, convert, data url, file, encode */
|
|
1004
|
+
export declare function blobToBase64(blob?: Blob | null, clean?: boolean): Promise<string | undefined>;
|
|
921
1005
|
|
|
922
1006
|
/** Capitalizes the first letter of a string. @keywords capitalize, uppercase, first letter, string */
|
|
923
|
-
export declare function capitalize(value
|
|
1007
|
+
export declare function capitalize<T = string>(value?: T, locale?: boolean | string): T extends string ? Capitalize<T> : string;
|
|
924
1008
|
|
|
925
|
-
/** Creates a deep copy of an object to prevent
|
|
1009
|
+
/** Creates a deep copy of an object to prevent unintended mutations. @keywords deep copy clone duplicate object */
|
|
926
1010
|
export declare function copyObject<T>(value: T): T;
|
|
927
1011
|
|
|
928
|
-
/**
|
|
929
|
-
export declare function copyObjectLite<T, R = T>(value
|
|
1012
|
+
/** Creates a shallow copy of an object with optional additional properties. @keywords copy, clone, shallow copy, object lite, merge */
|
|
1013
|
+
export declare function copyObjectLite<T = Record<PropertyKey, unknown>, R = T>(value?: T | null, source?: Record<PropertyKey, unknown> | null): R;
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Creates an HTML element, configures attributes or runs a modifier callback, and optionally appends it to a parent node.
|
|
1017
|
+
* @remarks Returns `undefined` during SSR. Uses `document.createElement`; use `document.createElementNS` for SVG/MathML. Sanitize input when providing `innerHTML` through options.
|
|
1018
|
+
* @keywords createElement, dom, html, create element, insert node
|
|
1019
|
+
*/
|
|
1020
|
+
export declare function createElement<T extends HTMLElement = HTMLDivElement>(parentElement?: Element | DocumentFragment | null, tagName?: string, options?: Partial<T> | Record<string, unknown> | ((element: T) => void) | null, referenceElement?: Node | null): T | undefined;
|
|
930
1021
|
|
|
931
1022
|
/**
|
|
932
|
-
*
|
|
933
|
-
* @remarks
|
|
934
|
-
* @keywords
|
|
1023
|
+
* Executes a callback when DOMContentLoaded fires, or immediately if the DOM is already loaded.
|
|
1024
|
+
* @remarks In non-DOM environments (SSR), execution can be disabled by passing `isServer: false`.
|
|
1025
|
+
* @keywords dom, ready, domContentLoaded, ssr, readyState, event
|
|
935
1026
|
*/
|
|
936
|
-
export declare function
|
|
1027
|
+
export declare function domContentLoaded<T = void>(callback?: (() => T | Promise<T>) | null, isServer?: boolean): Promise<T>;
|
|
937
1028
|
|
|
938
|
-
/**
|
|
939
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* Returns an array of all elements at the specified coordinates.
|
|
1031
|
+
* @remarks In non-DOM (SSR) environments or when `document.elementsFromPoint` is unsupported, the function returns an empty array `[]`. Coordinates are evaluated relative to the viewport.
|
|
1032
|
+
* @keywords dom, elementsFromPoint, hit test, coordinates, viewport elements
|
|
1033
|
+
*/
|
|
1034
|
+
export declare function domElementsFromPoint(coordinator?: ImageCoordinator | null): Element[];
|
|
940
1035
|
|
|
941
|
-
/** Selects the first element matching specified
|
|
1036
|
+
/** Selects the first element matching the specified selectors. @keywords dom, querySelector, find element */
|
|
942
1037
|
export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
|
|
943
1038
|
|
|
944
|
-
/** Selects all elements matching the specified selectors. @keywords dom, querySelectorAll,
|
|
1039
|
+
/** Selects all DOM elements matching the specified selectors. @keywords dom, querySelectorAll, selector, query, elements */
|
|
945
1040
|
export declare function domQuerySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E> | undefined;
|
|
946
1041
|
|
|
947
|
-
/**
|
|
948
|
-
|
|
1042
|
+
/**
|
|
1043
|
+
* Encodes special characters for safe use in HTML attributes.
|
|
1044
|
+
* @keywords html, attribute, encode, escape, sanitize
|
|
1045
|
+
* @example
|
|
1046
|
+
*
|
|
1047
|
+
* encodeAttribute('<div class="box">') // => '<div class="box">'
|
|
1048
|
+
* encodeAttribute(undefined) // => ''
|
|
1049
|
+
*
|
|
1050
|
+
*/
|
|
1051
|
+
export declare function encodeAttribute(text?: string | number | null): string;
|
|
949
1052
|
|
|
950
|
-
/**
|
|
951
|
-
|
|
1053
|
+
/**
|
|
1054
|
+
* Encodes basic HTML special characters (<, >, &) while preserving quotes.
|
|
1055
|
+
* @keywords html encode, escape html, lite attribute, html entities, title encode
|
|
1056
|
+
* @example
|
|
1057
|
+
* encodeLiteAttribute('Tom & Jerry') // => 'Tom & Jerry'
|
|
1058
|
+
* encodeLiteAttribute('<title> "Hello" </title>') // => '<title> "Hello" </title>'
|
|
1059
|
+
* encodeLiteAttribute(undefined) // => ''
|
|
1060
|
+
* @remarks Does NOT encode quotes (" and '). For untrusted input inside HTML attributes, use `encodeAttribute`.
|
|
1061
|
+
*/
|
|
1062
|
+
export declare function encodeLiteAttribute(text?: string | number | null): string;
|
|
952
1063
|
|
|
953
|
-
/** Resizes an image if it exceeds the maximum size, returning base64 data. @keywords
|
|
1064
|
+
/** Resizes an image if it exceeds the maximum size, returning base64 encoded data. @keywords resize, compress, image, max size, base64 */
|
|
954
1065
|
export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
|
|
955
1066
|
|
|
956
|
-
/** Escapes special regex characters in a string for safe
|
|
957
|
-
export declare function escapeExp(value
|
|
1067
|
+
/** Escapes special regex characters in a string or number for safe RegExp usage. @keywords escape, regex, regexp, sanitize, pattern */
|
|
1068
|
+
export declare function escapeExp(value?: string | number | null): string;
|
|
958
1069
|
|
|
959
|
-
/**
|
|
1070
|
+
/** Stops event propagation in the DOM tree. @keywords event, stopPropagation, prevent bubbling */
|
|
960
1071
|
export declare function eventStopPropagation(event: Event): void;
|
|
961
1072
|
|
|
962
|
-
/** Executes callback with
|
|
963
|
-
export declare function executeFunction<T>(callback: T | FunctionArgs<
|
|
1073
|
+
/** Executes a callback with arguments if callable, or returns the value as is. @keywords execute, invoke, call, callback, function or value */
|
|
1074
|
+
export declare function executeFunction<T, Args extends unknown[] = unknown[]>(callback: T | FunctionArgs<never, T> | ((...args: Args) => T), ...args: Args): T;
|
|
1075
|
+
|
|
1076
|
+
/** Safely executes a function, promise, or static value and awaits its resolution. @keywords execute promise, async executor, run promise, safe call */
|
|
1077
|
+
export declare function executePromise<T, Args extends unknown[] = unknown[]>(callback: ((...args: Args) => PromiseLike<T> | T) | PromiseLike<T> | T, ...args: Args): Promise<Awaited<T>>;
|
|
964
1078
|
|
|
965
|
-
|
|
966
|
-
export
|
|
1079
|
+
export type ForEachData<T = any> = readonly T[] | Record<PropertyKey, T> | Map<unknown, T> | Set<T> | object;
|
|
1080
|
+
export type ForEachItem<D> = D extends readonly (infer T)[] ? T : D extends Set<infer S> ? S : D extends Map<unknown, infer V> ? V : D extends object ? D[keyof D] : unknown;
|
|
1081
|
+
export type ForEachKey<D> = D extends readonly unknown[] ? number : D extends Set<infer S> ? S : D extends Map<infer K, unknown> ? K : string;
|
|
1082
|
+
export type ForEachReturn<R, S extends boolean = false> = (S extends true ? R : Exclude<R, undefined>)[];
|
|
1083
|
+
/** Iterates over collection items (Array, Object, Map, Set) executing a callback and returning mapped results, omitting undefined unless specified. @keywords foreach, iterate, map, collection, array, object, set */
|
|
1084
|
+
export declare function forEach<T = any, R = any, D extends ForEachData<T> = ForEachData<T>, K = ForEachKey<D>, S extends boolean = false>(data: D, callback: (item: D extends object ? ForEachItem<D> : T, key: K, collection: D) => R, saveUndefined?: S): ForEachReturn<R, S>;
|
|
967
1085
|
|
|
968
|
-
/** Iterates over
|
|
969
|
-
export declare function
|
|
1086
|
+
/** Iterates over own enumerable object properties safely skipping prototype pollution keys, supporting early exit when false is returned. @keywords forOwn, iterate, loop, object, enumerable, prototype pollution */
|
|
1087
|
+
export declare function forOwn<T extends object = Record<string, unknown>, K extends Extract<keyof T, string> = Extract<keyof T, string>>(data?: T, callback?: (value: T[K], key: K, collection: T) => void | boolean): void;
|
|
970
1088
|
|
|
971
|
-
/** Cyclically
|
|
972
|
-
export declare function frame(callback: () => void, next?: () => boolean, end?: () => void): void;
|
|
1089
|
+
/** Cyclically calls requestAnimationFrame while the next predicate returns true. @keywords requestAnimationFrame animation loop frame ticker */
|
|
1090
|
+
export declare function frame(callback: (timestamp: DOMHighResTimeStamp) => void, next?: (timestamp: DOMHighResTimeStamp) => boolean, end?: () => void): void;
|
|
973
1091
|
|
|
974
|
-
/** Splits a string into segments
|
|
1092
|
+
/** Splits a string into an array of text segments highlighting search matches. @keywords highlight match, string split, text search, regex */
|
|
975
1093
|
export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
|
|
976
1094
|
|
|
977
|
-
/**
|
|
1095
|
+
/** Gets a key-value record of attributes for an element. @keywords attributes, dom, element, element attributes */
|
|
978
1096
|
export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
|
|
979
1097
|
|
|
980
|
-
/** Retrieves
|
|
1098
|
+
/** Retrieves string data from the clipboard event or returns an empty string. @keywords clipboard, paste, copy, read, getClipboardData */
|
|
981
1099
|
export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
|
|
982
1100
|
|
|
983
1101
|
/** Extracts an array of values for a specific property or column from an array of objects. @keywords column, pluck, extract, values, property */
|
|
@@ -997,71 +1115,81 @@ export declare function getCurrentDate(format?: GeoDate): string;
|
|
|
997
1115
|
*/
|
|
998
1116
|
export declare function getCurrentTime(): number;
|
|
999
1117
|
|
|
1000
|
-
/**
|
|
1001
|
-
export declare function getElement<E extends ElementOrWindow, R extends
|
|
1118
|
+
/** Resolves a selector string, Element, or Window to a DOM element (or document.body for Window). @keywords element, querySelector, getElement, resolve, dom, window, ssr */
|
|
1119
|
+
export declare function getElement<E extends ElementOrWindow = HTMLElement, R extends ElementResolved<E> = ElementResolved<E>>(element?: ElementOrString<E> | null): R | undefined;
|
|
1002
1120
|
|
|
1003
|
-
/** Returns
|
|
1121
|
+
/** Returns or generates a unique element ID, targeting document.body if Window is provided. @keywords element id, get id, generate id, dom id */
|
|
1004
1122
|
export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
|
|
1005
1123
|
/**
|
|
1006
|
-
* Initializes the
|
|
1124
|
+
* Initializes the getElementId function with a context ID provider.
|
|
1007
1125
|
* @warning Initialization is mandatory for correct functioning of SSR on both server and client sides.
|
|
1008
1126
|
* @example
|
|
1009
|
-
*
|
|
1127
|
+
*
|
|
1010
1128
|
* import { useId } from 'vue'
|
|
1011
1129
|
* import { initGetElementId } from '@dxtmisha/functional-basic'
|
|
1012
1130
|
*
|
|
1013
1131
|
* initGetElementId(() => useId())
|
|
1014
|
-
*
|
|
1015
|
-
* @keywords init id, ssr id
|
|
1132
|
+
*
|
|
1133
|
+
* @keywords init element id, ssr id provider, listener setup
|
|
1016
1134
|
*/
|
|
1017
1135
|
export declare function initGetElementId(newListener: () => string | number): void;
|
|
1136
|
+
/** Resets the getElementId listener. @keywords reset element id, clear id listener */
|
|
1137
|
+
export declare function resetGetElementId(): void;
|
|
1018
1138
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1139
|
+
export type GetElementImageCallback = (image: HTMLImageElement, event?: Event | string) => void;
|
|
1140
|
+
/**
|
|
1141
|
+
* Resolves or creates an HTMLImageElement from an existing element or URL string.
|
|
1142
|
+
* @remarks
|
|
1143
|
+
* If `image` is a string, a new `HTMLImageElement` is created with load and error callbacks attached before assigning `src`.
|
|
1144
|
+
* If already an `HTMLImageElement`, it is returned directly. Returns `undefined` for null, undefined, or in SSR environments.
|
|
1145
|
+
* Created elements are not attached to the DOM tree.
|
|
1146
|
+
* @keywords image, HTMLImageElement, load image, image loader, create element, DOM
|
|
1147
|
+
*/
|
|
1148
|
+
export declare function getElementImage(image?: HTMLImageElement | string | null, onload?: GetElementImageCallback, onerror?: GetElementImageCallback): HTMLImageElement | undefined;
|
|
1021
1149
|
|
|
1022
|
-
/** Retrieves an element property
|
|
1023
|
-
export declare function getElementItem<
|
|
1150
|
+
/** Retrieves an element property by key, resolving to document.body for Window instances, or returning a default value. @keywords element property get value dom window document */
|
|
1151
|
+
export declare function getElementItem<E extends ElementOrWindow = HTMLElement, K extends keyof ElementResolved<E> = keyof ElementResolved<E>, D = undefined>(element?: ElementOrString<E> | null, property?: K | string | number, defaultValue?: D): ElementResolved<E>[K] | D;
|
|
1024
1152
|
|
|
1025
|
-
/**
|
|
1026
|
-
export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
|
|
1153
|
+
/** Resolves the specified selector or element, returning the Element or preserving the Window object directly. @keywords dom, window, element, selector, querySelector, getElementOrWindow */
|
|
1154
|
+
export declare function getElementOrWindow<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null): E | undefined;
|
|
1027
1155
|
|
|
1028
|
-
/** Generates a safe script tag
|
|
1029
|
-
export declare function getElementSafeScript(id: string, data
|
|
1156
|
+
/** Generates a safe HTML script tag containing serialized data for client hydration. @keywords safe script, hydration, state transfer, serialization, html */
|
|
1157
|
+
export declare function getElementSafeScript<T = unknown>(id: string | number, data?: T): string;
|
|
1030
1158
|
|
|
1031
1159
|
/** Creates a case-insensitive regular expression for an exact match of a phrase without anchors. @keywords regex, regular expression, exact match, search pattern */
|
|
1032
1160
|
export declare function getExactSearchExp(search: string): RegExp;
|
|
1033
1161
|
|
|
1034
|
-
/** Creates a RegExp object
|
|
1162
|
+
/** Creates a RegExp object with the escaped value substituted into the pattern. @keywords regex, regexp, pattern, match, escape */
|
|
1035
1163
|
export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
|
|
1036
1164
|
|
|
1037
|
-
/** Returns the first element of an array
|
|
1038
|
-
export declare function getFirst<T>(value
|
|
1165
|
+
/** Returns the first element of an array or object. @keywords first, head, element, array, object */
|
|
1166
|
+
export declare function getFirst<T = undefined>(value?: T | readonly T[] | Record<PropertyKey, T>): T;
|
|
1039
1167
|
|
|
1040
|
-
/** Retrieves and parses JSON hydration data from a
|
|
1041
|
-
export declare function getHydrationData<T>(id: string, defaultValue: T, remove?: boolean): T;
|
|
1168
|
+
/** Retrieves and parses JSON hydration data from a script element in the DOM. @keywords hydration, script tag, json parse, dom state */
|
|
1169
|
+
export declare function getHydrationData<T>(id: string | number, defaultValue: T, remove?: boolean): T;
|
|
1042
1170
|
|
|
1043
|
-
/**
|
|
1044
|
-
export declare function getImageSrc(image?: HTMLImageElement | string): string;
|
|
1171
|
+
/** Extracts the image source string from an HTMLImageElement, object with a src property, or string URL. @keywords image, src, url, source, extract */
|
|
1172
|
+
export declare function getImageSrc(image?: HTMLImageElement | Record<string, unknown> | string | null): string;
|
|
1045
1173
|
|
|
1046
|
-
/** Retrieves a nested value from an object by its path. @keywords get, path, nested
|
|
1047
|
-
export declare function getItemByPath<T extends Record<string,
|
|
1174
|
+
/** Retrieves a nested value from an object by its path. @keywords get by path, object path, nested property, deep get */
|
|
1175
|
+
export declare function getItemByPath<T extends Record<string, unknown>, R = string>(item: T, path: string): R | undefined;
|
|
1048
1176
|
|
|
1049
1177
|
/** Returns the pressed key from a keyboard event. @keywords keyboard, key, event, pressed key */
|
|
1050
1178
|
export declare function getKey(event: KeyboardEvent): string | number | undefined;
|
|
1051
1179
|
|
|
1052
|
-
/** Returns the last element of an array or object. @keywords last, tail, array, object */
|
|
1053
|
-
export declare function getLast<T>(value
|
|
1180
|
+
/** Returns the last element of an array or object. @keywords last, element, tail, array, object */
|
|
1181
|
+
export declare function getLast<T = undefined>(value?: T | readonly T[] | Record<PropertyKey, T>): T;
|
|
1054
1182
|
|
|
1055
|
-
/** Returns the length or size of
|
|
1056
|
-
export declare function getLength(value:
|
|
1183
|
+
/** Returns the length or size of arrays, objects, maps, sets, or strings, or 0 if unsupported or empty. @keywords length, size, count, collection, array, object, map, set, string */
|
|
1184
|
+
export declare function getLength(value: unknown): number;
|
|
1057
1185
|
|
|
1058
|
-
/** Returns the lengths of all string elements in an array or object. @keywords length,
|
|
1186
|
+
/** Returns the lengths of all string elements in an array or object. @keywords length, elements, string length, count */
|
|
1059
1187
|
export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
|
|
1060
1188
|
|
|
1061
1189
|
/** Finds the length of the longest string in an array or object. @keywords max length, longest string, array, object */
|
|
1062
1190
|
export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1063
1191
|
|
|
1064
|
-
/**
|
|
1192
|
+
/** Finds the shortest string in an array or object and returns its length. @keywords min length, shortest string, minimum, string length */
|
|
1065
1193
|
export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1066
1194
|
|
|
1067
1195
|
/** Retrieves the position of the mouse cursor or touch point from an event. @keywords mouse touch coordinates client position cursor */
|
|
@@ -1073,32 +1201,37 @@ export declare function getMouseClientX(event: MouseEvent | TouchEvent): number;
|
|
|
1073
1201
|
/** Returns the vertical client coordinate (Y) of a mouse or touch event. @keywords mouse, touch, clientY, cursor position, Y coordinate */
|
|
1074
1202
|
export declare function getMouseClientY(event: MouseEvent | TouchEvent): number;
|
|
1075
1203
|
|
|
1076
|
-
/** Creates a new object
|
|
1077
|
-
export declare function getObjectByKeys<T extends Record<string,
|
|
1204
|
+
/** Creates a new object composed of the picked keys from the source object. @keywords pick, subset, filter keys, extract */
|
|
1205
|
+
export declare function getObjectByKeys<T extends Record<string, unknown>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
|
|
1206
|
+
|
|
1207
|
+
/** Removes elements matching the exception value from an array and returns an indexed object. @keywords filter, omit, clean, undefined, array to object */
|
|
1208
|
+
export declare function getObjectNoUndefined<V>(data: readonly V[], exception?: unknown): Record<number, V>;
|
|
1209
|
+
/** Removes properties matching the exception value from an object. @keywords filter, omit, clean, undefined, compact */
|
|
1210
|
+
export declare function getObjectNoUndefined<T extends Record<PropertyKey, unknown>>(data: T, exception?: unknown): T;
|
|
1078
1211
|
|
|
1079
|
-
/**
|
|
1080
|
-
export declare function
|
|
1212
|
+
/** Creates a prototype-less object (`Object.create(null)`), optionally copying properties from the provided data. @keywords object create null prototype dictionary clean */
|
|
1213
|
+
export declare function getObjectNull<T = unknown>(data?: Record<string, T>): Record<string, T>;
|
|
1081
1214
|
|
|
1082
|
-
/** Returns the object if its values are
|
|
1083
|
-
export declare function getObjectOrNone<T>(value: T): T & Record<string,
|
|
1215
|
+
/** Returns the object if its values are set, or an empty object. @keywords object fallback empty validate */
|
|
1216
|
+
export declare function getObjectOrNone<T>(value: T): T & Record<string, unknown>;
|
|
1084
1217
|
|
|
1085
|
-
/**
|
|
1086
|
-
export declare function getOnlyText(text:
|
|
1218
|
+
/** Extracts only letters, numbers, and spaces from a value. @keywords sanitize, clean, alphanumeric, text, filter */
|
|
1219
|
+
export declare function getOnlyText(text: unknown): string;
|
|
1087
1220
|
|
|
1088
1221
|
/** Returns a random element from an array, object, or value, or undefined if empty. @keywords random, item, sample, choice, array, object */
|
|
1089
1222
|
export declare function getRandomItem<T>(value?: T | T[] | Record<string, T>): T | undefined;
|
|
1090
1223
|
|
|
1091
|
-
/** Generates random text with
|
|
1224
|
+
/** Generates random text with specified word count and length constraints. @keywords random, text, generator, words, string */
|
|
1092
1225
|
export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
|
|
1093
1226
|
|
|
1094
|
-
/** Serializes an object or array into a
|
|
1095
|
-
export declare function getRequestString(request: Record<string,
|
|
1227
|
+
/** Serializes an object or array into a key-value request string. @keywords request string, query string, serialize, key value, params */
|
|
1228
|
+
export declare function getRequestString(request: Record<string, unknown> | readonly unknown[], sign?: string, separator?: string, subKey?: string): string;
|
|
1096
1229
|
|
|
1097
|
-
/** Builds a case-insensitive RegExp matching strings containing all
|
|
1098
|
-
export declare function getSearchExp(search
|
|
1230
|
+
/** Builds a case-insensitive RegExp matching strings containing all specified words in any order. @keywords regex search query multi-word lookahead */
|
|
1231
|
+
export declare function getSearchExp(search?: unknown, limit?: number): RegExp;
|
|
1099
1232
|
|
|
1100
|
-
/** Creates a case-insensitive
|
|
1101
|
-
export declare function getSeparatingSearchExp(search
|
|
1233
|
+
/** Creates a case-insensitive, global word-separating search RegExp or clones an existing RegExp. @keywords search regexp regex query filter words */
|
|
1234
|
+
export declare function getSeparatingSearchExp(search?: unknown, limit?: number): RegExp;
|
|
1102
1235
|
|
|
1103
1236
|
/** Calculates the step value as a percentage within a min-max range. @keywords step, percent, range, slider, scale */
|
|
1104
1237
|
export declare function getStepPercent(min: number | undefined, max: number): number;
|
|
@@ -1106,183 +1239,280 @@ export declare function getStepPercent(min: number | undefined, max: number): nu
|
|
|
1106
1239
|
/** Calculates the step value unit relative to the given min and max range. @keywords step, step value, range, interval */
|
|
1107
1240
|
export declare function getStepValue(min: number | undefined, max: number): number;
|
|
1108
1241
|
|
|
1109
|
-
/**
|
|
1110
|
-
export declare function goScroll(
|
|
1242
|
+
/** Quickly scrolls a container element or selector to the specified target element with optional centering and indent offset. @keywords scroll, scrollTo, goScroll, container scroll, scroll into view */
|
|
1243
|
+
export declare function goScroll(target: string | HTMLElement, elementTo?: HTMLElement | null, elementCenter?: HTMLElement | null, indent?: number): void;
|
|
1111
1244
|
|
|
1112
|
-
/** Smoothly scrolls the viewport to
|
|
1113
|
-
export declare function goScrollSmooth
|
|
1245
|
+
/** Smoothly scrolls the viewport to a specified element with an optional top offset. @keywords smooth scroll, scroll to element, scrollIntoView, scroll offset */
|
|
1246
|
+
export declare function goScrollSmooth(element?: HTMLElement | Element | null, options?: ScrollIntoViewOptions, shift?: number): void;
|
|
1114
1247
|
|
|
1115
|
-
/** Scrolls
|
|
1116
|
-
export declare function goScrollTo(
|
|
1248
|
+
/** Scrolls a container to make the target element visible. @keywords scroll, scrollTo, container, element, view */
|
|
1249
|
+
export declare function goScrollTo(container?: HTMLElement | Element | null, elementTo?: HTMLElement | Element | null, behavior?: ScrollBehavior): void;
|
|
1117
1250
|
|
|
1118
1251
|
/** Invokes the native sharing mechanism via the Web Share API. @keywords share, web share api, navigator share, device share */
|
|
1119
1252
|
export declare function handleShare(data: ShareData): Promise<boolean>;
|
|
1120
1253
|
|
|
1254
|
+
/** Checks if an object has the specified own property. @keywords hasKey, hasOwnProperty, object, key, property check */
|
|
1255
|
+
export declare function hasKey<K extends PropertyKey = PropertyKey, T extends object = Record<K, unknown>>(object: unknown, key: K): object is T & Record<K, unknown>;
|
|
1256
|
+
|
|
1257
|
+
/** Checks whether an object has at least one own property. @keywords hasKeys, object, keys, own properties, not empty */
|
|
1258
|
+
export declare function hasKeys<T extends object = Record<PropertyKey, unknown>>(object: unknown): object is T;
|
|
1259
|
+
|
|
1121
1260
|
/** Checks if a value exists within the specified array. @keywords inArray, array, includes, contains, search */
|
|
1122
1261
|
export declare function inArray<T>(array: T[], value: T): boolean;
|
|
1123
1262
|
|
|
1124
1263
|
/** Initializes data for scrollbar offset and scroll control. @keywords scrollbar, offset, scroll control, initialize */
|
|
1125
1264
|
export declare function initScrollbarOffset(): Promise<void>;
|
|
1126
1265
|
|
|
1127
|
-
/** Computes the
|
|
1128
|
-
export declare function intersectKey<T
|
|
1266
|
+
/** Computes the intersection of two objects based on their keys. @keywords intersect, intersection, keys, pick, compare */
|
|
1267
|
+
export declare function intersectKey<T extends Record<PropertyKey, unknown>, C extends Record<PropertyKey, unknown>>(data?: T | null, comparison?: C | null): Pick<T, Extract<keyof T, keyof C>>;
|
|
1129
1268
|
|
|
1130
|
-
/** Checks if
|
|
1131
|
-
export declare
|
|
1269
|
+
/** Checks if the API response indicates success. @keywords api, response, success, status, check */
|
|
1270
|
+
export declare function isApiSuccess<T>(data?: ApiData<T>): boolean;
|
|
1132
1271
|
|
|
1133
|
-
/** Checks if a value is an array. @keywords isArray, array, type guard
|
|
1134
|
-
export declare function isArray<T
|
|
1272
|
+
/** Checks if a value is an array. @keywords isArray, array, type guard */
|
|
1273
|
+
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
|
1135
1274
|
|
|
1136
|
-
/** Checks if the values of two objects are different. @keywords compare,
|
|
1137
|
-
export declare function isDifferent<T>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
|
|
1275
|
+
/** Checks if the values of two objects are different. @keywords compare, diff, equality, object difference */
|
|
1276
|
+
export declare function isDifferent<T = unknown>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
|
|
1138
1277
|
|
|
1139
1278
|
/** Checks if the current environment is a data URL. @keywords isDomData, dom, data url, environment */
|
|
1140
1279
|
export declare function isDomData(): boolean;
|
|
1141
1280
|
|
|
1142
|
-
/** Checks
|
|
1281
|
+
/** Checks whether code is running in a browser environment with `window` available. @keywords dom, browser, runtime, window, client */
|
|
1143
1282
|
export declare function isDomRuntime(): boolean;
|
|
1144
1283
|
|
|
1145
|
-
/** Checks if an element is visible in the DOM and not hidden by CSS
|
|
1146
|
-
export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
|
|
1284
|
+
/** Checks if an element is visible in the DOM and not hidden by CSS. @keywords visibility, dom, is visible, element, hidden */
|
|
1285
|
+
export declare function isElementVisible<E extends ElementOrWindow = HTMLElement>(elementSelectors?: ElementOrString<E> | null): boolean;
|
|
1147
1286
|
|
|
1148
|
-
/** Checks if the pressed key is Enter or Space. @keywords enter
|
|
1149
|
-
export declare
|
|
1287
|
+
/** Checks if the pressed key is Enter or Space (WAI-ARIA action key) outside of text inputs. @keywords enter space wai-aria keyboard event */
|
|
1288
|
+
export declare function isEnter(event: KeyboardEvent, isInputElement?: boolean): boolean;
|
|
1150
1289
|
|
|
1151
|
-
/** Checks if a value is filled
|
|
1152
|
-
export declare function isFilled<T>(value
|
|
1290
|
+
/** Checks if a value is filled (not empty), optionally considering '0' as filled. @keywords isFilled, empty check, filled, validation */
|
|
1291
|
+
export declare function isFilled<T>(value?: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
|
|
1153
1292
|
|
|
1154
1293
|
/** Checks if the value is an integer or floating-point number. @keywords isFloat, float, number, numeric, check */
|
|
1155
|
-
export declare function isFloat(value:
|
|
1294
|
+
export declare function isFloat(value: unknown): boolean;
|
|
1156
1295
|
|
|
1157
|
-
/** Checks
|
|
1158
|
-
export declare function isFunction<T>(callback: T): callback is Extract<T,
|
|
1296
|
+
/** Checks whether a value is a function. @keywords isFunction, function check, type guard, predicate */
|
|
1297
|
+
export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionAnyType>;
|
|
1159
1298
|
|
|
1160
1299
|
/** Checks if an element or selector is attached to the DOM tree. @keywords dom, attached, is connected, element in dom, is in document */
|
|
1161
1300
|
export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
|
|
1162
1301
|
|
|
1163
|
-
/** Checks if
|
|
1164
|
-
export declare
|
|
1302
|
+
/** Checks if an element is an input field or editable. @keywords input, editable, form element, check, dom */
|
|
1303
|
+
export declare function isInput(element?: HTMLElement | EventTarget | null, includeDisabled?: boolean): element is HTMLElement;
|
|
1165
1304
|
|
|
1166
1305
|
/** Checks if a value is between integers relative to a rounding step. @keywords isIntegerBetween, integer, between, range, bounds */
|
|
1167
1306
|
export declare function isIntegerBetween(value: number, between: number): boolean;
|
|
1168
1307
|
|
|
1169
|
-
/** Checks if a keyboard event
|
|
1170
|
-
export declare
|
|
1308
|
+
/** Checks if a keyboard event contains active modifier or meta keys. @keywords meta key, modifier, keyboard event, ctrl, alt, shift, cmd */
|
|
1309
|
+
export declare function isMetaKey(event: KeyboardEvent): boolean;
|
|
1171
1310
|
|
|
1172
|
-
/** Checks if a value is null or undefined. @keywords isNull, isNil, null, undefined, check */
|
|
1311
|
+
/** Checks if a value is null or undefined. @keywords isNull, isNil, null, undefined, check, guard */
|
|
1173
1312
|
export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
|
|
1174
1313
|
|
|
1175
|
-
/** Checks if the value is a number. @keywords isNumber,
|
|
1176
|
-
export declare function isNumber(value
|
|
1314
|
+
/** Checks if the value is a number, numeric string, or bigint. @keywords isNumber, is numeric, check number, bigint, numeric string */
|
|
1315
|
+
export declare function isNumber(value?: unknown): value is number | string | bigint;
|
|
1177
1316
|
|
|
1178
|
-
/** Checks if a value is an object. @keywords isObject, object
|
|
1179
|
-
export declare function isObject<T>(value:
|
|
1317
|
+
/** Checks if a value is an object. @keywords isObject, object, type guard */
|
|
1318
|
+
export declare function isObject<T = unknown>(value: unknown): value is ObjectItem<T>;
|
|
1180
1319
|
|
|
1181
|
-
/** Checks if the value is an object and not an array. @keywords isObjectNotArray,
|
|
1182
|
-
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T,
|
|
1320
|
+
/** Checks if the value is an object and not an array. @keywords isObjectNotArray, object, not array, record, type guard */
|
|
1321
|
+
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, ObjectItem>, unknown[] | undefined | null>;
|
|
1183
1322
|
|
|
1184
1323
|
/** Check if the device is currently online. @keywords online, network, connectivity, internet */
|
|
1185
1324
|
export declare function isOnLine(): boolean;
|
|
1186
1325
|
|
|
1187
|
-
/** Checks if a
|
|
1188
|
-
export declare function
|
|
1326
|
+
/** Checks if a property key is a prototype pollution key (__proto__, constructor, prototype). @keywords prototype pollution, security, safe key, sanitize, proto, constructor */
|
|
1327
|
+
export declare function isPrototypeKey(key: unknown): boolean;
|
|
1328
|
+
|
|
1329
|
+
/** Checks if a value is a regular expression (including cross-realm instances). @keywords regex, regexp, regular expression, type guard */
|
|
1330
|
+
export declare function isRegExp(value: unknown): value is RegExp;
|
|
1189
1331
|
|
|
1190
|
-
/** Checks if
|
|
1332
|
+
/** Checks if a value matches a target or array of selected values with numeric equivalence support. @keywords isSelected, selection, match, compare */
|
|
1333
|
+
export declare function isSelected<T = unknown>(value?: T, selected?: unknown): boolean;
|
|
1334
|
+
|
|
1335
|
+
/** Checks if all specified values are selected. @keywords select, isSelected, selection, list, comparison */
|
|
1191
1336
|
export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
|
|
1192
1337
|
|
|
1193
1338
|
/** Checks if the Web Share API is supported in the current environment. @keywords web share, navigator.share, share api, support check */
|
|
1194
1339
|
export declare function isShare(): boolean;
|
|
1195
1340
|
|
|
1196
|
-
/** Checks if
|
|
1197
|
-
export declare function isString
|
|
1341
|
+
/** Checks if the value is of type string. @keywords is string, type guard, validation */
|
|
1342
|
+
export declare function isString(value?: unknown): value is string;
|
|
1198
1343
|
|
|
1199
|
-
/** Checks if the pressed key
|
|
1200
|
-
export declare
|
|
1344
|
+
/** Checks if the pressed key is Tab. @keywords tab key keyboard event check */
|
|
1345
|
+
export declare function isTab(event: KeyboardEvent): boolean;
|
|
1201
1346
|
|
|
1202
|
-
/** Checks if
|
|
1347
|
+
/** Checks if an object is a Window instance. @keywords window, isWindow, type guard, DOM */
|
|
1203
1348
|
export declare function isWindow<E>(element: E): element is Extract<E, Window>;
|
|
1204
1349
|
|
|
1205
|
-
/** Generates a random integer within
|
|
1350
|
+
/** Generates a random integer within the specified range (inclusive). @keywords random, integer, range, math, number */
|
|
1206
1351
|
export declare function random(min: number, max: number): number;
|
|
1207
1352
|
|
|
1208
|
-
/** Removes the common prefix from the
|
|
1209
|
-
export declare function removeCommonPrefix(
|
|
1353
|
+
/** Removes the common prefix from a string, optionally trimming the result. @keywords string prefix remove strip trim */
|
|
1354
|
+
export declare function removeCommonPrefix(mainString: string, prefix: string, trim?: boolean): string;
|
|
1210
1355
|
|
|
1211
|
-
|
|
1212
|
-
|
|
1356
|
+
export interface RemoveTagOptions {
|
|
1357
|
+
tag?: string | string[];
|
|
1358
|
+
replacement?: string;
|
|
1359
|
+
removeContent?: boolean | string | string[];
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Removes all HTML/XML tags or specified tags from a string.
|
|
1363
|
+
* @keywords html, xml, strip tags, sanitize, remove tag, strip html
|
|
1364
|
+
* @remarks
|
|
1365
|
+
* When `removeContent` is true (or a list of tags is provided),
|
|
1366
|
+
* executable and styling tags (`<script>`, `<style>`, `<noscript>`) or specified content tags
|
|
1367
|
+
* are silently removed along with their inner content without applying `replacement`.
|
|
1368
|
+
* Other formatting and layout tags preserve their text content, and their tag syntax
|
|
1369
|
+
* is replaced with `replacement`.
|
|
1370
|
+
* @example
|
|
1371
|
+
*
|
|
1372
|
+
* removeTag('<p>Hello <b>world</b>!</p>') // => 'Hello world!'
|
|
1373
|
+
* removeTag('<b>Hello</b> <p>world</p>', { tag: 'b' }) // => 'Hello <p>world</p>'
|
|
1374
|
+
* removeTag('<b>Hello</b> <p>world</p>', { tag: ['b', 'p'] }) // => 'Hello world'
|
|
1375
|
+
* removeTag('<p>Hello</p><p>world</p>', { replacement: ' ' }) // => ' Hello world '
|
|
1376
|
+
* removeTag('<p>Hello</p><script>alert(1)</script>') // => 'Hello'
|
|
1377
|
+
* removeTag('<p>Hello</p><script>alert(1)</script>', { removeContent: false }) // => 'Helloalert(1)'
|
|
1378
|
+
* removeTag('<div>Text</div><script>alert(1)</script>', { tag: 'script', removeContent: false }) // => '<div>Text</div>alert(1)'
|
|
1379
|
+
*
|
|
1380
|
+
*/
|
|
1381
|
+
export declare function removeTag(value?: string | number | null, options?: RemoveTagOptions): string;
|
|
1213
1382
|
|
|
1214
|
-
/**
|
|
1215
|
-
export declare function
|
|
1383
|
+
/** Replaces occurrences of a component name within the provided text. @keywords replace component name, text replacement, rename component */
|
|
1384
|
+
export declare function replaceComponentName(text: string | undefined, name: string, componentName: string): string | undefined;
|
|
1216
1385
|
|
|
1217
|
-
/**
|
|
1218
|
-
|
|
1386
|
+
/**
|
|
1387
|
+
* Recursively merges a target object with elements from a replacement object or array without mutating source data.
|
|
1388
|
+
* @warning Intended exclusively for plain JSON-like objects and arrays; built-in class instances (`Date`, `RegExp`, `Map`, `Set`) and functions are not supported.
|
|
1389
|
+
* @keywords deep merge, recursive replace, object merge, immutable merge
|
|
1390
|
+
*/
|
|
1391
|
+
export declare function replaceRecursive<I = unknown>(target?: ObjectItem<I> | null, replacement?: ObjectOrArray<I> | readonly I[] | null, isMerge?: boolean, disableCopy?: boolean): ObjectItem<I>;
|
|
1392
|
+
|
|
1393
|
+
/** Replaces `[key]` placeholders in a template string with matching values or function results. @keywords template, replace, placeholder, substitute, string interpolation */
|
|
1394
|
+
export declare function replaceTemplate(value: string, replaces: Record<string, FunctionOr<string | number | boolean>>): string;
|
|
1219
1395
|
|
|
1220
1396
|
/** Asynchronously resizes an image to fit within maximum dimension constraints. @keywords resize, image, scale, canvas, thumbnail, base64 */
|
|
1221
1397
|
export declare function resizeImage(image: HTMLImageElement | string, maxSize?: number, typeData?: string): Promise<string>;
|
|
1222
1398
|
|
|
1223
|
-
type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1224
|
-
|
|
1225
|
-
|
|
1399
|
+
export type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* Resizes an image to fit within a maximum size constraint using HTML Canvas.
|
|
1403
|
+
* @remarks Synchronous; requires a fully loaded image with valid natural dimensions. Returns a Base64 Data URL only when scaled; returns `undefined` if already within `maxSize` or unprocessable to prevent redundant Canvas re-encoding. For a fallback to the original source, use `resizeImage`.
|
|
1404
|
+
* @keywords image resize, scale image, max dimension, canvas resize, thumbnail, base64 data url
|
|
1405
|
+
*/
|
|
1406
|
+
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string, quality?: number): string | undefined;
|
|
1226
1407
|
|
|
1227
|
-
/**
|
|
1408
|
+
/** Validates and normalizes an external locale code string for URL safety and ECMA-402 BCP-47 compatibility. @keywords locale, sanitize, normalize, bcp47, ecma402 */
|
|
1409
|
+
export declare function sanitizeLocation(code?: unknown): string | undefined;
|
|
1410
|
+
|
|
1411
|
+
/** Converts seconds into a formatted time string (MM:SS or HH:MM:SS). @keywords time format, seconds to time, duration, timestamp */
|
|
1228
1412
|
export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
|
|
1229
1413
|
|
|
1230
|
-
/**
|
|
1231
|
-
export declare function setElementItem<E extends ElementOrWindow, K extends keyof E, V extends E[K] = E[K]>(element
|
|
1414
|
+
/** Modifies the value of an element property, attribute, or style by key. @keywords element attribute property style set modify */
|
|
1415
|
+
export declare function setElementItem<E extends ElementOrWindow = HTMLElement, K extends keyof E = keyof E, V extends E[K] = E[K]>(element?: ElementOrString<E> | null, index?: K | string, value?: V | Record<string, V> | unknown): boolean;
|
|
1416
|
+
|
|
1417
|
+
/** Sets or removes an HTML or ARIA attribute on a DOM element. @keywords set attribute, remove attribute, html attribute, aria attribute, dom */
|
|
1418
|
+
export declare function setElementItemAttribute<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, attribute?: string, value?: unknown): boolean;
|
|
1419
|
+
|
|
1420
|
+
/** Sets or merges nested properties on an element with prototype pollution protection. @keywords set element property, merge properties, prototype pollution */
|
|
1421
|
+
export declare function setElementItemProperty<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, index?: PropertyKey, value?: unknown): boolean;
|
|
1422
|
+
|
|
1423
|
+
/** Sets style properties, CSS custom properties, or cssText on a DOM element or window. @keywords style, css properties, custom properties, cssText, set element style */
|
|
1424
|
+
export declare function setElementItemStyle<E extends ElementOrWindow = HTMLElement>(element?: ElementOrString<E> | null, styles?: unknown): boolean;
|
|
1425
|
+
|
|
1426
|
+
export interface SetValuesOptions {
|
|
1427
|
+
multiple?: boolean;
|
|
1428
|
+
maxlength?: number;
|
|
1429
|
+
alwaysChange?: boolean;
|
|
1430
|
+
notEmpty?: boolean;
|
|
1431
|
+
}
|
|
1432
|
+
/** Modifies or toggles single or multiple selected values according to configuration options. @keywords set values, toggle selection, collection, update */
|
|
1433
|
+
export declare function setValues<T>(selected: T | T[] | undefined, value: T, options?: SetValuesOptions): T | T[] | undefined;
|
|
1232
1434
|
|
|
1233
|
-
/**
|
|
1234
|
-
export declare function
|
|
1235
|
-
multiple?: boolean | undefined;
|
|
1236
|
-
maxlength?: number | undefined;
|
|
1237
|
-
alwaysChange?: boolean | undefined;
|
|
1238
|
-
notEmpty?: boolean | undefined;
|
|
1239
|
-
}): T | T[] | undefined;
|
|
1435
|
+
/** Asynchronously skips specified animation frames or executes a callback within them, resolving immediately in non-DOM/SSR. @keywords skip frame, animation frame, raf, requestAnimationFrame, ssr */
|
|
1436
|
+
export declare function skipFrame<T = void>(callback?: () => T | Promise<T>, count?: number): Promise<T | void>;
|
|
1240
1437
|
|
|
1241
1438
|
/** Pauses execution for the specified number of milliseconds. @keywords sleep, delay, wait, pause, timeout */
|
|
1242
1439
|
export declare function sleep(ms: number): Promise<void>;
|
|
1243
1440
|
|
|
1244
|
-
/** Sorts an array of items by column
|
|
1245
|
-
export declare function sortList<T =
|
|
1441
|
+
/** Sorts an array of items by column paths, directions, or a custom comparison function. @keywords sort, order, multi-column, comparator, array */
|
|
1442
|
+
export declare function sortList<T = Record<string, unknown>>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
|
|
1246
1443
|
|
|
1247
|
-
/**
|
|
1248
|
-
|
|
1444
|
+
/**
|
|
1445
|
+
* Recursively merges properties from a replacement object into a target object, optionally replacing a matched entry in place.
|
|
1446
|
+
* @warning Supports plain JSON-like objects only; built-in instances (`Date`, `RegExp`, `Map`, `Set`) and functions are not supported.
|
|
1447
|
+
* @keywords splice, merge, object, replace, recursive
|
|
1448
|
+
*/
|
|
1449
|
+
export declare function splice<I = unknown>(array?: ObjectItem<I> | null, replacement?: ObjectItem<I> | I | null, indexStart?: string | null): ObjectItem<I>;
|
|
1249
1450
|
|
|
1250
1451
|
/** Creates a string of the specified length filled with the given character. @keywords string fill repeat pad */
|
|
1251
1452
|
export declare function strFill(value: string, count: number): string;
|
|
1252
1453
|
|
|
1253
|
-
/** Splits a string by separator
|
|
1254
|
-
export declare function strSplit(value
|
|
1454
|
+
/** Splits a string by a separator with a limit where the last element retains the remainder. @keywords string split, separator, limit, remainder, tokenize */
|
|
1455
|
+
export declare function strSplit(value?: unknown, separator?: string, limit?: number): string[];
|
|
1255
1456
|
|
|
1256
|
-
/** Converts a value to an array
|
|
1257
|
-
export declare function toArray<T>(value: T): T extends
|
|
1457
|
+
/** Converts a value to an array or returns it as-is if already an array. @keywords toArray, array wrap, ensure array, cast array */
|
|
1458
|
+
export declare function toArray<T>(value: T): T extends unknown[] ? T : [T];
|
|
1258
1459
|
|
|
1259
|
-
/** Converts a string to
|
|
1260
|
-
export declare function toCamelCase(value
|
|
1460
|
+
/** Converts a string to camelCase. @keywords camelCase, string, case conversion */
|
|
1461
|
+
export declare function toCamelCase(value?: string): string;
|
|
1261
1462
|
|
|
1262
|
-
/** Converts a string to PascalCase (CamelCase with
|
|
1263
|
-
export declare function toCamelCaseFirst(value
|
|
1463
|
+
/** Converts a string to PascalCase (CamelCase with first letter capitalized). @keywords pascalCase, camelCase, capitalize, case conversion */
|
|
1464
|
+
export declare function toCamelCaseFirst(value?: string): string;
|
|
1264
1465
|
|
|
1265
|
-
/**
|
|
1466
|
+
/** Extracts and validates a 2-letter country code from a location or locale string. @keywords country, locale, bcp47, geolist, parse country */
|
|
1467
|
+
export declare function toCountry(code?: unknown, raw?: boolean): string;
|
|
1468
|
+
|
|
1469
|
+
/** Converts a value to a Date object. @keywords date, parse, convert, timestamp */
|
|
1266
1470
|
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
1267
1471
|
|
|
1268
|
-
/**
|
|
1269
|
-
export declare function
|
|
1472
|
+
/** Finds geographical country and locale data by language-country, country, or language code. @keywords geo, country, locale, language code, geo item */
|
|
1473
|
+
export declare function toGeoItem(code?: unknown): GeoItem | undefined;
|
|
1474
|
+
|
|
1475
|
+
/** Transforms a basic geo item into a full geo item with resolved location data and defaults. @keywords geo item, location resolution, defaults, country code */
|
|
1476
|
+
export declare function toGeoItemFull(item: GeoItem, code?: string): GeoItemFull;
|
|
1477
|
+
|
|
1478
|
+
/** Converts a geo item to its standard string representation (language-country). @keywords geo standard country language code format */
|
|
1479
|
+
export declare function toGeoStandard(item?: GeoItem, language?: string, raw?: boolean): string;
|
|
1480
|
+
|
|
1481
|
+
/** Converts a string to kebab-case format by replacing spaces and separators with hyphens. @keywords kebab-case, dash-case, slugify, string */
|
|
1482
|
+
export declare function toKebabCase(value?: string): string;
|
|
1483
|
+
|
|
1484
|
+
/** Extracts and validates a canonical language code from a location or language string (BCP-47, ISO 639). @keywords language, locale, bcp47, iso639, geolist, parse, normalize */
|
|
1485
|
+
export declare function toLanguage(code?: unknown, raw?: boolean): string;
|
|
1486
|
+
|
|
1487
|
+
/** Converts a full locale string into canonical standard 'aa-AA' format, or returns an empty string if incomplete. @keywords locale, canonicalize, format, language, country */
|
|
1488
|
+
export declare function toLocale(code?: unknown): string;
|
|
1270
1489
|
|
|
1271
1490
|
/**
|
|
1272
|
-
* Converts a
|
|
1273
|
-
* @keywords
|
|
1491
|
+
* Converts a value to a finite floating-point number, normalizing separators and stripping non-numeric characters.
|
|
1492
|
+
* @keywords parse, float, number, cast, numeric conversion, separator
|
|
1274
1493
|
* @example
|
|
1275
1494
|
* toNumber("1 234,56") // 1234.56
|
|
1276
1495
|
* toNumber("1,234.56") // 1234.56
|
|
1277
1496
|
* toNumber("1,234") // 1.234
|
|
1278
1497
|
*/
|
|
1279
|
-
export declare function toNumber(value?:
|
|
1498
|
+
export declare function toNumber(value?: unknown): number;
|
|
1280
1499
|
|
|
1281
|
-
/** Converts a value to a number clamped
|
|
1282
|
-
export declare function toNumberByMax(value
|
|
1500
|
+
/** Converts a value to a number clamped by a maximum permissible value, with optional formatting. @keywords toNumberByMax, clamp, max, number, format */
|
|
1501
|
+
export declare function toNumberByMax(value?: NumberOrString, max?: NumberOrString, formatting?: boolean, language?: string): string | number;
|
|
1283
1502
|
|
|
1284
|
-
/**
|
|
1285
|
-
|
|
1503
|
+
/**
|
|
1504
|
+
* Converts a value to a positive finite number (> 0), or returns a fallback value.
|
|
1505
|
+
* @keywords toNumberPositive, positive number, parse positive, sanitize number
|
|
1506
|
+
* @example
|
|
1507
|
+
* toNumberPositive(15) // 15
|
|
1508
|
+
* toNumberPositive('10') // 10
|
|
1509
|
+
* toNumberPositive(-5) // 0
|
|
1510
|
+
* toNumberPositive('invalid', 1) // 1
|
|
1511
|
+
*/
|
|
1512
|
+
export declare function toNumberPositive(value?: NumberOrString | null, defaultValue?: number): number;
|
|
1513
|
+
|
|
1514
|
+
/** Converts a string to PascalCase. @keywords pascal case, string transform, formatting, casing */
|
|
1515
|
+
export declare function toPascalCase(value?: string): string;
|
|
1286
1516
|
|
|
1287
1517
|
/** Converts a value to a percentage relative to a maximum value. @keywords percentage, percent, ratio, calculate, convert */
|
|
1288
1518
|
export declare function toPercent(maxValue: number, value: number): number;
|
|
@@ -1293,22 +1523,35 @@ export declare function toPercentBy100(maxValue: number, value: number): number;
|
|
|
1293
1523
|
/** Converts a value to a string, returning an empty string for null or undefined. @keywords stringify, convert, format, serialize */
|
|
1294
1524
|
export declare function toString<T>(value: T): string;
|
|
1295
1525
|
|
|
1296
|
-
/**
|
|
1297
|
-
|
|
1526
|
+
/**
|
|
1527
|
+
* Transforms a string into its corresponding data type (boolean, number, object, null, undefined, or function).
|
|
1528
|
+
* @keywords transform, parse, cast, deserialize, type conversion
|
|
1529
|
+
* @example
|
|
1530
|
+
* transformation('true') // true
|
|
1531
|
+
* transformation('12.5') // 12.5
|
|
1532
|
+
* transformation('{"a":1}') // { a: 1 }
|
|
1533
|
+
* transformation('null') // null
|
|
1534
|
+
*/
|
|
1535
|
+
export declare function transformation<T = unknown>(value?: unknown, isFunctionCheck?: boolean): T;
|
|
1298
1536
|
|
|
1299
|
-
/**
|
|
1300
|
-
|
|
1537
|
+
/**
|
|
1538
|
+
* Converts a Uint8Array to a base64 encoded string across Node.js, modern ECMAScript, and browsers.
|
|
1539
|
+
* @keywords uint8array, base64, encode, binary, buffer, btoa
|
|
1540
|
+
* @example
|
|
1541
|
+
* uint8ArrayToBase64(new Uint8Array([72, 101, 108, 108, 111])) // "SGVsbG8="
|
|
1542
|
+
*/
|
|
1543
|
+
export declare function uint8ArrayToBase64(bytes?: Uint8Array | null): string;
|
|
1301
1544
|
|
|
1302
|
-
/** Removes duplicate elements from an array. @keywords unique, deduplicate, distinct, array
|
|
1303
|
-
export declare function uniqueArray<T>(value
|
|
1545
|
+
/** Removes duplicate elements from an array. @keywords unique, deduplicate, distinct, array */
|
|
1546
|
+
export declare function uniqueArray<T = unknown>(value?: readonly T[] | null): T[];
|
|
1304
1547
|
|
|
1305
|
-
/** Writes text data to the system clipboard. @keywords clipboard, copy, write,
|
|
1548
|
+
/** Writes text data to the system clipboard. @keywords clipboard, copy, write, text */
|
|
1306
1549
|
export declare function writeClipboardData(text: string): Promise<void>;
|
|
1307
1550
|
|
|
1308
1551
|
/** Default list of predefined error causes and messages for ErrorCenter. @keywords error_causes error_list error_center */
|
|
1309
1552
|
export declare const errorCauseList: ErrorCenterCauseList;
|
|
1310
1553
|
|
|
1311
|
-
/** HTTP methods
|
|
1554
|
+
/** HTTP request methods. @keywords http, method, rest, verb */
|
|
1312
1555
|
export declare enum ApiMethodItem {
|
|
1313
1556
|
delete = "DELETE",
|
|
1314
1557
|
get = "GET",
|
|
@@ -1316,14 +1559,14 @@ export declare enum ApiMethodItem {
|
|
|
1316
1559
|
put = "PUT",
|
|
1317
1560
|
patch = "PATCH"
|
|
1318
1561
|
}
|
|
1319
|
-
/** Cached API response
|
|
1562
|
+
/** Cached API response structure. @keywords cache, response, ttl, storage */
|
|
1320
1563
|
export type ApiCacheItem<T = any> = {
|
|
1321
1564
|
value: T;
|
|
1322
1565
|
age?: number;
|
|
1323
1566
|
cacheAge: number;
|
|
1324
1567
|
};
|
|
1325
1568
|
export type ApiCacheList = Record<string, ApiCacheItem>;
|
|
1326
|
-
/**
|
|
1569
|
+
/** Configuration options for the API client. @keywords api, config, options, client */
|
|
1327
1570
|
export type ApiConfig = {
|
|
1328
1571
|
urlRoot?: string;
|
|
1329
1572
|
origin?: string;
|
|
@@ -1336,7 +1579,7 @@ export type ApiConfig = {
|
|
|
1336
1579
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1337
1580
|
};
|
|
1338
1581
|
export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
|
|
1339
|
-
/** API response validation
|
|
1582
|
+
/** API response validation metadata. @keywords validation, response, status, error */
|
|
1340
1583
|
export type ApiDataValidation = {
|
|
1341
1584
|
status?: ApiStatusType;
|
|
1342
1585
|
code?: string | number;
|
|
@@ -1346,7 +1589,7 @@ export type ApiDataValidation = {
|
|
|
1346
1589
|
message?: string;
|
|
1347
1590
|
};
|
|
1348
1591
|
};
|
|
1349
|
-
/** API response payload and metadata
|
|
1592
|
+
/** Unified API response payload wrapped with status and error metadata. @keywords response, wrapper, payload, data */
|
|
1350
1593
|
export type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
1351
1594
|
data?: T;
|
|
1352
1595
|
success?: boolean;
|
|
@@ -1355,7 +1598,7 @@ export type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
|
1355
1598
|
};
|
|
1356
1599
|
export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
|
|
1357
1600
|
export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
|
|
1358
|
-
/**
|
|
1601
|
+
/** Parameters and execution options for API fetch requests. @keywords fetch, request, options, http */
|
|
1359
1602
|
export type ApiFetch = {
|
|
1360
1603
|
api?: boolean;
|
|
1361
1604
|
path?: string;
|
|
@@ -1385,7 +1628,7 @@ export type ApiFetch = {
|
|
|
1385
1628
|
endResetLimit?: number;
|
|
1386
1629
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1387
1630
|
};
|
|
1388
|
-
/**
|
|
1631
|
+
/** SSR hydration record for matching and preloading API responses. @keywords hydration, ssr, match */
|
|
1389
1632
|
export type ApiHydrationItem = {
|
|
1390
1633
|
path: string;
|
|
1391
1634
|
method: ApiMethod;
|
|
@@ -1393,23 +1636,23 @@ export type ApiHydrationItem = {
|
|
|
1393
1636
|
response: any;
|
|
1394
1637
|
};
|
|
1395
1638
|
export type ApiHydrationList = ApiHydrationItem[];
|
|
1396
|
-
/**
|
|
1639
|
+
/** Error matching rule descriptor for API error management. @keywords error, handler, matcher, storage */
|
|
1397
1640
|
export type ApiErrorStorageItem = Record<string, any> & {
|
|
1398
1641
|
url: string | RegExp;
|
|
1399
1642
|
method: ApiMethodItem;
|
|
1400
|
-
code?: string;
|
|
1643
|
+
code?: string | number;
|
|
1401
1644
|
status?: number;
|
|
1402
1645
|
validation?: (response: Response) => boolean;
|
|
1403
1646
|
message?: string | ((response?: Response) => string);
|
|
1404
1647
|
};
|
|
1405
1648
|
export type ApiErrorStorageList = ApiErrorStorageItem[];
|
|
1406
1649
|
export type ApiMethod = string | ApiMethodItem;
|
|
1407
|
-
/**
|
|
1650
|
+
/** Hook return value containing state reset flag and payload data. @keywords hook, lifecycle, reset */
|
|
1408
1651
|
export type ApiPreparationEnd = {
|
|
1409
1652
|
reset?: boolean;
|
|
1410
1653
|
data?: any;
|
|
1411
1654
|
};
|
|
1412
|
-
/** Mock API response descriptor
|
|
1655
|
+
/** Mock API response rule descriptor. @keywords mock, response, test, stub */
|
|
1413
1656
|
export type ApiResponseItem = {
|
|
1414
1657
|
path: string | RegExp;
|
|
1415
1658
|
method: ApiMethod;
|
|
@@ -1419,7 +1662,7 @@ export type ApiResponseItem = {
|
|
|
1419
1662
|
isForGlobal?: boolean;
|
|
1420
1663
|
lag?: any;
|
|
1421
1664
|
};
|
|
1422
|
-
/**
|
|
1665
|
+
/** Execution status state and metadata for the last API request. @keywords status, error, response, state */
|
|
1423
1666
|
export type ApiStatusItem = {
|
|
1424
1667
|
status?: number;
|
|
1425
1668
|
statusText?: string;
|
|
@@ -1432,7 +1675,7 @@ export type ApiStatusItem = {
|
|
|
1432
1675
|
export type ApiStatusType = 'success' | 'error' | 'warning' | 'info';
|
|
1433
1676
|
|
|
1434
1677
|
export type Undefined = undefined | null;
|
|
1435
|
-
/** Union
|
|
1678
|
+
/** Union representing falsy, nullish, or string-serialized empty values @keywords empty, nullish, falsy */
|
|
1436
1679
|
export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
|
|
1437
1680
|
export type NumberOrString = number | string;
|
|
1438
1681
|
export type NumberOrStringOrBoolean = number | string | boolean;
|
|
@@ -1441,7 +1684,7 @@ export type NormalOrArray<T = NumberOrString> = T | T[];
|
|
|
1441
1684
|
export type NormalOrPromise<T> = T | Promise<T>;
|
|
1442
1685
|
export type ObjectItem<T = any> = Record<string, T>;
|
|
1443
1686
|
export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
|
|
1444
|
-
/**
|
|
1687
|
+
/** Unwraps an array type to its element type @keywords array, unwrap, extract */
|
|
1445
1688
|
export type ArrayToItem<T> = T extends any[] ? T[number] : T;
|
|
1446
1689
|
export type FunctionOr<T = any> = T | FunctionReturn<T>;
|
|
1447
1690
|
export type FunctionReturn<R = any> = () => R;
|
|
@@ -1450,32 +1693,34 @@ export type FunctionArgs<T, R> = (...args: T[]) => R;
|
|
|
1450
1693
|
export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
|
|
1451
1694
|
export type ItemList<T = any> = Record<string, T>;
|
|
1452
1695
|
export type Item<V> = {
|
|
1453
|
-
|
|
1454
|
-
|
|
1696
|
+
index: string;
|
|
1697
|
+
value: V;
|
|
1455
1698
|
};
|
|
1456
1699
|
export type ItemValue<V> = {
|
|
1457
|
-
|
|
1458
|
-
|
|
1700
|
+
label: string;
|
|
1701
|
+
value: V;
|
|
1459
1702
|
};
|
|
1460
1703
|
export type ItemName<V> = {
|
|
1461
|
-
|
|
1462
|
-
|
|
1704
|
+
name: string | number;
|
|
1705
|
+
value: V;
|
|
1463
1706
|
};
|
|
1464
|
-
export type ElementOrWindow = HTMLElement | Window;
|
|
1707
|
+
export type ElementOrWindow = HTMLElement | SVGElement | Element | Window;
|
|
1708
|
+
/** Resolves ElementOrWindow types, substituting Window with HTMLElement @keywords element, dom, window */
|
|
1709
|
+
export type ElementResolved<E extends ElementOrWindow = HTMLElement> = E extends Window ? HTMLElement : Exclude<E, Window>;
|
|
1465
1710
|
export type ElementOrString<E extends ElementOrWindow> = E | string;
|
|
1466
1711
|
export type EventOptions = AddEventListenerOptions | boolean | undefined;
|
|
1467
|
-
/** Event listener
|
|
1712
|
+
/** Event listener accepting an event and an optional custom detail payload @keywords event, listener, detail */
|
|
1468
1713
|
export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
|
|
1469
|
-
/**
|
|
1714
|
+
/** Tracks an active event listener or observer registration @keywords event, listener, observer, activity */
|
|
1470
1715
|
export type EventActivityItem<E extends ElementOrWindow> = {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1716
|
+
element: E | undefined;
|
|
1717
|
+
type: string;
|
|
1718
|
+
listener?: (event: any | Event) => void;
|
|
1719
|
+
observer?: ResizeObserver;
|
|
1475
1720
|
};
|
|
1476
1721
|
export type ImageCoordinator = {
|
|
1477
|
-
|
|
1478
|
-
|
|
1722
|
+
x: number;
|
|
1723
|
+
y: number;
|
|
1479
1724
|
};
|
|
1480
1725
|
|
|
1481
1726
|
export type ErrorCenterGroup = string | undefined;
|
|
@@ -1574,89 +1819,84 @@ export type FormattersReturn<List extends FormattersListProp, Options extends Fo
|
|
|
1574
1819
|
|
|
1575
1820
|
export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
|
|
1576
1821
|
export type GeoFirstDay = 1 | 6 | 0;
|
|
1822
|
+
/** Default first day of the week ('Mo' = Monday). @keywords calendar, first_day, locale */
|
|
1823
|
+
export declare const GEO_DEFAULT_FIRST_DAY = "Mo";
|
|
1577
1824
|
export type GeoHours = '12' | '24';
|
|
1578
1825
|
export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
|
|
1579
|
-
|
|
1580
|
-
/** Geographic configuration item containing country, language, and locale formatting rules @keywords geo, locale, country, language */
|
|
1826
|
+
/** Geographic item configuration for country, language, and regional formats. @keywords geo, country, language, locale, unit */
|
|
1581
1827
|
export interface GeoItem {
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1828
|
+
country: string;
|
|
1829
|
+
countryAlternative?: string[];
|
|
1830
|
+
language: string;
|
|
1831
|
+
languageAlternative?: string[];
|
|
1832
|
+
firstDay?: string | null;
|
|
1833
|
+
zone?: string | null;
|
|
1834
|
+
phoneCode?: string;
|
|
1835
|
+
phoneWithin?: string;
|
|
1836
|
+
phoneMask?: string | string[];
|
|
1837
|
+
nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
|
|
1838
|
+
unit?: {
|
|
1839
|
+
'millimeter'?: string;
|
|
1840
|
+
'centimeter'?: string;
|
|
1841
|
+
'meter'?: string;
|
|
1842
|
+
'kilometer'?: string;
|
|
1843
|
+
'square-meter'?: string;
|
|
1844
|
+
'hectare'?: string;
|
|
1845
|
+
'gram'?: string;
|
|
1846
|
+
'kilogram'?: string;
|
|
1847
|
+
'tonne'?: string;
|
|
1848
|
+
'milliliter'?: string;
|
|
1849
|
+
'liter'?: string;
|
|
1850
|
+
'celsius'?: string;
|
|
1851
|
+
'kilometer-per-hour'?: string;
|
|
1852
|
+
};
|
|
1607
1853
|
}
|
|
1608
|
-
|
|
1609
|
-
/** Extended geographic item with resolved required locale fields @keywords geo, locale, full */
|
|
1854
|
+
/** Complete geographic item with resolved locale and location identifiers. @keywords geo, location, locale, country */
|
|
1610
1855
|
export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1856
|
+
standard: string;
|
|
1857
|
+
firstDay: string;
|
|
1858
|
+
location: string;
|
|
1859
|
+
locationCountry: string;
|
|
1860
|
+
locationLanguage: string;
|
|
1616
1861
|
}
|
|
1617
|
-
|
|
1618
|
-
/** Geographic flag and country display metadata @keywords flag, country, language */
|
|
1862
|
+
/** Country flag selection and display item. @keywords flag, country, language, option */
|
|
1619
1863
|
export interface GeoFlagItem {
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1864
|
+
language: string;
|
|
1865
|
+
languageCode: string;
|
|
1866
|
+
country: string;
|
|
1867
|
+
countryCode: string;
|
|
1868
|
+
standard: string;
|
|
1869
|
+
icon?: string;
|
|
1870
|
+
label: string;
|
|
1871
|
+
value: string;
|
|
1872
|
+
phoneCode?: string;
|
|
1629
1873
|
}
|
|
1630
|
-
|
|
1631
|
-
/** Geographic flag item with localized native language descriptions @keywords flag, national, localized */
|
|
1874
|
+
/** Extended geographic flag item containing localized national language and country names. @keywords flag, national, localization */
|
|
1632
1875
|
export interface GeoFlagNational extends GeoFlagItem {
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1876
|
+
description: string;
|
|
1877
|
+
nationalLanguage: string;
|
|
1878
|
+
nationalCountry: string;
|
|
1636
1879
|
}
|
|
1637
|
-
|
|
1638
|
-
/** Country phone prefix and mask pattern metadata @keywords phone, mask, countryCode */
|
|
1880
|
+
/** Phone dialing configuration and mask metadata for a country. @keywords phone, country_code, mask, dialing */
|
|
1639
1881
|
export interface GeoPhoneValue {
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1882
|
+
phone: number;
|
|
1883
|
+
within: number;
|
|
1884
|
+
mask: string[];
|
|
1885
|
+
value: string;
|
|
1644
1886
|
}
|
|
1645
|
-
|
|
1646
|
-
/** Prefix tree node for phone code lookup and mask formatting @keywords phone, trie, prefix, mask */
|
|
1887
|
+
/** Node in the internal phone prefix tree (Trie) for number lookup. @keywords phone, trie, prefix_tree, lookup */
|
|
1647
1888
|
export interface GeoPhoneMap {
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1889
|
+
items: GeoPhoneValue[];
|
|
1890
|
+
info: GeoPhoneValue | undefined;
|
|
1891
|
+
value: string | undefined;
|
|
1892
|
+
mask: string[];
|
|
1893
|
+
maskFull: string[];
|
|
1894
|
+
next: Record<string, GeoPhoneMap>;
|
|
1654
1895
|
}
|
|
1655
|
-
|
|
1656
|
-
/** Result of a phone number lookup against the prefix tree @keywords phone, lookup, result */
|
|
1896
|
+
/** Result of matching a phone number against the prefix tree. @keywords phone, lookup, result, match */
|
|
1657
1897
|
export interface GeoPhoneMapInfo {
|
|
1658
|
-
|
|
1659
|
-
|
|
1898
|
+
item?: GeoPhoneMap;
|
|
1899
|
+
phone?: string;
|
|
1660
1900
|
}
|
|
1661
1901
|
|
|
1662
1902
|
export declare enum MetaTag {
|
|
@@ -1881,34 +2121,44 @@ export type HighlightMatchItem = {
|
|
|
1881
2121
|
};
|
|
1882
2122
|
|
|
1883
2123
|
export type SortDir = 'asc' | 'desc';
|
|
2124
|
+
/** Column sort specification. @keywords sort, column, order */
|
|
1884
2125
|
export type SortColumnItem = {
|
|
1885
2126
|
column?: string;
|
|
1886
2127
|
dir?: SortDir;
|
|
1887
2128
|
};
|
|
1888
|
-
/** Custom
|
|
1889
|
-
export type SortFunction<T =
|
|
2129
|
+
/** Custom comparator function for sorting items. @keywords sort, comparator, sort-function */
|
|
2130
|
+
export type SortFunction<T = Record<string, unknown>> = (a: T, b: T, column?: string, dir?: SortDir) => number;
|
|
1890
2131
|
|
|
1891
|
-
/**
|
|
2132
|
+
/** Configuration options for the translation plugin. @keywords translate, config, options */
|
|
1892
2133
|
export type TranslateConfig = {
|
|
1893
2134
|
url?: string;
|
|
1894
2135
|
propsName?: string;
|
|
1895
2136
|
readApi?: boolean;
|
|
1896
2137
|
};
|
|
1897
|
-
/** Translation code or list of translation codes @keywords i18n, key, code */
|
|
1898
2138
|
export type TranslateCode = string | string[];
|
|
1899
|
-
/** Map of translation
|
|
2139
|
+
/** Map of translation codes to their localized string values. @keywords translate, list, mapping */
|
|
1900
2140
|
export type TranslateList<T extends TranslateCode[]> = {
|
|
1901
2141
|
[K in T[number] as K extends readonly string[] ? K[0] : K]: string;
|
|
1902
2142
|
};
|
|
1903
|
-
/**
|
|
2143
|
+
/** Resolves return type to a single translated string or a mapped dictionary. @keywords translate, conditional */
|
|
1904
2144
|
export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
|
|
1905
2145
|
export type TranslateDataFileList = Record<string, string>;
|
|
1906
|
-
/** Asynchronous loader function for translation data @keywords i18n, loader, async */
|
|
1907
2146
|
export type TranslateDataFileItem = () => Promise<TranslateDataFileList>;
|
|
1908
|
-
/** Mapping of locale identifiers to translation file loaders @keywords i18n, locale, dictionary */
|
|
1909
2147
|
export type TranslateDataFile = Record<string, TranslateDataFileItem>;
|
|
1910
|
-
|
|
2148
|
+
export type TranslatePromiseItem = {
|
|
2149
|
+
id: number;
|
|
2150
|
+
promise: Promise<TranslateDataFileList | undefined>;
|
|
2151
|
+
};
|
|
2152
|
+
/** Translation batch queued for retrieval by locale and language. @keywords translate, batch, queue */
|
|
2153
|
+
export interface TranslateBatch {
|
|
2154
|
+
readonly location: string;
|
|
2155
|
+
readonly language: string;
|
|
2156
|
+
readonly path: string;
|
|
2157
|
+
readonly codes: string[];
|
|
2158
|
+
readonly resolves: (() => void)[];
|
|
2159
|
+
}
|
|
2160
|
+
/** Prefix for global translation keys. @keywords translate, prefix, global */
|
|
1911
2161
|
export declare const TRANSLATE_GLOBAL_PREFIX = "global";
|
|
1912
|
-
/**
|
|
2162
|
+
/** Request debounce timeout in milliseconds for batch translation loading. @keywords translate, timeout, debounce */
|
|
1913
2163
|
export declare const TRANSLATE_TIME_OUT = 160;
|
|
1914
2164
|
```
|