@dxtmisha/functional-basic 1.11.1 → 1.14.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 +252 -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 +13 -0
- package/ai-types.md +740 -664
- package/dist/library.d.ts +1952 -1586
- package/dist/library.js +1706 -1294
- package/package.json +2 -2
package/ai-types.md
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional-basic (v1.
|
|
1
|
+
All these methods are in the @dxtmisha/functional-basic (v1.14.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
|
-
/**
|
|
82
|
+
/** Class for managing browser cookies. @keywords cookie, storage, browser */
|
|
83
83
|
export declare class Cookie<T> {
|
|
84
|
-
/**
|
|
85
|
-
static getInstance<T>(name: string): Cookie<T>;
|
|
86
|
-
/** Creates a new Cookie instance. @keywords cookie, constructor */
|
|
84
|
+
/** Creates a new Cookie manager instance for the specified cookie name. @keywords cookie, constructor */
|
|
87
85
|
constructor(name: string);
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
/**
|
|
86
|
+
/** Retrieves or creates an instance for the specified cookie name. @keywords cookie, getInstance, factory */
|
|
87
|
+
static getInstance<T>(name: string): Cookie<T>;
|
|
88
|
+
/** Retrieves cookie data or initializes with default value if absent. @keywords get, read, cookie */
|
|
89
|
+
get(defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): T | string | undefined;
|
|
90
|
+
/** Updates or sets cookie data. @keywords set, write, update, cookie */
|
|
91
91
|
set(value?: T | string | (() => (T | string)), options?: CookieOptions): void;
|
|
92
|
-
/** Deletes the cookie. @keywords
|
|
92
|
+
/** Deletes the cookie. @keywords delete, remove, cookie */
|
|
93
93
|
remove(): void;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/** Manages cookie access
|
|
96
|
+
/** Manages cookie access and blocking status. @keywords cookie, block, access, permissions */
|
|
97
97
|
export declare class CookieBlock {
|
|
98
|
-
/**
|
|
99
|
-
static getItem(): CookieBlockInstance;
|
|
100
|
-
/** Retrieves the current cookie block status. @keywords cookie, block, status, get */
|
|
98
|
+
/** Retrieves current cookie blocking status. @keywords cookie, block, status, check */
|
|
101
99
|
static get(): boolean;
|
|
102
|
-
/** Sets
|
|
100
|
+
/** Sets cookie blocking status. @keywords cookie, block, status, toggle */
|
|
103
101
|
static set(value: boolean): void;
|
|
102
|
+
/** Gets request-isolated CookieBlockInstance. @keywords cookie, block, instance, request */
|
|
103
|
+
static getItem(): CookieBlockInstance;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export type CookieSameSite = 'strict' | 'lax';
|
|
107
107
|
|
|
108
|
-
/**
|
|
108
|
+
/** Cookie configuration options @keywords cookie, options, settings */
|
|
109
109
|
export type CookieOptions = {
|
|
110
110
|
age?: number;
|
|
111
111
|
sameSite?: CookieSameSite;
|
|
@@ -117,826 +117,841 @@ export type CookieOptions = {
|
|
|
117
117
|
arguments?: string[] | Record<string, string | number | boolean>;
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
/**
|
|
120
|
+
/** Universal cookie storage manager supporting custom listeners for DOM and SSR environments @keywords cookie, storage, ssr, persistence */
|
|
121
121
|
export declare class CookieStorage {
|
|
122
|
-
/**
|
|
123
|
-
static init(getListener?: (key: string) => any | undefined, getListenerRaw?: () => string, setListener?: (key: string, value: any, cookie: string, options?: CookieOptions) => void): void;
|
|
124
|
-
/** Resets the storage by clearing all in-memory items and resetting listeners. @keywords reset, clear */
|
|
125
|
-
static reset(): void;
|
|
126
|
-
/** Retrieves a typed cookie value from storage or returns a default fallback. @keywords get, read, retrieve */
|
|
122
|
+
/** Retrieves data from cookie storage with optional fallback @keywords cookie, get, read */
|
|
127
123
|
static get<T>(name: string, defaultValue?: T | (() => T)): T | undefined;
|
|
128
|
-
/**
|
|
124
|
+
/** Stores a value in cookies with configurable options @keywords cookie, set, write, save */
|
|
129
125
|
static set<T>(name: string, value: T | (() => T), options?: CookieOptions): T;
|
|
130
|
-
/** Removes a cookie by name from storage
|
|
126
|
+
/** Removes a cookie by name from storage @keywords cookie, remove, delete */
|
|
131
127
|
static remove(name: string): void;
|
|
132
|
-
/** Synchronizes and updates
|
|
128
|
+
/** Synchronizes and updates data from current cookies @keywords cookie, update, sync, refresh */
|
|
133
129
|
static update(): void;
|
|
130
|
+
/** Clears all in-memory items and resets registered listeners @keywords cookie, reset, clear */
|
|
131
|
+
static reset(): void;
|
|
132
|
+
/** Initializes storage listeners for custom cookie retrieval and persistence @keywords cookie, init, setup, listeners */
|
|
133
|
+
static init(getListener?: (key: string) => unknown, getListenerRaw?: () => string, setListener?: (key: string, value: string, cookie: string, options?: CookieOptions) => void): void;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/** Storage
|
|
136
|
+
/** Storage manager for localStorage and sessionStorage with prefix, TTL expiration, and SSR isolation support. @keywords localstorage, sessionstorage, storage, cache, ssr */
|
|
137
137
|
export declare class DataStorage<T> {
|
|
138
|
-
/**
|
|
139
|
-
static setPrefix(newPrefix: string): void;
|
|
140
|
-
/** Initializes storage instance for a named key. @keywords storage, constructor, session */
|
|
138
|
+
/** Initializes storage key, storage type, and optional error handler. @keywords constructor, init, storage */
|
|
141
139
|
constructor(name: string, isSession?: boolean, errorCenter?: ErrorCenterInstance);
|
|
142
|
-
/** Retrieves stored
|
|
140
|
+
/** Retrieves stored value with optional fallback and cache expiration in seconds. @keywords get, read, retrieve, cache */
|
|
143
141
|
get(defaultValue?: T | (() => T), cache?: number): T | undefined;
|
|
144
|
-
/**
|
|
142
|
+
/** Updates stored value using a direct value or resolver function. @keywords set, write, update, store */
|
|
145
143
|
set(value?: T | (() => T)): T | undefined;
|
|
146
|
-
/**
|
|
144
|
+
/** Configures global storage key prefix. @keywords setPrefix, prefix, namespace */
|
|
145
|
+
static setPrefix(newPrefix: string): void;
|
|
146
|
+
/** Removes stored item from storage. @keywords remove, delete, clear */
|
|
147
147
|
remove(): this;
|
|
148
|
-
/** Synchronizes data from
|
|
148
|
+
/** Synchronizes data from storage into instance. @keywords update, sync, refresh */
|
|
149
149
|
update(): this;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
153
|
+
* Date manipulation and localization utility class.
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* Creating a `Datetime` instance without a specific date (using the current time)
|
|
157
|
+
* for rendering in SSR may lead to hydration mismatches because the time or time zone
|
|
158
|
+
* on the server may differ from the time on the client.
|
|
159
|
+
* @keywords datetime, date, calendar, timezone, localization, intl
|
|
156
160
|
*/
|
|
157
161
|
export declare class Datetime {
|
|
158
|
-
/**
|
|
162
|
+
/** Constructs a Datetime instance. @keywords constructor, init */
|
|
159
163
|
constructor(date?: NumberOrStringOrDate, type?: GeoDate, code?: string);
|
|
160
|
-
/**
|
|
164
|
+
/** Gets the GeoIntl localization formatting instance. @keywords intl, localization */
|
|
161
165
|
getIntl(): GeoIntl;
|
|
162
|
-
/**
|
|
166
|
+
/** Gets the underlying native Date object. @keywords date, native */
|
|
163
167
|
getDate(): Date;
|
|
164
|
-
/**
|
|
168
|
+
/** Gets the configured output date type format. @keywords type, format */
|
|
165
169
|
getType(): GeoDate;
|
|
166
|
-
/**
|
|
170
|
+
/** Gets the hour display format type. @keywords hours, format */
|
|
167
171
|
getHoursType(): GeoHours;
|
|
168
|
-
/**
|
|
172
|
+
/** Checks whether 24-hour time format is enabled. @keywords hour24, format, time */
|
|
169
173
|
getHour24(): boolean;
|
|
170
|
-
/** Returns
|
|
174
|
+
/** Returns time zone offset in minutes relative to UTC. @keywords timezone, offset, utc */
|
|
171
175
|
getTimeZoneOffset(): number;
|
|
172
|
-
/**
|
|
176
|
+
/** Gets the time zone representation string. @keywords timezone, tz */
|
|
173
177
|
getTimeZone(style?: GeoTimeZoneStyle): string;
|
|
174
|
-
/**
|
|
178
|
+
/** Gets the code for the first day of the week. @keywords firstDay, weekday */
|
|
175
179
|
getFirstDayCode(): GeoFirstDay;
|
|
176
|
-
/**
|
|
180
|
+
/** Gets the full year in local time. @keywords year, local */
|
|
177
181
|
getYear(): number;
|
|
178
|
-
/**
|
|
182
|
+
/** Gets the 1-based month (1-12) in local time. @keywords month, local */
|
|
179
183
|
getMonth(): number;
|
|
180
|
-
/**
|
|
184
|
+
/** Gets the day of the month (1-31) in local time. @keywords day, date, local */
|
|
181
185
|
getDay(): number;
|
|
182
|
-
/**
|
|
186
|
+
/** Gets the hour (0-23) in local time. @keywords hour, local */
|
|
183
187
|
getHour(): number;
|
|
184
|
-
/**
|
|
188
|
+
/** Gets the minute (0-59) in local time. @keywords minute, local */
|
|
185
189
|
getMinute(): number;
|
|
186
|
-
/**
|
|
190
|
+
/** Gets the second (0-59) in local time. @keywords second, local */
|
|
187
191
|
getSecond(): number;
|
|
188
|
-
/**
|
|
192
|
+
/** Gets the total number of days (28-31) in the current month. @keywords maxDay, daysInMonth */
|
|
189
193
|
getMaxDay(): number;
|
|
190
|
-
/**
|
|
191
|
-
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
|
|
192
|
-
/** Formats the year according to the current locale. @keywords locale year format */
|
|
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 */
|
|
194
|
+
/** Replaces the current date value. @keywords setDate, update */
|
|
207
195
|
setDate(value: NumberOrStringOrDate): this;
|
|
208
|
-
/** Sets the date
|
|
196
|
+
/** Sets the output date type format. @keywords setType, format */
|
|
209
197
|
setType(value: GeoDate): this;
|
|
210
|
-
/** Sets whether to use 24-hour time format. @keywords
|
|
198
|
+
/** Sets whether to use 24-hour time format. @keywords setHour24, format */
|
|
211
199
|
setHour24(value: boolean): this;
|
|
212
|
-
/** Sets the country
|
|
200
|
+
/** Sets the locale/country code. @keywords setCode, locale */
|
|
213
201
|
setCode(code: string): this;
|
|
214
|
-
/** Registers a
|
|
202
|
+
/** Registers a change listener callback. @keywords watch, observer, listener */
|
|
215
203
|
setWatch(watch: (date: Date, type: GeoDate, hour24: boolean) => void): this;
|
|
216
|
-
/** Sets the full year
|
|
204
|
+
/** Sets the full year in local time. @keywords setYear, year */
|
|
217
205
|
setYear(value: number): this;
|
|
218
|
-
/** Sets the 1-based month (1-12)
|
|
206
|
+
/** Sets the 1-based month (1-12) in local time. @keywords setMonth, month */
|
|
219
207
|
setMonth(value: number): this;
|
|
220
|
-
/** Sets the day of the month (1-31)
|
|
208
|
+
/** Sets the day of the month (1-31) in local time. @keywords setDay, day */
|
|
221
209
|
setDay(value: number): this;
|
|
222
|
-
/** Sets the hour (0-23)
|
|
210
|
+
/** Sets the hour (0-23) in local time. @keywords setHour, hour */
|
|
223
211
|
setHour(value: number): this;
|
|
224
|
-
/** Sets the minute (0-59)
|
|
212
|
+
/** Sets the minute (0-59) in local time. @keywords setMinute, minute */
|
|
225
213
|
setMinute(value: number): this;
|
|
226
|
-
/** Sets the second (0-59)
|
|
214
|
+
/** Sets the second (0-59) in local time. @keywords setSecond, second */
|
|
227
215
|
setSecond(value: number): this;
|
|
228
|
-
/**
|
|
216
|
+
/** Formats date and time according to locale and format options. @keywords locale, format, string */
|
|
217
|
+
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): string;
|
|
218
|
+
/** Formats the year according to locale. @keywords localeYear, year, format */
|
|
219
|
+
localeYear(style?: Intl.DateTimeFormatOptions['year']): string;
|
|
220
|
+
/** Formats the month according to locale. @keywords localeMonth, month, format */
|
|
221
|
+
localeMonth(style?: Intl.DateTimeFormatOptions['month']): string;
|
|
222
|
+
/** Formats the day according to locale. @keywords localeDay, day, format */
|
|
223
|
+
localeDay(style?: Intl.DateTimeFormatOptions['day']): string;
|
|
224
|
+
/** Formats the hour according to locale. @keywords localeHour, hour, format */
|
|
225
|
+
localeHour(style?: Intl.DateTimeFormatOptions['hour']): string;
|
|
226
|
+
/** Formats the minute according to locale. @keywords localeMinute, minute, format */
|
|
227
|
+
localeMinute(style?: Intl.DateTimeFormatOptions['minute']): string;
|
|
228
|
+
/** Formats the second according to locale. @keywords localeSecond, second, format */
|
|
229
|
+
localeSecond(style?: Intl.DateTimeFormatOptions['second']): string;
|
|
230
|
+
/** Formats date to a standard ISO-like string. @keywords standard, iso, format */
|
|
231
|
+
standard(timeZone?: boolean): string;
|
|
232
|
+
/** Shifts the date by a specified number of years. @keywords moveByYear, addYears */
|
|
229
233
|
moveByYear(value: number): this;
|
|
230
|
-
/** Shifts the date by
|
|
234
|
+
/** Shifts the date by a specified number of months. @keywords moveByMonth, addMonths */
|
|
231
235
|
moveByMonth(value: number): this;
|
|
232
|
-
/** Shifts the date by
|
|
236
|
+
/** Shifts the date by a specified number of days. @keywords moveByDay, addDays */
|
|
233
237
|
moveByDay(value: number): this;
|
|
234
|
-
/** Shifts the date by
|
|
238
|
+
/** Shifts the date by a specified number of hours. @keywords moveByHour, addHours */
|
|
235
239
|
moveByHour(value: number): this;
|
|
236
|
-
/** Shifts the date by
|
|
240
|
+
/** Shifts the date by a specified number of minutes. @keywords moveByMinute, addMinutes */
|
|
237
241
|
moveByMinute(value: number): this;
|
|
238
|
-
/** Shifts the date by
|
|
242
|
+
/** Shifts the date by a specified number of seconds. @keywords moveBySecond, addSeconds */
|
|
239
243
|
moveBySecond(value: number): this;
|
|
240
|
-
/**
|
|
244
|
+
/** Moves the date to January of the current year. @keywords moveMonthFirst, january */
|
|
241
245
|
moveMonthFirst(): this;
|
|
242
|
-
/**
|
|
246
|
+
/** Moves the date to December of the current year. @keywords moveMonthLast, december */
|
|
243
247
|
moveMonthLast(): this;
|
|
244
|
-
/** Advances the date to the first day of the next month. @keywords
|
|
248
|
+
/** Advances the date to the first day of the next month. @keywords moveMonthNext, nextMonth */
|
|
245
249
|
moveMonthNext(): this;
|
|
246
|
-
/**
|
|
250
|
+
/** Rewinds the date to the first day of the previous month. @keywords moveMonthPrevious, prevMonth */
|
|
247
251
|
moveMonthPrevious(): this;
|
|
248
|
-
/** Moves the date to the first day of the current week. @keywords
|
|
252
|
+
/** Moves the date to the first day of the current week. @keywords moveWeekdayFirst, weekStart */
|
|
249
253
|
moveWeekdayFirst(): this;
|
|
250
|
-
/** Moves the date to the last day of the current week. @keywords
|
|
254
|
+
/** Moves the date to the last day of the current week. @keywords moveWeekdayLast, weekEnd */
|
|
251
255
|
moveWeekdayLast(): this;
|
|
252
|
-
/** Moves
|
|
256
|
+
/** Moves to the first weekday of the month's first week. @keywords moveWeekdayFirstByMonth */
|
|
253
257
|
moveWeekdayFirstByMonth(): this;
|
|
254
|
-
/** Moves
|
|
258
|
+
/** Moves to the first weekday of the following month's first full week. @keywords moveWeekdayLastByMonth */
|
|
255
259
|
moveWeekdayLastByMonth(): this;
|
|
256
|
-
/** Advances the date by one week. @keywords
|
|
260
|
+
/** Advances the date by one full week. @keywords moveWeekdayNext, nextWeek */
|
|
257
261
|
moveWeekdayNext(): this;
|
|
258
|
-
/**
|
|
262
|
+
/** Rewinds the date by one full week. @keywords moveWeekdayPrevious, prevWeek */
|
|
259
263
|
moveWeekdayPrevious(): this;
|
|
260
|
-
/** Moves the date to the first day of the current month. @keywords
|
|
264
|
+
/** Moves the date to the first day of the current month. @keywords moveDayFirst, startOfMonth */
|
|
261
265
|
moveDayFirst(): this;
|
|
262
|
-
/** Moves the date to the last day of the current month. @keywords
|
|
266
|
+
/** Moves the date to the last day of the current month. @keywords moveDayLast, endOfMonth */
|
|
263
267
|
moveDayLast(): this;
|
|
264
|
-
/** Advances the date
|
|
268
|
+
/** Advances the date by one day. @keywords moveDayNext, tomorrow */
|
|
265
269
|
moveDayNext(): this;
|
|
266
|
-
/**
|
|
270
|
+
/** Rewinds the date by one day. @keywords moveDayPrevious, yesterday */
|
|
267
271
|
moveDayPrevious(): this;
|
|
268
|
-
/**
|
|
272
|
+
/** Clones and returns a native Date instance. @keywords clone, date */
|
|
269
273
|
clone(): Date;
|
|
270
|
-
/**
|
|
274
|
+
/** Clones and returns a new Datetime instance. @keywords cloneClass, copy */
|
|
271
275
|
cloneClass(): Datetime;
|
|
272
|
-
/** Clones
|
|
276
|
+
/** Clones instance and sets month to January. @keywords cloneMonthFirst, january */
|
|
273
277
|
cloneMonthFirst(): Datetime;
|
|
274
|
-
/** Clones
|
|
278
|
+
/** Clones instance and sets month to December. @keywords cloneMonthLast, december */
|
|
275
279
|
cloneMonthLast(): Datetime;
|
|
276
|
-
/** Clones
|
|
280
|
+
/** Clones instance shifted to the next month. @keywords cloneMonthNext, nextMonth */
|
|
277
281
|
cloneMonthNext(): Datetime;
|
|
278
|
-
/** Clones
|
|
282
|
+
/** Clones instance shifted to the previous month. @keywords cloneMonthPrevious, prevMonth */
|
|
279
283
|
cloneMonthPrevious(): Datetime;
|
|
280
|
-
/** Clones
|
|
284
|
+
/** Clones instance set to the first day of the week. @keywords cloneWeekdayFirst, weekStart */
|
|
281
285
|
cloneWeekdayFirst(): Datetime;
|
|
282
|
-
/** Clones
|
|
286
|
+
/** Clones instance set to the last day of the week. @keywords cloneWeekdayLast, weekEnd */
|
|
283
287
|
cloneWeekdayLast(): Datetime;
|
|
284
|
-
/** Clones
|
|
288
|
+
/** Clones instance set to the first weekday of the month's first week. @keywords cloneWeekdayFirstByMonth */
|
|
285
289
|
cloneWeekdayFirstByMonth(): Datetime;
|
|
286
|
-
/** Clones
|
|
290
|
+
/** Clones instance set to the first weekday of the following month's first full week. @keywords cloneWeekdayLastByMonth */
|
|
287
291
|
cloneWeekdayLastByMonth(): Datetime;
|
|
288
|
-
/** Clones
|
|
292
|
+
/** Clones instance advanced by one week. @keywords cloneWeekdayNext, nextWeek */
|
|
289
293
|
cloneWeekdayNext(): Datetime;
|
|
290
|
-
/** Clones
|
|
294
|
+
/** Clones instance rewound by one week. @keywords cloneWeekdayPrevious, prevWeek */
|
|
291
295
|
cloneWeekdayPrevious(): Datetime;
|
|
292
|
-
/** Clones
|
|
296
|
+
/** Clones instance set to the first day of the month. @keywords cloneDayFirst, startOfMonth */
|
|
293
297
|
cloneDayFirst(): Datetime;
|
|
294
|
-
/** Clones
|
|
298
|
+
/** Clones instance set to the last day of the month. @keywords cloneDayLast, endOfMonth */
|
|
295
299
|
cloneDayLast(): Datetime;
|
|
296
|
-
/** Clones
|
|
300
|
+
/** Clones instance advanced by one day. @keywords cloneDayNext, tomorrow */
|
|
297
301
|
cloneDayNext(): Datetime;
|
|
298
|
-
/** Clones
|
|
302
|
+
/** Clones instance rewound by one day. @keywords cloneDayPrevious, yesterday */
|
|
299
303
|
cloneDayPrevious(): Datetime;
|
|
300
304
|
}
|
|
301
305
|
|
|
302
|
-
/** Error
|
|
306
|
+
/** Error storage and centralized handling manager. @keywords error, center, manager, storage, handling */
|
|
303
307
|
export declare class ErrorCenter {
|
|
304
|
-
/**
|
|
305
|
-
static getItem(): ErrorCenterInstance;
|
|
306
|
-
/** Checks if an error cause exists by code and optional group. @keywords exists, check, has */
|
|
307
|
-
static has(code: string, group?: string): boolean;
|
|
308
|
-
/** Retrieves an error cause item by code and group. @keywords get, find, cause */
|
|
308
|
+
/** Retrieves an error cause by code and optional group. @keywords get, error cause, lookup, code, group */
|
|
309
309
|
static get(code: string, group?: string): ErrorCenterCauseItem | undefined;
|
|
310
|
-
/**
|
|
310
|
+
/** Checks whether an error cause exists by code and optional group. @keywords has, exists, check, error cause */
|
|
311
|
+
static has(code: string, group?: string): boolean;
|
|
312
|
+
/** Returns the global singleton instance of ErrorCenterInstance. @keywords singleton, instance, error center */
|
|
313
|
+
static getItem(): ErrorCenterInstance;
|
|
314
|
+
/** Configures console logging behavior or custom filter for errors. @keywords console, logging, debug, filter */
|
|
315
|
+
static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
|
|
316
|
+
/** Registers a single error cause in storage. @keywords add, register, error cause */
|
|
311
317
|
static add(cause: ErrorCenterCauseItem): void;
|
|
312
|
-
/** Registers
|
|
313
|
-
static
|
|
314
|
-
/** Registers an error handler for a specific group. @keywords handler, group,
|
|
318
|
+
/** Registers a global callback executed on any triggered error. @keywords callback, listener, global, on error */
|
|
319
|
+
static addCallback(callback: ErrorCenterHandlerCallback): void;
|
|
320
|
+
/** Registers an error handler callback for a specific group. @keywords handler, group, error listener */
|
|
315
321
|
static addHandler(group: ErrorCenterGroup, handler: ErrorCenterHandlerCallback): void;
|
|
316
|
-
/** Registers multiple error handlers. @keywords
|
|
322
|
+
/** Registers multiple group-specific error handlers. @keywords handler list, batch register, error handlers */
|
|
317
323
|
static addHandlerList(handlers: ErrorCenterHandlerList): void;
|
|
318
|
-
/** Registers a
|
|
319
|
-
static
|
|
320
|
-
/**
|
|
321
|
-
static setIsConsole(isConsole: ErrorCenterHandlerIsConsole): void;
|
|
322
|
-
/** Triggers error handling workflow for an error cause. @keywords trigger, dispatch, emit */
|
|
324
|
+
/** Registers a list of error causes in storage. @keywords batch add, error cause list, register */
|
|
325
|
+
static addList(causes: ErrorCenterCauseList): void;
|
|
326
|
+
/** Triggers error handling workflow for the specified error cause. @keywords trigger, dispatch, handle, error */
|
|
323
327
|
static on(cause: ErrorCenterCauseItem): void;
|
|
324
328
|
}
|
|
325
329
|
|
|
326
330
|
/**
|
|
327
|
-
* Advanced
|
|
328
|
-
* @keywords event
|
|
331
|
+
* Advanced lifecycle-managed event listener wrapper with DOM-safety checks and optimizations for resize and scroll.
|
|
332
|
+
* @keywords event-listener dom-events resize-observer scroll-sync event-dispatch
|
|
333
|
+
* @example
|
|
334
|
+
* const clickEvent = new EventItem('.btn', 'click', (e) => console.log('Clicked!'));
|
|
335
|
+
* clickEvent.start();
|
|
329
336
|
*/
|
|
330
|
-
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string,
|
|
331
|
-
/** Creates an EventItem instance. @keywords
|
|
337
|
+
export declare class EventItem<E extends ElementOrWindow, O extends Event, D extends Record<string, unknown> = Record<string, unknown>> {
|
|
338
|
+
/** Creates an EventItem instance. @keywords constructor init */
|
|
332
339
|
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
|
|
340
|
+
/** Checks whether event listening is currently active. @keywords active status listening */
|
|
334
341
|
isActive(): boolean;
|
|
335
|
-
/** Returns the target
|
|
342
|
+
/** Returns the resolved target element. @keywords target element getter */
|
|
336
343
|
getElement(): E | undefined;
|
|
337
|
-
/**
|
|
344
|
+
/** Updates the target element or selector. @keywords set-target element-bind */
|
|
338
345
|
setElement(elementSelector?: ElementOrString<E>): this;
|
|
339
|
-
/** Sets the control element for DOM safety checks. @keywords
|
|
346
|
+
/** Sets the control element used for DOM attachment safety checks. @keywords dom-safety control-element */
|
|
340
347
|
setElementControl<EC extends HTMLElement>(elementSelector?: ElementOrString<EC>): this;
|
|
341
|
-
/**
|
|
348
|
+
/** Updates the event type or types to listen to. @keywords set-type event-type */
|
|
342
349
|
setType(type: string | string[]): this;
|
|
343
|
-
/**
|
|
350
|
+
/** Updates the event listener callback. @keywords set-listener callback handler */
|
|
344
351
|
setListener(listener: EventListenerDetail<O, D>): this;
|
|
345
|
-
/**
|
|
352
|
+
/** Updates the event listener configuration options. @keywords options capture passive */
|
|
346
353
|
setOptions(options?: EventOptions): this;
|
|
347
|
-
/**
|
|
354
|
+
/** Updates the custom detail payload passed to listeners. @keywords set-detail payload custom-event */
|
|
348
355
|
setDetail(detail?: D): this;
|
|
349
|
-
/** Dispatches a CustomEvent
|
|
356
|
+
/** Dispatches a CustomEvent with optional payload across configured event types. @keywords dispatch trigger fire */
|
|
350
357
|
dispatch(detail?: D | undefined): this;
|
|
351
|
-
/**
|
|
358
|
+
/** Attaches and activates the event listeners. @keywords start listen attach */
|
|
352
359
|
start(): this;
|
|
353
|
-
/**
|
|
360
|
+
/** Detaches and stops the event listeners. @keywords stop remove detach */
|
|
354
361
|
stop(): this;
|
|
355
|
-
/** Toggles
|
|
362
|
+
/** Toggles the active listening state based on the given boolean. @keywords toggle state active */
|
|
356
363
|
toggle(activity: boolean): this;
|
|
357
|
-
/**
|
|
364
|
+
/** Resets the event listener lifecycle by restarting if currently active. @keywords reset reload restart */
|
|
358
365
|
reset(): this;
|
|
359
366
|
}
|
|
360
367
|
|
|
361
|
-
/** Formats a
|
|
368
|
+
/** Formats a dataset or single item using configured options. @keywords formatters, list format, data formatting */
|
|
362
369
|
export declare class Formatters<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp, Item extends FormattersItemProp<List> = FormattersItemProp<List>> {
|
|
363
|
-
/** Initializes
|
|
370
|
+
/** Initializes formatter options and dataset. @keywords constructor, initialize */
|
|
364
371
|
constructor(options: Options, list?: List | undefined);
|
|
365
|
-
/** Checks
|
|
372
|
+
/** Checks whether the dataset is defined. @keywords is, has data, exists */
|
|
366
373
|
is(): boolean;
|
|
367
|
-
/** Type guard checking
|
|
374
|
+
/** Type guard checking whether the dataset is an array. @keywords isArray, type guard, array */
|
|
368
375
|
isArray(): this is this & {
|
|
369
376
|
list: FormattersList<Item>;
|
|
370
377
|
};
|
|
371
|
-
/** Returns
|
|
372
|
-
length(): number;
|
|
373
|
-
/** Returns the current list of items as an array. @keywords getList, items, array */
|
|
378
|
+
/** Returns current dataset normalized as an array. @keywords getList, list, array */
|
|
374
379
|
getList(): FormattersList<Item>;
|
|
375
|
-
/** Returns
|
|
380
|
+
/** Returns current formatting options configuration. @keywords getOptions, options, config */
|
|
376
381
|
getOptions(): Options;
|
|
377
|
-
/** Sets
|
|
382
|
+
/** Sets or updates the dataset to format. @keywords setList, update, dataset */
|
|
378
383
|
setList(list?: List): this;
|
|
379
|
-
/**
|
|
384
|
+
/** Returns the record count in the dataset. @keywords length, count, size */
|
|
385
|
+
length(): number;
|
|
386
|
+
/** Formats the dataset or single item and appends formatted values with 'Format' suffix. @keywords to, format, transform */
|
|
380
387
|
to(): FormattersReturn<List, Options>;
|
|
381
388
|
}
|
|
382
389
|
|
|
383
|
-
/** Static
|
|
390
|
+
/** Static manager for geographical data, locale, country, and time zone. @keywords geo, locale, country, timezone */
|
|
384
391
|
export declare class Geo {
|
|
385
|
-
/** Returns
|
|
386
|
-
static getObject(): GeoInstance;
|
|
387
|
-
/** Returns information about the current country and language. @keywords current, geo, locale */
|
|
392
|
+
/** Returns information about the current country and language. @keywords current, country, language, geo */
|
|
388
393
|
static get(): GeoItemFull;
|
|
394
|
+
/** Sets the current geographical location and updates instance state. @keywords set, location, locale */
|
|
395
|
+
static set(code: string, save?: boolean): void;
|
|
396
|
+
/** Resolves geo data by country or language code from the global database. @keywords lookup, code, country, language */
|
|
397
|
+
static getByCode(code?: string): GeoItemFull;
|
|
398
|
+
/** Finds exact geo data matching a full locale string. @keywords match, locale, full */
|
|
399
|
+
static getByCodeFull(code: string): GeoItem | undefined;
|
|
400
|
+
/** Retrieves geo data for a specific country code. @keywords country, lookup */
|
|
401
|
+
static getByCountry(country: string): GeoItem | undefined;
|
|
402
|
+
/** Retrieves geo data for a specific language code. @keywords language, lookup */
|
|
403
|
+
static getByLanguage(language: string): GeoItem | undefined;
|
|
389
404
|
/** Returns the 2-letter code of the current country. @keywords country, code, iso */
|
|
390
405
|
static getCountry(): string;
|
|
406
|
+
/** Returns the first day of the week for the current locale. @keywords firstDay, week, calendar */
|
|
407
|
+
static getFirstDay(): string;
|
|
408
|
+
/** Returns fully processed geo data updated with the current language. @keywords item, full, locale */
|
|
409
|
+
static getItem(): GeoItemFull;
|
|
391
410
|
/** Returns the 2-letter code of the current language. @keywords language, code, iso */
|
|
392
411
|
static getLanguage(): string;
|
|
393
|
-
/** Returns the
|
|
394
|
-
static
|
|
395
|
-
/** Returns the
|
|
396
|
-
static getFirstDay(): string;
|
|
397
|
-
/** Returns the current location string. @keywords location, current */
|
|
412
|
+
/** Returns the list of all available countries and regions. @keywords list, countries, regions */
|
|
413
|
+
static getList(): GeoItem[];
|
|
414
|
+
/** Returns the current location string identifier. @keywords location, current */
|
|
398
415
|
static getLocation(): string;
|
|
399
|
-
/** Returns the country code extracted from the location string. @keywords location, country,
|
|
416
|
+
/** Returns the country code extracted from the location string. @keywords location, country, extract */
|
|
400
417
|
static getLocationCountry(): string;
|
|
401
|
-
/** Returns the language code extracted from the location string. @keywords location, language,
|
|
418
|
+
/** Returns the language code extracted from the location string. @keywords location, language, extract */
|
|
402
419
|
static getLocationLanguage(): string;
|
|
403
|
-
/** Returns
|
|
404
|
-
static
|
|
405
|
-
/** Returns the
|
|
406
|
-
static
|
|
407
|
-
/** Returns
|
|
408
|
-
static getByCode(code?: string): GeoItemFull;
|
|
409
|
-
/** Returns exact geo data by searching for full locale match (e.g., 'en-US'). @keywords full, locale, lookup */
|
|
410
|
-
static getByCodeFull(code: string): GeoItem | undefined;
|
|
411
|
-
/** Returns geo data for a specific country by its code. @keywords country, lookup */
|
|
412
|
-
static getByCountry(country: string): GeoItem | undefined;
|
|
413
|
-
/** Returns geo data for a specific language by its code. @keywords language, lookup */
|
|
414
|
-
static getByLanguage(language: string): GeoItem | undefined;
|
|
415
|
-
/** Returns the time zone offset in minutes for the current context. @keywords timezone, offset, minutes */
|
|
420
|
+
/** Returns a request-isolated instance of GeoInstance. @keywords instance, isolated, context */
|
|
421
|
+
static getObject(): GeoInstance;
|
|
422
|
+
/** Returns the combined standard locale string (e.g. 'en-US'). @keywords standard, locale, format */
|
|
423
|
+
static getStandard(): string;
|
|
424
|
+
/** Returns the timezone offset in minutes for the current context. @keywords timezone, offset, minutes */
|
|
416
425
|
static getTimezone(): number;
|
|
417
|
-
/** Returns the formatted
|
|
426
|
+
/** Returns the formatted timezone string (e.g. '+00:00'). @keywords timezone, format, offset */
|
|
418
427
|
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 */
|
|
428
|
+
/** Sets a custom timezone offset in minutes for the current context. @keywords timezone, set, offset */
|
|
426
429
|
static setTimezone(timezone: number): void;
|
|
427
|
-
/** Sets the default
|
|
430
|
+
/** Sets the default country code or provider function. @keywords default, country, fallback */
|
|
428
431
|
static setValueDefault(code?: string | (() => string)): void;
|
|
429
|
-
/** Adds or updates country geo data and merges with existing
|
|
432
|
+
/** Adds or updates country geo data and merges with existing records. @keywords add, country, update, merge */
|
|
430
433
|
static add(country: string, item: Partial<GeoItem>): GeoInstance;
|
|
431
|
-
/** Adds or updates multiple
|
|
434
|
+
/** Adds or updates multiple country entries in the geo registry. @keywords addList, bulk, countries */
|
|
432
435
|
static addList(list: Record<string, Partial<GeoItem>>): GeoInstance;
|
|
436
|
+
/** Resolves geo data for a given code (alias for getByCode). @keywords find, search, code */
|
|
437
|
+
static find(code: string): GeoItemFull;
|
|
438
|
+
/** Generates a standard formatted locale string from a geo item. @keywords standard, format, locale */
|
|
439
|
+
static toStandard(item: GeoItem): string;
|
|
433
440
|
}
|
|
434
441
|
|
|
435
442
|
export declare const GEO_FLAG_ICON_NAME = "f";
|
|
436
|
-
/**
|
|
443
|
+
/** Country, language, and flag icon geographic utility. @keywords geo flag country language locale icon */
|
|
437
444
|
export declare class GeoFlag {
|
|
438
|
-
/**
|
|
445
|
+
/** Country code to flag icon name mapping. @keywords flag icons mapping */
|
|
439
446
|
static flags: Record<string, string>;
|
|
440
|
-
/**
|
|
447
|
+
/** Creates a GeoFlag instance with an optional country/language code. @keywords constructor init */
|
|
441
448
|
constructor(code?: string);
|
|
442
|
-
/** Retrieves country
|
|
449
|
+
/** Retrieves country and flag details. @keywords get country flag */
|
|
443
450
|
get(code?: string): GeoFlagItem | undefined;
|
|
444
|
-
/** Retrieves language
|
|
451
|
+
/** Retrieves language and flag details. @keywords get language flag */
|
|
445
452
|
getLanguage(code?: string): GeoFlagItem | undefined;
|
|
446
|
-
/** Returns the active country code. @keywords
|
|
453
|
+
/** Returns the active country code. @keywords country code get */
|
|
447
454
|
getCode(): string;
|
|
448
|
-
/** Returns the flag icon identifier for a
|
|
455
|
+
/** Returns the flag icon identifier for a country code. @keywords flag icon code */
|
|
449
456
|
getFlag(code?: string): string | undefined;
|
|
450
|
-
/**
|
|
457
|
+
/** Returns country list, optionally filtered and sorted. @keywords list countries sort */
|
|
451
458
|
getList(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
452
|
-
/**
|
|
459
|
+
/** Returns language list, optionally filtered and sorted. @keywords list languages sort */
|
|
453
460
|
getListLanguage(codes?: string[], sort?: boolean): GeoFlagItem[];
|
|
454
|
-
/**
|
|
461
|
+
/** Returns country list with names in native languages. @keywords national countries native */
|
|
455
462
|
getNational(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
456
|
-
/**
|
|
463
|
+
/** Returns language list with names in native languages. @keywords national languages native */
|
|
457
464
|
getNationalLanguage(codes?: string[], sort?: boolean): GeoFlagNational[];
|
|
458
|
-
/** Updates the
|
|
465
|
+
/** Updates the active locale or country code. @keywords set code locale */
|
|
459
466
|
setCode(code: string): this;
|
|
460
467
|
}
|
|
461
468
|
|
|
462
|
-
/** Internationalization and localization utility
|
|
469
|
+
/** Internationalization and localization utility wrapper for ECMAScript Intl API. @keywords intl, i18n, l10n, localization, format */
|
|
463
470
|
export declare class GeoIntl {
|
|
464
|
-
/**
|
|
471
|
+
/** Creates a GeoIntl instance for a given country or locale code. @keywords constructor, locale, init */
|
|
472
|
+
constructor(code?: string, errorCenter?: ErrorCenterInstance);
|
|
473
|
+
/** Checks whether an instance exists for the specified country or locale code. @keywords exists, cache, check */
|
|
465
474
|
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 */
|
|
475
|
+
/** Returns a cached or new GeoIntl instance for the specified code. @keywords singleton, instance, factory */
|
|
469
476
|
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 */
|
|
477
|
+
/** Returns the standard location code for a given country/locale. @keywords location, locale, code */
|
|
478
|
+
static getLocation(code?: string): string;
|
|
479
|
+
/** Returns the first day of the week for the locale. @keywords first day, week, start day */
|
|
475
480
|
getFirstDay(): string;
|
|
476
|
-
/**
|
|
481
|
+
/** Returns the current country and language locale code. @keywords location, locale, code */
|
|
482
|
+
getLocation(): string;
|
|
483
|
+
/** Translates language, region, or script display names. @keywords display, translate, intl */
|
|
477
484
|
display(value?: string, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): string;
|
|
478
|
-
/**
|
|
485
|
+
/** Returns localized display name of a language code. @keywords language, display name */
|
|
479
486
|
languageName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
480
|
-
/**
|
|
487
|
+
/** Returns localized display name of a region or country code. @keywords country, region, name */
|
|
481
488
|
countryName(value?: string, style?: Intl.RelativeTimeFormatStyle): string;
|
|
482
|
-
/**
|
|
489
|
+
/** Returns a formatted full name according to locale rules. @keywords fullName, person, format */
|
|
483
490
|
fullName(last: string, first: string, surname?: string, short?: boolean): string;
|
|
484
|
-
/** Formats
|
|
491
|
+
/** Formats a number, bigint, or string value according to locale rules. @keywords number, format, digits */
|
|
485
492
|
number(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
486
|
-
/**
|
|
493
|
+
/** Returns the decimal point separator symbol for the locale. @keywords decimal, point, separator */
|
|
487
494
|
decimal(): string;
|
|
488
|
-
/** Formats
|
|
495
|
+
/** Formats a numerical value as currency. @keywords currency, money, format */
|
|
489
496
|
currency(value: NumberOrString, currencyOptions?: string | Intl.NumberFormatOptions, numberOnly?: boolean): string;
|
|
490
|
-
/** Returns the currency symbol or code
|
|
497
|
+
/** Returns the currency symbol or currency code. @keywords currencySymbol, currency, sign */
|
|
491
498
|
currencySymbol(currency: string, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): string;
|
|
492
|
-
/** Formats a
|
|
499
|
+
/** Formats a value with a specific measurement unit. @keywords unit, measurement, format */
|
|
493
500
|
unit(value: NumberOrString, unitOptions?: string | Intl.NumberFormatOptions): string;
|
|
494
|
-
/**
|
|
501
|
+
/** Returns a localized formatted file size string. @keywords sizeFile, bytes, file size */
|
|
495
502
|
sizeFile(value: NumberOrString, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): string;
|
|
496
|
-
/** Formats a
|
|
503
|
+
/** Formats a number as a percentage. @keywords percent, percentage, ratio */
|
|
497
504
|
percent(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
498
|
-
/** Formats a 0-
|
|
505
|
+
/** Formats a fraction (0-1) as a percentage (0-100%). @keywords percentBy100, percentage, ratio */
|
|
499
506
|
percentBy100(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
500
|
-
/**
|
|
507
|
+
/** Applies plural-sensitive formatting and returns the appropriate word form. @keywords plural, rules, grammar */
|
|
501
508
|
plural(value: NumberOrString, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): string;
|
|
502
|
-
/** Formats date and time
|
|
509
|
+
/** Formats date and time according to locale rules. @keywords date, time, format */
|
|
503
510
|
date(value: NumberOrStringOrDate, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): string;
|
|
504
|
-
/** Formats
|
|
511
|
+
/** Formats relative time from a given date. @keywords relative, time, ago */
|
|
505
512
|
relative(value: NumberOrStringOrDate, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): string;
|
|
506
|
-
/** Formats relative time
|
|
513
|
+
/** Formats relative time within a limit, otherwise falls back to standard date format. @keywords relativeLimit, relative, limit */
|
|
507
514
|
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
|
|
515
|
+
/** Formats elapsed relative time for an explicit time unit. @keywords relativeByValue, relative, elapsed */
|
|
509
516
|
relativeByValue(value: NumberOrString, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): string;
|
|
510
|
-
/**
|
|
517
|
+
/** Returns the localized month name for a given date. @keywords month, name */
|
|
511
518
|
month(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['month']): string;
|
|
512
|
-
/** Returns
|
|
519
|
+
/** Returns a localized list of all months. @keywords months, list, select */
|
|
513
520
|
months(style?: Intl.DateTimeFormatOptions['month']): ItemValue<number | undefined>[];
|
|
514
|
-
/**
|
|
521
|
+
/** Returns the localized day-of-week name for a given date. @keywords weekday, day, name */
|
|
515
522
|
weekday(value?: NumberOrStringOrDate, style?: Intl.DateTimeFormatOptions['weekday']): string;
|
|
516
|
-
/** Returns
|
|
523
|
+
/** Returns a localized list of all days of the week. @keywords weekdays, list, select */
|
|
517
524
|
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ItemValue<number | undefined>[];
|
|
518
|
-
/** Formats the time portion of a date
|
|
525
|
+
/** Formats the time portion of a date. @keywords time, clock, format */
|
|
519
526
|
time(value: NumberOrStringOrDate): string;
|
|
520
|
-
/** Sorts
|
|
521
|
-
sort<T>(data: T[], compareFn?: (
|
|
527
|
+
/** Sorts an array of items using locale-sensitive string comparison. @keywords sort, collator, compare */
|
|
528
|
+
sort<T>(data: T[], compareFn?: (itemA: T, itemB: T) => [
|
|
529
|
+
string,
|
|
530
|
+
string
|
|
531
|
+
]): T[];
|
|
522
532
|
}
|
|
523
533
|
|
|
524
|
-
/**
|
|
534
|
+
/** Manages phone number masks, country codes, and formatting. @keywords phone mask country code parser */
|
|
525
535
|
export declare class GeoPhone {
|
|
526
|
-
/** Retrieves phone code and country
|
|
536
|
+
/** Retrieves phone code and country mask data by country or language code. @keywords phone mask country code lookup */
|
|
527
537
|
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 */
|
|
538
|
+
/** Retrieves full phone mask map item by country code. @keywords phone mask map country */
|
|
531
539
|
static getByCode(code: string): GeoPhoneMap | undefined;
|
|
532
|
-
/**
|
|
540
|
+
/** Identifies country and mask metadata from a phone number string. @keywords phone metadata identify lookup */
|
|
541
|
+
static getByPhone(phone: string): GeoPhoneMapInfo;
|
|
542
|
+
/** Retrieves a list of all available phone mask items. @keywords phone masks list all */
|
|
533
543
|
static getList(): GeoPhoneValue[];
|
|
534
|
-
/**
|
|
544
|
+
/** Retrieves a tree map of phone mask configurations indexed by code. @keywords phone mask tree map */
|
|
535
545
|
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 */
|
|
546
|
+
/** Strips leading zeros or country dialing prefix from a phone number. @keywords sanitize phone clean zero prefix */
|
|
539
547
|
static removeZero(phone: string): string;
|
|
548
|
+
/** Formats a phone number according to matching or provided masks. @keywords format phone mask formatter */
|
|
549
|
+
static toMask(phone: string, masks?: string[]): string | undefined;
|
|
540
550
|
}
|
|
541
551
|
|
|
542
|
-
/** Localized unit formatting and automatic conversions
|
|
552
|
+
/** Localized unit formatting and automatic conversions for metric and regional units. @keywords unit, localization, conversion, measurement, geo */
|
|
543
553
|
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 */
|
|
554
|
+
/** Creates a GeoUnit instance for a locale or country code. @keywords constructor, locale */
|
|
547
555
|
constructor(code?: string);
|
|
548
|
-
/** Gets the
|
|
556
|
+
/** Gets a cached GeoUnit instance for the specified locale code. @keywords cache, instance, factory */
|
|
557
|
+
static getInstance(code?: string): GeoUnit;
|
|
558
|
+
/** Returns the resolved standard location code. @keywords location, country, locale */
|
|
549
559
|
getLocation(): string;
|
|
550
|
-
/** Formats
|
|
560
|
+
/** Formats millimeters, converting to inches if configured by locale. @keywords millimeter, length, distance, inch */
|
|
551
561
|
millimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
552
|
-
/** Formats
|
|
562
|
+
/** Formats centimeters, converting to inches if configured by locale. @keywords centimeter, length, distance, inch */
|
|
553
563
|
centimeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
554
|
-
/** Formats
|
|
564
|
+
/** Formats meters, converting to feet if configured by locale. @keywords meter, length, distance, foot */
|
|
555
565
|
meter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
556
|
-
/** Formats
|
|
566
|
+
/** Formats kilometers, converting to miles if configured by locale. @keywords kilometer, distance, mile */
|
|
557
567
|
kilometer(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
558
|
-
/** Formats square
|
|
568
|
+
/** Formats square meters, converting to square feet if configured by locale. @keywords square meter, area, square foot */
|
|
559
569
|
squareMeter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
560
|
-
/** Formats
|
|
570
|
+
/** Formats hectares, converting to acres if configured by locale. @keywords hectare, area, acre */
|
|
561
571
|
hectare(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
562
|
-
/** Formats
|
|
572
|
+
/** Formats grams, converting to ounces if configured by locale. @keywords gram, weight, mass, ounce */
|
|
563
573
|
gram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
564
|
-
/** Formats
|
|
574
|
+
/** Formats kilograms, converting to pounds if configured by locale. @keywords kilogram, weight, mass, pound */
|
|
565
575
|
kilogram(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
566
|
-
/** Formats
|
|
576
|
+
/** Formats tonnes, converting to short tons if configured by locale. @keywords tonne, metric ton, mass, ton */
|
|
567
577
|
tonne(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
568
|
-
/** Formats
|
|
578
|
+
/** Formats milliliters, converting to fluid ounces if configured by locale. @keywords milliliter, volume, fluid ounce */
|
|
569
579
|
milliliter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
570
|
-
/** Formats
|
|
580
|
+
/** Formats liters, converting to gallons if configured by locale. @keywords liter, volume, gallon */
|
|
571
581
|
liter(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
572
|
-
/** Formats
|
|
582
|
+
/** Formats celsius, converting to fahrenheit if configured by locale. @keywords celsius, temperature, fahrenheit */
|
|
573
583
|
celsius(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
574
|
-
/** Formats
|
|
584
|
+
/** Formats kilometers per hour, converting to miles per hour if configured by locale. @keywords speed, kilometer per hour, mph */
|
|
575
585
|
kilometerPerHour(value: NumberOrString, options?: Intl.NumberFormatOptions): string;
|
|
576
|
-
/** Formats a numeric value for the specified unit according to locale
|
|
586
|
+
/** Formats a numeric value for the specified unit according to locale rules. @keywords format, unit, conversion */
|
|
577
587
|
format(value: NumberOrString, unit: string, options?: Intl.NumberFormatOptions): string;
|
|
578
588
|
}
|
|
579
589
|
|
|
580
|
-
/** Static utility class for storing and retrieving application-wide global data. @keywords global state storage
|
|
590
|
+
/** Static utility class for storing and retrieving application-wide global data. @keywords global state, storage, registry */
|
|
581
591
|
export declare class Global {
|
|
582
|
-
/**
|
|
583
|
-
static
|
|
584
|
-
/** Returns
|
|
585
|
-
static
|
|
586
|
-
/**
|
|
587
|
-
static add(data: Record<string,
|
|
592
|
+
/** Retrieves a global value by property name. @keywords get, lookup, retrieve, state */
|
|
593
|
+
static get<R = unknown>(name: string): R;
|
|
594
|
+
/** Returns the entire global data storage record. @keywords storage, state, get all, dictionary */
|
|
595
|
+
static getItem(): Record<string, unknown>;
|
|
596
|
+
/** Initializes global data once. @keywords add, initialize, set global */
|
|
597
|
+
static add(data: Record<string, unknown>): void;
|
|
588
598
|
}
|
|
589
599
|
|
|
590
|
-
/** Static
|
|
600
|
+
/** Static class managing data stored in the URL hash via HashInstance delegation. @keywords hash url state navigation routing */
|
|
591
601
|
export declare class Hash {
|
|
592
|
-
/** Returns a request-isolated HashInstance. @keywords instance
|
|
602
|
+
/** Returns a request-isolated HashInstance instance. @keywords hash instance isolate get */
|
|
593
603
|
static getItem(): HashInstance;
|
|
594
|
-
/** Retrieves a value from the URL hash. @keywords hash
|
|
604
|
+
/** Retrieves a stored value by name from the URL hash with an optional default. @keywords get hash value read query */
|
|
595
605
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
596
|
-
/** Sets or updates a value in the URL hash. @keywords hash
|
|
606
|
+
/** Sets or updates a value in the URL hash. @keywords set hash value update write */
|
|
597
607
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
598
|
-
/** Subscribes a listener callback to changes for a specific hash variable. @keywords watch
|
|
608
|
+
/** Subscribes a listener callback to changes for a specific hash variable. @keywords watch listener subscribe observe change */
|
|
599
609
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
600
|
-
/** Unsubscribes a listener callback from hash variable
|
|
610
|
+
/** Unsubscribes a listener callback from changes for a specific hash variable. @keywords unwatch unsubscribe remove listener */
|
|
601
611
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
602
|
-
/**
|
|
612
|
+
/** Synchronizes hash variables by reparsing the current URL string. @keywords reload sync refresh parse */
|
|
603
613
|
static reload(): void;
|
|
614
|
+
/** Resets the instance, clears state, and removes all active listeners. @keywords reset destroy clear teardown */
|
|
615
|
+
static reset(): void;
|
|
604
616
|
}
|
|
605
617
|
|
|
606
|
-
export type IconsItem = string | Promise<string |
|
|
618
|
+
export type IconsItem = string | Promise<string | unknown> | (() => Promise<string | unknown>);
|
|
607
619
|
export type IconsConfig = {
|
|
608
620
|
url?: string;
|
|
609
621
|
list?: Record<string, IconsItem>;
|
|
610
622
|
};
|
|
611
|
-
/** Icon manager
|
|
623
|
+
/** Icon manager for registering, caching, and retrieving icon assets. @keywords icon, icons, manager, registry */
|
|
612
624
|
export declare class Icons {
|
|
613
|
-
/** Checks
|
|
625
|
+
/** Checks whether an icon is registered by name. @keywords icon, check, exists, is */
|
|
614
626
|
static is(index: string): boolean;
|
|
615
|
-
/**
|
|
627
|
+
/** Asynchronously retrieves an icon by name or URL with optional timeout. @keywords icon, get, fetch, load, async */
|
|
616
628
|
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
617
|
-
/** Synchronously returns an icon if loaded or string
|
|
629
|
+
/** Synchronously returns an icon if loaded or retrieves from string source. @keywords icon, getAsync, sync, cache */
|
|
618
630
|
static getAsync(index: string, url?: string): string;
|
|
619
|
-
/**
|
|
631
|
+
/** Returns a list of all registered icon names. @keywords icon, list, names, keys */
|
|
620
632
|
static getNameList(): string[];
|
|
621
|
-
/**
|
|
633
|
+
/** Returns the global base URL for icon storage. @keywords icon, url, global, base */
|
|
622
634
|
static getUrlGlobal(): string;
|
|
623
|
-
/**
|
|
635
|
+
/** Updates the icon configuration. @keywords icon, config, configure, settings */
|
|
636
|
+
static setConfig(config: IconsConfig): void;
|
|
637
|
+
/** Sets the global base URL for icon storage. @keywords icon, url, set, base */
|
|
638
|
+
static setUrl(url: string): void;
|
|
639
|
+
/** Registers a custom icon by name with a path, promise, or loader function. @keywords icon, register, add, custom */
|
|
624
640
|
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 */
|
|
641
|
+
/** Registers multiple icons from a key-value map. @keywords icon, register, bulk, addByList, map */
|
|
630
642
|
static addByList(list: Record<string, IconsItem>): void;
|
|
631
|
-
/**
|
|
632
|
-
static
|
|
633
|
-
/**
|
|
634
|
-
static
|
|
643
|
+
/** Registers a global icon path by name. @keywords icon, global, register, addGlobal */
|
|
644
|
+
static addGlobal(index: string, file: string): void;
|
|
645
|
+
/** Marks an icon as being loaded. @keywords icon, load, loading, addLoad */
|
|
646
|
+
static addLoad(index: string): void;
|
|
647
|
+
/** Resets the icon registry to its default state. @keywords icon, reset, clear */
|
|
648
|
+
static reset(): void;
|
|
635
649
|
}
|
|
636
650
|
|
|
637
|
-
/**
|
|
651
|
+
/** Manages global loading state and loader events. @keywords global loading, loader, spinner, state */
|
|
638
652
|
export declare class Loading {
|
|
639
|
-
/**
|
|
640
|
-
static is(): boolean;
|
|
641
|
-
/** Gets the current loading count or value. @keywords loading count, status */
|
|
653
|
+
/** Gets the current loading counter value. @keywords loading value, counter, progress */
|
|
642
654
|
static get(): number;
|
|
643
|
-
/**
|
|
655
|
+
/** Checks if the loader is currently active. @keywords is loading, active loader, status */
|
|
656
|
+
static is(): boolean;
|
|
657
|
+
/** Returns a request-isolated LoadingInstance object. @keywords loading instance, isolated loader, context */
|
|
644
658
|
static getItem(): LoadingInstance;
|
|
645
|
-
/**
|
|
659
|
+
/** Increments the loading counter and displays the loader. @keywords show loader, start loading, display spinner */
|
|
646
660
|
static show(): void;
|
|
647
|
-
/**
|
|
661
|
+
/** Decrements the loading counter and hides the loader when zero. @keywords hide loader, stop loading, dismiss spinner */
|
|
648
662
|
static hide(): void;
|
|
649
|
-
/** Registers an event listener for loading state changes. @keywords loading event,
|
|
663
|
+
/** Registers an event listener for loading state changes. @keywords add event listener, loading event, watch */
|
|
650
664
|
static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
651
|
-
/** Unregisters a loading state event listener. @keywords remove listener, unsubscribe */
|
|
665
|
+
/** Unregisters a previously added loading state event listener. @keywords remove event listener, unsubscribe, loading event */
|
|
652
666
|
static unregistrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
653
667
|
}
|
|
654
668
|
|
|
655
|
-
/** Unified manager for standard HTML, Open Graph, and Twitter Card meta tags. @keywords meta,
|
|
669
|
+
/** Unified manager for standard HTML, Open Graph, and Twitter Card meta tags. @keywords meta, seo, open graph, twitter card, head */
|
|
656
670
|
export declare class Meta extends MetaManager<MetaTag[]> {
|
|
657
|
-
/**
|
|
671
|
+
/** Initializes Meta manager with integrated Open Graph and Twitter Card support. @keywords constructor, init */
|
|
658
672
|
constructor();
|
|
659
|
-
/** Gets the MetaOg instance for Open Graph operations. @keywords og,
|
|
673
|
+
/** Gets the MetaOg instance for Open Graph operations. @keywords og, open graph */
|
|
660
674
|
getOg(): MetaOg;
|
|
661
|
-
/** Gets the MetaTwitter instance for Twitter Card operations. @keywords twitter, card */
|
|
675
|
+
/** Gets the MetaTwitter instance for Twitter Card operations. @keywords twitter, twitter card */
|
|
662
676
|
getTwitter(): MetaTwitter;
|
|
663
|
-
/** Gets the page title without suffix. @keywords title, get */
|
|
677
|
+
/** Gets the page title without suffix. @keywords title, get title */
|
|
664
678
|
getTitle(): string;
|
|
665
|
-
/** Gets the keywords meta tag content. @keywords keywords,
|
|
679
|
+
/** Gets the keywords meta tag content. @keywords keywords, seo */
|
|
666
680
|
getKeywords(): string;
|
|
667
|
-
/** Gets the description meta tag content. @keywords description,
|
|
681
|
+
/** Gets the description meta tag content. @keywords description, seo */
|
|
668
682
|
getDescription(): string;
|
|
669
|
-
/** Gets the Open Graph image URL. @keywords image, og
|
|
683
|
+
/** Gets the Open Graph image URL. @keywords image, og image */
|
|
670
684
|
getImage(): string;
|
|
671
|
-
/** Gets the canonical URL. @keywords canonical, url
|
|
685
|
+
/** Gets the canonical URL. @keywords canonical, url */
|
|
672
686
|
getCanonical(): string;
|
|
673
|
-
/** Gets the robots meta tag directive. @keywords robots,
|
|
687
|
+
/** Gets the robots meta tag directive. @keywords robots, indexing, seo */
|
|
674
688
|
getRobots(): MetaRobots;
|
|
675
|
-
/** Gets the author meta tag content. @keywords author
|
|
689
|
+
/** Gets the author meta tag content. @keywords author */
|
|
676
690
|
getAuthor(): string;
|
|
677
|
-
/** Gets the Open Graph site name. @keywords
|
|
691
|
+
/** Gets the Open Graph site name. @keywords site name, og */
|
|
678
692
|
getSiteName(): string;
|
|
679
|
-
/** Gets the Open Graph locale. @keywords locale, og
|
|
693
|
+
/** Gets the Open Graph locale. @keywords locale, og */
|
|
680
694
|
getLocale(): string;
|
|
681
|
-
/** Sets the page title with suffix and updates Open Graph and Twitter Card titles. @keywords title,
|
|
695
|
+
/** Sets the page title with suffix and updates Open Graph and Twitter Card titles. @keywords set title, og title, twitter title */
|
|
682
696
|
setTitle(title: string): this;
|
|
683
|
-
/** Sets the keywords meta tag. @keywords keywords, set */
|
|
697
|
+
/** Sets the keywords meta tag from a string or string array. @keywords keywords, set keywords */
|
|
684
698
|
setKeywords(keywords: string | string[]): this;
|
|
685
|
-
/** Sets the description meta tag. @keywords description, set */
|
|
699
|
+
/** Sets the description meta tag. @keywords description, set description */
|
|
686
700
|
setDescription(description: string): this;
|
|
687
|
-
/** Sets the image for Open Graph and Twitter Card. @keywords image, og, twitter
|
|
701
|
+
/** Sets the image URL for Open Graph and Twitter Card. @keywords image, og image, twitter image */
|
|
688
702
|
setImage(image: string): this;
|
|
689
|
-
/** Sets the canonical URL and updates Open Graph and Twitter Card URLs. @keywords canonical, url
|
|
703
|
+
/** Sets the canonical URL and updates Open Graph and Twitter Card URLs. @keywords canonical, url */
|
|
690
704
|
setCanonical(canonical: string): this;
|
|
691
|
-
/** Sets the robots meta tag
|
|
705
|
+
/** Sets the robots meta directive tag. @keywords robots, indexing, crawler */
|
|
692
706
|
setRobots(robots: MetaRobots): this;
|
|
693
|
-
/** Sets the author meta tag. @keywords author
|
|
707
|
+
/** Sets the author meta tag. @keywords author */
|
|
694
708
|
setAuthor(author: string): this;
|
|
695
|
-
/** Sets the site name for Open Graph and Twitter Card. @keywords
|
|
709
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords site name, og */
|
|
696
710
|
setSiteName(siteName: string): this;
|
|
697
|
-
/** Sets the Open Graph
|
|
711
|
+
/** Sets the locale for Open Graph. @keywords locale, og locale */
|
|
698
712
|
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,
|
|
713
|
+
/** Sets the suffix to append to the page title. @keywords suffix, title suffix */
|
|
714
|
+
setSuffix(suffix?: string): this;
|
|
715
|
+
/** Generates the complete HTML string for all meta tags. @keywords html, render, tags */
|
|
702
716
|
html(): string;
|
|
703
|
-
/** Generates the
|
|
717
|
+
/** Generates the HTML-safe page title string. @keywords html title, render title */
|
|
704
718
|
htmlTitle(): string;
|
|
705
719
|
}
|
|
706
720
|
|
|
707
|
-
/** Static
|
|
721
|
+
/** Static utility providing centralized access to URL query parameters delegating to QueryInstance. @keywords query, search-params, url */
|
|
708
722
|
export declare class Query {
|
|
709
|
-
/** Returns a request-isolated QueryInstance. @keywords instance,
|
|
723
|
+
/** Returns a request-isolated instance of QueryInstance. @keywords query-instance, get-item, context */
|
|
710
724
|
static getItem(): QueryInstance;
|
|
711
|
-
/** Retrieves a parameter value from the query
|
|
725
|
+
/** Retrieves a parameter value from the URL query with an optional default value or getter. @keywords get, query-param, read */
|
|
712
726
|
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
713
|
-
/** Sets or updates a parameter in the URL query
|
|
727
|
+
/** Sets or updates a parameter value in the URL query. @keywords set, query-param, update, write */
|
|
714
728
|
static set<T>(name: string, callback: T | (() => T)): void;
|
|
715
|
-
/**
|
|
729
|
+
/** Registers a listener callback for changes to a specific query parameter. @keywords add-watch, listener, observe, query-change */
|
|
716
730
|
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
717
|
-
/**
|
|
731
|
+
/** Unregisters an existing change listener callback for a query parameter. @keywords remove-watch, unwatch, unsubscribe */
|
|
718
732
|
static removeWatch<T>(name: string, callback: (value: T) => void): void;
|
|
719
|
-
/**
|
|
733
|
+
/** Re-parses and updates query variables from the current URL string. @keywords reload, refresh, sync-url */
|
|
720
734
|
static reload(): void;
|
|
735
|
+
/** Resets the instance and removes all attached listeners. @keywords reset, destroy, cleanup, clear */
|
|
721
736
|
}
|
|
722
737
|
|
|
723
|
-
/** Timer that can be paused, resumed, reset, and cleared. @keywords timer, pause, resume, timeout,
|
|
738
|
+
/** Timer that can be paused, resumed, reset, and cleared. @keywords timer, pause, resume, delay, timeout, schedule */
|
|
724
739
|
export declare class ResumableTimer {
|
|
725
|
-
/** Creates a resumable timer instance. @
|
|
740
|
+
/** Creates a new resumable timer instance. @keywords constructor, create, timer */
|
|
726
741
|
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 */
|
|
742
|
+
/** Resets and restarts the timer with the original delay. @keywords reset, restart, timer */
|
|
732
743
|
reset(): this;
|
|
733
|
-
/**
|
|
744
|
+
/** Clears the timer and resets its state. @keywords clear, stop, cancel, timer */
|
|
734
745
|
clear(): this;
|
|
746
|
+
/** Pauses the timer and preserves remaining time. @keywords pause, freeze, timer */
|
|
747
|
+
pause(): this;
|
|
748
|
+
/** Resumes a paused timer or starts it if not running. @keywords resume, start, unpause, timer */
|
|
749
|
+
resume(): this;
|
|
735
750
|
}
|
|
736
751
|
|
|
737
|
-
/** Utility
|
|
752
|
+
/** Utility for measuring and caching browser scrollbar width. @keywords scrollbar width measurement scroll */
|
|
738
753
|
export declare class ScrollbarWidth {
|
|
739
|
-
/** Checks whether scrollbar hiding should be enabled. @keywords scrollbar
|
|
754
|
+
/** Checks whether scrollbar hiding should be enabled. @keywords scrollbar check hide enabled */
|
|
740
755
|
static is(): Promise<boolean>;
|
|
741
|
-
/**
|
|
756
|
+
/** Gets the scrollbar width in pixels. @keywords scrollbar width size pixels measure */
|
|
742
757
|
static get(): Promise<number>;
|
|
743
|
-
/** Returns the storage instance
|
|
758
|
+
/** Returns the storage instance caching the scrollbar width. @keywords scrollbar storage cache */
|
|
744
759
|
static getStorage(): DataStorage<number>;
|
|
745
|
-
/** Checks if scrollbar width calculation is currently in progress. @keywords scrollbar
|
|
760
|
+
/** Checks if scrollbar width calculation is currently in progress. @keywords scrollbar calculate status flag */
|
|
746
761
|
static getCalculate(): boolean;
|
|
747
762
|
}
|
|
748
763
|
|
|
749
|
-
/** Manages searchable lists, coordinating options, item state, matching
|
|
764
|
+
/** Manages searchable lists, coordinating options, item state, matching, and data storage. @keywords search list, filter, match coordinator */
|
|
750
765
|
export declare class SearchList<T extends SearchItem, K extends SearchColumns<T>> {
|
|
751
|
-
/**
|
|
766
|
+
/** Creates a new SearchList instance. @keywords initialize, search list, constructor */
|
|
752
767
|
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 */
|
|
768
|
+
/** Retrieves the configured search columns. @keywords get columns, search fields */
|
|
758
769
|
getColumns(): K | undefined;
|
|
759
|
-
/**
|
|
770
|
+
/** Retrieves the search data manager instance. @keywords get data, data manager */
|
|
771
|
+
getData(): SearchListData<T, K>;
|
|
772
|
+
/** Retrieves the search item manager instance. @keywords get item, item state */
|
|
760
773
|
getItem(): SearchListItem;
|
|
761
|
-
/**
|
|
762
|
-
|
|
763
|
-
/**
|
|
774
|
+
/** Retrieves the current list of items. @keywords get list, source items */
|
|
775
|
+
getList(): SearchListValue<T>;
|
|
776
|
+
/** Retrieves the search options instance. @keywords get options, search configuration */
|
|
764
777
|
getOptions(): SearchListOptions;
|
|
765
|
-
/**
|
|
766
|
-
|
|
767
|
-
/** Sets
|
|
778
|
+
/** Retrieves the active search query string. @keywords get value, search query */
|
|
779
|
+
getValue(): string | undefined;
|
|
780
|
+
/** Sets search columns and invalidates the cache. @keywords set columns, search fields */
|
|
768
781
|
setColumns(columns?: K): this;
|
|
769
|
-
/** Sets
|
|
770
|
-
|
|
771
|
-
/** Sets search options and updates the matcher. @keywords set options,
|
|
782
|
+
/** Sets a new list of items and invalidates the cache. @keywords set list, update items */
|
|
783
|
+
setList(list: SearchListValue<T>): this;
|
|
784
|
+
/** Sets search options and updates the matcher. @keywords set options, configure */
|
|
772
785
|
setOptions(options: SearchOptions): this;
|
|
773
|
-
/**
|
|
786
|
+
/** Sets a new search query and updates the matcher. @keywords set value, query filter */
|
|
787
|
+
setValue(value?: string): this;
|
|
788
|
+
/** Processes and returns the formatted list based on current search criteria. @keywords format, search results, execute */
|
|
774
789
|
to(): SearchFormatList<T, K>;
|
|
775
790
|
}
|
|
776
791
|
|
|
777
792
|
type ServerStorageItem = {
|
|
778
|
-
value:
|
|
793
|
+
value: unknown;
|
|
779
794
|
hydration: boolean;
|
|
780
795
|
};
|
|
781
796
|
type ServerStorageList = Record<string, ServerStorageItem>;
|
|
782
|
-
/** Manages isolated data storage during
|
|
797
|
+
/** Manages isolated data storage during server-side rendering (SSR). @keywords ssr server storage request isolation */
|
|
783
798
|
export declare class ServerStorage {
|
|
784
|
-
/**
|
|
785
|
-
static
|
|
786
|
-
/**
|
|
787
|
-
static
|
|
788
|
-
/** Checks if a
|
|
799
|
+
/** Retrieves a stored value or initializes it using the default value factory. @keywords get retrieve cache default */
|
|
800
|
+
static get<T = unknown>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
801
|
+
/** Stores a value produced by a factory function. @keywords set save store cache */
|
|
802
|
+
static set<T = unknown>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
803
|
+
/** Checks if a key exists in the storage. @keywords has exists contains key */
|
|
789
804
|
static has(key: string): boolean;
|
|
790
|
-
/**
|
|
791
|
-
static get<T = any>(key: string, defaultValue?: () => T, hydration?: boolean): T;
|
|
792
|
-
/** Stores a value from a factory function with optional hydration. @keywords set, store, hydration */
|
|
793
|
-
static set<T = any>(key: string, value: () => T, hydration?: boolean, storageList?: ServerStorageList): T;
|
|
794
|
-
/** Sets whether error messages should be hidden or shown. @keywords error, status, logging */
|
|
805
|
+
/** Configures whether error messages should be suppressed. @keywords error status visibility hide */
|
|
795
806
|
static setErrorStatus(hide: boolean): void;
|
|
796
|
-
/** Removes a
|
|
807
|
+
/** Removes a specific item from storage by key. @keywords remove delete clear key */
|
|
797
808
|
static remove(key: string): void;
|
|
798
|
-
/**
|
|
809
|
+
/** Clears all stored values from the current storage context. @keywords reset clear purge */
|
|
810
|
+
static reset(): void;
|
|
811
|
+
/** Initializes storage with a context resolver for request isolation. @keywords init initialize context ssr */
|
|
812
|
+
static init(listener: () => Record<string, unknown> | undefined): typeof ServerStorage;
|
|
813
|
+
/** Serializes storage state into a script tag string for client hydration. @keywords toString hydration serialize script */
|
|
799
814
|
static toString(): string;
|
|
800
815
|
}
|
|
801
816
|
export {};
|
|
802
817
|
|
|
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 */
|
|
818
|
+
/** Manages storage callback lists and execution state. @keywords storage, callbacks, listeners */
|
|
819
|
+
export declare class StorageCallback<T = unknown, Callback = (value: T) => void | Promise<void>> {
|
|
820
|
+
/** Initializes a storage callback manager. @keywords constructor, init */
|
|
808
821
|
constructor(name: string, group?: string);
|
|
809
|
-
/** Checks whether storage
|
|
822
|
+
/** Checks whether callbacks or storage are currently loading. @keywords loading, state, status */
|
|
810
823
|
isLoading(): boolean;
|
|
811
|
-
/**
|
|
812
|
-
|
|
813
|
-
/**
|
|
824
|
+
/** Returns or creates an instance by storage name and group. @keywords singleton, instance, lookup */
|
|
825
|
+
static getInstance<T>(name: string, group?: string): StorageCallback<T>;
|
|
826
|
+
/** Returns the current loading state. @keywords loading, state */
|
|
814
827
|
getLoading(): boolean;
|
|
815
|
-
/**
|
|
828
|
+
/** Returns the storage name identifier. @keywords name, identifier */
|
|
829
|
+
getName(): string;
|
|
830
|
+
/** Registers a callback listener to the list. @keywords add, listener, callback, subscribe */
|
|
816
831
|
addCallback(callback: Callback, isOnce?: boolean): this;
|
|
817
|
-
/**
|
|
832
|
+
/** Removes a callback listener from the list. @keywords remove, unsubscribe, callback */
|
|
818
833
|
removeCallback(callback: Callback): this;
|
|
819
|
-
/** Prepares
|
|
834
|
+
/** Prepares state and data before execution. @keywords prepare, setup, init */
|
|
820
835
|
preparation(): this;
|
|
821
|
-
/** Executes all registered callbacks
|
|
836
|
+
/** Executes all registered callbacks with the provided storage value. @keywords run, execute, notify, trigger */
|
|
822
837
|
run(value: T): Promise<this>;
|
|
823
838
|
}
|
|
824
839
|
|
|
825
|
-
/**
|
|
840
|
+
/** Global translation manager for retrieving and configuring localized text. @keywords translate, i18n, localization, l10n */
|
|
826
841
|
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
|
-
|
|
842
|
+
/** Retrieves translated text asynchronously by code with optional replacements. @keywords get, translate, async, i18n */
|
|
843
|
+
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
844
|
+
/** Returns the global singleton instance of TranslateInstance. @keywords getItem, instance, singleton */
|
|
845
|
+
static getItem(): TranslateInstance;
|
|
846
|
+
/** Retrieves multiple translations asynchronously by an array of text codes. @keywords getList, batch, translate, async */
|
|
847
|
+
static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
848
|
+
/** Retrieves multiple translations synchronously by an array of text codes. @keywords getListSync, batch, translate, sync */
|
|
849
|
+
static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
850
|
+
/** Retrieves translated text synchronously by code with optional replacements. @keywords getSync, translate, sync */
|
|
851
|
+
static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
852
|
+
/** Sets global configuration for the translation service. @keywords setConfig, config, setup */
|
|
853
|
+
static setConfig(config: TranslateConfig): void;
|
|
854
|
+
/** Changes the property name used to retrieve translations. @keywords setPropsName, property, configuration */
|
|
855
|
+
static setPropsName(name: string): void;
|
|
856
|
+
/** Changes the API read mode for translations. @keywords setReadApi, api, mode */
|
|
857
|
+
static setReadApi(value: boolean): void;
|
|
858
|
+
/** Changes the URL path to the script for fetching translations. @keywords setUrl, endpoint, api */
|
|
859
|
+
static setUrl(url: string): void;
|
|
860
|
+
/** Registers a list of translation codes to be loaded. @keywords add, load, translations */
|
|
861
|
+
static add(names: string | string[]): Promise<void>;
|
|
862
|
+
/** Adds translation key-value pairs via request or directly depending on environment. @keywords addNormalOrSync, register, translations */
|
|
863
|
+
static addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
864
|
+
/** Adds translation key-value pairs synchronously into memory. @keywords addSync, register, sync */
|
|
865
|
+
static addSync(data: Record<string, string>): void;
|
|
866
|
+
/** Adds translations synchronously from a file data object. @keywords addSyncByFile, file, import */
|
|
867
|
+
static addSyncByFile(data: TranslateDataFile): void;
|
|
868
|
+
/** Adds translations grouped by location synchronously. @keywords addSyncByLocation, location, locale */
|
|
869
|
+
static addSyncByLocation(data: Record<string, Record<string, string>>): void;
|
|
855
870
|
}
|
|
856
871
|
|
|
857
|
-
/** Isomorphic utility class for URL parsing, manipulation, and
|
|
872
|
+
/** Isomorphic utility class for URL parsing, manipulation, and serialization @keywords url, parser, route, query */
|
|
858
873
|
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 */
|
|
874
|
+
/** Creates a new UrlItem instance @keywords constructor, url, create */
|
|
862
875
|
constructor(url?: string | URL);
|
|
863
|
-
/**
|
|
876
|
+
/** Gets the serialized full URL string @keywords href, url, address */
|
|
864
877
|
get href(): string;
|
|
865
|
-
/**
|
|
878
|
+
/** Gets the protocol scheme including the trailing colon @keywords protocol, scheme, http, https */
|
|
866
879
|
get protocol(): string;
|
|
867
|
-
/**
|
|
880
|
+
/** Gets the username specified before the domain name @keywords username, auth, credentials */
|
|
868
881
|
get username(): string;
|
|
869
|
-
/**
|
|
882
|
+
/** Gets the password specified before the domain name @keywords password, auth, credentials */
|
|
870
883
|
get password(): string;
|
|
871
|
-
/**
|
|
884
|
+
/** Gets the host including hostname and port @keywords host, domain, port */
|
|
872
885
|
get host(): string;
|
|
873
|
-
/**
|
|
886
|
+
/** Gets the domain name or IP without the port @keywords hostname, domain */
|
|
874
887
|
get hostname(): string;
|
|
875
|
-
/**
|
|
888
|
+
/** Gets the port number portion of the URL @keywords port, network */
|
|
876
889
|
get port(): string;
|
|
877
|
-
/**
|
|
878
|
-
get pathname(): string;
|
|
879
|
-
/** Query string including leading question mark. @keywords search, querystring, query */
|
|
890
|
+
/** Gets the resource pathname @keywords pathname, path, route */
|
|
880
891
|
get search(): string;
|
|
881
|
-
/**
|
|
892
|
+
/** Gets the search query string including the leading question mark @keywords search, query, params */
|
|
893
|
+
get pathname(): string;
|
|
894
|
+
/** Gets the URLSearchParams object representing search parameters @keywords searchParams, query, urlsearchparams */
|
|
882
895
|
get searchParams(): URLSearchParams;
|
|
883
|
-
/**
|
|
896
|
+
/** Gets the fragment identifier hash string including the leading hash symbol @keywords hash, fragment, anchor */
|
|
884
897
|
get hash(): string;
|
|
885
|
-
/**
|
|
898
|
+
/** Gets the serialized origin of the URL @keywords origin, domain, protocol */
|
|
886
899
|
get origin(): string;
|
|
887
|
-
/**
|
|
900
|
+
/** Updates the internal URL value @keywords set, update, parse */
|
|
901
|
+
set(url?: string | URL): this;
|
|
902
|
+
/** Checks whether the specified query parameter exists @keywords hasParam, query, contains, exists */
|
|
888
903
|
hasParam(name: string): boolean;
|
|
889
|
-
/** Gets
|
|
904
|
+
/** Gets a request-isolated instance of UrlItem @keywords getInstance, singleton, request */
|
|
905
|
+
static getInstance(): UrlItem;
|
|
906
|
+
/** Gets the value of a specific query parameter @keywords getParam, query, search */
|
|
890
907
|
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 */
|
|
908
|
+
/** Gets all query parameters as an object with converted types @keywords getParams, query, dictionary */
|
|
909
|
+
getParams(): Record<string, unknown>;
|
|
910
|
+
/** Sets the value of a query parameter @keywords setParam, query, search */
|
|
896
911
|
setParam(name: string, value: string): this;
|
|
897
|
-
/** Replaces all query parameters with
|
|
898
|
-
setParams(params: Record<string,
|
|
899
|
-
/**
|
|
912
|
+
/** Replaces all query parameters with values from the specified object @keywords setParams, query, batch */
|
|
913
|
+
setParams(params: Record<string, unknown>): this;
|
|
914
|
+
/** Removes a query parameter by name @keywords deleteParam, query, remove */
|
|
900
915
|
deleteParam(name: string): this;
|
|
901
|
-
/**
|
|
916
|
+
/** Converts the URL instance to its full string representation @keywords toString, stringify, serialize */
|
|
902
917
|
toString(): string;
|
|
903
|
-
/**
|
|
918
|
+
/** Converts the URL instance to its JSON string representation @keywords toJSON, json, serialize */
|
|
904
919
|
toJSON(): string;
|
|
905
920
|
}
|
|
906
921
|
|
|
907
922
|
/** Wraps matched search substrings with an HTML highlight tag. @keywords highlight match search replace tag html */
|
|
908
923
|
export declare function addTagHighlightMatch(value: string, search?: string | RegExp, className?: string, shouldEscape?: boolean): string;
|
|
909
924
|
|
|
910
|
-
/** Converts any value to a string with
|
|
925
|
+
/** Converts any value to a string, joining flat arrays with commas if specified or serializing to JSON. @keywords convert, stringify, toString, serialize */
|
|
911
926
|
export declare function anyToString<V>(value: V, isArrayString?: boolean, trim?: boolean): string;
|
|
912
927
|
|
|
913
|
-
/** Replaces
|
|
914
|
-
export declare
|
|
928
|
+
/** Replaces placeholder keys like [key] or {key} in text with corresponding values from an object or array. @keywords template, interpolate, format, placeholder, replace */
|
|
929
|
+
export declare function applyTemplate(text: string, replacement?: Record<string, unknown> | readonly unknown[]): string;
|
|
915
930
|
|
|
916
931
|
/** Creates an array of specified length filled with the given value. @keywords array, fill, repeat, populate, initialize */
|
|
917
932
|
export declare function arrFill<T>(value: T, count: number): T[];
|
|
918
933
|
|
|
919
|
-
/** Converts a Blob to a Base64 string, optionally stripping the data URL prefix.
|
|
934
|
+
/** Converts a Blob to a Base64 string, optionally stripping the data URL prefix. Returns undefined if empty or unreadable. @keywords blob, base64, encode, file, data url */
|
|
920
935
|
export declare function blobToBase64(blob: Blob, clean?: boolean): Promise<string | undefined>;
|
|
921
936
|
|
|
922
|
-
/** Capitalizes the first letter of a string. @keywords capitalize, uppercase,
|
|
923
|
-
export declare function capitalize(value
|
|
937
|
+
/** Capitalizes the first letter of a string. @keywords capitalize, uppercase, string, formatting */
|
|
938
|
+
export declare function capitalize<T extends string = string>(value?: T, locale?: boolean | string): Capitalize<T>;
|
|
924
939
|
|
|
925
940
|
/** Creates a deep copy of an object to prevent unwanted mutations. @keywords deep copy, clone, duplicate */
|
|
926
941
|
export declare function copyObject<T>(value: T): T;
|
|
927
942
|
|
|
928
|
-
/**
|
|
929
|
-
export declare function copyObjectLite<T, R = T>(value: T, source?:
|
|
943
|
+
/** Creates a simple copy of an object with optional additional properties. @keywords copy, clone, shallow copy, object clone */
|
|
944
|
+
export declare function copyObjectLite<T, R = T>(value: T, source?: Record<PropertyKey, unknown> | null): R;
|
|
930
945
|
|
|
931
946
|
/**
|
|
932
|
-
* Creates an HTML element,
|
|
933
|
-
* @remarks Returns `undefined`
|
|
934
|
-
* @keywords createElement, create dom element, html
|
|
947
|
+
* Creates an HTML element, configures its attributes or logic, and optionally mounts it to a parent DOM node.
|
|
948
|
+
* @remarks Designed for standard HTML elements via `document.createElement` (use `document.createElementNS` for SVG/MathML). Returns `undefined` in SSR environments; execute within client-only lifecycle hooks to avoid hydration mismatches.
|
|
949
|
+
* @keywords createElement, create dom element, html, dom manipulation, mount
|
|
935
950
|
*/
|
|
936
|
-
export declare function createElement<T extends HTMLElement>(parentElement?:
|
|
951
|
+
export declare function createElement<T extends HTMLElement>(parentElement?: Element | DocumentFragment, tagName?: string, options?: Partial<T> | Record<string, unknown> | ((element: T) => void), referenceElement?: Node | null): T | undefined;
|
|
937
952
|
|
|
938
|
-
/** Executes a callback when
|
|
939
|
-
export declare function domContentLoaded<T = void>(callback
|
|
953
|
+
/** Executes a callback when DOMContentLoaded fires, or immediately if already ready. @remarks In non-DOM/SSR environments, execution can be disabled with `isServer: false`. @keywords domContentLoaded, dom ready, readyState, ssr */
|
|
954
|
+
export declare function domContentLoaded<T = void>(callback?: () => T | Promise<T>, isServer?: boolean): Promise<T>;
|
|
940
955
|
|
|
941
956
|
/** Selects the first element matching specified CSS selectors. @keywords dom, querySelector, element, find, select */
|
|
942
957
|
export declare function domQuerySelector<E extends Element = Element>(selectors: string): E | undefined;
|
|
@@ -947,37 +962,53 @@ export declare function domQuerySelectorAll<E extends Element = Element>(selecto
|
|
|
947
962
|
/** Encodes special characters in a string for safe use in HTML attributes. @keywords html attribute encode escape sanitize */
|
|
948
963
|
export declare function encodeAttribute(text: string): string;
|
|
949
964
|
|
|
950
|
-
/**
|
|
965
|
+
/**
|
|
966
|
+
* Encodes basic HTML characters (<, >, &) while preserving quotes.
|
|
967
|
+
* @remarks Does NOT encode quotes; use `encodeAttribute` for untrusted attribute values.
|
|
968
|
+
* @keywords html, encode, escape, lite attribute, sanitize
|
|
969
|
+
*/
|
|
951
970
|
export declare function encodeLiteAttribute(text: string): string;
|
|
952
971
|
|
|
953
|
-
/** Resizes an image if it exceeds the maximum size, returning base64 data. @keywords
|
|
972
|
+
/** Resizes an image if it exceeds the maximum size, returning base64 encoded data. @keywords resize, compress, image, max size, base64 */
|
|
954
973
|
export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
|
|
955
974
|
|
|
956
|
-
/** Escapes special regex characters in a string for safe use in
|
|
975
|
+
/** Escapes special regex characters in a string for safe use in RegExp. @keywords regex, regexp, escape, sanitize */
|
|
957
976
|
export declare function escapeExp(value: string): string;
|
|
958
977
|
|
|
959
|
-
/**
|
|
978
|
+
/** Stops event propagation in the DOM tree. @keywords event, stopPropagation, prevent bubbling */
|
|
960
979
|
export declare function eventStopPropagation(event: Event): void;
|
|
961
980
|
|
|
962
|
-
/** Executes callback with
|
|
963
|
-
export declare function executeFunction<T>(callback: T | FunctionArgs<
|
|
964
|
-
|
|
965
|
-
/** Safely executes a
|
|
966
|
-
export declare function executePromise<T>(callback: ((...args:
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
export
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
/**
|
|
981
|
+
/** Executes a callback with arguments if callable, or returns the value as is. @keywords execute, invoke, call, callback, function or value */
|
|
982
|
+
export declare function executeFunction<T, Args extends unknown[] = unknown[]>(callback: T | FunctionArgs<never, T> | ((...args: Args) => T), ...args: Args): T;
|
|
983
|
+
|
|
984
|
+
/** Safely executes a function, promise, or static value and awaits its resolution. @keywords execute promise, async executor, run promise, safe call */
|
|
985
|
+
export declare function executePromise<T, Args extends unknown[] = unknown[]>(callback: ((...args: Args) => PromiseLike<T> | T) | PromiseLike<T> | T, ...args: Args): Promise<Awaited<T>>;
|
|
986
|
+
|
|
987
|
+
/** Supported collection types for iteration. @keywords collection iterable */
|
|
988
|
+
export type ForEachData<T> = readonly T[] | Record<string, T> | Map<unknown, T> | Set<T>;
|
|
989
|
+
/** Resolves key type based on collection structure. @keywords key type inference */
|
|
990
|
+
export type ForEachKey<D> = D extends readonly unknown[] ? number : D extends Set<infer S> ? S : D extends Map<infer K, unknown> ? K : string;
|
|
991
|
+
/** Iterates over an array and returns mapped callback results. @keywords forEach array iterate map */
|
|
992
|
+
export declare function forEach<T, R>(data: readonly T[], callback: (item: T, index: number, collection: readonly T[]) => R, saveUndefined?: boolean): R[];
|
|
993
|
+
/** Iterates over a Set and returns mapped callback results. @keywords forEach set iterate map */
|
|
994
|
+
export declare function forEach<T, R>(data: Set<T>, callback: (item: T, key: T, collection: Set<T>) => R, saveUndefined?: boolean): R[];
|
|
995
|
+
/** Iterates over a Map and returns mapped callback results. @keywords forEach map iterate */
|
|
996
|
+
export declare function forEach<K, V, R>(data: Map<K, V>, callback: (item: V, key: K, collection: Map<K, V>) => R, saveUndefined?: boolean): R[];
|
|
997
|
+
/** Iterates over an object record and returns mapped callback results. @keywords forEach record object iterate */
|
|
998
|
+
export declare function forEach<T, R, D extends Record<string, unknown> = Record<string, T>>(data: D & Record<string, T>, callback: (item: T, key: string, collection: D) => R, saveUndefined?: boolean): R[];
|
|
999
|
+
/** Iterates over a collection and returns mapped callback results. @keywords forEach collection iterate */
|
|
1000
|
+
export declare function forEach<T, R, D extends ForEachData<T> = ForEachData<T>, K = ForEachKey<D>>(data: D & ForEachData<T>, callback: (item: T, key: K, collection: D) => R, saveUndefined?: boolean): R[];
|
|
1001
|
+
|
|
1002
|
+
/** Cyclically calls requestAnimationFrame while the next predicate returns true. @keywords requestAnimationFrame animation loop frame ticker */
|
|
1003
|
+
export declare function frame(callback: (timestamp: DOMHighResTimeStamp) => void, next?: (timestamp: DOMHighResTimeStamp) => boolean, end?: () => void): void;
|
|
1004
|
+
|
|
1005
|
+
/** Splits a string into an array of text segments highlighting search matches. @keywords highlight match, string split, text search, regex */
|
|
975
1006
|
export declare function getArrayHighlightMatch(value: string, search?: string | RegExp): HighlightMatchItem[];
|
|
976
1007
|
|
|
977
|
-
/**
|
|
1008
|
+
/** Gets a key-value record of attributes for an element. @keywords attributes, dom, element, element attributes */
|
|
978
1009
|
export declare function getAttributes<E extends ElementOrWindow>(element?: ElementOrString<E>): Record<string, string | undefined>;
|
|
979
1010
|
|
|
980
|
-
/** Retrieves
|
|
1011
|
+
/** Retrieves string data from the clipboard event or returns an empty string. @keywords clipboard, paste, copy, read, getClipboardData */
|
|
981
1012
|
export declare function getClipboardData(event?: ClipboardEvent): Promise<string>;
|
|
982
1013
|
|
|
983
1014
|
/** Extracts an array of values for a specific property or column from an array of objects. @keywords column, pluck, extract, values, property */
|
|
@@ -1000,41 +1031,44 @@ export declare function getCurrentTime(): number;
|
|
|
1000
1031
|
/** Returns the first Element matching the specified selector or the element itself. @keywords getElement, querySelector, dom, selector */
|
|
1001
1032
|
export declare function getElement<E extends ElementOrWindow, R extends Exclude<E, Window>>(element?: ElementOrString<E>): R | undefined;
|
|
1002
1033
|
|
|
1003
|
-
/** Returns
|
|
1034
|
+
/** Returns or generates a unique element ID, targeting document.body if Window is provided. @keywords element id, get id, generate id, dom id */
|
|
1004
1035
|
export declare function getElementId<E extends ElementOrWindow>(element?: ElementOrString<E>, selector?: string): string;
|
|
1005
1036
|
/**
|
|
1006
|
-
* Initializes the
|
|
1037
|
+
* Initializes the getElementId function with a context ID provider.
|
|
1007
1038
|
* @warning Initialization is mandatory for correct functioning of SSR on both server and client sides.
|
|
1008
1039
|
* @example
|
|
1009
|
-
*
|
|
1040
|
+
*
|
|
1010
1041
|
* import { useId } from 'vue'
|
|
1011
1042
|
* import { initGetElementId } from '@dxtmisha/functional-basic'
|
|
1012
1043
|
*
|
|
1013
1044
|
* initGetElementId(() => useId())
|
|
1014
|
-
*
|
|
1015
|
-
* @keywords init id, ssr id
|
|
1045
|
+
*
|
|
1046
|
+
* @keywords init element id, ssr id provider, listener setup
|
|
1016
1047
|
*/
|
|
1017
1048
|
export declare function initGetElementId(newListener: () => string | number): void;
|
|
1049
|
+
/** Resets the getElementId listener. @keywords reset element id, clear id listener */
|
|
1050
|
+
export declare function resetGetElementId(): void;
|
|
1018
1051
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1052
|
+
export type GetElementImageCallback = (image: HTMLImageElement, event?: Event | string) => void;
|
|
1053
|
+
/** Resolves or creates an HTMLImageElement from an image element or URL source with optional load/error callbacks. @keywords image, load image, image element, getElementImage */
|
|
1054
|
+
export declare function getElementImage(image?: HTMLImageElement | string, onload?: GetElementImageCallback, onerror?: GetElementImageCallback): HTMLImageElement | undefined;
|
|
1021
1055
|
|
|
1022
|
-
/** Retrieves an element property value by key with an optional fallback. @keywords element
|
|
1023
|
-
export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>,
|
|
1056
|
+
/** Retrieves an element or window property value by key, with an optional default fallback. @keywords element property getter window dom */
|
|
1057
|
+
export declare function getElementItem<T extends ElementOrWindow, K extends keyof T, D>(element: ElementOrString<T>, property: K | string, defaultValue?: D): T[K] | D | undefined;
|
|
1024
1058
|
|
|
1025
|
-
/**
|
|
1059
|
+
/** Resolves and returns a window or DOM element by selector or reference. @keywords window, element, dom, selector */
|
|
1026
1060
|
export declare function getElementOrWindow<E extends ElementOrWindow>(element?: ElementOrString<E>): E | undefined;
|
|
1027
1061
|
|
|
1028
|
-
/** Generates a safe script tag for data hydration. @keywords safe script tag,
|
|
1029
|
-
export declare function getElementSafeScript(id: string, data:
|
|
1062
|
+
/** Generates a safe script tag for data hydration. @keywords safe script, script tag, hydration, serialization */
|
|
1063
|
+
export declare function getElementSafeScript<T = unknown>(id: string, data: T): string;
|
|
1030
1064
|
|
|
1031
1065
|
/** Creates a case-insensitive regular expression for an exact match of a phrase without anchors. @keywords regex, regular expression, exact match, search pattern */
|
|
1032
1066
|
export declare function getExactSearchExp(search: string): RegExp;
|
|
1033
1067
|
|
|
1034
|
-
/** Creates a RegExp object
|
|
1068
|
+
/** Creates a RegExp object with the escaped value substituted into the pattern. @keywords regex, regexp, pattern, match, escape */
|
|
1035
1069
|
export declare function getExp(value: string, flags?: string, pattern?: string): RegExp;
|
|
1036
1070
|
|
|
1037
|
-
/** Returns the first element of an array
|
|
1071
|
+
/** Returns the first element of an array or object. @keywords first, head, element, array, object, get */
|
|
1038
1072
|
export declare function getFirst<T>(value: T | T[] | Record<string, T>): T | undefined;
|
|
1039
1073
|
|
|
1040
1074
|
/** Retrieves and parses JSON hydration data from a DOM script element. @keywords hydration, json, script tag, dom, parse, ssr */
|
|
@@ -1043,25 +1077,25 @@ export declare function getHydrationData<T>(id: string, defaultValue: T, remove?
|
|
|
1043
1077
|
/** Returns the source URL string from an HTMLImageElement or string. @keywords image, src, url, source, element */
|
|
1044
1078
|
export declare function getImageSrc(image?: HTMLImageElement | string): string;
|
|
1045
1079
|
|
|
1046
|
-
/** Retrieves a nested value from an object by its path. @keywords get, path, nested
|
|
1047
|
-
export declare function getItemByPath<T extends Record<string,
|
|
1080
|
+
/** Retrieves a nested value from an object by its path. @keywords get by path, object path, nested property, deep get */
|
|
1081
|
+
export declare function getItemByPath<T extends Record<string, unknown>, R = string>(item: T, path: string): R | undefined;
|
|
1048
1082
|
|
|
1049
1083
|
/** Returns the pressed key from a keyboard event. @keywords keyboard, key, event, pressed key */
|
|
1050
1084
|
export declare function getKey(event: KeyboardEvent): string | number | undefined;
|
|
1051
1085
|
|
|
1052
|
-
/** Returns the last element of an array or object. @keywords last,
|
|
1053
|
-
export declare function getLast<T>(value: T | T[] | Record<string, T>): T | undefined;
|
|
1086
|
+
/** Returns the last element of an array or object. @keywords last, element, array, object, tail */
|
|
1087
|
+
export declare function getLast<T>(value: T | readonly T[] | Record<string, T>): T | undefined;
|
|
1054
1088
|
|
|
1055
|
-
/** Returns the length or size of
|
|
1056
|
-
export declare function getLength(value:
|
|
1089
|
+
/** 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 */
|
|
1090
|
+
export declare function getLength(value: unknown): number;
|
|
1057
1091
|
|
|
1058
|
-
/** Returns the lengths of all string elements in an array or object. @keywords length,
|
|
1092
|
+
/** Returns the lengths of all string elements in an array or object. @keywords length, elements, string length, count */
|
|
1059
1093
|
export declare function getLengthOfAllArray(value: ObjectOrArray<string>): number[];
|
|
1060
1094
|
|
|
1061
1095
|
/** Finds the length of the longest string in an array or object. @keywords max length, longest string, array, object */
|
|
1062
1096
|
export declare function getMaxLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1063
1097
|
|
|
1064
|
-
/**
|
|
1098
|
+
/** Finds the shortest string in an array or object and returns its length. @keywords min length, shortest string, minimum, string length */
|
|
1065
1099
|
export declare function getMinLengthAllArray(data: ObjectOrArray<string>): number;
|
|
1066
1100
|
|
|
1067
1101
|
/** Retrieves the position of the mouse cursor or touch point from an event. @keywords mouse touch coordinates client position cursor */
|
|
@@ -1073,31 +1107,33 @@ export declare function getMouseClientX(event: MouseEvent | TouchEvent): number;
|
|
|
1073
1107
|
/** Returns the vertical client coordinate (Y) of a mouse or touch event. @keywords mouse, touch, clientY, cursor position, Y coordinate */
|
|
1074
1108
|
export declare function getMouseClientY(event: MouseEvent | TouchEvent): number;
|
|
1075
1109
|
|
|
1076
|
-
/** Creates a new object
|
|
1077
|
-
export declare function getObjectByKeys<T extends Record<string,
|
|
1110
|
+
/** Creates a new object composed of the picked keys from the source object. @keywords pick, subset, filter keys, extract */
|
|
1111
|
+
export declare function getObjectByKeys<T extends Record<string, unknown>, K extends keyof T>(data: T, keys: K[]): Pick<T, K>;
|
|
1078
1112
|
|
|
1079
|
-
/** Removes
|
|
1080
|
-
export declare function getObjectNoUndefined<
|
|
1113
|
+
/** Removes elements matching the exception value from an array and returns an indexed object. @keywords filter, omit, clean, undefined, array to object */
|
|
1114
|
+
export declare function getObjectNoUndefined<V>(data: readonly V[], exception?: unknown): Record<number, V>;
|
|
1115
|
+
/** Removes properties matching the exception value from an object. @keywords filter, omit, clean, undefined, compact */
|
|
1116
|
+
export declare function getObjectNoUndefined<T extends Record<PropertyKey, unknown>>(data: T, exception?: unknown): T;
|
|
1081
1117
|
|
|
1082
|
-
/** Returns the object if its values are
|
|
1083
|
-
export declare function getObjectOrNone<T>(value: T): T & Record<string,
|
|
1118
|
+
/** Returns the object if its values are set, or an empty object. @keywords object fallback empty validate */
|
|
1119
|
+
export declare function getObjectOrNone<T>(value: T): T & Record<string, unknown>;
|
|
1084
1120
|
|
|
1085
|
-
/**
|
|
1086
|
-
export declare function getOnlyText(text:
|
|
1121
|
+
/** Extracts only letters, numbers, and spaces from a value. @keywords sanitize, clean, alphanumeric, text, filter */
|
|
1122
|
+
export declare function getOnlyText(text: unknown): string;
|
|
1087
1123
|
|
|
1088
1124
|
/** Returns a random element from an array, object, or value, or undefined if empty. @keywords random, item, sample, choice, array, object */
|
|
1089
1125
|
export declare function getRandomItem<T>(value?: T | T[] | Record<string, T>): T | undefined;
|
|
1090
1126
|
|
|
1091
|
-
/** Generates random text with
|
|
1127
|
+
/** Generates random text with specified word count and length constraints. @keywords random, text, generator, words, string */
|
|
1092
1128
|
export declare function getRandomText(min: number, max: number, symbol?: string, lengthMin?: number, lengthMax?: number): string;
|
|
1093
1129
|
|
|
1094
|
-
/** Serializes an object or array into a
|
|
1095
|
-
export declare function getRequestString(request: Record<string,
|
|
1130
|
+
/** Serializes an object or array into a key-value request string. @keywords request string, query string, serialize, key value, params */
|
|
1131
|
+
export declare function getRequestString(request: Record<string, unknown> | readonly unknown[], sign?: string, separator?: string, subKey?: string): string;
|
|
1096
1132
|
|
|
1097
|
-
/** Builds a case-insensitive RegExp matching strings containing all
|
|
1133
|
+
/** Builds a case-insensitive RegExp matching strings containing all search words in any order. @keywords regex search multi-word lookahead filter query */
|
|
1098
1134
|
export declare function getSearchExp(search: string, limit?: number): RegExp;
|
|
1099
1135
|
|
|
1100
|
-
/** Creates a case-insensitive
|
|
1136
|
+
/** Creates a case-insensitive, global RegExp for word-separated search queries or clones an existing RegExp. @keywords regexp, search, word separator, pattern */
|
|
1101
1137
|
export declare function getSeparatingSearchExp(search: string | RegExp, limit?: number): RegExp;
|
|
1102
1138
|
|
|
1103
1139
|
/** Calculates the step value as a percentage within a min-max range. @keywords step, percent, range, slider, scale */
|
|
@@ -1106,171 +1142,186 @@ export declare function getStepPercent(min: number | undefined, max: number): nu
|
|
|
1106
1142
|
/** Calculates the step value unit relative to the given min and max range. @keywords step, step value, range, interval */
|
|
1107
1143
|
export declare function getStepValue(min: number | undefined, max: number): number;
|
|
1108
1144
|
|
|
1109
|
-
/**
|
|
1110
|
-
export declare function goScroll(
|
|
1145
|
+
/** 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 */
|
|
1146
|
+
export declare function goScroll(target: string | HTMLElement, elementTo?: HTMLElement | null, elementCenter?: HTMLElement | null, indent?: number): void;
|
|
1111
1147
|
|
|
1112
|
-
/** Smoothly scrolls the viewport to
|
|
1113
|
-
export declare function goScrollSmooth
|
|
1148
|
+
/** Smoothly scrolls the viewport to a specified element with an optional top offset. @keywords smooth scroll, scroll to element, scrollIntoView, scroll offset */
|
|
1149
|
+
export declare function goScrollSmooth(element?: HTMLElement | Element | null, options?: ScrollIntoViewOptions, shift?: number): void;
|
|
1114
1150
|
|
|
1115
|
-
/** Scrolls
|
|
1116
|
-
export declare function goScrollTo(
|
|
1151
|
+
/** Scrolls a container to make the target element visible. @keywords scroll, scrollTo, container, element, view */
|
|
1152
|
+
export declare function goScrollTo(container?: HTMLElement | Element | null, elementTo?: HTMLElement | Element | null, behavior?: ScrollBehavior): void;
|
|
1117
1153
|
|
|
1118
1154
|
/** Invokes the native sharing mechanism via the Web Share API. @keywords share, web share api, navigator share, device share */
|
|
1119
1155
|
export declare function handleShare(data: ShareData): Promise<boolean>;
|
|
1120
1156
|
|
|
1157
|
+
/** Checks if an object has the specified own property. @keywords hasKey, hasOwnProperty, property check, type guard */
|
|
1158
|
+
export declare function hasKey<K extends PropertyKey, T extends object = Record<K, unknown>>(object: unknown, key: K): object is T & Record<K, unknown>;
|
|
1159
|
+
|
|
1121
1160
|
/** Checks if a value exists within the specified array. @keywords inArray, array, includes, contains, search */
|
|
1122
1161
|
export declare function inArray<T>(array: T[], value: T): boolean;
|
|
1123
1162
|
|
|
1124
1163
|
/** Initializes data for scrollbar offset and scroll control. @keywords scrollbar, offset, scroll control, initialize */
|
|
1125
1164
|
export declare function initScrollbarOffset(): Promise<void>;
|
|
1126
1165
|
|
|
1127
|
-
/** Computes the
|
|
1128
|
-
export declare function intersectKey<T
|
|
1166
|
+
/** Computes the intersection of two objects based on their keys. @keywords intersect, intersection, keys, pick, compare */
|
|
1167
|
+
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
1168
|
|
|
1130
|
-
/** Checks if
|
|
1131
|
-
export declare
|
|
1169
|
+
/** Checks if the API response indicates success. @keywords api, response, success, status, check */
|
|
1170
|
+
export declare function isApiSuccess<T>(data?: ApiData<T>): boolean;
|
|
1132
1171
|
|
|
1133
|
-
/** Checks if a value is an array. @keywords isArray, array, type guard
|
|
1134
|
-
export declare function isArray<T
|
|
1172
|
+
/** Checks if a value is an array. @keywords isArray, array check, type guard */
|
|
1173
|
+
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
|
1135
1174
|
|
|
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;
|
|
1175
|
+
/** Checks if the values of two objects are different. @keywords compare, diff, equality, object difference */
|
|
1176
|
+
export declare function isDifferent<T = unknown>(value: ObjectItem<T>, old: ObjectItem<T>): boolean;
|
|
1138
1177
|
|
|
1139
1178
|
/** Checks if the current environment is a data URL. @keywords isDomData, dom, data url, environment */
|
|
1140
1179
|
export declare function isDomData(): boolean;
|
|
1141
1180
|
|
|
1142
|
-
/** Checks
|
|
1181
|
+
/** Checks whether code is running in a browser environment with `window` available. @keywords dom, browser, runtime, window, client */
|
|
1143
1182
|
export declare function isDomRuntime(): boolean;
|
|
1144
1183
|
|
|
1145
|
-
/** Checks if an element is visible
|
|
1184
|
+
/** Checks if an element is visible (not hidden by CSS and exists in the DOM). @keywords element, visibility, is visible, check visible, dom */
|
|
1146
1185
|
export declare function isElementVisible<E extends ElementOrWindow>(elementSelectors?: ElementOrString<E>): boolean;
|
|
1147
1186
|
|
|
1148
|
-
/** Checks if the pressed key is Enter or Space. @keywords enter
|
|
1149
|
-
export declare
|
|
1187
|
+
/** Checks if the pressed key is Enter or Space (WAI-ARIA action key) outside of text inputs. @keywords enter space wai-aria keyboard event */
|
|
1188
|
+
export declare function isEnter(event: KeyboardEvent, isInputElement?: boolean): boolean;
|
|
1150
1189
|
|
|
1151
|
-
/** Checks if a value is filled
|
|
1190
|
+
/** Checks if a value is filled (not empty), optionally treating '0' as filled. @keywords isFilled, filled, validation, empty check */
|
|
1152
1191
|
export declare function isFilled<T>(value: T, zeroTrue?: boolean): value is Exclude<T, EmptyValue>;
|
|
1153
1192
|
|
|
1154
1193
|
/** Checks if the value is an integer or floating-point number. @keywords isFloat, float, number, numeric, check */
|
|
1155
|
-
export declare function isFloat(value:
|
|
1194
|
+
export declare function isFloat(value: unknown): boolean;
|
|
1156
1195
|
|
|
1157
|
-
/** Checks if
|
|
1158
|
-
export declare function isFunction<T>(callback: T): callback is Extract<T,
|
|
1196
|
+
/** Checks if a value is a function. @keywords isFunction, function, callback, type guard */
|
|
1197
|
+
export declare function isFunction<T>(callback: T): callback is Extract<T, FunctionAnyType>;
|
|
1159
1198
|
|
|
1160
1199
|
/** Checks if an element or selector is attached to the DOM tree. @keywords dom, attached, is connected, element in dom, is in document */
|
|
1161
1200
|
export declare function isInDom<E extends ElementOrWindow>(element?: ElementOrString<E>): boolean;
|
|
1162
1201
|
|
|
1163
|
-
/** Checks if
|
|
1164
|
-
export declare
|
|
1202
|
+
/** Checks if an element is an input field or editable. @keywords input, editable, form element, check, dom */
|
|
1203
|
+
export declare function isInput(element?: HTMLElement | EventTarget | null, includeDisabled?: boolean): element is HTMLElement;
|
|
1165
1204
|
|
|
1166
1205
|
/** Checks if a value is between integers relative to a rounding step. @keywords isIntegerBetween, integer, between, range, bounds */
|
|
1167
1206
|
export declare function isIntegerBetween(value: number, between: number): boolean;
|
|
1168
1207
|
|
|
1169
|
-
/** Checks if a keyboard event
|
|
1170
|
-
export declare
|
|
1208
|
+
/** Checks if a keyboard event contains active modifier or meta keys. @keywords meta key, modifier, keyboard event, ctrl, alt, shift, cmd */
|
|
1209
|
+
export declare function isMetaKey(event: KeyboardEvent): boolean;
|
|
1171
1210
|
|
|
1172
1211
|
/** Checks if a value is null or undefined. @keywords isNull, isNil, null, undefined, check */
|
|
1173
1212
|
export declare function isNull<T>(value: T): value is Extract<T, Undefined>;
|
|
1174
1213
|
|
|
1175
|
-
/** Checks if the value is a number. @keywords isNumber, number, numeric,
|
|
1176
|
-
export declare function isNumber(value:
|
|
1214
|
+
/** Checks if the value is a number or numeric string. @keywords isNumber, number, numeric, type guard, validate */
|
|
1215
|
+
export declare function isNumber(value: unknown): value is number | string;
|
|
1177
1216
|
|
|
1178
|
-
/** Checks if a value is an object. @keywords isObject, object
|
|
1179
|
-
export declare function isObject<T>(value: T): value is Extract<T,
|
|
1217
|
+
/** Checks if a value is an object. @keywords isObject, object, type guard, predicate */
|
|
1218
|
+
export declare function isObject<T>(value: T): value is Extract<T, ObjectItem>;
|
|
1180
1219
|
|
|
1181
|
-
/** Checks if
|
|
1182
|
-
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T,
|
|
1220
|
+
/** Checks if a value is an object and not an array. @keywords isObjectNotArray, is object, not array, type guard */
|
|
1221
|
+
export declare function isObjectNotArray<T>(value: T): value is Exclude<Extract<T, ObjectItem>, unknown[] | undefined | null>;
|
|
1183
1222
|
|
|
1184
1223
|
/** Check if the device is currently online. @keywords online, network, connectivity, internet */
|
|
1185
1224
|
export declare function isOnLine(): boolean;
|
|
1186
1225
|
|
|
1187
|
-
/** Checks if a
|
|
1188
|
-
export declare function
|
|
1226
|
+
/** Checks if a property key is a prototype pollution key (__proto__, constructor, prototype). @keywords prototype pollution, security, safe key, sanitize, proto, constructor */
|
|
1227
|
+
export declare function isPrototypeKey(key: unknown): boolean;
|
|
1189
1228
|
|
|
1190
|
-
/** Checks if
|
|
1229
|
+
/** Checks if a value is selected against a target or an array of items, supporting numeric equivalence. @keywords isSelected check selected selection match compare */
|
|
1230
|
+
export declare function isSelected<T>(value: T, selected?: unknown): boolean;
|
|
1231
|
+
|
|
1232
|
+
/** Checks if all specified values are selected. @keywords select, isSelected, selection, list, comparison */
|
|
1191
1233
|
export declare function isSelectedByList<T>(values: T | T[], selected: T | T[]): boolean;
|
|
1192
1234
|
|
|
1193
1235
|
/** Checks if the Web Share API is supported in the current environment. @keywords web share, navigator.share, share api, support check */
|
|
1194
1236
|
export declare function isShare(): boolean;
|
|
1195
1237
|
|
|
1196
|
-
/** Checks if a value is of type string. @keywords isString,
|
|
1197
|
-
export declare function isString
|
|
1238
|
+
/** Checks if a value is of type string. @keywords isString, type guard, check string */
|
|
1239
|
+
export declare function isString(value: unknown): value is string;
|
|
1198
1240
|
|
|
1199
|
-
/** Checks if the pressed key
|
|
1200
|
-
export declare
|
|
1241
|
+
/** Checks if the pressed key is Tab. @keywords tab key keyboard event check */
|
|
1242
|
+
export declare function isTab(event: KeyboardEvent): boolean;
|
|
1201
1243
|
|
|
1202
|
-
/** Checks if
|
|
1244
|
+
/** Checks if an object is a Window instance. @keywords window, isWindow, type guard, DOM */
|
|
1203
1245
|
export declare function isWindow<E>(element: E): element is Extract<E, Window>;
|
|
1204
1246
|
|
|
1205
1247
|
/** Generates a random integer within a specified range. @keywords random integer number math range */
|
|
1206
1248
|
export declare function random(min: number, max: number): number;
|
|
1207
1249
|
|
|
1208
|
-
/** Removes the common prefix from the
|
|
1209
|
-
export declare function removeCommonPrefix(
|
|
1250
|
+
/** Removes the common prefix from a string, optionally trimming the result. @keywords string prefix remove strip trim */
|
|
1251
|
+
export declare function removeCommonPrefix(mainString: string, prefix: string, trim?: boolean): string;
|
|
1210
1252
|
|
|
1211
|
-
/** Replaces
|
|
1212
|
-
export declare
|
|
1253
|
+
/** Replaces occurrences of a component name within the provided text. @keywords replace component name, text replacement, rename component */
|
|
1254
|
+
export declare function replaceComponentName(text: string | undefined, name: string, componentName: string): string | undefined;
|
|
1213
1255
|
|
|
1214
|
-
/** Recursively
|
|
1215
|
-
export declare function replaceRecursive<I>(
|
|
1256
|
+
/** Recursively merges or replaces properties of objects or arrays. @keywords deep merge, recursive replace, object assign, array merge */
|
|
1257
|
+
export declare function replaceRecursive<I>(target: ObjectItem<I>, replacement?: ObjectOrArray<I>, isMerge?: boolean): ObjectItem<I>;
|
|
1216
1258
|
|
|
1217
|
-
/** Replaces placeholders in a template string with values or function
|
|
1218
|
-
export declare function replaceTemplate(value: string, replaces: Record<string, string |
|
|
1259
|
+
/** Replaces `[key]` placeholders in a template string with matching values or function results. @keywords template, replace, placeholder, substitute, string interpolation */
|
|
1260
|
+
export declare function replaceTemplate(value: string, replaces: Record<string, FunctionOr<string | number | boolean>>): string;
|
|
1219
1261
|
|
|
1220
1262
|
/** Asynchronously resizes an image to fit within maximum dimension constraints. @keywords resize, image, scale, canvas, thumbnail, base64 */
|
|
1221
1263
|
export declare function resizeImage(image: HTMLImageElement | string, maxSize?: number, typeData?: string): Promise<string>;
|
|
1222
1264
|
|
|
1223
|
-
type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1224
|
-
/** Resizes an image to fit within a maximum dimension constraint. @keywords image, resize, scale, dimension, max-size */
|
|
1225
|
-
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string): string | undefined;
|
|
1265
|
+
export type ResizeImageByMaxType = 'auto' | 'width' | 'height';
|
|
1226
1266
|
|
|
1227
|
-
/**
|
|
1267
|
+
/**
|
|
1268
|
+
* Resizes an image synchronously to fit within a maximum size constraint.
|
|
1269
|
+
* @remarks Requires a loaded image with valid dimensions. Returns `undefined` if already within bounds or unprocessable to prevent redundant canvas re-encoding.
|
|
1270
|
+
* @keywords resize image, scale image, max dimension, canvas resize, base64
|
|
1271
|
+
*/
|
|
1272
|
+
export declare function resizeImageByMax(image: HTMLImageElement | string, maxSize: number, type?: ResizeImageByMaxType, typeData?: string, quality?: number): string | undefined;
|
|
1273
|
+
|
|
1274
|
+
/** Converts seconds into a formatted time string (MM:SS or HH:MM:SS). @keywords time format, seconds to time, duration, timestamp */
|
|
1228
1275
|
export declare function secondToTime(second: number | string | undefined, hasHour?: boolean): string;
|
|
1229
1276
|
|
|
1230
|
-
/**
|
|
1231
|
-
export declare function setElementItem<E extends ElementOrWindow, K extends keyof E, V extends E[K] = E[K]>(element: ElementOrString<E>, index: K, value: V | Record<string, V>): E | undefined;
|
|
1277
|
+
/** Modifies the property, attribute, or style value of an element by key. @keywords element, set property, attribute, style, dom */
|
|
1278
|
+
export declare function setElementItem<E extends ElementOrWindow, K extends keyof E = keyof E, V extends E[K] = E[K]>(element: ElementOrString<E>, index: K | string, value: V | Record<string, V> | unknown): E | undefined;
|
|
1232
1279
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1280
|
+
export interface SetValuesOptions {
|
|
1281
|
+
multiple?: boolean;
|
|
1282
|
+
maxlength?: number;
|
|
1283
|
+
alwaysChange?: boolean;
|
|
1284
|
+
notEmpty?: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
/** Modifies or toggles single or multiple selected values according to configuration options. @keywords set values, toggle selection, collection, update */
|
|
1287
|
+
export declare function setValues<T>(selected: T | T[] | undefined, value: T, options?: SetValuesOptions): T | T[] | undefined;
|
|
1288
|
+
|
|
1289
|
+
/** 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 */
|
|
1290
|
+
export declare function skipFrame<T = void>(callback?: () => T | Promise<T>, count?: number): Promise<T | void>;
|
|
1240
1291
|
|
|
1241
1292
|
/** Pauses execution for the specified number of milliseconds. @keywords sleep, delay, wait, pause, timeout */
|
|
1242
1293
|
export declare function sleep(ms: number): Promise<void>;
|
|
1243
1294
|
|
|
1244
|
-
/** Sorts an array of items by column
|
|
1245
|
-
export declare function sortList<T =
|
|
1295
|
+
/** Sorts an array of items by column paths, directions, or a custom comparison function. @keywords sort, order, multi-column, comparator, array */
|
|
1296
|
+
export declare function sortList<T = Record<string, unknown>>(list: T[], sortColumns: SortColumnItem[], customSort?: SortFunction<T>): T[];
|
|
1246
1297
|
|
|
1247
|
-
/** Copies enumerable own properties from a source to a target object
|
|
1298
|
+
/** Copies enumerable own properties from a source to a target object starting at a specific index. @keywords splice, copy, merge, assign */
|
|
1248
1299
|
export declare function splice<I>(array: ObjectItem<I>, replacement?: ObjectItem<I> | I, indexStart?: string): ObjectItem<I>;
|
|
1249
1300
|
|
|
1250
1301
|
/** Creates a string of the specified length filled with the given character. @keywords string fill repeat pad */
|
|
1251
1302
|
export declare function strFill(value: string, count: number): string;
|
|
1252
1303
|
|
|
1253
|
-
/** Splits a string by separator
|
|
1254
|
-
export declare function strSplit(value
|
|
1304
|
+
/** Splits a string by a separator with a limit where the last element retains the remainder. @keywords string split, separator, limit, remainder, tokenize */
|
|
1305
|
+
export declare function strSplit(value?: unknown, separator?: string, limit?: number): string[];
|
|
1255
1306
|
|
|
1256
|
-
/** Converts a value to an array
|
|
1257
|
-
export declare function toArray<T>(value: T): T extends
|
|
1307
|
+
/** Converts a value to an array or returns it as-is if already an array. @keywords toArray, array wrap, ensure array, cast array */
|
|
1308
|
+
export declare function toArray<T>(value: T): T extends unknown[] ? T : [T];
|
|
1258
1309
|
|
|
1259
|
-
/** Converts a string to
|
|
1260
|
-
export declare function toCamelCase(value
|
|
1310
|
+
/** Converts a string to camelCase. @keywords camelCase, string, case conversion */
|
|
1311
|
+
export declare function toCamelCase(value?: string): string;
|
|
1261
1312
|
|
|
1262
|
-
/** Converts a string to PascalCase (CamelCase with
|
|
1263
|
-
export declare function toCamelCaseFirst(value
|
|
1313
|
+
/** Converts a string to PascalCase (CamelCase with first letter capitalized). @keywords pascalCase, camelCase, capitalize, case conversion */
|
|
1314
|
+
export declare function toCamelCaseFirst(value?: string): string;
|
|
1264
1315
|
|
|
1265
|
-
/** Converts a
|
|
1316
|
+
/** Converts a value to a Date object. @keywords date, parse, convert, timestamp */
|
|
1266
1317
|
export declare function toDate<T extends Date | number | string>(value?: T): (T & Date) | Date;
|
|
1267
1318
|
|
|
1268
|
-
/** Converts a string to kebab-case format by
|
|
1269
|
-
export declare function toKebabCase(value
|
|
1319
|
+
/** Converts a string to kebab-case format by replacing spaces and separators with hyphens. @keywords kebab-case, dash-case, slugify, string */
|
|
1320
|
+
export declare function toKebabCase(value?: string): string;
|
|
1270
1321
|
|
|
1271
1322
|
/**
|
|
1272
|
-
* Converts a string or number to a finite floating-point number, handling
|
|
1273
|
-
* @keywords toNumber, parse float, string to number,
|
|
1323
|
+
* Converts a string or number to a finite floating-point number, handling separators and stripping non-numeric characters.
|
|
1324
|
+
* @keywords toNumber, parse float, string to number, numeric cast, sanitize
|
|
1274
1325
|
* @example
|
|
1275
1326
|
* toNumber("1 234,56") // 1234.56
|
|
1276
1327
|
* toNumber("1,234.56") // 1234.56
|
|
@@ -1278,11 +1329,22 @@ export declare function toKebabCase(value: string): string;
|
|
|
1278
1329
|
*/
|
|
1279
1330
|
export declare function toNumber(value?: NumberOrString): number;
|
|
1280
1331
|
|
|
1281
|
-
/** Converts a value to a number clamped
|
|
1282
|
-
export declare function toNumberByMax(value
|
|
1332
|
+
/** Converts a value to a number clamped by a maximum permissible value, with optional formatting. @keywords toNumberByMax, clamp, max, number, format */
|
|
1333
|
+
export declare function toNumberByMax(value?: NumberOrString, max?: NumberOrString, formatting?: boolean, language?: string): string | number;
|
|
1283
1334
|
|
|
1284
|
-
/**
|
|
1285
|
-
|
|
1335
|
+
/**
|
|
1336
|
+
* Converts a value to a positive finite number (> 0), or returns a fallback value.
|
|
1337
|
+
* @keywords toNumberPositive, positive number, parse positive, sanitize number
|
|
1338
|
+
* @example
|
|
1339
|
+
* toNumberPositive(15) // 15
|
|
1340
|
+
* toNumberPositive('10') // 10
|
|
1341
|
+
* toNumberPositive(-5) // 0
|
|
1342
|
+
* toNumberPositive('invalid', 1) // 1
|
|
1343
|
+
*/
|
|
1344
|
+
export declare function toNumberPositive(value?: NumberOrString | null, defaultValue?: number): number;
|
|
1345
|
+
|
|
1346
|
+
/** Converts a string to PascalCase. @keywords pascal case, string transform, formatting, casing */
|
|
1347
|
+
export declare function toPascalCase(value?: string): string;
|
|
1286
1348
|
|
|
1287
1349
|
/** Converts a value to a percentage relative to a maximum value. @keywords percentage, percent, ratio, calculate, convert */
|
|
1288
1350
|
export declare function toPercent(maxValue: number, value: number): number;
|
|
@@ -1293,22 +1355,35 @@ export declare function toPercentBy100(maxValue: number, value: number): number;
|
|
|
1293
1355
|
/** Converts a value to a string, returning an empty string for null or undefined. @keywords stringify, convert, format, serialize */
|
|
1294
1356
|
export declare function toString<T>(value: T): string;
|
|
1295
1357
|
|
|
1296
|
-
/**
|
|
1297
|
-
|
|
1358
|
+
/**
|
|
1359
|
+
* Transforms a string into its corresponding data type (undefined, null, boolean, number, object, or function).
|
|
1360
|
+
* @keywords transform, parse, cast, deserialize, type coercion, string conversion
|
|
1361
|
+
* @example
|
|
1362
|
+
* transformation('true') // true
|
|
1363
|
+
* transformation('12.5') // 12.5
|
|
1364
|
+
* transformation('{"a":1}') // { a: 1 }
|
|
1365
|
+
* transformation('null') // null
|
|
1366
|
+
*/
|
|
1367
|
+
export declare function transformation<T = unknown>(value: unknown, isFunctionCheck?: boolean): T;
|
|
1298
1368
|
|
|
1299
|
-
/**
|
|
1300
|
-
|
|
1369
|
+
/**
|
|
1370
|
+
* Converts a Uint8Array to a base64 encoded string across Node.js, modern ECMAScript, and browsers.
|
|
1371
|
+
* @keywords uint8array, base64, encode, binary, buffer, btoa
|
|
1372
|
+
* @example
|
|
1373
|
+
* uint8ArrayToBase64(new Uint8Array([72, 101, 108, 108, 111])) // "SGVsbG8="
|
|
1374
|
+
*/
|
|
1375
|
+
export declare function uint8ArrayToBase64(bytes?: Uint8Array | null): string;
|
|
1301
1376
|
|
|
1302
1377
|
/** Removes duplicate elements from an array. @keywords unique, deduplicate, distinct, array, filter */
|
|
1303
1378
|
export declare function uniqueArray<T>(value: T[]): T[];
|
|
1304
1379
|
|
|
1305
|
-
/** Writes text data to the system clipboard. @keywords clipboard, copy, write,
|
|
1380
|
+
/** Writes text data to the system clipboard. @keywords clipboard, copy, write, text */
|
|
1306
1381
|
export declare function writeClipboardData(text: string): Promise<void>;
|
|
1307
1382
|
|
|
1308
1383
|
/** Default list of predefined error causes and messages for ErrorCenter. @keywords error_causes error_list error_center */
|
|
1309
1384
|
export declare const errorCauseList: ErrorCenterCauseList;
|
|
1310
1385
|
|
|
1311
|
-
/** HTTP methods
|
|
1386
|
+
/** HTTP request methods. @keywords http, method, rest, verb */
|
|
1312
1387
|
export declare enum ApiMethodItem {
|
|
1313
1388
|
delete = "DELETE",
|
|
1314
1389
|
get = "GET",
|
|
@@ -1316,14 +1391,14 @@ export declare enum ApiMethodItem {
|
|
|
1316
1391
|
put = "PUT",
|
|
1317
1392
|
patch = "PATCH"
|
|
1318
1393
|
}
|
|
1319
|
-
/** Cached API response
|
|
1394
|
+
/** Cached API response structure. @keywords cache, response, ttl, storage */
|
|
1320
1395
|
export type ApiCacheItem<T = any> = {
|
|
1321
1396
|
value: T;
|
|
1322
1397
|
age?: number;
|
|
1323
1398
|
cacheAge: number;
|
|
1324
1399
|
};
|
|
1325
1400
|
export type ApiCacheList = Record<string, ApiCacheItem>;
|
|
1326
|
-
/**
|
|
1401
|
+
/** Configuration options for the API client. @keywords api, config, options, client */
|
|
1327
1402
|
export type ApiConfig = {
|
|
1328
1403
|
urlRoot?: string;
|
|
1329
1404
|
origin?: string;
|
|
@@ -1336,7 +1411,7 @@ export type ApiConfig = {
|
|
|
1336
1411
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1337
1412
|
};
|
|
1338
1413
|
export type ApiData<T = any> = T extends any[] ? T : ApiDataItem<T>;
|
|
1339
|
-
/** API response validation
|
|
1414
|
+
/** API response validation metadata. @keywords validation, response, status, error */
|
|
1340
1415
|
export type ApiDataValidation = {
|
|
1341
1416
|
status?: ApiStatusType;
|
|
1342
1417
|
code?: string | number;
|
|
@@ -1346,7 +1421,7 @@ export type ApiDataValidation = {
|
|
|
1346
1421
|
message?: string;
|
|
1347
1422
|
};
|
|
1348
1423
|
};
|
|
1349
|
-
/** API response payload and metadata
|
|
1424
|
+
/** Unified API response payload wrapped with status and error metadata. @keywords response, wrapper, payload, data */
|
|
1350
1425
|
export type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
1351
1426
|
data?: T;
|
|
1352
1427
|
success?: boolean;
|
|
@@ -1355,7 +1430,7 @@ export type ApiDataItem<T = any> = T & ApiDataValidation & {
|
|
|
1355
1430
|
};
|
|
1356
1431
|
export type ApiHeadersValue = Record<string, string> | (() => Record<string, string>);
|
|
1357
1432
|
export type ApiDefaultValue = Record<string, any> | (() => Record<string, any>);
|
|
1358
|
-
/**
|
|
1433
|
+
/** Parameters and execution options for API fetch requests. @keywords fetch, request, options, http */
|
|
1359
1434
|
export type ApiFetch = {
|
|
1360
1435
|
api?: boolean;
|
|
1361
1436
|
path?: string;
|
|
@@ -1385,7 +1460,7 @@ export type ApiFetch = {
|
|
|
1385
1460
|
endResetLimit?: number;
|
|
1386
1461
|
wrapper?: <R>(callback: () => Promise<R>, apiFetch: ApiFetch) => Promise<R>;
|
|
1387
1462
|
};
|
|
1388
|
-
/**
|
|
1463
|
+
/** SSR hydration record for matching and preloading API responses. @keywords hydration, ssr, match */
|
|
1389
1464
|
export type ApiHydrationItem = {
|
|
1390
1465
|
path: string;
|
|
1391
1466
|
method: ApiMethod;
|
|
@@ -1393,23 +1468,23 @@ export type ApiHydrationItem = {
|
|
|
1393
1468
|
response: any;
|
|
1394
1469
|
};
|
|
1395
1470
|
export type ApiHydrationList = ApiHydrationItem[];
|
|
1396
|
-
/**
|
|
1471
|
+
/** Error matching rule descriptor for API error management. @keywords error, handler, matcher, storage */
|
|
1397
1472
|
export type ApiErrorStorageItem = Record<string, any> & {
|
|
1398
1473
|
url: string | RegExp;
|
|
1399
1474
|
method: ApiMethodItem;
|
|
1400
|
-
code?: string;
|
|
1475
|
+
code?: string | number;
|
|
1401
1476
|
status?: number;
|
|
1402
1477
|
validation?: (response: Response) => boolean;
|
|
1403
1478
|
message?: string | ((response?: Response) => string);
|
|
1404
1479
|
};
|
|
1405
1480
|
export type ApiErrorStorageList = ApiErrorStorageItem[];
|
|
1406
1481
|
export type ApiMethod = string | ApiMethodItem;
|
|
1407
|
-
/**
|
|
1482
|
+
/** Hook return value containing state reset flag and payload data. @keywords hook, lifecycle, reset */
|
|
1408
1483
|
export type ApiPreparationEnd = {
|
|
1409
1484
|
reset?: boolean;
|
|
1410
1485
|
data?: any;
|
|
1411
1486
|
};
|
|
1412
|
-
/** Mock API response descriptor
|
|
1487
|
+
/** Mock API response rule descriptor. @keywords mock, response, test, stub */
|
|
1413
1488
|
export type ApiResponseItem = {
|
|
1414
1489
|
path: string | RegExp;
|
|
1415
1490
|
method: ApiMethod;
|
|
@@ -1419,7 +1494,7 @@ export type ApiResponseItem = {
|
|
|
1419
1494
|
isForGlobal?: boolean;
|
|
1420
1495
|
lag?: any;
|
|
1421
1496
|
};
|
|
1422
|
-
/**
|
|
1497
|
+
/** Execution status state and metadata for the last API request. @keywords status, error, response, state */
|
|
1423
1498
|
export type ApiStatusItem = {
|
|
1424
1499
|
status?: number;
|
|
1425
1500
|
statusText?: string;
|
|
@@ -1881,12 +1956,13 @@ export type HighlightMatchItem = {
|
|
|
1881
1956
|
};
|
|
1882
1957
|
|
|
1883
1958
|
export type SortDir = 'asc' | 'desc';
|
|
1959
|
+
/** Column sort specification. @keywords sort, column, order */
|
|
1884
1960
|
export type SortColumnItem = {
|
|
1885
1961
|
column?: string;
|
|
1886
1962
|
dir?: SortDir;
|
|
1887
1963
|
};
|
|
1888
|
-
/** Custom
|
|
1889
|
-
export type SortFunction<T =
|
|
1964
|
+
/** Custom comparator function for sorting items. @keywords sort, comparator, sort-function */
|
|
1965
|
+
export type SortFunction<T = Record<string, unknown>> = (a: T, b: T, column?: string, dir?: SortDir) => number;
|
|
1890
1966
|
|
|
1891
1967
|
/** Translation plugin configuration options @keywords i18n, translate, config, options */
|
|
1892
1968
|
export type TranslateConfig = {
|