@dxtmisha/functional 1.15.6 → 1.15.7

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 CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.15.7] - 2026-08-05
6
+
7
+ ### Changed
8
+ - **AI Documentation**: Modularized package documentation and generated `ai-mcp.json` resource definitions alongside updated `ai-description.md` and `ai-types.md`.
9
+
10
+ ## [1.15.6] - 2026-07-28
11
+
12
+ ### Changed
13
+ - **GeoIntlRef & useGeoIntlRef**: Added JSDoc `@remarks` guidelines recommending the use of standard non-reactive `GeoIntl` from `@dxtmisha/functional-basic` when reactivity is not required.
14
+ - **Documentation**: Updated AI documentation context (`ai-description.md`, `ai-types.md`) and package type definitions.
15
+
5
16
  ## [1.15.5] - 2026-07-25
6
17
 
7
18
  ### Added
package/ai-description.md CHANGED
@@ -1,7 +1,7 @@
1
- This library provides a reactive utility and component abstraction framework for Vue 3 built on top of functional basic utilities, standardizing UI design system architecture, reactive API request orchestration, localized data formatting, and state management. Its core capabilities span five main modules: the API & Network Module (`useApiRef`, `useApiAsyncRef`, `useApiManagementRef`, `useApiRequest`, and HTTP method composables) manages reactive request lifecycle, SSR prefetching, error contracts, response validation, and list mutations; the Design & Component Architecture Module (`DesignConstructorAbstract`, `DesignComponents`, `DesignAbstract`, `DesignChanged`) provides abstract base classes for component setup, dynamic rendering, class and style calculation, slot management, and prop change tracking; the Localization & Geo Module (`GeoRef`, `GeoIntlRef`, `GeoUnitRef`, `GeoFlagRef`, `DatetimeRef`, `useTranslateRef`) handles reactive internationalization, language/country metadata, locale-sensitive number and date formatting, unit conversions, and translation keys; the Storage & State Module (`useStorageRef`, `useCookieRef`, `useSessionRef`, `useBroadcastValueRef`, `useQueryRef`, `useHashRef`, `executeUse`) binds local/session storage, cookies, cross-tab communication, URL state, and singletons to Vue reactive references; and the DOM, Search & Navigation Module (`useLazyRef`, `RouterItemRef`, `useRouterList`, `useSearchRef`, `useMeta`, `EventRef`) provides lazy visibility tracking, router integration, search indexing, DOM event listeners, and reactive meta tag management. AI assistant study of ai-types.md is mandatory when extending design component abstractions like `DesignConstructorAbstract` or `DesignComponents`, typing component properties, modifications, or emits via `ConstrComponentMod`, `ConstrClasses`, `ConstrEmit`, or `ConstrBind`, configuring API management types including `ApiManagementGet`, `ApiManagementRequest`, or `ApiManagementSearch`, handling reactive input wrappers typed with `RefOrNormal` or `RefOrNormalOrFunction`, or structuring dataset records using `ListListInput`, `ListDataItem`, and `ListSelectedList`. The library seamlessly integrates with Vue 3, vue-router, and @dxtmisha/functional-basic to form a cohesive reactive application infrastructure.
1
+ This library is a reactive utility and component architecture framework for Vue 3 that standardizes design system component construction, locale-aware data formatting, browser storage state, and API request lifecycle orchestration. It provides abstract component models for computing styles, classes, slots, and properties, alongside wrappers for reactive state synchronization and dynamic component rendering. Design System Architecture components abstractly encapsulate Vue component structures, automating class and style generation, property change detection, slot bindings, and dynamic component rendering. API and Network Management modules manage asynchronous HTTP request lifecycles, server-side prefetching, CRUD mutations, response contract validation, error handling, and unified client-side search or formatting pipelines. Localization and Formatting utilities deliver reactive interfaces for internationalized formatting of dates, currencies, numbers, measurement units, country flag metadata, and dynamic translation lists. Storage and State controls wrap browser local storage, session storage, cookies, broadcast channels, and URL query or hash parameters into reactive references. List and Search utilities provide reactive controllers for hierarchical list filtering, multi-item selection tracking, focus navigation, and debounced text searches. DOM and Lifecycle controls manage intersection observers for lazy loading, document head metadata, scrollbar dimensions, global loading state tracking, and reactive event listeners. Injection and Singleton utilities support managed lifecycle topologies across application, component-subtree, or closure scopes. Studying ai-types.md is mandatory when implementing custom component constructors extending base design abstract classes, defining request or response validation contracts, configuring complex API management options, typing list data inputs and selection states, setting up functional plugin options, or establishing singleton execution topologies. The library integrates directly with Vue 3 reactivity and SSR runtime paradigms, Vue Router navigation mechanisms, and core functional utility packages.
2
2
  ## Mandatory Rules
