@dxtmisha/functional 1.15.6 → 1.15.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ai-types.md CHANGED
@@ -1,33 +1,20 @@
1
- 1) All these methods are in the @dxtmisha/functional library.
2
- 2) Everything that is exported can be used.
3
- 3) Use what is in this library if it exists; do not use other libraries if there is an analogue here. Do not create new ones if an analogue already exists here.
1
+ All these methods are in the @dxtmisha/functional library.
4
2
 
5
- The following is the content of "exports" from package.json:
6
- {
7
- ".": {
8
- "import": "./dist/library.js",
9
- "types": "./dist/library.d.ts"
10
- },
11
- "./flags": {
12
- "import": "./dist/flags.js",
13
- "types": "./dist/flags.d.ts"
14
- }
15
- }
16
-
17
- import { ComputedRef, Ref, ShallowRef, ToRefs, VNode, DebuggerOptions, ComputedGetter, Plugin, PropType } from 'vue';
18
- import { RouteLocationRaw, Router, _RouterClassic } from 'vue-router';
19
- import { Datetime, GeoDate, GeoFirstDay, GeoHours, NumberOrStringOrDate, ElementOrString, ElementOrWindow, EventItem, EventListenerDetail, EventOptions, GeoFlag, GeoFlagItem, GeoFlagNational, ItemValue, NumberOrString, GeoItemFull, GeoUnit, ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList, ApiFetch, ArrayToItem, FormattersListColumns, FormattersOptionsList, SearchColumns, SearchFormatList, ApiErrorItem, ApiMethodItem, CookieOptions, FormattersListProp, FormattersReturn, MetaRobots, Meta, NumberOrStringOrBoolean, SearchItem, SearchOptions, TranslateInstance, TranslateList, ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig, ItemList, Undefined, ApiDefaultValue, SearchListValue } from '@dxtmisha/functional-basic';
3
+ import { ComputedRef, Ref, ShallowRef, ToRefs, VNode, VNodeArrayChildren, ComputedGetter, DebuggerOptions, Plugin, PropType } from 'vue';
4
+ import { Datetime, GeoDate, GeoFirstDay, GeoHours, NumberOrStringOrDate, ElementOrString, ElementOrWindow, EventItem, EventListenerDetail, EventOptions, GeoFlag, GeoFlagItem, GeoFlagNational, ItemValue, NumberOrString, GeoItemFull, GeoUnit, ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList, ApiErrorItem, ApiFetch, FormattersListColumns, FormattersOptionsList, SearchColumns, SearchFormatList, FormattersListProp, FormattersReturn, MetaRobots, Meta, SearchItem, SearchOptions, TranslateInstance, TranslateList, ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig, ItemList, ApiDefaultValue, ApiMethodItem, Undefined, NumberOrStringOrBoolean, SearchListValue } from '@dxtmisha/functional-basic';
20
5
  import { InputSocialIcons } from '@dxtmisha/media';
21
- export * from '@dxtmisha/functional-basic';
6
+ import { RouteLocationRaw, Router, _RouterClassic } from 'vue-router';
22
7
  export type RefType<T> = ComputedRef<T> | Ref<T>;
23
8
  export type RefUndefined<T> = RefType<T | undefined>;
24
9
  export type RefOrNormal<T> = RefType<T> | T;
25
10
  export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
26
11
  export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
27
- export type RawSlots = { [name: string]: unknown; $stable?: boolean; };
12
+ export type RawSlots = {
13
+ [name: string]: unknown;
14
+ $stable?: boolean;
15
+ };
28
16
  export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
29
17
  export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
30
- /** Configuration for the main GET request in API management. */
31
18
  export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
32
19
  path?: RefOrNormal<string | undefined>;
33
20
  options?: ApiOptions;
@@ -40,13 +27,11 @@ export type ApiManagementGet<Return extends ApiManagementValue, Type extends Api
40
27
  unmounted?: boolean;
41
28
  skeleton?: () => Return;
42
29
  };
43
- /** Configuration for client-side search across API data. */
44
30
  export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
45
31
  columns: K;
46
32
  value?: Ref<string>;
47
33
  options?: SearchOptions;
48
34
  };
49
- /** Configuration for mutation requests (POST, PUT, DELETE). */
50
35
  export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
51
36
  path?: RefOrNormal<string | undefined>;
52
37
  action?: (data: Return | undefined) => Promise<void> | void;
@@ -58,17 +43,27 @@ export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFet
58
43
  options?: ApiOptions;
59
44
  };
60
45
  export type ConstrItem = Record<string, any>;
61
- export type ConstrValue<T = any> = { value?: T; };
46
+ export type ConstrValue<T = any> = {
47
+ value?: T;
48
+ };
62
49
  export type ConstrComponent = Record<string, any>;
63
- export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | { [K in keyof P]?: RefOrNormal<P[K]>; };
64
- export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & { elementHtml?: ComputedRef<E | undefined>; };
50
+ export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
51
+ [K in keyof P]?: RefOrNormal<P[K]>;
52
+ };
53
+ export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
54
+ elementHtml?: ComputedRef<E | undefined>;
55
+ };
65
56
  export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
66
57
  export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
67
- export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{ [K in keyof T]: (evt: K, ...args: T[K]) => void; }>>;
58
+ export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
59
+ [K in keyof T]: (evt: K, ...args: T[K]) => void;
60
+ }>>;
68
61
  export type ConstrClassObject = Record<string, boolean | undefined>;
69
62
  export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
70
63
  export type ConstrClassList = Record<string, ConstrClass>;
71
- export type ConstrClasses = { main: ConstrClass; } & ConstrClassList;
64
+ export type ConstrClasses = {
65
+ main: ConstrClass;
66
+ } & ConstrClassList;
72
67
  export type ConstrStylesItem = string | null;
73
68
  export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
74
69
  export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
@@ -100,14 +95,32 @@ export type ConstrPropItemOptions<T = any> = {
100
95
  validator?(value: any, props: any): boolean;
101
96
  };
102
97
  export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
103
- export type ConstrProps<P = Record<string, any>> = { [K in keyof P]: ConstrPropItem<P[K]>; };
104
- export type ConstrHrefProps = { href?: string; };
98
+ export type ConstrProps<P = Record<string, any>> = {
99
+ [K in keyof P]: ConstrPropItem<P[K]>;
100
+ };
101
+ export type ConstrHrefProps = {
102
+ href?: string;
103
+ };
105
104
  export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