3
3
  Read the corresponding file if your task relates to:
4
- - 'node_modules/@dxtmisha/functional/ai-prompts/api-reference.md': Scope-isolated singleton factories and reactive REST API management
5
- - 'node_modules/@dxtmisha/functional/ai-prompts/localization-seo.md': Geographic context, i18n formatting, translation primitives, document metadata, and scrollbar utilities
6
- - 'node_modules/@dxtmisha/functional/ai-prompts/reactivity-lists.md': Async reactivity composables, list data models, search filters, and DOM observers
7
- - 'node_modules/@dxtmisha/functional/ai-prompts/storage-state.md': Composables for reactive browser storage, session, cookies, cross-tab broadcasting, and URL hash state
4
+ - 'node_modules/@dxtmisha/functional/ai-prompts/api-reference.md': Scope factory initialization, reactive singletons, and REST API management patterns
5
+ - 'node_modules/@dxtmisha/functional/ai-prompts/localization-seo.md': Geographic context, internationalization formatting, translation utilities, HTML metadata management, and scrollbar measurement
6
+ - 'node_modules/@dxtmisha/functional/ai-prompts/reactivity-lists.md': Async reactivity helpers, list management, search filtering, and DOM event observers
7
+ - 'node_modules/@dxtmisha/functional/ai-prompts/storage-state.md': Reactive composables for persistent browser storage, cookies, broadcast messaging, and URL hashes
package/ai-mcp.json CHANGED
@@ -1,26 +1,38 @@
1
1
  [
2
+ {
3
+ "uri": "@dxtmisha/functional/ai-types.md",
4
+ "name": "Vue Functional Reference",
5
+ "mimeType": "text/markdown",
6
+ "description": "TypeScript type definitions and composable API specifications for Vue application state management, data formatting, localization, and API request handling."
7
+ },
8
+ {
9
+ "uri": "@dxtmisha/functional/ai-description.md",
10
+ "name": "Vue Framework Architecture",
11
+ "mimeType": "text/markdown",
12
+ "description": "Comprehensive architectural conventions and guidelines for a Vue 3 reactive utility framework, covering component construction, API lifecycle management, localization, and persistent state controls."
13
+ },
2
14
  {
3
15
  "uri": "@dxtmisha/functional/ai-prompts/api-reference.md",
4
- "name": "API Management Reference",
16
+ "name": "API Reference",
5
17
  "mimeType": "text/markdown",
6
- "description": "Guidance and architectural patterns for REST API management and scope-isolated reactive singleton factories using the @dxtmisha/functional library."
18
+ "description": "Defines architectural patterns and usage guidelines for REST API management and scope-isolated reactive singletons within @dxtmisha/functional. Details scope factory initialization alongside reactive CRUD operations with client-side caching and contract validation."
7
19
  },
8
20
  {
9
21
  "uri": "@dxtmisha/functional/ai-prompts/localization-seo.md",
10
- "name": "Localization SEO Utilities",
22
+ "name": "Localization and SEO",
11
23
  "mimeType": "text/markdown",
12
- "description": "Guidelines and reactive utilities for locale-aware formatting, multi-key translations, geographic context, and dynamic HTML document metadata management."
24
+ "description": "Covers locale-aware formatting, multi-key translations, geographic context management, and reactive HTML document metadata handling for SEO optimization."
13
25
  },
14
26
  {
15
27
  "uri": "@dxtmisha/functional/ai-prompts/reactivity-lists.md",
16
28
  "name": "Reactivity and Lists",
17
29
  "mimeType": "text/markdown",
18
- "description": "Provides specifications and usage patterns for advanced async reactivity helpers, list selection models, debounced search filters, and DOM observer utilities."
30
+ "description": "Comprehensive guide to advanced asynchronous reactivity composables, list data models, multi-field search filtering, and DOM observer utilities."
19
31
  },
20
32
  {
21
33
  "uri": "@dxtmisha/functional/ai-prompts/storage-state.md",
22
- "name": "Browser State Composables",
34
+ "name": "Reactive Browser State",
23
35
  "mimeType": "text/markdown",
24
- "description": "Provides reactive composable wrappers for persistent and synchronized browser state management, including localStorage, sessionStorage, cookies, broadcast channels, and URL hash fragments."
36
+ "description": "API reference and usage examples for reactive composables managing persistent browser state and cross-tab synchronization. Covers localStorage, sessionStorage, cookies, BroadcastChannel, and URL hash state."
25
37
  }
26
38
  ]