106
- export type ListDataBasic = { label?: NumberOrString; value?: any; search?: string; };
107
- export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & { parent?: string; type: ListType; index: string; disabled?: boolean; }>;
105
+ export type ListDataBasic = {
106
+ label?: NumberOrString;
107
+ value?: any;
108
+ search?: string;
109
+ };
110
+ export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
111
+ parent?: string;
112
+ type: ListType;
113
+ index: string;
114
+ disabled?: boolean;
115
+ }>;
108
116
  export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
109
117
  export type ListRecord<Item extends ListDataBasic = ListDataBasic> = ListList<Item> | Record<string, any>;
110
- export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & { focus: boolean; highlight?: string; selected: boolean; disabled?: boolean; };
118
+ export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
119
+ focus: boolean;
120
+ highlight?: string;
121
+ selected: boolean;
122
+ disabled?: boolean;
123
+ };
111
124
  export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
112
125
  export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
113
126
  export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
@@ -119,540 +132,133 @@ export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListVal
119
132
  export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
120
133
  export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
121
134
  export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
122
- export type LazyItemByMargin = { rootMargin: string; item: ReturnType<typeof useLazyRef>; };
123
- export type LazyItem = { status: ShallowRef<boolean>; ratio: ShallowRef<number>; entry: ShallowRef<IntersectionObserverEntry | undefined>; stopWatch: () => void; };
124
- export type LazyList = Record<string, LazyItem>;
125
- export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
126
- export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
127
- export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
128
- export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
129
- /** Interface for reactive API request instance. */
130
- export interface UseApiRef<R> {
131
- data: ComputedRef<ApiData<R> | undefined>;
132
- item: Ref<ApiData<R> | undefined>;
133
- errorItem: ComputedRef<ApiErrorItem | undefined>;
134
- isResponseContractValid: ComputedRef<boolean>;
135
- responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
136
- length: ComputedRef<number>;
137
- starting: ComputedRef<boolean>;
138
- loading: Ref<boolean>;
139
- reading: Ref<boolean>;
140
- isStarting(): boolean;
141
- isLoading(): boolean;
142
- isReading(): boolean;
143
- getItem(): ApiData<R> | undefined;
144
- init(): void;
145
- initSsr(): void;
146
- reset(): Promise<void>;
147
- stop(): void;
148
- abort(): void;
149
- }
150
- /** Setup interface for API request. */
151
- export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
152
- path?: RefOrNormal<string | undefined>;
153
- method?: ApiMethodItem;
154
- action?: (data: Return | undefined) => Promise<void> | void;
155
- transformation?: (data: T) => Return;
156
- validateRequestContract?: (data: Request) => ApiDataValidation & Return;
157
- validateResponseContract?: (data: T) => ApiDataValidation & Return;
158
- errorContract?: ApiErrorStorageList;
159
- toData?: boolean;
160
- options?: ApiOptions;
161
- apiInstance?: ApiInstance;
162
- }
163
- /** Interface for functional plugin configuration options. */
164
- export interface FunctionalPluginOptions {
165
- api?: ApiConfig;
166
- translate?: TranslateConfig;
167
- location?: string | (() => string);
168
- metaSuffix?: string;
169
- icons?: IconsConfig;
170
- iconsSocial?: InputSocialIcons;
171
- router?: Router;
172
- errorCauses?: ErrorCenterCauseList;
173
- errorHandlers?: ErrorCenterHandlerList;
174
- errorCallbacks?: ErrorCenterHandlerCallback[];
175
- }
176
- /** Base abstract class for design constructor components managing properties, callbacks, and tracked changes. */
177
135
  export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
178
- /**
179
- * Constructor
180
- * @param props base data
181
- * @param callback callback function when the value changes
182
- * @param changed data for tracking
183
- */
184
136
  constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
185
- /**
186
- * Calls the callback function.
187
- * @param compelled forces data to update
188
- */
189
137
  make(compelled?: boolean): this;
190
- /**
191
- * Calls the callback function.
192
- * @param compelled forces data to update
193
- */
194
138
  makeCallback(compelled?: boolean): void;
195
139
  }
196
- /** Base async abstract class for design components with asynchronous initialization. */
197
140
  export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
198
- /**
199
- * Calls the callback function.
200
- * @param compelled forces data to update
201
- */
202
141
  make(compelled?: boolean): this;
203
- /**
204
- * Calls the callback function.
205
- * @param compelled forces data to update
206
- */
207
142
  makeCallback(compelled?: boolean): Promise<void>;
208
143
  }
209
- /** Class for tracking edited/changed values. */
210
144
  export declare class DesignChanged<T extends Record<string, any>> {
211
- /**
212
- * Constructor
213
- * @param props base data
214
- * @param watch data for tracking
215
- */
216
145
  constructor(props: T, watch?: string[]);
217
- /**
218
- * Checks if the value has been updated.
219
- * @param name property name
220
- */
221
146
  is(name: string | string[]): boolean;
222
- /** Checks if there are changes in the data. */
223
147
  isChanged(): boolean;
224
- /** Updates all values. */
225
148
  update(): void;
226
149
  }
227
- /** Component wrapper class extending DesignComponents. */
228
- export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {}
229
- /** Class for working with connected components. */
150
+ export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
151
+ }
230
152
  export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
231
- /**
232
- * Constructor
233
- * @param components list of connected components
234
- * @param modification data for modification
235
- */
236
153
  constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
237
- /**
238
- * Check the presence of the component.
239
- * @param name name of the component
240
- */
241
154
  is<K extends keyof COMP>(name: K): name is K;
242
- /**
243
- * Getting the object of the component.
244
- * @param name name of the component
245
- */
246
155
  get<K extends keyof COMP>(name: K): COMP[K];
247
- /**
248
- * Returns the modified input data of the connected components.
249
- * @param index the name of this
250
- * @param props basic data
251
- */
252
156
  getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
253
- /**
254
- * Rendering a component by its name and returning an array with one component.
255
- * @param name name of the component
256
- * @param props property of the component
257
- * @param children sub-elements of the component
258
- * @param index the name of the key
259
- */
260
157
  render<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode[];
261
- /**
262
- * Rendering a component by its name.
263
- * @param name name of the component
264
- * @param props property of the component
265
- * @param children sub-elements of the component
266
- * @param index the name of the key
267
- */
268
158
  renderOne<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode | undefined;
269
- /**
270
- * Rendering the component by its name.
271
- * @param item an array to which the rendered object will be added
272
- * @param name name of the component
273
- * @param props property of the component
274
- * @param children sub-elements of the component
275
- * @param index the name of the key
276
- */
277
159
  renderAdd<K extends keyof COMP, PK extends keyof P>(item: any[], name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): this;
278
160
  }
279
- /** Class for collecting all functional components. */
280
161
  export declare abstract class DesignConstructorAbstract<E extends Element, COMP extends ConstrComponent, EMITS extends ConstrItem, EXPOSE extends ConstrItem, SLOTS extends ConstrItem, CLASSES extends ConstrClasses, P extends ConstrItem> {
281
- /** Getting the class name. */
162
+ constructor(name: string, props: Readonly<P>, options?: ConstrOptions<COMP, EMITS, P> | undefined);
282
163
  getName(): string;
283
- /** Getting the design name. */
284
164
  getDesign(): string;
285
- /**
286
- * Getting the class name.
287
- * @param name list of class names by levels
288
- */
289
165
  getSubClass(name: string | string[]): string;
290
- /**
291
- * Getting the class name for the status.
292
- * @param name list of class names by levels
293
- */
294
166
  getStatusClass(name: string | string[]): string;
295
- /**
296
- * Getting the property name for the style.
297
- * @param name list of class names by levels
298
- */
299
167
  getStyle(name: string | string[]): string;
300
- /** Getting additional parameters. */
301
168
  getAttrs(): ConstrItem;
302
- /** List of available external variables. */
303
169
  expose(): ConstrExpose<E, EXPOSE>;
304
- /** The rendering method for the setup method. */
305
170
  render(): () => VNode | (VNode | any)[] | undefined;
306
171
  }
307
- /** A class for working with dates reactively. */
308
172
  export declare class DatetimeRef {
309
- /**
310
- * Constructor
311
- * @param date date for processing
312
- * @param type type of date format for output
313
- * @param code country and language code
314
- */
315
173
  constructor(date: RefOrNormal<NumberOrStringOrDate>, type?: RefOrNormal<GeoDate>, code?: RefOrNormal<string>);
316
- /** Returns the basic data for the date. */
317
174
  getItem(): Ref<NumberOrStringOrDate>;
318
- /** Returns a Date object. */
319
175
  getDate(): Ref<Date>;
320
- /** Obtaining an object of the basic Datetime class. */
321
176
  getDatetime(): Datetime;
322
- /** Returns the format of hours. */
323
177
  getHoursType(): ComputedRef<GeoHours>;
324
- /** Returns the code of the first day of the week. */
325
178
  getFirstDayCode(): ComputedRef<GeoFirstDay>;
326
- /** The method returns the year of the specified date according to local time. */
327
179
  getYear(): ComputedRef<number>;
328
- /** The method returns the month in the specified date according to local time. */
329
180
  getMonth(): ComputedRef<number>;
330
- /** The method returns the day of the month for the specified date according to local time. */
331
181
  getDay(): ComputedRef<number>;
332
- /** The method returns the hour for the specified date, according to local time. */
333
182
  getHour(): ComputedRef<number>;
334
- /** The method returns the minutes in the specified date according to local time. */
335
183
  getMinute(): ComputedRef<number>;
336
- /** The method returns the seconds in the specified date according to local time. */
337
184
  getSecond(): ComputedRef<number>;
338
- /** Returns the last day of the week. */
339
185
  getMaxDay(): ComputedRef<number>;
340
- /**
341
- * Enables language-sensitive date and time formatting.
342
- * @param type type of date format for output
343
- * @param styleOptions the representation of the month
344
- */
345
186
  locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): ComputedRef<string>;
346
- /**
347
- * Output of standard data.
348
- * @param timeZone add time zone
349
- */
350
187
  standard(timeZone?: boolean): ComputedRef<string>;
351
188
  }
352
- /** Global effect scope class. */
353
189
  export declare class EffectScopeGlobal {
354
- /**
355
- * Runs a function within the global scope.
356
- * @param fn function
357
- * @returns the return value of the function
358
- */
359
190
  static run<T>(fn: () => T): T | undefined;
360
191
  }
361
- /** Class for working with events (Ref). */
362
192
  export declare class EventRef<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> extends EventItem<E, O, D> {
363
- /**
364
- * Classes Constructor
365
- * @param elementSelector element
366
- * @param elementSelectorControl control element
367
- * @param type type
368
- * @param listener event listener callback
369
- * @param options event listener characteristics
370
- * @param detail event-dependent detail value
371
- */
372
193
  constructor(elementSelector?: RefOrNormal<ElementOrString<E> | undefined>, elementSelectorControl?: RefOrNormal<ElementOrString<HTMLElement>>, type?: string | string[], listener?: EventListenerDetail<O, D>, options?: EventOptions, detail?: D);
373
194
  }