package/ai-types.md CHANGED
@@ -1,33 +1,12 @@
1
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.
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';
3
+ import { ComputedRef, Ref, ShallowRef, ToRefs, VNode, DebuggerOptions, ComputedGetter, PropType, VNodeArrayChildren, Plugin } from 'vue';
18
4
  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';
20
5
  import { InputSocialIcons } from '@dxtmisha/media';
6
+ 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, FormattersListProp, FormattersReturn, MetaRobots, Meta, SearchItem, SearchOptions, TranslateInstance, TranslateList, ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig, Undefined, NumberOrStringOrBoolean, ApiDefaultValue, SearchListValue, ItemList, ApiMethodItem } from '@dxtmisha/functional-basic';
21
7
  export * from '@dxtmisha/functional-basic';
22
- export type RefType<T> = ComputedRef<T> | Ref<T>;
23
- export type RefUndefined<T> = RefType<T | undefined>;
24
- export type RefOrNormal<T> = RefType<T> | T;
25
- export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
26
- export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
27
- export type RawSlots = { [name: string]: unknown; $stable?: boolean; };
28
8
  export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
29
9
  export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
30
- /** Configuration for the main GET request in API management. */
31
10
  export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
32
11
  path?: RefOrNormal<string | undefined>;
33
12
  options?: ApiOptions;
@@ -40,13 +19,11 @@ export type ApiManagementGet<Return extends ApiManagementValue, Type extends Api
40
19
  unmounted?: boolean;
41
20
  skeleton?: () => Return;
42
21
  };
43
- /** Configuration for client-side search across API data. */
44
22
  export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
45
23
  columns: K;
46
24
  value?: Ref<string>;
47
25
  options?: SearchOptions;
48
26
  };
49
- /** Configuration for mutation requests (POST, PUT, DELETE). */
50
27
  export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
51
28
  path?: RefOrNormal<string | undefined>;
52
29
  action?: (data: Return | undefined) => Promise<void> | void;
@@ -58,17 +35,27 @@ export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFet
58
35
  options?: ApiOptions;
59
36
  };
60
37
  export type ConstrItem = Record<string, any>;
61
- export type ConstrValue<T = any> = { value?: T; };
38
+ export type ConstrValue<T = any> = {
39
+ value?: T;
40
+ };
62
41
  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>; };
42
+ export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
43
+ [K in keyof P]?: RefOrNormal<P[K]>;
44
+ };
45
+ export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
46
+ elementHtml?: ComputedRef<E | undefined>;
47
+ };
65
48
  export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
66
49
  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; }>>;
50
+ export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
51
+ [K in keyof T]: (evt: K, ...args: T[K]) => void;
52
+ }>>;
68
53
  export type ConstrClassObject = Record<string, boolean | undefined>;
69
54
  export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
70
55
  export type ConstrClassList = Record<string, ConstrClass>;
71
- export type ConstrClasses = { main: ConstrClass; } & ConstrClassList;
56
+ export type ConstrClasses = {
57
+ main: ConstrClass;
58
+ } & ConstrClassList;
72
59
  export type ConstrStylesItem = string | null;
73
60
  export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
74
61
  export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
@@ -100,14 +87,32 @@ export type ConstrPropItemOptions<T = any> = {
100
87
  validator?(value: any, props: any): boolean;
101
88
  };
102
89
  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; };
90
+ export type ConstrProps<P = Record<string, any>> = {
91
+ [K in keyof P]: ConstrPropItem<P[K]>;
92
+ };
93
+ export type ConstrHrefProps = {
94
+ href?: string;
95
+ };
105
96
  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; }>;
97
+ export type ListDataBasic = {
98
+ label?: NumberOrString;
99
+ value?: any;
100
+ search?: string;
101
+ };
102
+ export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
103
+ parent?: string;
104
+ type: ListType;
105
+ index: string;
106
+ disabled?: boolean;
107
+ }>;
108
108
  export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
109
109
  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; };
110
+ export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
111
+ focus: boolean;
112
+ highlight?: string;
113
+ selected: boolean;
114
+ disabled?: boolean;
115
+ };
111
116
  export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