374
- /** Class for working with Flags. */
375
195
  export declare class GeoFlagRef {
376
- /**
377
- * Constructor.
378
- * @param code country and language code
379
- */
380
196
  constructor(code?: RefOrNormal<string | undefined>);
381
- /**
382
- * Getting the country code.
383
- * @returns country code
384
- */
385
197
  getCode(): string;
386
- /**
387
- * Returns information about the country and its flag.
388
- * @param code country code
389
- */
390
198
  get(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
391
- /**
392
- * Returns information about the language and its flag.
393
- * @param code country code
394
- */
395
199
  getLanguage(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
396
- /**
397
- * Getting a link to the flag.
398
- * @param code country code
399
- */
400
200
  getFlag(code?: RefOrNormal<string>): ComputedRef<string | undefined>;
401
- /**
402
- * Getting a list of countries by an array of codes.
403
- * @param codes list of country codes
404
- */
405
201
  getList(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
406
- /**
407
- * Getting a list of languages by an array of codes.
408
- * @param codes list of country codes
409
- */
410
202
  getListLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
411
- /**
412
- * Getting a list of countries by an array of codes in national language.
413
- * @param codes list of country codes
414
- */
415
203
  getNational(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
416
- /**
417
- * Getting a list of languages by an array of codes in national language.
418
- * @param codes list of country codes
419
- */
420
204
  getNationalLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
421
205
  }
422
- /**
423
- * Reactive class for managing the formatting of numbers and dates.
424
- * @remarks
425
- * Avoid using this reactive class if reactive updates are not required.
426
- * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
427
- */
428
206
  export declare class GeoIntlRef {
429
- /**
430
- * Constructor
431
- * @param code country code, full form language-country or one of them
432
- */
433
207
  constructor(code?: RefOrNormal<string>);
434
- /**
435
- * The consistent translation of language, region and script display names.
436
- * @param value the code to provide depends on the type
437
- * @param typeOptions options object or type string
438
- */
439
208
  display(value?: RefOrNormal<string>, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): ComputedRef<string>;
440
- /**
441
- * Get display names of language.
442
- * @param value the code to provide depends on the type
443
- * @param style the formatting style to use
444
- */
445
209
  languageName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
446
- /**
447
- * Get display names of region.
448
- * @param value the code to provide depends on the type
449
- * @param style the formatting style to use
450
- */
451
210
  countryName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
452
- /**
453
- * In basic use without specifying a locale, a formatted string.
454
- * @param value a number, bigint, or string, to format
455
- * @param options format options
456
- */
457
211
  number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
458
- /** Decimal point symbol. */
459
212
  decimal(): ComputedRef<string>;
460
- /**
461
- * Currency formatting.
462
- * @param value a number, bigint, or string, to format
463
- * @param currencyOptions currency code or options
464
- * @param numberOnly do not display currency symbol
465
- */
466
213
  currency(value: RefOrNormal<NumberOrString>, currencyOptions?: RefOrNormal<string | Intl.NumberFormatOptions>, numberOnly?: boolean): ComputedRef<string>;
467
- /**
468
- * Returns the currency symbol if it exists, otherwise the currency code.
469
- * @param currency currency code
470
- * @param currencyDisplay display mode
471
- */
472
214
  currencySymbol(currency: RefOrNormal<string>, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): ComputedRef<string>;
473
- /**
474
- * Unit formatting.
475
- * @param value a number, bigint, or string, to format
476
- * @param unitOptions unit identifier or options
477
- */
478
215
  unit(value: RefOrNormal<NumberOrString>, unitOptions?: string | Intl.NumberFormatOptions): ComputedRef<string>;
479
- /**
480
- * Returns formatted file size.
481
- * @param value size number
482
- * @param unitOptions unit options
483
- */
484
216
  sizeFile(value: RefOrNormal<NumberOrString>, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): ComputedRef<string>;
485
- /**
486
- * Number as a percentage.
487
- * @param value number to format
488
- * @param options format options
489
- */
490
217
  percent(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
491
- /**
492
- * Number as a percentage (unit).
493
- * @param value number to format
494
- * @param options format options
495
- */
496
218
  percentBy100(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
497
- /**
498
- * Formats plural rules based on input number and words list.
499
- * @param value number to format
500
- * @param words formatted words separated by pipeline
501
- * @param options plural rules options
502
- * @param optionsNumber number format options
503
- */
504
219
  plural(value: RefOrNormal<NumberOrString>, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): ComputedRef<string>;
505
- /**
506
- * Enables language-sensitive date and time formatting.
507
- * @param value date to format
508
- * @param type type of data format
509
- * @param styleOptions representation of month or options
510
- * @param hour24 whether to use 24-hour time
511
- */
512
220
  date(value: RefOrNormal<NumberOrStringOrDate>, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): ComputedRef<string>;
513
- /**
514
- * Enables language-sensitive relative time formatting.
515
- * @param value number or date to format
516
- * @param styleOptions style options
517
- * @param todayValue reference current date
518
- */
519
221
  relative(value: RefOrNormal<NumberOrStringOrDate>, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): ComputedRef<string>;
520
- /**
521
- * Enables relative time formatting with limit checks.
522
- * @param value number or date to format
523
- * @param limit day limit threshold
524
- * @param todayValue reference current date
525
- * @param relativeOptions relative options
526
- * @param dateOptions date options
527
- * @param type date format type
528
- * @param hour24 24-hour flag
529
- */
530
222
  relativeLimit(value: RefOrNormal<NumberOrStringOrDate>, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): ComputedRef<string>;
531
- /**
532
- * Formats relative time elapsed from value.
533
- * @param value number to format
534
- * @param unit relative time unit
535
- * @param styleOptions style options
536
- */
537
223
  relativeByValue(value: RefOrNormal<NumberOrString>, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): ComputedRef<string>;
538
- /**
539
- * Names of months.
540
- * @param value date
541
- * @param style month style
542
- */
543
224
  month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
544
- /**
545
- * List of months.
546
- * @param style month style
547
- */
548
225
  months(style?: Intl.DateTimeFormatOptions['month']): ComputedRef<ItemValue<number | undefined>[]>;
549
- /**
550
- * Returns weekday name.
551
- * @param value date
552
- * @param style weekday style
553
- */
554
226
  weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
555
- /**
556
- * List of weekday names.
557
- * @param style weekday style
558
- */
559
227
  weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
560
- /**
561
- * Formatted time string.
562
- * @param value date
563
- */
564
228
  time(value: RefOrNormal<NumberOrStringOrDate>): ComputedRef<string>;
565
- /**
566
- * Sorts strings taking into account the characteristics of countries.
567
- * @param data array data
568
- * @param compareFn comparison function
569
- */
570
229
  sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
571
230
  }
572
- /** Reactive class for working with geographic data. */
573
231
  export declare class GeoRef {
574
- /** Information about the current country. */
575
232
  static get(): Ref<GeoItemFull>;
576
- /** Current country code. */
577
233
  static getCountry(): ComputedRef<string>;
578
- /** Current language code. */
579
234
  static getLanguage(): ComputedRef<string>;
580
- /** Full standard locale format. */
581
235
  static getStandard(): ComputedRef<string>;
582
- /** First day of week code. */
583
236
  static getFirstDay(): ComputedRef<string>;
584
- /** Current location string. */
585
237
  static getLocation(): ComputedRef<string>;
586
- /** Current country code from location. */
587
238
  static getLocationCountry(): ComputedRef<string>;
588
- /** Current language code from location. */
589
239
  static getLocationLanguage(): ComputedRef<string>;
590
- /**
591
- * Changes the data by full code.
592
- * @param code location code
593
- */
594
240
  static set(code: string): void;
595
- /**
596
- * Sets default country code.
597
- * @param code default code or getter
598
- */
599
241
  static setValueDefault(code?: string | (() => string)): void;
600
242
  }
601
- /** Reactive class for managing localized unit formatting and automatic conversions. */
602
243
  export declare class GeoUnitRef {
603
- /**
604
- * Constructor.
605
- * @param code location code
606
- */
607
244
  constructor(code?: RefOrNormal<string>);
608
- /** Standard location code. */
609
245
  getLocation(): ComputedRef<string>;
610
- /** Formats millimeter value. */
611
246
  millimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
612
- /** Formats centimeter value. */
613
247
  centimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
614
- /** Formats meter value. */
615
248
  meter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
616
- /** Formats kilometer value. */
617
249
  kilometer(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
618
- /** Formats square meter value. */
619
250
  squareMeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
620
- /** Formats hectare value. */
621
251
  hectare(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
622
- /** Formats gram value. */
623
252
  gram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
624
- /** Formats kilogram value. */
625
253
  kilogram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
626
- /** Formats tonne value. */
627
254
  tonne(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
628
- /** Formats milliliter value. */
629
255
  milliliter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
630
- /** Formats liter value. */
631
256
  liter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
632
- /** Formats celsius value. */
633
257
  celsius(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
634
- /** Formats kilometer per hour value. */
635
258
  kilometerPerHour(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
636
- /** Formats custom unit value. */
637
259
  format(value: RefOrNormal<NumberOrString>, unit: RefOrNormal<string>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
638
260
  }
639
- /** Class for managing list data structure and navigation. */
640
261
  export declare class ListDataRef {
641
- /**
642
- * Constructor
643
- * @param list list data
644
- * @param focus focus identifier
645
- * @param highlight search highlight text
646
- * @param highlightLengthStart min length to highlight
647
- * @param filterMode filter mode flag
648
- * @param selected selected identifiers
649
- * @param keyValue value key name
650
- * @param keyLabel label key name
651
- * @param lite lite mode threshold
652
- * @param min minimum selection
653
- * @param max maximum selection
654
- * @param parent parent identifier
655
- */
656
262
  constructor(list: RefOrNormal<ListListInput | undefined>, focus?: RefType<ListSelectedItem | undefined> | undefined, highlight?: RefType<string | undefined> | undefined, highlightLengthStart?: RefType<number | undefined> | undefined, filterMode?: RefType<boolean | undefined> | undefined, selected?: RefType<ListSelectedList | undefined> | undefined, keyValue?: RefType<string | undefined> | undefined, keyLabel?: RefType<string | undefined> | undefined, lite?: RefType<number | undefined> | undefined, min?: RefOrNormal<number | string | undefined>, max?: RefOrNormal<number | string | undefined>, parent?: string | undefined);
657
263
  readonly data: ComputedRef<ListList>;
658
264
  readonly liteData: ComputedRef<ListList>;
@@ -689,30 +295,24 @@ export declare class ListDataRef {
689
295
  getIndexByStep(index: string, step: number): ListDataItem | undefined;
690
296
  getIndexNext(index: string): ListDataItem | undefined;
691
297
  getIndexPrev(index: string): ListDataItem | undefined;
692
- getItemByIndex(index?: string): { key: number; item: ListDataItem; } | undefined;
298
+ getItemByIndex(index?: string): {
299
+ key: number;
300
+ item: ListDataItem;
301
+ } | undefined;
693
302
  getItemByKey(key: number): ListDataItem | undefined;
694
303
  getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
695
304
  getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
696
305
  getSubList(item: ListDataItem): ListDataRef;
697
306
  }
698
- /** Router management class. */
699
307
  export declare class RouterItemRef {
700
- /** Get router instance. */
701
308
  static get(): _RouterClassic;
702
- /** Returns link by route name. */
703
309
  static getLink(name: string, params?: any, query?: any): string | undefined;
704
- /** Returns href properties by route name. */
705
310
  static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
706
- /** Changes site path. */
707
311
  static push(to: string | RouteLocationRaw): void;
708
- /** Sets router instance. */
709
312
  static set(router: Router): void;
710
- /** Sets router instance once. */
711
313
  static setOneTime(router: Router): void;
712
- /** Converts raw location to href properties. */
713
314
  static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
714
315
  }
715
- /** Class for getting scrollbar width as a reactive item. */
716
316
  export declare class ScrollbarWidthRef {
717
317
  readonly item: Ref<boolean | undefined, boolean | undefined>;
718
318
  readonly width: Ref<number, number>;
@@ -721,23 +321,55 @@ export declare class ScrollbarWidthRef {
721
321
  }
722
322
  /**
723
323
  * Asynchronous reactive composable for API requests with built-in SSR support.
324
+ * Wraps `useApiRef` and immediately calls `initSsr()` to ensure data is pre-fetched on the server side.
325
+ * Use this composable ONLY if you need the request to be executed on the server side during SSR.
326
+ * For all other cases, use `useApiRef`.
327
+ *
724
328
  * @example
725
329
  * ```typescript
726
- * const { data, loading } = useApiAsyncRef('/users/1', { method: 'GET' });
330
+ * import { Schema as S } from '@effect/schema'
331
+ * import { useApiAsyncRef } from '@dxtmisha/functional'
332
+ *
333
+ * const userSchema = S.Struct({ id: S.Number, name: S.String })
334
+ *
335
+ * const { data, loading, errorItem, isResponseContractValid } = useApiAsyncRef(
336
+ * '/users/1',
337
+ * { method: 'GET' },
338
+ * true,
339
+ * undefined,
340
+ * undefined,
341
+ * (data) => {
342
+ * try {
343
+ * return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
344
+ * } catch (e) {
345
+ * return { status: 'error', errors: e }
346
+ * }
347
+ * },
348
+ * [
349
+ * { status: 404, message: 'User not found' }
350
+ * ]
351
+ * )
727
352
  * ```
728
353
  */
729
354
  export declare function useApiAsyncRef<R, T = R>(path?: RefOrNormal<string | undefined>, options?: ApiOptions, reactivity?: boolean, conditions?: RefType<boolean>, transformation?: (data: T, isResponseContractValid?: ApiDataValidation) => ApiData<R>, validateResponseContract?: (data: T) => ApiDataValidation, errorContract?: ApiErrorStorageList, unmounted?: boolean, apiInstance?: ApiInstance): UseApiRef<R>;
730
- /** Use API delete request helper wrapper. */
355
+ export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
356
+ }
731
357
  export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
732
358
  loading: Ref<boolean, boolean>;
733
359
  send(request?: Request | undefined): Promise<Return | undefined>;
734
360
  };
735
- /** Use API get request helper wrapper. */
361
+ export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
362
+ }
736
363
  export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
737
364
  loading: Ref<boolean, boolean>;
738
365
  send(request?: Request | undefined): Promise<Return | undefined>;
739
366
  };
740
- /** Asynchronous reactive composable for API management requests with built-in SSR support. */
367
+ /**
368
+ * Asynchronous reactive composable for API management requests with built-in SSR support.
369
+ * Wraps `useApiManagementRef` and immediately calls `initSsr()` to ensure data is pre-fetched on the server side.
370
+ * Use this composable ONLY if you need the request to be executed on the server side during SSR.
371
+ * For all other cases, use `useApiManagementRef`.
372
+ */
741
373
  export declare function useApiManagementAsyncRef<Return extends ApiManagementValue, FormattersOptions extends FormattersOptionsList, Post extends Record<string, any>, Put extends Record<string, any>, Delete extends Record<string, any>, Type extends ApiManagementValue = Return, Item extends ArrayToItem<Return> = ArrayToItem<Return>, ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number], Columns extends SearchColumns<ItemFormatters> = []>(propsGet: ApiManagementGet<Return, Type>, formattersOptions?: FormattersOptions, searchOptions?: ApiManagementSearch<Item, Columns>, postRequest?: ApiManagementRequest<Post>, putRequest?: ApiManagementRequest<Put>, deleteRequest?: ApiManagementRequest<Delete>, action?: () => Promise<void> | void, apiInstance?: ApiInstance): {
742
374
  isValid: ComputedRef<boolean>;
743
375
  isResponseContractValid: ComputedRef<boolean>;
@@ -766,14 +398,35 @@ export declare function useApiManagementAsyncRef<Return extends ApiManagementVal
766
398
  };
767
399
  /**
768
400
  * A powerful composable for comprehensive API request orchestration.
401
+ * It centrally manages data loading (GET), list formatting, client-side searching,
402
+ * and mutations (POST, PUT, DELETE) through a single reactive interface.
403
+ *
769
404
  * @note This hook is recommended to be used in tandem with `executeUse` for centralized state management.
770
- * @remarks Data formatting guidelines for `formattersOptions`:
771
- * - Recommended for values, dates, currencies.
772
- * - Not recommended for technical identifiers (IDs, UUIDs).
405
+ * By wrapping `useApiManagementRef` in `executeUseProvide` or `executeUseGlobal`, you can ensure
406
+ * a single source of truth across the component tree or the entire application.
407
+ *
408
+ * @remarks
409
+ * Data formatting guidelines for `formattersOptions`:
410
+ * - Recommended for formatting: Numbers that represent values (prices, counts), dates, currency, units, and statuses.
411
+ * - Not recommended for formatting: Technical identifiers such as ID, UUID, account numbers, types, or internal codes.
412
+ *
773
413
  * @example
774
- * ```typescript
775
- * const products = useApiManagementRef({ path: '/api/v1/products' });
776
- * ```
414
+ * const products = useApiManagementRef(
415
+ * {
416
+ * path: '/api/v1/products',
417
+ * skeleton: () => Array(5).fill({ id: 0, name: 'Loading...', price: 0 })
418
+ * },
419
+ * {
420
+ * price: (v) => `${v} USD`,
421
+ * created_at: (v) => new Date(v).toLocaleDateString()
422
+ * },
423
+ * {
424
+ * columns: ['name', 'category']
425
+ * },
426
+ * { path: '/api/v1/products' },
427
+ * { path: (data) => `/api/v1/products/${data.id}` },
428
+ * { path: (data) => `/api/v1/products/${data.id}` }
429
+ * );
777
430
  */
778
431
  export declare function useApiManagementRef<Return extends ApiManagementValue, FormattersOptions extends FormattersOptionsList, Post extends Record<string, any>, Put extends Record<string, any>, Delete extends Record<string, any>, Type extends ApiManagementValue = Return, Item extends ArrayToItem<Return> = ArrayToItem<Return>, ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number], Columns extends SearchColumns<ItemFormatters> = []>(propsGet: ApiManagementGet<Return, Type>, formattersOptions?: FormattersOptions, searchOptions?: ApiManagementSearch<Item, Columns>, postRequest?: ApiManagementRequest<Post>, putRequest?: ApiManagementRequest<Put>, deleteRequest?: ApiManagementRequest<Delete>, action?: () => Promise<void> | void, apiInstance?: ApiInstance): {
779
432
  isValid: ComputedRef<boolean>;
@@ -801,56 +454,121 @@ export declare function useApiManagementRef<Return extends ApiManagementValue, F
801
454
  sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
802
455
  sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
803
456
  };
804
- /** Use API post request helper wrapper. */
457
+ export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
458
+ }
805
459
  export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
806
460
  loading: Ref<boolean, boolean>;
807
461
  send(request?: Request | undefined): Promise<Return | undefined>;
808
462
  };
809
- /** Use API put request helper wrapper. */
463
+ export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
464
+ }
810
465
  export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
811
466
  loading: Ref<boolean, boolean>;
812
467
  send(request?: Request | undefined): Promise<Return | undefined>;
813
468
  };
469
+ export interface UseApiRef<R> {
470
+ data: ComputedRef<ApiData<R> | undefined>;
471
+ item: Ref<ApiData<R> | undefined>;
472
+ errorItem: ComputedRef<ApiErrorItem | undefined>;
473
+ isResponseContractValid: ComputedRef<boolean>;
474
+ responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
475
+ length: ComputedRef<number>;
476
+ starting: ComputedRef<boolean>;
477
+ loading: Ref<boolean>;
478
+ reading: Ref<boolean>;
479
+ isStarting(): boolean;
480
+ isLoading(): boolean;
481
+ isReading(): boolean;
482
+ getItem(): ApiData<R> | undefined;
483
+ init(): void;
484
+ initSsr(): void;
485
+ reset(): Promise<void>;
486
+ stop(): void;
487
+ abort(): void;
488
+ }
814
489
  /**
815
490
  * Main reactive composable for working with API requests in Vue.
491
+ * Automatically handles SSR, reactivity, caching, error storage, data validation, and transformation.
492
+ *
816
493
  * @example
817
494
  * ```typescript
818
- * const { data, loading } = useApiRef('/users/1');
495
+ * import { Schema as S } from '@effect/schema'
496
+ * import { useApiRef } from '@dxtmisha/functional'
497
+ *
498
+ * const userSchema = S.Struct({ id: S.Number, name: S.String })
499
+ *
500
+ * const { data, loading, errorItem, isResponseContractValid } = useApiRef(
501
+ * '/users/1',
502
+ * { method: 'GET' },
503
+ * true,
504
+ * undefined,
505
+ * (data) => ({ ...data, isTransformed: true }),
506
+ * (data) => {
507
+ * try {
508
+ * return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
509
+ * } catch (e) {
510
+ * return { status: 'error', errors: e }
511
+ * }
512
+ * },
513
+ * [
514
+ * {
515
+ * status: 404,
516
+ * message: 'User not found'
517
+ * }
518
+ * ]
519
+ * )
819
520
  * ```
820
521
  */
821
522
  export declare function useApiRef<R, T = R>(path?: RefOrNormal<string | undefined>, options?: ApiOptions, reactivity?: boolean, conditions?: RefType<boolean>, transformation?: (data: T, isResponseContractValid?: ApiDataValidation) => ApiData<R>, validateResponseContract?: (data: T) => ApiDataValidation, errorContract?: ApiErrorStorageList, unmounted?: boolean, apiInstance?: ApiInstance): UseApiRef<R>;
822
523
  export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
823
- /** Sends configured API request. */
524
+ export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
525
+ path?: RefOrNormal<string | undefined>;
526
+ method?: ApiMethodItem;
527
+ action?: (data: Return | undefined) => Promise<void> | void;
528
+ transformation?: (data: T) => Return;
529
+ validateRequestContract?: (data: Request) => ApiDataValidation & Return;
530
+ validateResponseContract?: (data: T) => ApiDataValidation & Return;
531
+ errorContract?: ApiErrorStorageList;
532
+ toData?: boolean;
533
+ options?: ApiOptions;
534
+ apiInstance?: ApiInstance;
535
+ }
824
536
  export declare function useApiRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>({ path, method, action, transformation, validateRequestContract, validateResponseContract, errorContract, toData, options, apiInstance }: UseApiRequestSetup<T, Request, Return>): {
825
537
  loading: Ref<boolean, boolean>;
826
538
  send(request?: Request): Promise<Return | undefined>;
827
539
  };
828
- /** Creates reactive variable synced across browser tabs using BroadcastChannel. */
829
- export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<T | string | undefined>;
830
- /** Creates reactive cookie reference. */
540
+ type BroadcastValueItem<T> = T | string | undefined;
541
+ export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
831
542
  export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
832
- /** Composable for reactive formatting of data lists based on rules. */
833
543
  export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
834
544
  listFormat: ComputedRef<FormattersReturn<List, Options>>;
835
545
  length: ComputedRef<number>;
836
546
  };
837
547
  /**
838
- * Returns GeoIntlRef instance.
548
+ * Returns a class object for working with data formatting.
549
+ *
839
550
  * @remarks
840
551
  * Avoid using this reactive composable if reactive updates are not required.
841
- * For non-reactive formatting, use `GeoIntl` directly.
552
+ * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
842
553
  */
843
554
  export declare function useGeoIntlRef(): GeoIntlRef;
844
- /** Returns GeoUnitRef instance. */
845
555
  export declare function useGeoUnitRef(): GeoUnitRef;
846
- /** Creates reactive hash variable. */
847
556
  export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
848
- /** Hook for initializing lazy tracking of element appearance with root margin. */
557
+ export type LazyItemByMargin = {
558
+ rootMargin: string;
559
+ item: ReturnType<typeof useLazyRef>;
560
+ };
849
561
  export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
850
562
  lazyItemStatus: ShallowRef<boolean, boolean>;
851
563
  readonly lazyItem: LazyItem | undefined;
852
564
  };
853
- /** Hook for initializing lazy element appearance tracking. */
565
+ export type LazyItem = {
566
+ status: ShallowRef<boolean>;
567
+ ratio: ShallowRef<number>;
568
+ entry: ShallowRef<IntersectionObserverEntry | undefined>;
569
+ stopWatch: () => void;
570
+ };
571
+ export type LazyList = Record<string, LazyItem>;
854
572
  export declare const useLazyRef: (options?: IntersectionObserverInit) => {
855
573
  intersectionObserver: IntersectionObserver | undefined;
856
574
  getItem(element?: HTMLElement): LazyItem | undefined;
@@ -858,9 +576,7 @@ export declare const useLazyRef: (options?: IntersectionObserverInit) => {
858
576
  removeLazyItem: (element?: HTMLElement) => void;
859
577
  disconnectLazy: () => void | undefined;
860
578
  };
861
- /** Returns reactive global loading status. */
862
579
  export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
863
- /** Vue composable for reactive meta tags management with DOM synchronization. */
864
580
  export declare const useMeta: () => Readonly<{
865
581
  meta: Meta;
866
582
  title: Ref<string, string>;
@@ -910,10 +626,8 @@ export declare const useMeta: () => Readonly<{
910
626
  setSuffix: (suffix: string) => void;
911
627
  }>;
912
628
  destroyExecute?(): void;
913
- };
914
- /** Creates reactive URL query parameter reference. */
629
+ }>;
915
630
  export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
916
- /** Managing router link list. */
917
631
  export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
918
632
  item: ComputedRef<T | undefined>;
919
633
  selected: Ref<string, string>;
@@ -922,7 +636,6 @@ export declare const useRouterList: <T extends ListDataBasic>(list: RefType<Cons
922
636
  to: (name?: string) => void;
923
637
  toMain(): void;
924
638
  };
925
- /** Composable for search logic with reactive data. */
926
639
  export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
927
640
  isSearch: ComputedRef<boolean>;
928
641
  search: Ref<string, string>;
@@ -930,62 +643,95 @@ export declare function useSearchRef<T extends SearchItem, K extends SearchColum
930
643
  listSearch: ComputedRef<SearchFormatList<T, K>>;
931
644
  length: ComputedRef<number>;
932
645
  };
933
- /** Composable for search value state and handling delays. */
934
646
  export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
935
647
  search: Ref<string, string>;
936
648
  searchDelay: Ref<string, string>;
937
649
  loading: Ref<boolean, boolean>;
938
650
  };
939
- /** Creates reactive session storage reference. */
940
651
  export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
941
- /** Creates reactive local storage reference. */
942
652
  export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
943
653
  /**
944
- * Getting translated text by keys.
654
+ * Getting the translated text by an array of keys or a string with a key.
655
+ * Returns a `ShallowRef` that automatically updates when the global language changes.
656
+ * Use `as const` for arrays to ensure proper TypeScript key inference.
657
+ *
945
658
  * @example
946
659
  * ```typescript
947
- * const labels = useTranslateRef(['home.title'] as const);
660
+ * const translations = useTranslateRef(['home.title', 'home.description'] as const);
661
+ * const labels = t(['button.save', 'button.cancel'] as const);
948
662
  * ```
949
663
  */
950
664
  export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
951
- /** Shorthand for useTranslateRef. */
952
665
  export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
953
- /** Creates computed property handling async getters. */
666
+ export declare const uiMakeFlags: () => void;
667
+ export * from '@dxtmisha/functional-basic';
954
668
  export declare function computedAsync<R>(getter: (() => Promise<R>) | (() => R) | R, initialState?: (() => R) | R, ignore?: R, debugOptions?: DebuggerOptions): ComputedRef<R | undefined>;