112
117
  export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
113
118
  export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
@@ -115,544 +120,152 @@ export type ListSelectedItem = NumberOrStringOrBoolean;
115
120
  export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
116
121
  export type ListName = string | number | undefined;
117
122
  export type ListNames = ListName[];
123
+ export type RefType<T> = ComputedRef<T> | Ref<T>;
124
+ export type RefUndefined<T> = RefType<T | undefined>;
125
+ export type RefOrNormal<T> = RefType<T> | T;
126
+ export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
127
+ export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
128
+ export type RawSlots = {
129
+ [name: string]: unknown;
130
+ $stable?: boolean;
131
+ };
118
132
  export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
119
133
  export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
120
134
  export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
121
135
  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
136
  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
137
  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
138
  make(compelled?: boolean): this;
190
- /**
191
- * Calls the callback function.
192
- * @param compelled forces data to update
193
- */
194
139
  makeCallback(compelled?: boolean): void;
195
140
  }
196
- /** Base async abstract class for design components with asynchronous initialization. */
197
141
  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
142
  make(compelled?: boolean): this;
203
- /**
204
- * Calls the callback function.
205
- * @param compelled forces data to update
206
- */
207
143
  makeCallback(compelled?: boolean): Promise<void>;
208
144
  }
209
- /** Class for tracking edited/changed values. */
210
145
  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
146
  constructor(props: T, watch?: string[]);
217
- /**
218
- * Checks if the value has been updated.
219
- * @param name property name
220
- */
221
147
  is(name: string | string[]): boolean;
222
- /** Checks if there are changes in the data. */
223
148
  isChanged(): boolean;
224
- /** Updates all values. */
225
149
  update(): void;
226
150
  }
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. */
151
+ export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
152
+ }
230
153
  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
154
  constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
237
- /**
238
- * Check the presence of the component.
239
- * @param name name of the component
240
- */
241
155
  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
156
  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
157
  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
158
  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
159
  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
160
  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
161
  }
279
- /** Class for collecting all functional components. */
280
162
  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. */
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
206
  /**
423
207
  * Reactive class for managing the formatting of numbers and dates.
208
+ *
424
209
  * @remarks
425
210
  * Avoid using this reactive class if reactive updates are not required.
426
211
  * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
427
212
  */
428
213
  export declare class GeoIntlRef {
429
- /**
430
- * Constructor
431
- * @param code country code, full form language-country or one of them
432
- */
433
214
  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
215
  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
216
  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
217
  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
218
  number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
458
- /** Decimal point symbol. */
459
219
  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
220
  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
221
  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
222
  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
223
  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
224
  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
225
  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
226
  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
227
  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
228
  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
229
  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
230
  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
231
  month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
544
- /**
545
- * List of months.
546
- * @param style month style
547
- */
548
232
  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
233
  weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
555
- /**
556
- * List of weekday names.
557
- * @param style weekday style
558
- */
559
234
  weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
560
- /**
561
- * Formatted time string.
562
- * @param value date
563
- */
564
235
  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
236
  sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
571
237
  }
572
- /** Reactive class for working with geographic data. */
573
238
  export declare class GeoRef {
574
- /** Information about the current country. */
575
239
  static get(): Ref<GeoItemFull>;
576
- /** Current country code. */
577
240
  static getCountry(): ComputedRef<string>;
578
- /** Current language code. */
579
241
  static getLanguage(): ComputedRef<string>;
580
- /** Full standard locale format. */
581
242
  static getStandard(): ComputedRef<string>;
582
- /** First day of week code. */
583
243
  static getFirstDay(): ComputedRef<string>;
584
- /** Current location string. */
585
244
  static getLocation(): ComputedRef<string>;
586
- /** Current country code from location. */
587
245
  static getLocationCountry(): ComputedRef<string>;
588
- /** Current language code from location. */
589
246
  static getLocationLanguage(): ComputedRef<string>;
590
- /**
591
- * Changes the data by full code.
592
- * @param code location code
593
- */
594
247
  static set(code: string): void;
595
- /**
596
- * Sets default country code.
597
- * @param code default code or getter
598
- */
599
248
  static setValueDefault(code?: string | (() => string)): void;
600
249
  }
601
- /** Reactive class for managing localized unit formatting and automatic conversions. */
602
250
  export declare class GeoUnitRef {
603
- /**
604
- * Constructor.
605
- * @param code location code
606
- */
607
251
  constructor(code?: RefOrNormal<string>);
608
- /** Standard location code. */
609
252
  getLocation(): ComputedRef<string>;
610
- /** Formats millimeter value. */
611
253
  millimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
612
- /** Formats centimeter value. */
613
254
  centimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
614
- /** Formats meter value. */
615
255
  meter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
616
- /** Formats kilometer value. */
617
256
  kilometer(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
618
- /** Formats square meter value. */
619
257
  squareMeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
620
- /** Formats hectare value. */
621
258
  hectare(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
622
- /** Formats gram value. */
623
259
  gram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
624
- /** Formats kilogram value. */
625
260
  kilogram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
626
- /** Formats tonne value. */
627
261
  tonne(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
628
- /** Formats milliliter value. */
629
262
  milliliter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
630
- /** Formats liter value. */
631
263
  liter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
632
- /** Formats celsius value. */
633
264
  celsius(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
634
- /** Formats kilometer per hour value. */
635
265
  kilometerPerHour(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
636
- /** Formats custom unit value. */
637
266
  format(value: RefOrNormal<NumberOrString>, unit: RefOrNormal<string>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
638
267
  }
639
- /** Class for managing list data structure and navigation. */
640
268
  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
269
  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
270
  readonly data: ComputedRef<ListList>;
658
271
  readonly liteData: ComputedRef<ListList>;
@@ -689,30 +302,24 @@ export declare class ListDataRef {
689
302
  getIndexByStep(index: string, step: number): ListDataItem | undefined;
690
303
  getIndexNext(index: string): ListDataItem | undefined;
691
304
  getIndexPrev(index: string): ListDataItem | undefined;
692
- getItemByIndex(index?: string): { key: number; item: ListDataItem; } | undefined;
305
+ getItemByIndex(index?: string): {
306
+ key: number;
307
+ item: ListDataItem;
308
+ } | undefined;
693
309
  getItemByKey(key: number): ListDataItem | undefined;
694
310
  getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
695
311
  getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
696
312
  getSubList(item: ListDataItem): ListDataRef;
697
313
  }
698
- /** Router management class. */
699
314
  export declare class RouterItemRef {
700
- /** Get router instance. */
701
315
  static get(): _RouterClassic;
702
- /** Returns link by route name. */
703
316
  static getLink(name: string, params?: any, query?: any): string | undefined;
704
- /** Returns href properties by route name. */
705
317
  static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
706
- /** Changes site path. */
707
318
  static push(to: string | RouteLocationRaw): void;
708
- /** Sets router instance. */
709
319
  static set(router: Router): void;
710
- /** Sets router instance once. */
711
320
  static setOneTime(router: Router): void;
712
- /** Converts raw location to href properties. */
713
321
  static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
714
322
  }
715
- /** Class for getting scrollbar width as a reactive item. */
716
323
  export declare class ScrollbarWidthRef {
717
324
  readonly item: Ref<boolean | undefined, boolean | undefined>;
718
325
  readonly width: Ref<number, number>;
@@ -721,23 +328,28 @@ export declare class ScrollbarWidthRef {
721
328
  }
722
329
  /**
723
330
  * Asynchronous reactive composable for API requests with built-in SSR support.
331
+ *
724
332
  * @example
725
333
  * ```typescript
726
- * const { data, loading } = useApiAsyncRef('/users/1', { method: 'GET' });
334
+ * import { Schema as S } from '@effect/schema'
335
+ * import { useApiAsyncRef } from '@dxtmisha/functional'
336
+ * const userSchema = S.Struct({ id: S.Number, name: S.String })
337
+ * const { data, loading, errorItem } = useApiAsyncRef('/users/1')
727
338
  * ```
728
339
  */
729
340
  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. */
341
+ export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
342
+ }
731
343
  export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
732
344
  loading: Ref<boolean, boolean>;
733
345
  send(request?: Request | undefined): Promise<Return | undefined>;
734
346
  };
735
- /** Use API get request helper wrapper. */
347
+ export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
348
+ }
736
349
  export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
737
350
  loading: Ref<boolean, boolean>;
738
351
  send(request?: Request | undefined): Promise<Return | undefined>;
739
352
  };
740
- /** Asynchronous reactive composable for API management requests with built-in SSR support. */
741
353
  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
354
  isValid: ComputedRef<boolean>;
743
355
  isResponseContractValid: ComputedRef<boolean>;
@@ -766,13 +378,23 @@ export declare function useApiManagementAsyncRef<Return extends ApiManagementVal
766
378
  };
767
379
  /**
768
380
  * A powerful composable for comprehensive API request orchestration.
769
- * @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).
381
+ *
382
+ * @note
383
+ * This hook is recommended to be used in tandem with `executeUse` for centralized state management.
384
+ *
385
+ * @remarks
386
+ * Data formatting guidelines for `formattersOptions`:
387
+ * - Recommended for formatting: Numbers that represent values, dates, currency, units, and statuses.
388
+ * - Not recommended for formatting: Technical identifiers such as ID, UUID, account numbers, types, or internal codes.
389
+ *
773
390
  * @example
774
391
  * ```typescript
775
- * const products = useApiManagementRef({ path: '/api/v1/products' });
392
+ * const products = useApiManagementRef(
393
+ * { path: '/api/v1/products' },
394
+ * { price: (v) => `${v} USD` },
395
+ * { columns: ['name', 'category'] },
396
+ * { path: '/api/v1/products' }
397
+ * );
776
398
  * ```
777
399
  */
778
400
  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): {
@@ -801,56 +423,98 @@ export declare function useApiManagementRef<Return extends ApiManagementValue, F
801
423
  sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
802
424
  sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
803
425
  };
804
- /** Use API post request helper wrapper. */
426
+ export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
427
+ }
805
428
  export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