955
- /** Creates computed property dependent on current language state. */
956
669
  export declare function computedByLanguage<T, R extends (T | undefined) = T | undefined>(getter: ComputedGetter<R>, getterNone?: R | (() => R), conditions?: () => boolean, debugOptions?: DebuggerOptions): ComputedRef<R>;
957
- /** Creates cached computed property computed on demand. */
958
670
  export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
671
+ export interface FunctionalPluginOptions {
672
+ api?: ApiConfig;
673
+ translate?: TranslateConfig;
674
+ location?: string | (() => string);
675
+ metaSuffix?: string;
676
+ icons?: IconsConfig;
677
+ iconsSocial?: InputSocialIcons;
678
+ router?: Router;
679
+ errorCauses?: ErrorCenterCauseList;
680
+ errorHandlers?: ErrorCenterHandlerList;
681
+ errorCallbacks?: ErrorCenterHandlerCallback[];
682
+ }
959
683
  /**
960
- * Vue plugin for initializing global functional services.
684
+ * Vue plugin for initializing and configuring global functional services
685
+ * (Api, Translate, Icons, Meta).
686
+ *
961
687
  * @example
962
688
  * ```typescript
963
- * app.use(dxtFunctionalPlugin, { api: { url: 'https://api.example.com' } });
689
+ * import { createApp } from 'vue'
690
+ * import { dxtFunctionalPlugin } from '@dxtmisha/functional'
691
+ * import router from './router'
692
+ *
693
+ * const app = createApp(App)
694
+ * app.use(dxtFunctionalPlugin, {
695
+ * api: { url: 'https://api.example.com' },
696
+ * metaSuffix: ' | My App',
697
+ * router
698
+ * })
964
699
  * ```
965
700
  */