806
429
  loading: Ref<boolean, boolean>;
807
430
  send(request?: Request | undefined): Promise<Return | undefined>;
808
431
  };
809
- /** Use API put request helper wrapper. */
432
+ export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
433
+ }
810
434
  export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
811
435
  loading: Ref<boolean, boolean>;
812
436
  send(request?: Request | undefined): Promise<Return | undefined>;
813
437
  };
438
+ export interface UseApiRef<R> {
439
+ data: ComputedRef<ApiData<R> | undefined>;
440
+ item: Ref<ApiData<R> | undefined>;
441
+ errorItem: ComputedRef<ApiErrorItem | undefined>;
442
+ isResponseContractValid: ComputedRef<boolean>;
443
+ responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
444
+ length: ComputedRef<number>;
445
+ starting: ComputedRef<boolean>;
446
+ loading: Ref<boolean>;
447
+ reading: Ref<boolean>;
448
+ isStarting(): boolean;
449
+ isLoading(): boolean;
450
+ isReading(): boolean;
451
+ getItem(): ApiData<R> | undefined;
452
+ init(): void;
453
+ initSsr(): void;
454
+ reset(): Promise<void>;
455
+ stop(): void;
456
+ abort(): void;
457
+ }
814
458
  /**
815
459
  * Main reactive composable for working with API requests in Vue.
460
+ *
816
461
  * @example
817
462
  * ```typescript
818
- * const { data, loading } = useApiRef('/users/1');
463
+ * import { Schema as S } from '@effect/schema'
464
+ * import { useApiRef } from '@dxtmisha/functional'
465
+ * const { data, loading } = useApiRef('/users/1')
819
466
  * ```
820
467
  */
821
468
  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
469
  export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
823
- /** Sends configured API request. */
470
+ export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
471
+ path?: RefOrNormal<string | undefined>;
472
+ method?: ApiMethodItem;
473
+ action?: (data: Return | undefined) => Promise<void> | void;
474
+ transformation?: (data: T) => Return;
475
+ validateRequestContract?: (data: Request) => ApiDataValidation & Return;
476
+ validateResponseContract?: (data: T) => ApiDataValidation & Return;
477
+ errorContract?: ApiErrorStorageList;
478
+ toData?: boolean;
479
+ options?: ApiOptions;
480
+ apiInstance?: ApiInstance;
481
+ }
824
482
  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
483
  loading: Ref<boolean, boolean>;
826
484
  send(request?: Request): Promise<Return | undefined>;
827
485
  };
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. */
486
+ type BroadcastValueItem<T> = T | string | undefined;
487
+ export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
831
488
  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
489
  export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
834
490
  listFormat: ComputedRef<FormattersReturn<List, Options>>;
835
491
  length: ComputedRef<number>;
836
492
  };
837
493
  /**
838
- * Returns GeoIntlRef instance.
494
+ * Returns a class object for working with data formatting.
495
+ *
839
496
  * @remarks
840
497
  * Avoid using this reactive composable if reactive updates are not required.
841
- * For non-reactive formatting, use `GeoIntl` directly.
498
+ * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
842
499
  */
843
500
  export declare function useGeoIntlRef(): GeoIntlRef;