966
701
  export declare const dxtFunctionalPlugin: Plugin;
967
- /** Types of initialization for executeUse singleton. */
968
702
  export declare enum ExecuteUseType {
969
703
  global = "global",
970
704
  provide = "provide",
971
705
  local = "local"
972
706
  }
973
- /** Return structure of executeUse singleton wrapper. */
974
707
  export type ExecuteUseReturn<R> = Readonly<R & {
975
708
  init(): Readonly<R>;
976
709
  destroyExecute?(): void;
977
710
  }>;
978
711
  /**
979
- * Creates managed singleton encapsulating initialization strategy.
712
+ * Creates a managed singleton that encapsulates initialization logic and access mode.
713
+ * Supports initialization strategies: 'global', 'provide', 'local'.
714
+ *
980
715
  * @remarks
981
- * Use for API services, resource optimization, and shared state.
716
+ * Use this function for API services, shared reactive states, and singleton resource optimizations.
717
+ *
982
718
  * @example
983
- * ```typescript
984
- * export const useUserApi = executeUseGlobal(() => useApiGet('/api/user'));
985
- * ```
719
+ * export const useUserApi = executeUseGlobal(() => {
720
+ * return useApiGet('/api/user');
721
+ * });
722
+ *
723
+ * export const useFeatureState = executeUseProvide(() => {
724
+ * const items = [];
725
+ * const addItem = (item) => items.push(item);
726
+ * return { items, addItem };
727
+ * });
986
728
  */