844
- /** Returns GeoUnitRef instance. */
845
501
  export declare function useGeoUnitRef(): GeoUnitRef;
846
- /** Creates reactive hash variable. */
847
502
  export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
848
- /** Hook for initializing lazy tracking of element appearance with root margin. */
503
+ export type LazyItemByMargin = {
504
+ rootMargin: string;
505
+ item: ReturnType<typeof useLazyRef>;
506
+ };
849
507
  export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
850
508
  lazyItemStatus: ShallowRef<boolean, boolean>;
851
509
  readonly lazyItem: LazyItem | undefined;
852
510
  };
853
- /** Hook for initializing lazy element appearance tracking. */
511
+ export type LazyItem = {
512
+ status: ShallowRef<boolean>;
513
+ ratio: ShallowRef<number>;
514
+ entry: ShallowRef<IntersectionObserverEntry | undefined>;
515
+ stopWatch: () => void;
516
+ };
517
+ export type LazyList = Record<string, LazyItem>;
854
518
  export declare const useLazyRef: (options?: IntersectionObserverInit) => {
855
519
  intersectionObserver: IntersectionObserver | undefined;
856
520
  getItem(element?: HTMLElement): LazyItem | undefined;
@@ -858,9 +522,7 @@ export declare const useLazyRef: (options?: IntersectionObserverInit) => {
858
522
  removeLazyItem: (element?: HTMLElement) => void;
859
523
  disconnectLazy: () => void | undefined;
860
524
  };
861
- /** Returns reactive global loading status. */
862
525
  export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
863
- /** Vue composable for reactive meta tags management with DOM synchronization. */
864
526
  export declare const useMeta: () => Readonly<{
865
527
  meta: Meta;
866
528
  title: Ref<string, string>;
@@ -910,10 +572,8 @@ export declare const useMeta: () => Readonly<{
910
572
  setSuffix: (suffix: string) => void;
911
573
  }>;
912
574
  destroyExecute?(): void;
913
- };
914
- /** Creates reactive URL query parameter reference. */
575
+ }>;
915
576
  export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
916
- /** Managing router link list. */
917
577
  export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
918
578
  item: ComputedRef<T | undefined>;
919
579
  selected: Ref<string, string>;
@@ -922,7 +582,6 @@ export declare const useRouterList: <T extends ListDataBasic>(list: RefType<Cons
922
582
  to: (name?: string) => void;
923
583
  toMain(): void;
924
584
  };
925
- /** Composable for search logic with reactive data. */
926
585
  export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
927
586
  isSearch: ComputedRef<boolean>;
928
587
  search: Ref<string, string>;
@@ -930,62 +589,73 @@ export declare function useSearchRef<T extends SearchItem, K extends SearchColum
930
589
  listSearch: ComputedRef<SearchFormatList<T, K>>;
931
590
  length: ComputedRef<number>;
932
591
  };
933
- /** Composable for search value state and handling delays. */
934
592
  export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
935
593
  search: Ref<string, string>;
936
594
  searchDelay: Ref<string, string>;
937
595
  loading: Ref<boolean, boolean>;
938
596
  };
939
- /** Creates reactive session storage reference. */
940
597
  export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
941
- /** Creates reactive local storage reference. */
942
598
  export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
943
599
  /**
944
- * Getting translated text by keys.
600
+ * Getting translated text by array of keys or key string.
601
+ *
945
602
  * @example
946
603
  * ```typescript
947
- * const labels = useTranslateRef(['home.title'] as const);
604
+ * const translations = useTranslateRef(['home.title', 'home.description'] as const);
605
+ * const labels = t(['button.save', 'button.cancel'] as const);
948
606
  * ```
949
607
  */
950
608
  export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
951
- /** Shorthand for useTranslateRef. */
952
609
  export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
953
- /** Creates computed property handling async getters. */
610
+ export declare const uiMakeFlags: () => void;
954
611
  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
612
  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
613
  export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
614
+ export interface FunctionalPluginOptions {
615
+ api?: ApiConfig;
616
+ translate?: TranslateConfig;
617
+ location?: string | (() => string);
618
+ metaSuffix?: string;
619
+ icons?: IconsConfig;
620
+ iconsSocial?: InputSocialIcons;
621
+ router?: Router;
622
+ errorCauses?: ErrorCenterCauseList;
623
+ errorHandlers?: ErrorCenterHandlerList;
624
+ errorCallbacks?: ErrorCenterHandlerCallback[];
625
+ }
959
626
  /**
960
627
  * Vue plugin for initializing global functional services.
628
+ *
961
629
  * @example
962
630
  * ```typescript
963
- * app.use(dxtFunctionalPlugin, { api: { url: 'https://api.example.com' } });
631
+ * import { createApp } from 'vue'
632
+ * import { dxtFunctionalPlugin } from '@dxtmisha/functional'
633
+ * const app = createApp(App)
634
+ * app.use(dxtFunctionalPlugin, { api: { url: 'https://api.example.com' } })
964
635
  * ```
965
636
  */