987
729
  export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
988
- /** Creates global singleton. */
730
+
731
+ /**
732
+ * Creates a global singleton.
733
+ * @remarks See {@link executeUse} for more details.
734
+ */
989
735
  export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
990
736
  init(): Readonly<R>;
991
737
  destroyExecute?(): void;
@@ -993,7 +739,11 @@ export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<
993
739
  init(): Readonly<R>;
994
740
  destroyExecute?(): void;
995
741
  }>);
996
- /** Creates component-scoped singleton via provide/inject. */
742
+
743
+ /**
744
+ * Creates a component-scoped singleton.
745
+ * @remarks Best for sharing state within a component sub-tree. See {@link executeUse} for more details.
746
+ */
997
747
  export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
998
748
  init(): Readonly<R>;
999
749
  destroyExecute?(): void;
@@ -1001,7 +751,11 @@ export declare function executeUseProvide<R, O extends any[]>(callback: (...args
1001
751
  init(): Readonly<R>;
1002
752
  destroyExecute?(): void;
1003
753
  }>);
1004
- /** Creates local singleton inside closure. */
754
+
755
+ /**
756
+ * Creates a local singleton.
757
+ * @remarks Best for internal state preservation within a closure. See {@link executeUse} for more details.
758
+ */
1005
759
  export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
1006
760
  init(): Readonly<R>;
1007
761
  destroyExecute?(): void;
@@ -1009,33 +763,19 @@ export declare function executeUseLocal<R, O extends any[]>(callback: (...args:
1009
763
  init(): Readonly<R>;
1010
764
  destroyExecute?(): void;
1011
765
  }>);
1012
- /** Initializes all registered global singletons. */
766
+
1013
767
  export declare function executeUseGlobalInit(): void;
1014
- /** Gets injected Vue value by key name. */
1015
768
  export declare function getInject<T>(name: string): T | undefined;
1016
- /** Resolves options object for API fetch calls. */
1017
769
  export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
1018
- /** Executes argument if function and unwraps resulting Vue ref. */
1019
770
  export declare function executeFunctionRef<T>(data: RefOrNormalOrFunction<T>): T;
1020
- /** Returns reactive error item from API ref data. */
1021
771
  export declare function getApiErrorRef<R>(data: RefType<ApiData<R> | undefined>): ComputedRef<ApiErrorItem | undefined>;
1022
- /** Generates computed properties binding for subcomponent. */
1023
772
  export declare function getBindRef<T, R extends ItemList>(value: RefOrNormal<T | R> | undefined, nameExtra?: RefOrNormal<ItemList> | string, name?: string): ComputedRef<R>;
1024
- /** Unwraps ref value or returns raw value. */
1025
773
  export declare function getRef<T>(item: RefOrNormal<T>): T;
1026
- /** Renders component VNode with cached properties. */
1027
774
  export declare function render<T extends ItemList>(name: string | any, props?: T, children?: RawChildren | RawSlots, index?: string): VNode;
1028
- /** Updates ref value if changed. */
1029
775
  export declare function setRef<T>(item: Ref<T>, value: T): void;
1030
- /** Wraps value into Vue ref if not reactive. */
1031
776
  export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
1032
- /** Merges two property objects merging classes and styles. */
1033
777
  export declare function getBind<T, R extends ItemList>(value: T | R | undefined | null, nameExtra?: ItemList | string, name?: string, except?: boolean): ConstrBind<R>;
1034
- /** Returns class name property from component props object. */
1035
778
  export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
1036
- /** Returns or generates index key for VNode rendering. */
1037
779
  export declare function getIndexForRender<T extends ItemList>(name: string | any, props?: T, index?: string): string | undefined;
1038
- /** Merges two objects taking into account class and style arrays. */
1039
780
  export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
1040
- /** Merges multiple property objects preserving classes and styles. */
1041
781
  export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;