966
637
  export declare const dxtFunctionalPlugin: Plugin;
967
- /** Types of initialization for executeUse singleton. */
968
638
  export declare enum ExecuteUseType {
969
639
  global = "global",
970
640
  provide = "provide",
971
641
  local = "local"
972
642
  }
973
- /** Return structure of executeUse singleton wrapper. */
974
643
  export type ExecuteUseReturn<R> = Readonly<R & {
975
644
  init(): Readonly<R>;
976
645
  destroyExecute?(): void;
977
646
  }>;
978
647
  /**
979
- * Creates managed singleton encapsulating initialization strategy.
648
+ * Creates a managed singleton that encapsulates initialization logic and access mode.
649
+ *
980
650
  * @remarks
981
- * Use for API services, resource optimization, and shared state.
651
+ * Use this function for API services, resource optimization, shared state, or external SDKs.
652
+ *
982
653
  * @example
983
654
  * ```typescript
984
655
  * export const useUserApi = executeUseGlobal(() => useApiGet('/api/user'));
985
656
  * ```
986
657
  */
987
658
  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. */
989
659
  export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
990
660
  init(): Readonly<R>;
991
661
  destroyExecute?(): void;
@@ -993,7 +663,6 @@ export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<
993
663
  init(): Readonly<R>;
994
664
  destroyExecute?(): void;
995
665
  }>);
996
- /** Creates component-scoped singleton via provide/inject. */
997
666
  export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
998
667
  init(): Readonly<R>;
999
668
  destroyExecute?(): void;
@@ -1001,7 +670,6 @@ export declare function executeUseProvide<R, O extends any[]>(callback: (...args
1001
670
  init(): Readonly<R>;
1002
671
  destroyExecute?(): void;
1003
672
  }>);
1004
- /** Creates local singleton inside closure. */
1005
673
  export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
1006
674
  init(): Readonly<R>;
1007
675
  destroyExecute?(): void;
@@ -1009,33 +677,18 @@ export declare function executeUseLocal<R, O extends any[]>(callback: (...args:
1009
677
  init(): Readonly<R>;
1010
678
  destroyExecute?(): void;
1011
679
  }>);
1012
- /** Initializes all registered global singletons. */
1013
680
  export declare function executeUseGlobalInit(): void;
1014
- /** Gets injected Vue value by key name. */
1015
681
  export declare function getInject<T>(name: string): T | undefined;
1016
- /** Resolves options object for API fetch calls. */
1017
682
  export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
1018
- /** Executes argument if function and unwraps resulting Vue ref. */
1019
683
  export declare function executeFunctionRef<T>(data: RefOrNormalOrFunction<T>): T;
1020
- /** Returns reactive error item from API ref data. */
1021
684
  export declare function getApiErrorRef<R>(data: RefType<ApiData<R> | undefined>): ComputedRef<ApiErrorItem | undefined>;
1022
- /** Generates computed properties binding for subcomponent. */
1023
685
  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
686
  export declare function getRef<T>(item: RefOrNormal<T>): T;
1026
- /** Renders component VNode with cached properties. */
1027
687
  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
688
  export declare function setRef<T>(item: Ref<T>, value: T): void;
1030
- /** Wraps value into Vue ref if not reactive. */
1031
689
  export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
1032
- /** Merges two property objects merging classes and styles. */
1033
690
  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
691
  export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
1036
- /** Returns or generates index key for VNode rendering. */
1037
692
  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
693
  export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
1040
- /** Merges multiple property objects preserving classes and styles. */
1041
694
  export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional",
3
3
  "private": false,
4
- "version": "1.15.6",
4
+ "version": "1.15.7",
5
5
  "type": "module",
6
6
  "description": "A comprehensive library of utilities, base classes, and Vue 3 composables for reactive web development — API orchestration, state singletons (executeUse), storage sync, i18n, formatters, and component design. Extends @dxtmisha/functional-basic.",
7
7
  "keywords": [