@dxtmisha/functional 1.15.9 → 1.15.13
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 +25 -0
- package/ai-description.md +8 -21
- package/ai-doc.md +1 -0
- package/ai-mcp-resources.json +11 -11
- package/ai-types.md +1019 -659
- package/dist/library.js +4 -4
- package/package.json +3 -3
package/ai-types.md
CHANGED
|
@@ -1,320 +1,761 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional library.
|
|
1
|
+
All these methods are in the @dxtmisha/functional (v1.15.13) library.
|
|
2
2
|
|
|
3
|
-
/** Base class for working with
|
|
3
|
+
/** Base class for working with design component constructors. @keywords design abstract constructor callback */
|
|
4
4
|
export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
|
|
5
|
-
|
|
5
|
+
/** Constructor @keywords design constructor initialize */
|
|
6
6
|
constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
|
|
7
|
+
/** Calls the callback function. @keywords design make update */
|
|
7
8
|
make(compelled?: boolean): this;
|
|
8
|
-
|
|
9
|
-
protected isChanged<K extends keyof C & string, KT extends keyof T & string>(name: K, nameProp?: KT | KT[]): boolean;
|
|
9
|
+
/** Calls the callback function. @keywords design callback */
|
|
10
10
|
makeCallback(compelled?: boolean): void;
|
|
11
|
-
protected makeCallbackItem(): void;
|
|
12
|
-
protected abstract initEvent(): void;
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
/** Base class for asynchronous design construction. @keywords design async abstract class */
|
|
15
14
|
export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
|
|
15
|
+
/** Makes design callbacks. @keywords make design async */
|
|
16
16
|
make(compelled?: boolean): this;
|
|
17
|
+
/** Makes callback asynchronously. @keywords make callback async */
|
|
17
18
|
makeCallback(compelled?: boolean): Promise<void>;
|
|
19
|
+
/** Initializes event asynchronously. @keywords init event async */
|
|
18
20
|
protected abstract initEvent(): Promise<void>;
|
|
19
21
|
}
|
|
22
|
+
|
|
23
|
+
/** Checks properties for changes. @keywords design changed check update */
|
|
20
24
|
export declare class DesignChanged<T extends Record<string, any>> {
|
|
25
|
+
/** Creates a changed tracker instance. @keywords constructor create */
|
|
21
26
|
constructor(props: T, watch?: string[]);
|
|
27
|
+
/** Checks if property changed. @keywords is changed check */
|
|
22
28
|
is(name: string | string[]): boolean;
|
|
29
|
+
/** Checks if any watched property changed. @keywords is changed */
|
|
23
30
|
isChanged(): boolean;
|
|
31
|
+
/** Updates cached property values. @keywords update cache */
|
|
24
32
|
update(): void;
|
|
25
|
-
protected isDifferent(name: string): boolean;
|
|
26
33
|
}
|
|
27
|
-
|
|
34
|
+
|
|
35
|
+
export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
import { ComputedRef, VNode } from 'vue';
|
|
39
|
+
|
|
40
|
+
/** Manages and renders connected UI components with modifier support. @keywords design components modification render */
|
|
28
41
|
export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
|
|
42
|
+
/** Creates a component manager instance. @keywords constructor design components */
|
|
29
43
|
constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
|
|
44
|
+
/** Checks if a component exists by name. @keywords check component exists */
|
|
30
45
|
is<K extends keyof COMP>(name: K): name is K;
|
|
46
|
+
/** Retrieves a component by name. @keywords get component */
|
|
31
47
|
get<K extends keyof COMP>(name: K): COMP[K];
|
|
48
|
+
/** Computes and returns modified component properties. @keywords get modification props */
|
|
32
49
|
getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
|
|
50
|
+
/** Renders a component and returns an array containing the VNode. @keywords render component array */
|
|
33
51
|
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[];
|
|
52
|
+
/** Renders a single component VNode. @keywords render one component */
|
|
34
53
|
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;
|
|
54
|
+
/** Renders a component and appends it to an array. @keywords render add component */
|
|
35
55
|
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;
|
|
56
|
+
/** Computes modifications for a specific component index. @keywords compute modification */
|
|
36
57
|
protected computeModification<K extends keyof P>(index: K & string | string): Record<string, any>;
|
|
37
58
|
}
|
|
59
|
+
|
|
60
|
+
import { ComputedRef, ToRefs, VNode, Ref } from 'vue';
|
|
61
|
+
/** Component constructor abstract class. @keywords design constructor abstract component */
|
|
38
62
|
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> {
|
|
63
|
+
/** Creates instance of design constructor. @keywords constructor design */
|
|
39
64
|
protected constructor(name: string, props: Readonly<P>, options?: ConstrOptions<COMP, EMITS, P> | undefined);
|
|
65
|
+
/** Initializes instance properties. @keywords init design */
|
|
40
66
|
protected init(): this;
|
|
67
|
+
/** Gets full class name. @keywords get name class */
|
|
41
68
|
getName(): string;
|
|
69
|
+
/** Gets design prefix/name. @keywords get design */
|
|
42
70
|
getDesign(): string;
|
|
71
|
+
/** Gets sub-class name by levels. @keywords get sub class */
|
|
43
72
|
getSubClass(name: string | string[]): string;
|
|
73
|
+
/** Gets status modifier class name. @keywords get status class */
|
|
44
74
|
getStatusClass(name: string | string[]): string;
|
|
75
|
+
/** Gets CSS custom property name. @keywords get style var */
|
|
45
76
|
getStyle(name: string | string[]): string;
|
|
77
|
+
/** Gets filtered element attributes. @keywords get attrs */
|
|
46
78
|
getAttrs(): ConstrItem;
|
|
79
|
+
/** Exposes public component properties and element. @keywords expose component */
|
|
47
80
|
expose(): ConstrExpose<E, EXPOSE>;
|
|
81
|
+
/** Returns component render function. @keywords render function */
|
|
48
82
|
render(): () => VNode | (VNode | any)[] | undefined;
|
|
83
|
+
/** Initializes exposed context. @keywords init expose */
|
|
49
84
|
protected abstract initExpose(): EXPOSE;
|
|
85
|
+
/** Initializes computed CSS classes. @keywords init classes */
|
|
50
86
|
protected abstract initClasses(): Partial<CLASSES>;
|
|
87
|
+
/** Initializes computed inline styles. @keywords init styles */
|
|
51
88
|
protected abstract initStyles(): ConstrStyles;
|
|
89
|
+
/** Renders component template VNode. @keywords init render */
|
|
52
90
|
protected abstract initRender(): VNode | (VNode | any)[] | undefined;
|
|
91
|
+
/** Initializes slot content and optionally pushes to children. @keywords init slot */
|
|
53
92
|
protected initSlot<K extends keyof SLOTS>(name: K, children?: any[], props?: ConstrItem): VNode | undefined;
|
|
93
|
+
/** Normalizes class definition into class object map. @keywords to class */
|
|
54
94
|
protected toClass(classes?: ConstrClass): ConstrClassObject;
|
|
95
|
+
/** Maps class definition placeholders to component names. @keywords to class name */
|
|
55
96
|
protected toClassName<T extends ConstrItem>(classes?: ConstrItem): T;
|
|
56
97
|
}
|
|
98
|
+
|
|
99
|
+
import { ComputedRef, Ref } from 'vue';
|
|
100
|
+
import { Datetime, GeoDate, GeoFirstDay, GeoHours, NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
101
|
+
|
|
102
|
+
/** @keywords DatetimeRef, date, reactive, time */
|
|
57
103
|
export declare class DatetimeRef {
|
|
104
|
+
/** @keywords constructor, init */
|
|
58
105
|
constructor(date: RefOrNormal<NumberOrStringOrDate>, type?: RefOrNormal<GeoDate>, code?: RefOrNormal<string>);
|
|
106
|
+
/** @keywords getItem, date, ref */
|
|
59
107
|
getItem(): Ref<NumberOrStringOrDate>;
|
|
108
|
+
/** @keywords getDate, date */
|
|
60
109
|
getDate(): Ref<Date>;
|
|
110
|
+
/** @keywords getDatetime, datetime */
|
|
61
111
|
getDatetime(): Datetime;
|
|
112
|
+
/** @keywords getHoursType, hours */
|
|
62
113
|
getHoursType(): ComputedRef<GeoHours>;
|
|
114
|
+
/** @keywords getFirstDayCode, firstDay */
|
|
63
115
|
getFirstDayCode(): ComputedRef<GeoFirstDay>;
|
|
116
|
+
/** @keywords getYear, year */
|
|
64
117
|
getYear(): ComputedRef<number>;
|
|
118
|
+
/** @keywords getMonth, month */
|
|
65
119
|
getMonth(): ComputedRef<number>;
|
|
120
|
+
/** @keywords getDay, day */
|
|
66
121
|
getDay(): ComputedRef<number>;
|
|
122
|
+
/** @keywords getHour, hour */
|
|
67
123
|
getHour(): ComputedRef<number>;
|
|
124
|
+
/** @keywords getMinute, minute */
|
|
68
125
|
getMinute(): ComputedRef<number>;
|
|
126
|
+
/** @keywords getSecond, second */
|
|
69
127
|
getSecond(): ComputedRef<number>;
|
|
128
|
+
/** @keywords getMaxDay, maxDay */
|
|
70
129
|
getMaxDay(): ComputedRef<number>;
|
|
130
|
+
/** @keywords locale, format */
|
|
71
131
|
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): ComputedRef<string>;
|
|
132
|
+
/** @keywords standard, format */
|
|
72
133
|
standard(timeZone?: boolean): ComputedRef<string>;
|
|
73
134
|
protected updateDate(): this;
|
|
74
135
|
}
|
|
136
|
+
|
|
137
|
+
/** Global effect scope class. @keywords effect scope global scope */
|
|
75
138
|
export declare class EffectScopeGlobal {
|
|
139
|
+
/** Runs a function within the global scope. @keywords run execute global scope */
|
|
76
140
|
static run<T>(fn: () => T): T | undefined;
|
|
141
|
+
/** Gets the global effect scope instance. @keywords get scope instance global */
|
|
142
|
+
static getScope(): import("vue").EffectScope;
|
|
77
143
|
}
|
|
144
|
+
|
|
78
145
|
import { ElementOrString, ElementOrWindow, EventItem, EventListenerDetail, EventOptions } from '@dxtmisha/functional-basic';
|
|
146
|
+
|
|
79
147
|
/**
|
|
80
|
-
* Class for working with events
|
|
81
|
-
*
|
|
82
|
-
* Класс для работа с события (Ref).
|
|
148
|
+
* Class for working with events using reactive references.
|
|
149
|
+
* @keywords event_ref event_wrapper reactive_event dom_event
|
|
83
150
|
*/
|
|
84
151
|
export declare class EventRef<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> extends EventItem<E, O, D> {
|
|
85
152
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
88
|
-
* @param elementSelectorControl control element/ элемент управления
|
|
89
|
-
* @param type type/ тип
|
|
90
|
-
* @param listener the object that receives a notification (an object that implements the
|
|
91
|
-
* Event interface) when an event of the specified type occurs/ объект, который принимает
|
|
92
|
-
* уведомление, когда событие указанного типа произошло
|
|
93
|
-
* @param options object that specifies characteristics/ объект options
|
|
94
|
-
* @param detail an event-dependent value associated with the event/ зависимое от события
|
|
95
|
-
* значение, связанное с событием
|
|
153
|
+
* Creates an instance of EventRef.
|
|
154
|
+
* @keywords constructor event_ref_init
|
|
96
155
|
*/
|
|
97
156
|
constructor(elementSelector?: RefOrNormal<ElementOrString<E> | undefined>, elementSelectorControl?: RefOrNormal<ElementOrString<HTMLElement>>, type?: string | string[], listener?: EventListenerDetail<O, D>, options?: EventOptions, detail?: D);
|
|
98
157
|
}
|
|
158
|
+
|
|
159
|
+
import { ComputedRef } from 'vue';
|
|
160
|
+
import { GeoFlagItem, GeoFlagNational } from '@dxtmisha/functional-basic';
|
|
161
|
+
|
|
162
|
+
/** Geo flag reactive reference manager. @keywords geo, flag, country, language */
|
|
99
163
|
export declare class GeoFlagRef {
|
|
164
|
+
/**
|
|
165
|
+
* Creates a new GeoFlagRef instance.
|
|
166
|
+
* @param code Country or language code
|
|
167
|
+
*/
|
|
100
168
|
constructor(code?: RefOrNormal<string | undefined>);
|
|
169
|
+
/** Gets the current country code. @keywords code, get */
|
|
101
170
|
getCode(): string;
|
|
171
|
+
/** Gets reactive country flag item information. @keywords country, flag, item */
|
|
102
172
|
get(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
173
|
+
/** Gets reactive language flag item information. @keywords language, flag, item */
|
|
103
174
|
getLanguage(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
175
|
+
/** Gets reactive flag image URL or source. @keywords flag, link, image */
|
|
104
176
|
getFlag(code?: RefOrNormal<string>): ComputedRef<string | undefined>;
|
|
177
|
+
/** Gets a reactive list of country flag items. @keywords list, country, flags */
|
|
105
178
|
getList(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
179
|
+
/** Gets a reactive list of language flag items. @keywords list, language, flags */
|
|
106
180
|
getListLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
181
|
+
/** Gets reactive country flag items in national representation. @keywords national, country, list */
|
|
107
182
|
getNational(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
183
|
+
/** Gets reactive language flag items in national representation. @keywords national, language, list */
|
|
108
184
|
getNationalLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
109
185
|
}
|
|
186
|
+
|
|
187
|
+
import { ComputedRef } from 'vue';
|
|
188
|
+
import { GeoDate, ItemValue, NumberOrString, NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
189
|
+
|
|
110
190
|
/**
|
|
111
191
|
* Reactive class for managing the formatting of numbers and dates.
|
|
112
|
-
* @
|
|
192
|
+
* @keywords geo intl format reactive number date localize
|
|
113
193
|
*/
|
|
114
194
|
export declare class GeoIntlRef {
|
|
195
|
+
/**
|
|
196
|
+
* Constructor for GeoIntlRef.
|
|
197
|
+
* @keywords constructor initialize geo intl ref
|
|
198
|
+
*/
|
|
115
199
|
constructor(code?: RefOrNormal<string>);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Format display names for language, region, and script.
|
|
203
|
+
* @keywords display name language region script intl
|
|
204
|
+
*/
|
|
116
205
|
display(value?: RefOrNormal<string>, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): ComputedRef<string>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Get display names of language.
|
|
209
|
+
* @keywords language name translate intl
|
|
210
|
+
*/
|
|
117
211
|
languageName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Get display names of region.
|
|
215
|
+
* @keywords country region name intl
|
|
216
|
+
*/
|
|
118
217
|
countryName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Format a number value.
|
|
221
|
+
* @keywords number format intl digit
|
|
222
|
+
*/
|
|
119
223
|
number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get the decimal point symbol.
|
|
227
|
+
* @keywords decimal point symbol separator
|
|
228
|
+
*/
|
|
120
229
|
decimal(): ComputedRef<string>;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Format a currency value.
|
|
233
|
+
* @keywords currency format money price intl
|
|
234
|
+
*/
|
|
121
235
|
currency(value: RefOrNormal<NumberOrString>, currencyOptions?: RefOrNormal<string | Intl.NumberFormatOptions>, numberOnly?: boolean): ComputedRef<string>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get the currency symbol or code.
|
|
239
|
+
* @keywords currency symbol code intl
|
|
240
|
+
*/
|
|
122
241
|
currencySymbol(currency: RefOrNormal<string>, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): ComputedRef<string>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Format a unit value.
|
|
245
|
+
* @keywords unit format measurement intl
|
|
246
|
+
*/
|
|
123
247
|
unit(value: RefOrNormal<NumberOrString>, unitOptions?: string | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Format a file size value.
|
|
251
|
+
* @keywords size file bytes megabytes intl
|
|
252
|
+
*/
|
|
124
253
|
sizeFile(value: RefOrNormal<NumberOrString>, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Format a number as a percentage.
|
|
257
|
+
* @keywords percent percentage format intl
|
|
258
|
+
*/
|
|
125
259
|
percent(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Format a number as a percentage by 100.
|
|
263
|
+
* @keywords percent 100 format intl
|
|
264
|
+
*/
|
|
126
265
|
percentBy100(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Format text based on plural rules and language words.
|
|
269
|
+
* @keywords plural rules words format intl
|
|
270
|
+
*/
|
|
127
271
|
plural(value: RefOrNormal<NumberOrString>, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Format a date and time value.
|
|
275
|
+
* @keywords date time format intl calendar
|
|
276
|
+
*/
|
|
128
277
|
date(value: RefOrNormal<NumberOrStringOrDate>, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): ComputedRef<string>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Format relative time.
|
|
281
|
+
* @keywords relative time ago format intl
|
|
282
|
+
*/
|
|
129
283
|
relative(value: RefOrNormal<NumberOrStringOrDate>, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): ComputedRef<string>;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Format relative time with a limit falling back to standard date.
|
|
287
|
+
* @keywords relative time limit format intl
|
|
288
|
+
*/
|
|
130
289
|
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>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Format relative time by specific unit and value.
|
|
293
|
+
* @keywords relative value unit time format intl
|
|
294
|
+
*/
|
|
131
295
|
relativeByValue(value: RefOrNormal<NumberOrString>, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): ComputedRef<string>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Get the name of a month.
|
|
299
|
+
* @keywords month name date format intl
|
|
300
|
+
*/
|
|
132
301
|
month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Get an array of all months.
|
|
305
|
+
* @keywords months list array intl
|
|
306
|
+
*/
|
|
133
307
|
months(style?: Intl.DateTimeFormatOptions['month']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Get the name of a weekday.
|
|
311
|
+
* @keywords weekday name date format intl
|
|
312
|
+
*/
|
|
134
313
|
weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Get an array of all weekdays.
|
|
317
|
+
* @keywords weekdays list array intl
|
|
318
|
+
*/
|
|
135
319
|
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Format time.
|
|
323
|
+
* @keywords time format intl
|
|
324
|
+
*/
|
|
136
325
|
time(value: RefOrNormal<NumberOrStringOrDate>): ComputedRef<string>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Sort an array of items taking into account locale specifics.
|
|
329
|
+
* @keywords sort locale array intl
|
|
330
|
+
*/
|
|
137
331
|
sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
|
|
138
332
|
}
|
|
333
|
+
|
|
334
|
+
import { ComputedRef, Ref } from 'vue';
|
|
335
|
+
import { GeoItemFull } from '@dxtmisha/functional-basic';
|
|
336
|
+
|
|
337
|
+
/** Geo reference reactive manager class @keywords geo ref country language */
|
|
139
338
|
export declare class GeoRef {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
339
|
+
/** Get reactive geographic full item @keywords get geo item */
|
|
340
|
+
static get(): Ref<GeoItemFull>;
|
|
341
|
+
/** Get current country code @keywords country code */
|
|
342
|
+
static getCountry(): ComputedRef<string>;
|
|
343
|
+
/** Get current language code @keywords language code */
|
|
344
|
+
static getLanguage(): ComputedRef<string>;
|
|
345
|
+
/** Get standard format string @keywords standard locale */
|
|
346
|
+
static getStandard(): ComputedRef<string>;
|
|
347
|
+
/** Get first day of the week @keywords first day */
|
|
348
|
+
static getFirstDay(): ComputedRef<string>;
|
|
349
|
+
/** Get current location string @keywords location */
|
|
350
|
+
static getLocation(): ComputedRef<string>;
|
|
351
|
+
/** Get country from location @keywords location country */
|
|
352
|
+
static getLocationCountry(): ComputedRef<string>;
|
|
353
|
+
/** Get language from location @keywords location language */
|
|
354
|
+
static getLocationLanguage(): ComputedRef<string>;
|
|
355
|
+
/** Set geographic code @keywords set geo */
|
|
356
|
+
static set(code: string): void;
|
|
357
|
+
/** Set default geographic value @keywords default geo */
|
|
358
|
+
static setValueDefault(code?: string | (() => string)): void;
|
|
150
359
|
}
|
|
360
|
+
|
|
361
|
+
import { ComputedRef, Ref } from 'vue';
|
|
362
|
+
import { GeoUnit, NumberOrString } from '@dxtmisha/functional-basic';
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Reactive class for managing localized unit formatting and automatic conversions.
|
|
366
|
+
* @keywords GeoUnitRef, geo, unit, formatting, conversion, localized
|
|
367
|
+
*/
|
|
151
368
|
export declare class GeoUnitRef {
|
|
369
|
+
/**
|
|
370
|
+
* Creates an instance of GeoUnitRef.
|
|
371
|
+
* @keywords constructor, geo, unit
|
|
372
|
+
*/
|
|
152
373
|
constructor(code?: RefOrNormal<string>);
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Returns the standard location code.
|
|
377
|
+
* @keywords getLocation, location, code, standard
|
|
378
|
+
*/
|
|
153
379
|
getLocation(): ComputedRef<string>;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Formats millimeter value, converting to inches if overridden by locale unit settings.
|
|
383
|
+
* @keywords millimeter, format, length, unit
|
|
384
|
+
*/
|
|
154
385
|
millimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Formats centimeter value, converting to inches if overridden by locale unit settings.
|
|
389
|
+
* @keywords centimeter, format, length, unit
|
|
390
|
+
*/
|
|
155
391
|
centimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Formats meter value, converting to feet if overridden by locale unit settings.
|
|
395
|
+
* @keywords meter, format, length, unit
|
|
396
|
+
*/
|
|
156
397
|
meter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Formats kilometer value, converting to miles if overridden by locale unit settings.
|
|
401
|
+
* @keywords kilometer, format, length, unit
|
|
402
|
+
*/
|
|
157
403
|
kilometer(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Formats square meter value, converting to square feet if overridden by locale unit settings.
|
|
407
|
+
* @keywords squareMeter, format, area, unit
|
|
408
|
+
*/
|
|
158
409
|
squareMeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Formats hectare value, converting to acres if overridden by locale unit settings.
|
|
413
|
+
* @keywords hectare, format, area, unit
|
|
414
|
+
*/
|
|
159
415
|
hectare(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Formats gram value, converting to ounces if overridden by locale unit settings.
|
|
419
|
+
* @keywords gram, format, mass, weight, unit
|
|
420
|
+
*/
|
|
160
421
|
gram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Formats kilogram value, converting to pounds if overridden by locale unit settings.
|
|
425
|
+
* @keywords kilogram, format, mass, weight, unit
|
|
426
|
+
*/
|
|
161
427
|
kilogram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Formats tonne value, converting to short tons if overridden by locale unit settings.
|
|
431
|
+
* @keywords tonne, format, mass, weight, unit
|
|
432
|
+
*/
|
|
162
433
|
tonne(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Formats milliliter value, converting to fluid ounces if overridden by locale unit settings.
|
|
437
|
+
* @keywords milliliter, format, volume, unit
|
|
438
|
+
*/
|
|
163
439
|
milliliter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Formats liter value, converting to gallons if overridden by locale unit settings.
|
|
443
|
+
* @keywords liter, format, volume, unit
|
|
444
|
+
*/
|
|
164
445
|
liter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Formats celsius value, converting to fahrenheit if overridden by locale unit settings.
|
|
449
|
+
* @keywords celsius, format, temperature, unit
|
|
450
|
+
*/
|
|
165
451
|
celsius(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Formats kilometer per hour value, converting to miles per hour if overridden by locale unit settings.
|
|
455
|
+
* @keywords kilometerPerHour, format, speed, unit
|
|
456
|
+
*/
|
|
166
457
|
kilometerPerHour(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Formats the value for the specified unit reactively, converting and formatting it according to the locale.
|
|
461
|
+
* @keywords format, unit, conversion, localized
|
|
462
|
+
*/
|
|
167
463
|
format(value: RefOrNormal<NumberOrString>, unit: RefOrNormal<string>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
168
464
|
}
|
|
465
|
+
|
|
466
|
+
import { ComputedRef } from 'vue';
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Class for managing the data list.
|
|
470
|
+
* @keywords list data management collection items
|
|
471
|
+
*/
|
|
169
472
|
export declare class ListDataRef {
|
|
473
|
+
/**
|
|
474
|
+
* Creates an instance of ListData for managing list data.
|
|
475
|
+
* @keywords list data constructor initialize
|
|
476
|
+
*/
|
|
170
477
|
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);
|
|
478
|
+
/**
|
|
479
|
+
* Returns a list for forming a list.
|
|
480
|
+
* @keywords list items data reactive
|
|
481
|
+
*/
|
|
171
482
|
readonly data: ComputedRef<ListList>;
|
|
483
|
+
/**
|
|
484
|
+
* Returns a simplified list for quick loading.
|
|
485
|
+
* @keywords lite list fast items
|
|
486
|
+
*/
|
|
172
487
|
readonly liteData: ComputedRef<ListList>;
|
|
488
|
+
/**
|
|
489
|
+
* Returns a list of records with all additional data.
|
|
490
|
+
* @keywords full list data items state
|
|
491
|
+
*/
|
|
173
492
|
readonly fullData: ComputedRef<ListDataFull>;
|
|
493
|
+
/**
|
|
494
|
+
* Returns a flat map of all entries including sublists.
|
|
495
|
+
* @keywords map flat list items
|
|
496
|
+
*/
|
|
174
497
|
readonly map: ComputedRef<ListList>;
|
|
498
|
+
/**
|
|
499
|
+
* Returns a list consisting only of items.
|
|
500
|
+
* @keywords map items array
|
|
501
|
+
*/
|
|
175
502
|
readonly mapItems: ComputedRef<ListList>;
|
|
503
|
+
/**
|
|
504
|
+
* Returns a list consisting only of values for selection.
|
|
505
|
+
* @keywords items selection values group menu
|
|
506
|
+
*/
|
|
176
507
|
readonly items: ComputedRef<ListList>;
|
|
508
|
+
/**
|
|
509
|
+
* Finds the first element that meets the search conditions.
|
|
510
|
+
* @keywords highlight first item search index
|
|
511
|
+
*/
|
|
177
512
|
readonly highlightFirstItem: ComputedRef<number>;
|
|
513
|
+
/**
|
|
514
|
+
* Is there a selected item.
|
|
515
|
+
* @keywords is selected boolean state
|
|
516
|
+
*/
|
|
178
517
|
readonly isSelected: ComputedRef<boolean>;
|
|
518
|
+
/**
|
|
519
|
+
* Is the minimum selection reached.
|
|
520
|
+
* @keywords is selected min threshold
|
|
521
|
+
*/
|
|
179
522
|
readonly isSelectedMin: ComputedRef<boolean>;
|
|
523
|
+
/**
|
|
524
|
+
* Is the maximum selection reached.
|
|
525
|
+
* @keywords is selected max threshold
|
|
526
|
+
*/
|
|
180
527
|
readonly isSelectedMax: ComputedRef<boolean>;
|
|
528
|
+
/**
|
|
529
|
+
* Returns a list of selected items on the map.
|
|
530
|
+
* @keywords selected list items
|
|
531
|
+
*/
|
|
181
532
|
readonly selectedList: ComputedRef<ListList>;
|
|
533
|
+
/**
|
|
534
|
+
* Returns a list of selected items in the current group.
|
|
535
|
+
* @keywords selected list group items
|
|
536
|
+
*/
|
|
182
537
|
readonly selectedListInGroup: ComputedRef<ListList>;
|
|
538
|
+
/**
|
|
539
|
+
* Returns a list of selected labels on the map.
|
|
540
|
+
* @keywords selected names labels list
|
|
541
|
+
*/
|
|
183
542
|
readonly selectedNames: ComputedRef<ListNames>;
|
|
543
|
+
/**
|
|
544
|
+
* Returns a list of selected values on the map.
|
|
545
|
+
* @keywords selected values list
|
|
546
|
+
*/
|
|
184
547
|
readonly selectedValues: ComputedRef<any[]>;
|
|
548
|
+
/**
|
|
549
|
+
* Checks whether it is necessary to first display a simplified version.
|
|
550
|
+
* @keywords is lite mode check
|
|
551
|
+
*/
|
|
185
552
|
isLite(): boolean;
|
|
553
|
+
/**
|
|
554
|
+
* Checks if an element is in focus.
|
|
555
|
+
* @keywords is focus check
|
|
556
|
+
*/
|
|
186
557
|
isFocus(): boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Checks if there is a highlighted item (search results).
|
|
560
|
+
* @keywords is highlight check search
|
|
561
|
+
*/
|
|
187
562
|
isHighlight(): boolean;
|
|
563
|
+
/**
|
|
564
|
+
* Checks if highlighting is active (minimum length reached).
|
|
565
|
+
* @keywords is highlight active check
|
|
566
|
+
*/
|
|
188
567
|
isHighlightActive(): boolean;
|
|
568
|
+
/**
|
|
569
|
+
* Returns the number of records in the current list.
|
|
570
|
+
* @keywords get length count list
|
|
571
|
+
*/
|
|
189
572
|
getLength(): number;
|
|
573
|
+
/**
|
|
574
|
+
* Returns the number of all available records in the map.
|
|
575
|
+
* @keywords get length map count
|
|
576
|
+
*/
|
|
190
577
|
getLengthByMap(): number;
|
|
578
|
+
/**
|
|
579
|
+
* Returns the number of all available records (items).
|
|
580
|
+
* @keywords get length items count
|
|
581
|
+
*/
|
|
191
582
|
getLengthByItems(): number;
|
|
583
|
+
/**
|
|
584
|
+
* Returns the identifier in focus.
|
|
585
|
+
* @keywords get focus identifier
|
|
586
|
+
*/
|
|
192
587
|
getFocus(): ListSelectedItem | undefined;
|
|
588
|
+
/**
|
|
589
|
+
* Returns the item in focus.
|
|
590
|
+
* @keywords get focus item data
|
|
591
|
+
*/
|
|
193
592
|
getFocusItem(): ListDataItem | undefined;
|
|
593
|
+
/**
|
|
594
|
+
* Returns the highlight text.
|
|
595
|
+
* @keywords get highlight search text
|
|
596
|
+
*/
|
|
194
597
|
getHighlight(): string | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* Returns the minimum length for highlight to start.
|
|
600
|
+
* @keywords get highlight length start
|
|
601
|
+
*/
|
|
195
602
|
getHighlightLengthStart(): number;
|
|
603
|
+
/**
|
|
604
|
+
* Returns the selected identifiers list.
|
|
605
|
+
* @keywords get selected list
|
|
606
|
+
*/
|
|
196
607
|
getSelected(): ListSelectedList | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* Returns an item by moving a certain number of steps from the selected item.
|
|
610
|
+
* @keywords get selected by step navigation
|
|
611
|
+
*/
|
|
197
612
|
getSelectedByStep(step: number): ListSelectedItem | undefined;
|
|
613
|
+
/**
|
|
614
|
+
* Returns the next item from the selected one.
|
|
615
|
+
* @keywords get selected next item
|
|
616
|
+
*/
|
|
198
617
|
getSelectedNext(): ListSelectedItem | undefined;
|
|
618
|
+
/**
|
|
619
|
+
* Returns the previous item from the selected one.
|
|
620
|
+
* @keywords get selected prev item
|
|
621
|
+
*/
|
|
199
622
|
getSelectedPrev(): ListSelectedItem | undefined;
|
|
623
|
+
/**
|
|
624
|
+
* Returns an item by moving a certain number of steps from the specified item.
|
|
625
|
+
* @keywords get item by step navigation
|
|
626
|
+
*/
|
|
200
627
|
getItemByStep(item: ListDataItem, step: number): ListDataItem | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* Returns the next item from the specified one.
|
|
630
|
+
* @keywords get item next
|
|
631
|
+
*/
|
|
201
632
|
getItemNext(item: ListDataItem): ListDataItem | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* Returns the previous item from the specified one.
|
|
635
|
+
* @keywords get item prev
|
|
636
|
+
*/
|
|
202
637
|
getItemPrev(item: ListDataItem): ListDataItem | undefined;
|
|
638
|
+
/**
|
|
639
|
+
* Returns an item by moving a certain number of steps from the specified index.
|
|
640
|
+
* @keywords get index by step navigation
|
|
641
|
+
*/
|
|
203
642
|
getIndexByStep(index: string, step: number): ListDataItem | undefined;
|
|
643
|
+
/**
|
|
644
|
+
* Returns the next item from the specified index.
|
|
645
|
+
* @keywords get index next
|
|
646
|
+
*/
|
|
204
647
|
getIndexNext(index: string): ListDataItem | undefined;
|
|
648
|
+
/**
|
|
649
|
+
* Returns the previous item from the specified index.
|
|
650
|
+
* @keywords get index prev
|
|
651
|
+
*/
|
|
205
652
|
getIndexPrev(index: string): ListDataItem | undefined;
|
|
653
|
+
/**
|
|
654
|
+
* Returns an item by its index.
|
|
655
|
+
* @keywords get item by index
|
|
656
|
+
*/
|
|
206
657
|
getItemByIndex(index?: string): {
|
|
207
658
|
key: number;
|
|
208
659
|
item: ListDataItem;
|
|
209
660
|
} | undefined;
|
|
661
|
+
/**
|
|
662
|
+
* Returns an item by its key.
|
|
663
|
+
* @keywords get item by key number
|
|
664
|
+
*/
|
|
210
665
|
getItemByKey(key: number): ListDataItem | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* Returns the first item with the specified parent.
|
|
668
|
+
* @keywords get first item by parent
|
|
669
|
+
*/
|
|
211
670
|
getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
671
|
+
/**
|
|
672
|
+
* Returns the last item with the specified parent.
|
|
673
|
+
* @keywords get last item by parent
|
|
674
|
+
*/
|
|
212
675
|
getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
676
|
+
/**
|
|
677
|
+
* Returns a sublist object for a group item.
|
|
678
|
+
* @keywords get sub list group item
|
|
679
|
+
*/
|
|
213
680
|
getSubList(item: ListDataItem): ListDataRef;
|
|
214
|
-
protected isItem(item: ListDataItem): boolean;
|
|
215
|
-
protected isInParent(parent: string | undefined, item: ListDataItem): boolean;
|
|
216
|
-
protected getIndex(index: string | number | undefined, value: any, key: string | number | undefined, label: string | number | undefined): string | number | undefined;
|
|
217
|
-
protected initItem(key: string | number, item: any): ListDataItem;
|
|
218
681
|
}
|
|
682
|
+
|
|
683
|
+
import { RouteLocationRaw, Router, _RouterClassic } from 'vue-router';
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Router management class.
|
|
687
|
+
* @keywords router, navigation, ref, link, href
|
|
688
|
+
*/
|
|
219
689
|
export declare class RouterItemRef {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
690
|
+
/** Get router instance. @keywords router, get */
|
|
691
|
+
static get(): _RouterClassic;
|
|
692
|
+
/** Returns the link by name. @keywords router, link, resolve */
|
|
693
|
+
static getLink(name: string, params?: any, query?: any): string | undefined;
|
|
694
|
+
/** Returns the link property by name. @keywords router, href */
|
|
695
|
+
static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
|
|
696
|
+
/** Site path change. @keywords router, push, navigate */
|
|
697
|
+
static push(to: string | RouteLocationRaw): void;
|
|
698
|
+
/** Set router instance. @keywords router, set */
|
|
699
|
+
static set(router: Router): void;
|
|
700
|
+
/** Set router instance only once. @keywords router, set, once */
|
|
701
|
+
static setOneTime(router: Router): void;
|
|
702
|
+
/** Converts the raw route location to href properties. @keywords router, href, raw */
|
|
703
|
+
static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
|
|
227
704
|
}
|
|
705
|
+
|
|
706
|
+
import { Ref, ComputedRef } from 'vue';
|
|
707
|
+
|
|
708
|
+
/** Scrollbar width reactive reference utility class @keywords scrollbar, width, reactive, dom */
|
|
228
709
|
export declare class ScrollbarWidthRef {
|
|
710
|
+
/** Reactive item state @keywords item, state, boolean */
|
|
229
711
|
readonly item: Ref<boolean | undefined, boolean | undefined>;
|
|
712
|
+
/** Reactive scrollbar width value @keywords width, number, size */
|
|
230
713
|
readonly width: Ref<number, number>;
|
|
714
|
+
/** Creates a scrollbar width reference instance @keywords constructor, init */
|
|
231
715
|
constructor();
|
|
716
|
+
/** Computes whether scrollbar width is available @keywords is, computed, check */
|
|
232
717
|
readonly is: ComputedRef<boolean>;
|
|
233
718
|
}
|
|
719
|
+
|
|
720
|
+
import { ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList } from '@dxtmisha/functional-basic';
|
|
721
|
+
|
|
234
722
|
/**
|
|
235
723
|
* Asynchronous reactive composable for API requests with built-in SSR support.
|
|
236
|
-
*
|
|
237
|
-
* Use this composable ONLY if you need the request to be executed on the server side during SSR.
|
|
238
|
-
* For all other cases, use `useApiRef`.
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
* ```typescript
|
|
242
|
-
* import { Schema as S } from '@effect/schema'
|
|
243
|
-
* import { useApiAsyncRef } from '@dxtmisha/functional'
|
|
244
|
-
*
|
|
245
|
-
* const userSchema = S.Struct({ id: S.Number, name: S.String })
|
|
246
|
-
*
|
|
247
|
-
* // Data will be pre-fetched on the server during SSR (onServerPrefetch)
|
|
248
|
-
* const { data, loading, errorItem, isResponseContractValid } = useApiAsyncRef(
|
|
249
|
-
* '/users/1',
|
|
250
|
-
* { method: 'GET' },
|
|
251
|
-
* true, // reactivity
|
|
252
|
-
* undefined, // conditions
|
|
253
|
-
* undefined, // transformation
|
|
254
|
-
* (data) => { // validateResponseContract
|
|
255
|
-
* try {
|
|
256
|
-
* return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
|
|
257
|
-
* } catch (e) {
|
|
258
|
-
* return { status: 'error', errors: e }
|
|
259
|
-
* }
|
|
260
|
-
* },
|
|
261
|
-
* [ // errorContract
|
|
262
|
-
* { status: 404, message: 'User not found' }
|
|
263
|
-
* ]
|
|
264
|
-
* )
|
|
265
|
-
* ```
|
|
724
|
+
* @keywords api, async, ssr, request, fetch
|
|
266
725
|
*/
|
|
267
726
|
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>;
|
|
727
|
+
|
|
728
|
+
import { ApiData, ApiFetch } from '@dxtmisha/functional-basic';
|
|
729
|
+
import { Ref } from 'vue';
|
|
730
|
+
|
|
268
731
|
export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
269
732
|
}
|
|
733
|
+
|
|
270
734
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
735
|
+
* Executes a DELETE request via the API.
|
|
736
|
+
* @keywords api delete request setup composable
|
|
273
737
|
*/
|
|
274
738
|
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
|
|
275
739
|
loading: Ref<boolean, boolean>;
|
|
276
740
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
277
741
|
};
|
|
742
|
+
|
|
743
|
+
/** Setup interface for API GET request @keywords api get setup request configuration */
|
|
278
744
|
export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
279
745
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
* This is a convenient wrapper over `useApiRequest` that pre-fills the GET method.
|
|
283
|
-
*/
|
|
746
|
+
|
|
747
|
+
/** Executes an API GET request with loading state and send method @keywords api get request wrapper */
|
|
284
748
|
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
|
|
285
749
|
loading: Ref<boolean, boolean>;
|
|
286
750
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
287
751
|
};
|
|
752
|
+
|
|
288
753
|
import { ApiInstance, ArrayToItem, FormattersListColumns, FormattersOptionsList, SearchColumns, ApiDataValidation, SearchFormatList, ApiData, ApiErrorItem, ApiFetch } from '@dxtmisha/functional-basic';
|
|
289
754
|
import { ComputedRef, Ref } from 'vue';
|
|
755
|
+
|
|
290
756
|
/**
|
|
291
|
-
* Asynchronous reactive composable for API management requests with
|
|
292
|
-
*
|
|
293
|
-
* Use this composable ONLY if you need the request to be executed on the server side during SSR.
|
|
294
|
-
* For all other cases, use `useApiManagementRef`.
|
|
295
|
-
*
|
|
296
|
-
* Асинхронный реактивный composable для запросов управления API со встроенной поддержкой SSR.
|
|
297
|
-
* Оборачивает `useApiManagementRef` и сразу вызывает `initSsr()`, чтобы гарантировать предзагрузку данных на сервере.
|
|
298
|
-
* Используйте этот composable ТОЛЬКО если вам необходимо, чтобы запрос был выполнен на стороне сервера
|
|
299
|
-
* во время SSR. Во всех остальных случаях используйте обычный `useApiManagementRef`.
|
|
300
|
-
* @template Return type of data returned by the API / тип данных, возвращаемых API
|
|
301
|
-
* @template FormattersOptions optional formatting rules / опциональные правила форматирования
|
|
302
|
-
* @template Post data type for POST creation request / тип данных для POST-запроса создания
|
|
303
|
-
* @template Put data type for PUT update request / тип данных для PUT-запроса обновления
|
|
304
|
-
* @template Delete data type for DELETE removal request / тип данных для DELETE-запроса удаления
|
|
305
|
-
* @template Type original data type (before transformation) / тип исходных данных (до трансформации)
|
|
306
|
-
* @template Item type of a single item in the data list / тип одного элемента из списка данных
|
|
307
|
-
* @template ItemFormatters item type after formatters are applied / тип элемента после применения форматировщиков
|
|
308
|
-
* @template Columns search columns derived from formatting / колонки, по которым производится поиск
|
|
309
|
-
*
|
|
310
|
-
* @param propsGet main GET request settings (path, reactivity, skeleton, etc.) / настройки главного GET-запроса
|
|
311
|
-
* @param formattersOptions optional reactive formatting rules / правила для реактивного форматирования данных
|
|
312
|
-
* @param searchOptions optional client-side search settings / настройки для клиентского поиска по списку
|
|
313
|
-
* @param postRequest optional POST mutation settings / настройки для POST-запроса создания
|
|
314
|
-
* @param putRequest optional PUT mutation settings / настройки для PUT-запроса обновления
|
|
315
|
-
* @param deleteRequest optional DELETE mutation settings / настройки для DELETE-запроса удаления
|
|
316
|
-
* @param action common callback executed after any successful mutation / общий коллбэк после любой успешной мутации
|
|
317
|
-
* @param apiInstance API instance for requests (defaults to Api.getItem()) / экземпляр API для выполнения запроса
|
|
757
|
+
* Asynchronous reactive composable for API management requests with SSR support.
|
|
758
|
+
* @keywords api management async ssr composable fetch
|
|
318
759
|
*/
|
|
319
760
|
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): {
|
|
320
761
|
isValid: ComputedRef<boolean>;
|
|
@@ -342,65 +783,13 @@ export declare function useApiManagementAsyncRef<Return extends ApiManagementVal
|
|
|
342
783
|
sendPut: (request?: ApiFetch["request"]) => Promise< ApiData<Put> | undefined>;
|
|
343
784
|
sendDelete: (request?: ApiFetch["request"]) => Promise< ApiData<Delete> | undefined>;
|
|
344
785
|
};
|
|
786
|
+
|
|
787
|
+
import { Ref, ComputedRef } from 'vue';
|
|
788
|
+
import { FormattersOptionsList, ApiData, ApiInstance, ArrayToItem, SearchColumns, SearchFormatList, FormattersListColumns, ApiFetch, ApiDataValidation, ApiErrorItem, ApiManagementValue, ApiManagementGet, ApiManagementSearch, ApiManagementRequest } from '@dxtmisha/functional-basic';
|
|
789
|
+
|
|
345
790
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* and mutations (POST, PUT, DELETE) through a single reactive interface.
|
|
349
|
-
*
|
|
350
|
-
* @template Return type of data returned by the API
|
|
351
|
-
* @template FormattersOptions optional formatting rules
|
|
352
|
-
* @template Post data type for POST creation request
|
|
353
|
-
* @template Put data type for PUT update request
|
|
354
|
-
* @template Delete data type for DELETE removal request
|
|
355
|
-
* @template Type original data type (before transformation)
|
|
356
|
-
* @template Item type of a single item in the data list
|
|
357
|
-
* @template ItemFormatters item type after formatters are applied
|
|
358
|
-
* @template Columns search columns derived from formatting
|
|
359
|
-
*
|
|
360
|
-
* @param propsGet main GET request settings (path, reactivity, skeleton, etc.)
|
|
361
|
-
* @param formattersOptions optional reactive formatting rules
|
|
362
|
-
* @param searchOptions optional client-side search settings
|
|
363
|
-
* @param postRequest optional POST mutation settings
|
|
364
|
-
* @param putRequest optional PUT mutation settings
|
|
365
|
-
* @param deleteRequest optional DELETE mutation settings
|
|
366
|
-
* @param action common callback executed after any successful mutation
|
|
367
|
-
* @param apiInstance API instance for requests (defaults to Api.getItem())
|
|
368
|
-
*
|
|
369
|
-
* @returns reactive API management interface
|
|
370
|
-
*
|
|
371
|
-
* @note This hook is recommended to be used in tandem with `executeUse` for centralized state management.
|
|
372
|
-
* By wrapping `useApiManagementRef` in `executeUseProvide` or `executeUseGlobal`, you can ensure
|
|
373
|
-
* a single source of truth across the component tree or the entire application.
|
|
374
|
-
*
|
|
375
|
-
* @remarks
|
|
376
|
-
* Data formatting guidelines for `formattersOptions`:
|
|
377
|
-
* - **Recommended for formatting:** Numbers that represent values (prices, counts), dates, currency, units, and statuses.
|
|
378
|
-
* - **Not recommended for formatting:** Technical identifiers such as ID, UUID, account numbers (if used for logic), types, or internal codes.
|
|
379
|
-
*
|
|
380
|
-
* @example
|
|
381
|
-
* // 1. Comprehensive API orchestration
|
|
382
|
-
* const products = useApiManagementRef(
|
|
383
|
-
* {
|
|
384
|
-
* path: '/api/v1/products',
|
|
385
|
-
* skeleton: () => Array(5).fill({ id: 0, name: 'Loading...', price: 0 })
|
|
386
|
-
* },
|
|
387
|
-
* {
|
|
388
|
-
* // Formatters for display
|
|
389
|
-
* price: (v) => `${v} USD`,
|
|
390
|
-
* created_at: (v) => new Date(v).toLocaleDateString()
|
|
391
|
-
* },
|
|
392
|
-
* {
|
|
393
|
-
* // Client-side search setup
|
|
394
|
-
* columns: ['name', 'category']
|
|
395
|
-
* },
|
|
396
|
-
* { path: '/api/v1/products' }, // POST (create)
|
|
397
|
-
* { path: (data) => `/api/v1/products/${data.id}` }, // PUT (update)
|
|
398
|
-
* { path: (data) => `/api/v1/products/${data.id}` } // DELETE (remove)
|
|
399
|
-
* );
|
|
400
|
-
*
|
|
401
|
-
* // Accessing data:
|
|
402
|
-
* // products.list.value -> processed, formatted, and searched list
|
|
403
|
-
* // products.sendPost({ name: 'New Product', price: 100 }) -> execute mutation
|
|
791
|
+
* Manages API requests and list operations.
|
|
792
|
+
* @keywords api, management, ref, request
|
|
404
793
|
*/
|
|
405
794
|
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): {
|
|
406
795
|
isValid: ComputedRef<boolean>;
|
|
@@ -420,232 +809,257 @@ export declare function useApiManagementRef<Return extends ApiManagementValue, F
|
|
|
420
809
|
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
421
810
|
isSearch: ComputedRef<boolean> | undefined;
|
|
422
811
|
search: Ref<string>;
|
|
812
|
+
/** Initializes api management. @keywords init, start */
|
|
423
813
|
init: () => void;
|
|
814
|
+
/** Initializes server-side rendering. @keywords ssr, init */
|
|
424
815
|
initSsr: () => void;
|
|
816
|
+
/** Resets request state. @keywords reset, clear */
|
|
425
817
|
reset: () => Promise<void>;
|
|
818
|
+
/** Aborts active request. @keywords abort, cancel */
|
|
426
819
|
abort: () => void;
|
|
820
|
+
/** Sends POST request. @keywords post, send */
|
|
427
821
|
sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>;
|
|
822
|
+
/** Sends PUT request. @keywords put, send */
|
|
428
823
|
sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
|
|
824
|
+
/** Sends DELETE request. @keywords delete, send */
|
|
429
825
|
sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
|
|
430
826
|
};
|
|
827
|
+
|
|
828
|
+
import { ApiData, ApiFetch } from '@dxtmisha/functional-basic';
|
|
829
|
+
import { Ref } from 'vue';
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Setup interface for API POST request.
|
|
833
|
+
* @keywords api, post, setup, request
|
|
834
|
+
*/
|
|
431
835
|
export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
432
836
|
}
|
|
837
|
+
|
|
433
838
|
/**
|
|
434
|
-
*
|
|
435
|
-
*
|
|
839
|
+
* Executes a POST request using the API.
|
|
840
|
+
* @keywords api, post, request, send
|
|
436
841
|
*/
|
|
437
842
|
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
|
|
438
843
|
loading: Ref<boolean, boolean>;
|
|
439
844
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
440
845
|
};
|
|
846
|
+
|
|
847
|
+
/** Setup interface for API PUT request @keywords useApiPutSetup, api, put */
|
|
441
848
|
export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
442
849
|
}
|
|
443
|
-
/**
|
|
444
|
-
* Use API put request.
|
|
445
|
-
* This is a convenient wrapper over `useApiRequest` that pre-fills the PUT method.
|
|
446
|
-
*/
|
|
850
|
+
/** Use API PUT request wrapper @keywords useApiPut, api, put, request */
|
|
447
851
|
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
|
|
448
852
|
loading: Ref<boolean, boolean>;
|
|
449
853
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
450
854
|
};
|
|
855
|
+
|
|
856
|
+
import { ComputedRef, Ref } from 'vue';
|
|
857
|
+
import { ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList, ApiErrorItem } from '@dxtmisha/functional-basic';
|
|
858
|
+
|
|
451
859
|
export interface UseApiRef<R> {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
860
|
+
/** @keywords data, computed, reactive */
|
|
861
|
+
data: ComputedRef<ApiData<R> | undefined>;
|
|
862
|
+
/** @keywords item, ref */
|
|
863
|
+
item: Ref<ApiData<R> | undefined>;
|
|
864
|
+
/** @keywords error, computed, item */
|
|
865
|
+
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
866
|
+
/** @keywords response, contract, valid, status */
|
|
867
|
+
isResponseContractValid: ComputedRef<boolean>;
|
|
868
|
+
/** @keywords response, validation, result */
|
|
869
|
+
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
870
|
+
/** @keywords length, computed */
|
|
871
|
+
length: ComputedRef<number>;
|
|
872
|
+
/** @keywords starting, flag */
|
|
873
|
+
starting: ComputedRef<boolean>;
|
|
874
|
+
/** @keywords loading, ref */
|
|
875
|
+
loading: Ref<boolean>;
|
|
876
|
+
/** @keywords reading, ref */
|
|
877
|
+
reading: Ref<boolean>;
|
|
878
|
+
/** @keywords is, starting */
|
|
879
|
+
isStarting(): boolean;
|
|
880
|
+
/** @keywords is, loading */
|
|
881
|
+
isLoading(): boolean;
|
|
882
|
+
/** @keywords is, reading */
|
|
883
|
+
isReading(): boolean;
|
|
884
|
+
/** @keywords get, item */
|
|
885
|
+
getItem(): ApiData<R> | undefined;
|
|
886
|
+
/** @keywords init */
|
|
887
|
+
init(): void;
|
|
888
|
+
/** @keywords init, ssr */
|
|
889
|
+
initSsr(): void;
|
|
890
|
+
/** @keywords reset */
|
|
891
|
+
reset(): Promise<void>;
|
|
892
|
+
/** @keywords stop */
|
|
893
|
+
stop(): void;
|
|
894
|
+
/** @keywords abort */
|
|
895
|
+
abort(): void;
|
|
470
896
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
* Automatically handles SSR, reactivity, caching, error storage, data validation, and transformation.
|
|
474
|
-
*
|
|
475
|
-
* @example
|
|
476
|
-
* ```typescript
|
|
477
|
-
* import { Schema as S } from '@effect/schema'
|
|
478
|
-
* import { useApiRef } from '@dxtmisha/functional'
|
|
479
|
-
*
|
|
480
|
-
* // Define a schema using @effect/schema
|
|
481
|
-
* const userSchema = S.Struct({ id: S.Number, name: S.String })
|
|
482
|
-
*
|
|
483
|
-
* const { data, loading, errorItem, isResponseContractValid } = useApiRef(
|
|
484
|
-
* '/users/1',
|
|
485
|
-
* { method: 'GET' },
|
|
486
|
-
* true, // reactivity
|
|
487
|
-
* undefined, // conditions
|
|
488
|
-
* (data) => ({ ...data, isTransformed: true }), // transformation
|
|
489
|
-
* (data) => { // validateResponseContract
|
|
490
|
-
* try {
|
|
491
|
-
* return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
|
|
492
|
-
* } catch (e) {
|
|
493
|
-
* return { status: 'error', errors: e }
|
|
494
|
-
* }
|
|
495
|
-
* },
|
|
496
|
-
* [ // errorContract (ApiErrorStorageList)
|
|
497
|
-
* {
|
|
498
|
-
* status: 404,
|
|
499
|
-
* message: 'User not found'
|
|
500
|
-
* }
|
|
501
|
-
* ]
|
|
502
|
-
* )
|
|
503
|
-
* ```
|
|
504
|
-
*/
|
|
897
|
+
|
|
898
|
+
/** @keywords api, ref, vue, composable */
|
|
505
899
|
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>;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
*
|
|
509
|
-
* Определяет глобальные условия для API запроса.
|
|
510
|
-
* @param conditions conditions for executing the request/ условия выполнения запроса
|
|
511
|
-
*/
|
|
900
|
+
|
|
901
|
+
/** @keywords set, api, global, conditions */
|
|
512
902
|
export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
|
|
903
|
+
|
|
513
904
|
import { ApiInstance, ApiMethodItem, ApiData, ApiFetch, ApiErrorStorageList, ApiDataValidation } from '@dxtmisha/functional-basic';
|
|
514
905
|
import { Ref } from 'vue';
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
*
|
|
518
|
-
* Интерфейс настроек для запроса API.
|
|
519
|
-
*/
|
|
906
|
+
|
|
907
|
+
/** Setup interface for API request. @keywords useApiRequest setup api request configuration */
|
|
520
908
|
export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
|
|
521
|
-
/**
|
|
522
|
-
* Path to the API endpoint. Can be a reactive Ref or a normal string.
|
|
523
|
-
*
|
|
524
|
-
* Путь к endpoint API. Может быть реактивным Ref или обычной строкой.
|
|
525
|
-
*/
|
|
909
|
+
/** Path to the API endpoint. @keywords path endpoint api */
|
|
526
910
|
path?: RefOrNormal<string | undefined>;
|
|
527
|
-
/**
|
|
528
|
-
* HTTP method used for the request (e.g., GET, POST, PUT, DELETE). Defaults to POST.
|
|
529
|
-
*
|
|
530
|
-
* HTTP метод, используемый для запроса (например, GET, POST, PUT, DELETE). По умолчанию POST.
|
|
531
|
-
*/
|
|
911
|
+
/** HTTP method used for the request. @keywords method http get post */
|
|
532
912
|
method?: ApiMethodItem;
|
|
533
|
-
/**
|
|
534
|
-
* Action/callback to perform after the request has successfully completed.
|
|
535
|
-
* Can return a Promise for asynchronous operations.
|
|
536
|
-
*
|
|
537
|
-
* Действие/колбэк, выполняемое после успешного завершения запроса.
|
|
538
|
-
* Может возвращать Promise для асинхронных операций.
|
|
539
|
-
*/
|
|
913
|
+
/** Action callback after successful completion. @keywords action callback success */
|
|
540
914
|
action?: (data: Return | undefined) => Promise<void> | void;
|
|
541
|
-
/**
|
|
542
|
-
* Transformation function that modifies the raw response data before returning it.
|
|
543
|
-
*
|
|
544
|
-
* Функция трансформации, которая преобразует исходные данные ответа перед их возвратом.
|
|
545
|
-
*/
|
|
915
|
+
/** Transformation function for response data. @keywords transformation transform response data */
|
|
546
916
|
transformation?: (data: T) => Return;
|
|
547
|
-
/**
|
|
548
|
-
* Function to validate the request payload contract. Used to ensure that the API
|
|
549
|
-
* request payload matches the expected structure.
|
|
550
|
-
*
|
|
551
|
-
* Функция для проверки контракта данных запроса. Используется для гарантии того,
|
|
552
|
-
* что отправляемая полезная нагрузка запроса API соответствует ожидаемой структуре.
|
|
553
|
-
*/
|
|
917
|
+
/** Function to validate the request payload contract. @keywords validate request contract payload */
|
|
554
918
|
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
555
|
-
/**
|
|
556
|
-
* Function to validate response data contract. Used to ensure that the API
|
|
557
|
-
* response matches the expected structure. Highly recommended to use with `@effect/schema`.
|
|
558
|
-
* It should return `ApiDataValidation` containing a `status` ('success' or 'error')
|
|
559
|
-
* and the parsed data or errors.
|
|
560
|
-
*
|
|
561
|
-
* Функция для проверки контракта данных ответа. Используется для гарантии того, что ответ API соответствует
|
|
562
|
-
* ожидаемой структуре. Настоятельно рекомендуется использовать с `@effect/schema`. Должна возвращать объект
|
|
563
|
-
* `ApiDataValidation`, содержащий `status` ('success' или 'error') и распарсенные данные или ошибки.
|
|
564
|
-
*/
|
|
919
|
+
/** Function to validate response data contract. @keywords validate response contract schema */
|
|
565
920
|
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
566
|
-
/**
|
|
567
|
-
* Array of expected error contracts for the request (`ApiErrorStorageList`).
|
|
568
|
-
* Highly recommended to add if there is information about possible request errors. Allows you to predefine
|
|
569
|
-
* possible errors (by code, status, or custom validation) which will be centrally processed by the application.
|
|
570
|
-
*
|
|
571
|
-
* Массив контрактов ожидаемых ошибок для запроса (`ApiErrorStorageList`). Желательно добавлять, если есть
|
|
572
|
-
* информация о возможных ошибках запроса. Позволяет заранее описать возможные ошибки (по коду, статусу или
|
|
573
|
-
* кастомной валидации) для централизованной обработки в приложении.
|
|
574
|
-
*/
|
|
921
|
+
/** Array of expected error contracts for the request. @keywords error contract list */
|
|
575
922
|
errorContract?: ApiErrorStorageList;
|
|
576
|
-
/**
|
|
577
|
-
* If true, extracts the nested 'data' field from the response object instead of returning the raw envelope.
|
|
578
|
-
* Defaults to true.
|
|
579
|
-
*
|
|
580
|
-
* Если true, извлекает вложенное поле 'data' из объекта ответа вместо возврата исходного конверта.
|
|
581
|
-
* По умолчанию true.
|
|
582
|
-
*/
|
|
923
|
+
/** If true, extracts nested data field. @keywords toData extract response data */
|
|
583
924
|
toData?: boolean;
|
|
584
|
-
/**
|
|
585
|
-
* Additional request options (headers, query params, etc.).
|
|
586
|
-
*
|
|
587
|
-
* Дополнительные опции запроса (заголовки, параметры запроса и т.д.).
|
|
588
|
-
*/
|
|
925
|
+
/** Additional request options. @keywords options request headers params */
|
|
589
926
|
options?: ApiOptions;
|
|
590
|
-
/**
|
|
591
|
-
* Custom Api instance to execute the request on. Defaults to global Api singleton instance.
|
|
592
|
-
*
|
|
593
|
-
* Кастомный экземпляр класса Api для выполнения запроса. По умолчанию используется глобальный синглтон Api.
|
|
594
|
-
*/
|
|
927
|
+
/** Custom Api instance. @keywords apiInstance custom api */
|
|
595
928
|
apiInstance?: ApiInstance;
|
|
596
929
|
}
|
|
930
|
+
|
|
931
|
+
/** Execute an API request with loading states. @keywords useApiRequest request api fetch */
|
|
597
932
|
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>): {
|
|
933
|
+
/** Loading state flag. @keywords loading state ref */
|
|
598
934
|
loading: Ref<boolean, boolean>;
|
|
935
|
+
/** Send the API request. @keywords send request api method */
|
|
599
936
|
send(request?: Request): Promise<Return | undefined>;
|
|
600
937
|
};
|
|
938
|
+
|
|
939
|
+
import { Ref } from 'vue';
|
|
940
|
+
|
|
601
941
|
type BroadcastValueItem<T> = T | string | undefined;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Creates a reactive variable to manage data between browser tabs.
|
|
945
|
+
* @keywords broadcast value ref tabs reactive
|
|
946
|
+
* @param name value name
|
|
947
|
+
* @param defaultValue default value
|
|
948
|
+
*/
|
|
602
949
|
export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
|
|
950
|
+
|
|
951
|
+
export {};
|
|
952
|
+
|
|
953
|
+
import { Ref } from 'vue';
|
|
954
|
+
import { CookieOptions } from '@dxtmisha/functional-basic';
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Creates a reactive variable to manage cookies.
|
|
958
|
+
* @keywords cookie, ref, reactive, storage, useCookieRef
|
|
959
|
+
*/
|
|
603
960
|
export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
|
|
961
|
+
|
|
962
|
+
import { FormattersListProp, FormattersOptionsList, FormattersReturn } from '@dxtmisha/functional-basic';
|
|
963
|
+
import { ComputedRef } from 'vue';
|
|
964
|
+
|
|
604
965
|
/**
|
|
605
|
-
*
|
|
606
|
-
* @
|
|
607
|
-
* @param options formatting settings for each property
|
|
966
|
+
* Reactively formats a list of data based on provided formatting options.
|
|
967
|
+
* @keywords useFormattersRef formatters list reactive
|
|
608
968
|
*/
|
|
609
969
|
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
|
|
970
|
+
/** Formatted data list. @keywords list format computed */
|
|
610
971
|
listFormat: ComputedRef<FormattersReturn<List, Options>>;
|
|
972
|
+
/** Count of records in the formatted list. @keywords length count list */
|
|
611
973
|
length: ComputedRef<number>;
|
|
612
974
|
};
|
|
975
|
+
|
|
976
|
+
/** Returns a class object for working with data formatting. @keywords geo intl format ref */
|
|
977
|
+
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
978
|
+
|
|
613
979
|
/**
|
|
614
|
-
* Returns a class object for working with
|
|
615
|
-
*
|
|
616
|
-
* @remarks
|
|
617
|
-
* Avoid using this reactive composable if reactive updates are not required.
|
|
618
|
-
* For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
|
|
980
|
+
* Returns a class object for working with unit formatting and automatic conversions.
|
|
981
|
+
* @keywords useGeoUnitRef, geo, unit, formatting, conversion
|
|
619
982
|
*/
|
|
620
|
-
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
621
983
|
export declare function useGeoUnitRef(): GeoUnitRef;
|
|
984
|
+
|
|
985
|
+
import { ShallowRef } from 'vue';
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Creates a reactive variable to manage the hash.
|
|
989
|
+
* @keywords useHashRef hash reactive variable state url
|
|
990
|
+
* @param name value name
|
|
991
|
+
* @param defaultValue default value
|
|
992
|
+
*/
|
|
622
993
|
export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
994
|
+
|
|
623
995
|
export type LazyItemByMargin = {
|
|
624
996
|
rootMargin: string;
|
|
625
997
|
item: ReturnType<typeof useLazyRef>;
|
|
626
998
|
};
|
|
999
|
+
/**
|
|
1000
|
+
* Hook for tracking element visibility by margin.
|
|
1001
|
+
* @keywords useLazyItemByMarginRef, lazy, observer, margin
|
|
1002
|
+
*/
|
|
627
1003
|
export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
|
|
1004
|
+
/** Lazy item status */
|
|
628
1005
|
lazyItemStatus: ShallowRef<boolean, boolean>;
|
|
1006
|
+
/** Tracked lazy item instance */
|
|
629
1007
|
readonly lazyItem: LazyItem | undefined;
|
|
630
1008
|
};
|
|
1009
|
+
|
|
1010
|
+
import { Ref, ShallowRef } from 'vue';
|
|
1011
|
+
|
|
631
1012
|
export type LazyItem = {
|
|
632
1013
|
status: ShallowRef<boolean>;
|
|
633
1014
|
ratio: ShallowRef<number>;
|
|
634
1015
|
entry: ShallowRef<IntersectionObserverEntry | undefined>;
|
|
635
1016
|
stopWatch: () => void;
|
|
636
1017
|
};
|
|
1018
|
+
|
|
637
1019
|
export type LazyList = Record<string, LazyItem>;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Initializes lazy reference tracking using Intersection Observer.
|
|
1023
|
+
* @keywords useLazyRef, lazy, observer, intersection, ref
|
|
1024
|
+
*/
|
|
638
1025
|
export declare const useLazyRef: (options?: IntersectionObserverInit) => {
|
|
639
1026
|
intersectionObserver: IntersectionObserver | undefined;
|
|
1027
|
+
/**
|
|
1028
|
+
* Gets lazy item by element.
|
|
1029
|
+
* @keywords getItem, lazy, element
|
|
1030
|
+
*/
|
|
640
1031
|
getItem(element?: HTMLElement): LazyItem | undefined;
|
|
1032
|
+
/**
|
|
1033
|
+
* Adds an element for lazy tracking.
|
|
1034
|
+
* @keywords addLazyItem, lazy, track
|
|
1035
|
+
*/
|
|
641
1036
|
addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Removes an element from lazy tracking.
|
|
1039
|
+
* @keywords removeLazyItem, lazy, remove
|
|
1040
|
+
*/
|
|
642
1041
|
removeLazyItem: (element?: HTMLElement) => void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Disconnects lazy observer.
|
|
1044
|
+
* @keywords disconnectLazy, lazy, observer
|
|
1045
|
+
*/
|
|
643
1046
|
disconnectLazy: () => void | undefined;
|
|
644
1047
|
};
|
|
1048
|
+
|
|
1049
|
+
import { ShallowRef } from 'vue';
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Returns the global loading status reference.
|
|
1053
|
+
* @keywords useLoadingRef, loading, status, ref
|
|
1054
|
+
*/
|
|
645
1055
|
export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
|
|
1056
|
+
|
|
1057
|
+
import { MetaRobots, Meta } from '@dxtmisha/functional-basic';
|
|
1058
|
+
import { Ref } from 'vue';
|
|
1059
|
+
|
|
646
1060
|
/**
|
|
647
|
-
* Vue composable for reactive meta tags management
|
|
648
|
-
*
|
|
1061
|
+
* Vue composable for reactive meta tags management.
|
|
1062
|
+
* @keywords use_meta meta tags management seo vue
|
|
649
1063
|
*/
|
|
650
1064
|
export declare const useMeta: () => Readonly<{
|
|
651
1065
|
meta: Meta;
|
|
@@ -657,18 +1071,31 @@ export declare const useMeta: () => Readonly<{
|
|
|
657
1071
|
canonical: Ref<string, string>;
|
|
658
1072
|
robots: Ref<MetaRobots, MetaRobots>;
|
|
659
1073
|
siteName: Ref<string, string>;
|
|
1074
|
+
/** Generates HTML string for all meta tags. @keywords get_html_meta ssr */
|
|
660
1075
|
getHtmlMeta: () => string;
|
|
1076
|
+
/** Synchronizes reactive values with MetaStatic. @keywords sync meta */
|
|
661
1077
|
sync: () => void;
|
|
1078
|
+
/** Updates MetaStatic values with current reactive state. @keywords update meta */
|
|
662
1079
|
update: () => void;
|
|
1080
|
+
/** Updates MetaStatic values in SSR environment. @keywords update ssr */
|
|
663
1081
|
updateSsr: () => void;
|
|
1082
|
+
/** Sets the page title. @keywords set title */
|
|
664
1083
|
setTitle: (value: string) => void;
|
|
1084
|
+
/** Sets the keywords meta tag. @keywords set keywords */
|
|
665
1085
|
setKeywords: (value: string) => void;
|
|
1086
|
+
/** Sets the description meta tag. @keywords set description */
|
|
666
1087
|
setDescription: (value: string) => void;
|
|
1088
|
+
/** Sets the author meta tag. @keywords set author */
|
|
667
1089
|
setAuthor: (value: string) => void;
|
|
1090
|
+
/** Sets the Open Graph / Twitter Card image URL. @keywords set image */
|
|
668
1091
|
setImage: (value: string) => void;
|
|
1092
|
+
/** Sets the canonical URL. @keywords set canonical */
|
|
669
1093
|
setCanonical: (value: string) => void;
|
|
1094
|
+
/** Sets the robots meta tag directive. @keywords set robots */
|
|
670
1095
|
setRobots: (value: MetaRobots) => void;
|
|
1096
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords set site name */
|
|
671
1097
|
setSiteName: (value: string) => void;
|
|
1098
|
+
/** Sets the suffix for the page title. @keywords set suffix */
|
|
672
1099
|
setSuffix: (suffix: string) => void;
|
|
673
1100
|
} & {
|
|
674
1101
|
init(): Readonly<{
|
|
@@ -681,182 +1108,217 @@ export declare const useMeta: () => Readonly<{
|
|
|
681
1108
|
canonical: Ref<string, string>;
|
|
682
1109
|
robots: Ref<MetaRobots, MetaRobots>;
|
|
683
1110
|
siteName: Ref<string, string>;
|
|
1111
|
+
/** Generates HTML string for all meta tags. @keywords get_html_meta ssr */
|
|
684
1112
|
getHtmlMeta: () => string;
|
|
1113
|
+
/** Synchronizes reactive values with MetaStatic. @keywords sync meta */
|
|
685
1114
|
sync: () => void;
|
|
1115
|
+
/** Updates MetaStatic values with current reactive state. @keywords update meta */
|
|
686
1116
|
update: () => void;
|
|
1117
|
+
/** Updates MetaStatic values in SSR environment. @keywords update ssr */
|
|
687
1118
|
updateSsr: () => void;
|
|
1119
|
+
/** Sets the page title. @keywords set title */
|
|
688
1120
|
setTitle: (value: string) => void;
|
|
1121
|
+
/** Sets the keywords meta tag. @keywords set keywords */
|
|
689
1122
|
setKeywords: (value: string) => void;
|
|
1123
|
+
/** Sets the description meta tag. @keywords set description */
|
|
690
1124
|
setDescription: (value: string) => void;
|
|
1125
|
+
/** Sets the author meta tag. @keywords set author */
|
|
691
1126
|
setAuthor: (value: string) => void;
|
|
1127
|
+
/** Sets the Open Graph / Twitter Card image URL. @keywords set image */
|
|
692
1128
|
setImage: (value: string) => void;
|
|
1129
|
+
/** Sets the canonical URL. @keywords set canonical */
|
|
693
1130
|
setCanonical: (value: string) => void;
|
|
1131
|
+
/** Sets the robots meta tag directive. @keywords set robots */
|
|
694
1132
|
setRobots: (value: MetaRobots) => void;
|
|
1133
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords set site name */
|
|
695
1134
|
setSiteName: (value: string) => void;
|
|
1135
|
+
/** Sets the suffix for the page title. @keywords set suffix */
|
|
696
1136
|
setSuffix: (suffix: string) => void;
|
|
697
1137
|
}>;
|
|
1138
|
+
/** Destroys execution context. @keywords destroy execute */
|
|
698
1139
|
destroyExecute?(): void;
|
|
699
1140
|
}>;
|
|
1141
|
+
|
|
1142
|
+
import { ShallowRef } from 'vue';
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Creates a reactive variable to manage URL query parameters.
|
|
1146
|
+
* @keywords query parameter url ref reactive
|
|
1147
|
+
* @param name Parameter name
|
|
1148
|
+
* @param defaultValue Default value
|
|
1149
|
+
*/
|
|
700
1150
|
export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
1151
|
+
|
|
1152
|
+
import { Ref, ComputedRef } from 'vue';
|
|
1153
|
+
import { NumberOrString } from '@dxtmisha/functional-basic';
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Managing a list of links for the router.
|
|
1157
|
+
* @keywords useRouterList router links navigation
|
|
1158
|
+
*/
|
|
701
1159
|
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
|
|
1160
|
+
/** Active router item / Активный элемент роутера */
|
|
702
1161
|
item: ComputedRef<T | undefined>;
|
|
1162
|
+
/** Selected element / Выбранный элемент */
|
|
703
1163
|
selected: Ref<string, string>;
|
|
1164
|
+
/** Label of selected element / Метка выбранного элемента */
|
|
704
1165
|
label: ComputedRef<NumberOrString>;
|
|
1166
|
+
/** List of elements / Список элементов */
|
|
705
1167
|
list: ComputedRef<ConstrBind<T>[]>;
|
|
1168
|
+
/** Navigate by name / Переход по имени */
|
|
706
1169
|
to: (name?: string) => void;
|
|
1170
|
+
/** Transition to the main element / Переход к главному элементу */
|
|
707
1171
|
toMain(): void;
|
|
708
1172
|
};
|
|
1173
|
+
|
|
1174
|
+
import { Ref, ComputedRef } from 'vue';
|
|
1175
|
+
import { SearchColumns, SearchFormatList, SearchItem, SearchOptions } from '@dxtmisha/functional-basic';
|
|
1176
|
+
|
|
709
1177
|
/**
|
|
710
1178
|
* Composable for handling search logic with reactive data.
|
|
711
|
-
* @
|
|
712
|
-
* @param columns columns to search in
|
|
713
|
-
* @param value reactive search string
|
|
714
|
-
* @param options search options
|
|
1179
|
+
* @keywords search ref reactive list columns
|
|
715
1180
|
*/
|
|
716
1181
|
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
|
|
1182
|
+
/** Whether search is currently active. @keywords isSearch active */
|
|
717
1183
|
isSearch: ComputedRef<boolean>;
|
|
1184
|
+
/** Search string reference. @keywords search string */
|
|
718
1185
|
search: Ref<string, string>;
|
|
1186
|
+
/** Search loading status reference. @keywords loading status */
|
|
719
1187
|
loading: Ref<boolean, boolean>;
|
|
1188
|
+
/** Formatted search results list. @keywords list search results */
|
|
720
1189
|
listSearch: ComputedRef<SearchFormatList<T, K>>;
|
|
1190
|
+
/** Length of search results. @keywords length count */
|
|
721
1191
|
length: ComputedRef<number>;
|
|
722
1192
|
};
|
|
1193
|
+
|
|
1194
|
+
import { Ref } from 'vue';
|
|
1195
|
+
import { SearchList, SearchColumns, SearchItem } from '@dxtmisha/functional-basic';
|
|
1196
|
+
|
|
723
1197
|
/**
|
|
724
|
-
*
|
|
725
|
-
* @
|
|
726
|
-
* @param value reactive search string (optional)
|
|
1198
|
+
* Manages search value state and handling delays.
|
|
1199
|
+
* @keywords useSearchValueRef, search, delay, debounce, loading
|
|
727
1200
|
*/
|
|
728
1201
|
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
|
|
1202
|
+
/** Current search value */
|
|
729
1203
|
search: Ref<string, string>;
|
|
1204
|
+
/** Search value with applied delay */
|
|
730
1205
|
searchDelay: Ref<string, string>;
|
|
1206
|
+
/** Loading status during delay */
|
|
731
1207
|
loading: Ref<boolean, boolean>;
|
|
732
1208
|
};
|
|
1209
|
+
|
|
1210
|
+
import { Ref } from 'vue';
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Creates a reactive variable for session storage.
|
|
1214
|
+
* @keywords session ref storage reactive
|
|
1215
|
+
*/
|
|
733
1216
|
export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
|
|
1217
|
+
|
|
1218
|
+
import { Ref } from 'vue';
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Creates a reactive reference to manage browser local storage.
|
|
1222
|
+
* @keywords storage, local, reactive, ref
|
|
1223
|
+
*/
|
|
734
1224
|
export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
|
|
1225
|
+
|
|
735
1226
|
import { ShallowRef } from 'vue';
|
|
736
1227
|
import { TranslateInstance, TranslateList } from '@dxtmisha/functional-basic';
|
|
1228
|
+
|
|
737
1229
|
/**
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
* It returns a `ShallowRef` that automatically updates when the global language changes.
|
|
741
|
-
* Use `as const` for arrays to ensure proper TypeScript key inference.
|
|
742
|
-
*
|
|
743
|
-
* ### Examples
|
|
744
|
-
* ```typescript
|
|
745
|
-
* // 1. Using the main composable
|
|
746
|
-
* const translations = useTranslateRef(['home.title', 'home.description'] as const);
|
|
747
|
-
*
|
|
748
|
-
* // 2. Using the shorthand 't'
|
|
749
|
-
* const labels = t(['button.save', 'button.cancel'] as const);
|
|
750
|
-
* ```
|
|
751
|
-
*
|
|
752
|
-
* @param names a string or an array with keys
|
|
753
|
-
* @param translateInstance a translate instance
|
|
1230
|
+
* Gets translated text by key or array of keys.
|
|
1231
|
+
* @keywords translate ref localization i18n
|
|
754
1232
|
*/
|
|
755
1233
|
export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
|
|
1234
|
+
|
|
756
1235
|
/**
|
|
757
|
-
* Shorthand for useTranslateRef.
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
* @param names a string or an array with keys
|
|
1236
|
+
* Shorthand alias for useTranslateRef.
|
|
1237
|
+
* @keywords translate t localization i18n shorthand
|
|
761
1238
|
*/
|
|
762
1239
|
export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
|
|
1240
|
+
|
|
1241
|
+
```ts
|
|
1242
|
+
/** Initializes user interface flags. @keywords ui, flags, initialize */
|
|
763
1243
|
export declare const uiMakeFlags: () => void;
|
|
1244
|
+
```
|
|
1245
|
+
|
|
764
1246
|
export * from '@dxtmisha/functional-basic';
|
|
1247
|
+
|
|
765
1248
|
import { ComputedRef, DebuggerOptions } from 'vue';
|
|
1249
|
+
|
|
766
1250
|
/**
|
|
767
|
-
* Creates a computed property that
|
|
768
|
-
* @
|
|
769
|
-
* @param initialState initial value of result
|
|
770
|
-
* @param ignore values to be ignored
|
|
771
|
-
* @param debugOptions Used for debugging reactive computations. Supported by Vue.js library
|
|
1251
|
+
* Creates a computed property that handles asynchronous getters.
|
|
1252
|
+
* @keywords computed async reactive vue
|
|
772
1253
|
*/
|
|
773
1254
|
export declare function computedAsync<R>(getter: (() => Promise<R>) | (() => R) | R, initialState?: (() => R) | R, ignore?: R, debugOptions?: DebuggerOptions): ComputedRef<R | undefined>;
|
|
774
|
-
|
|
1255
|
+
|
|
1256
|
+
import { ComputedGetter, ComputedRef, DebuggerOptions } from 'vue';
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Creates a language-dependent computed reactive property.
|
|
1260
|
+
* @keywords computed language reactive getter
|
|
1261
|
+
*/
|
|
1262
|
+
export declare function computedByLanguage<T, R extends (T | undefined) = T | undefined>(getter: ComputedGetter<R>, getterNone?: R | (() => R), conditions?: () => boolean, debugOptions?: DebuggerOptions): ComputedRef<R>;
|
|
1263
|
+
|
|
1264
|
+
/** Computes eternity property on demand with caching @keywords computed eternity cache async */
|
|
1265
|
+
export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
|
|
1266
|
+
|
|
1267
|
+
import { Plugin } from 'vue';
|
|
1268
|
+
import { InputSocialIcons } from '@dxtmisha/media';
|
|
1269
|
+
import { ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig } from '@dxtmisha/functional-basic';
|
|
1270
|
+
import { Router } from 'vue-router';
|
|
1271
|
+
|
|
1272
|
+
export interface FunctionalPluginOptions {
|
|
1273
|
+
api?: ApiConfig;
|
|
1274
|
+
translate?: TranslateConfig;
|
|
1275
|
+
location?: string | (() => string);
|
|
1276
|
+
metaSuffix?: string;
|
|
1277
|
+
icons?: IconsConfig;
|
|
1278
|
+
iconsSocial?: InputSocialIcons;
|
|
1279
|
+
router?: Router;
|
|
1280
|
+
errorCauses?: ErrorCenterCauseList;
|
|
1281
|
+
errorHandlers?: ErrorCenterHandlerList;
|
|
1282
|
+
errorCallbacks?: ErrorCenterHandlerCallback[];
|
|
1283
|
+
}
|
|
1284
|
+
|
|
775
1285
|
/**
|
|
776
|
-
*
|
|
777
|
-
* @
|
|
778
|
-
* @
|
|
779
|
-
*
|
|
780
|
-
*
|
|
1286
|
+
* Vue plugin for initializing and configuring global functional services.
|
|
1287
|
+
* @keywords plugin, dxtFunctionalPlugin, functional, vue
|
|
1288
|
+
* @example
|
|
1289
|
+
* import { createApp } from 'vue'
|
|
1290
|
+
* import { dxtFunctionalPlugin } from '@dxtmisha/functional'
|
|
1291
|
+
* const app = createApp(App)
|
|
1292
|
+
* app.use(dxtFunctionalPlugin, { api: { url: 'https://api.example.com' } })
|
|
781
1293
|
*/
|
|
1294
|
+
export declare const dxtFunctionalPlugin: Plugin;
|
|
1295
|
+
|
|
1296
|
+
/** Types of initialization for a singleton @keywords execute, use, type */
|
|
782
1297
|
export declare enum ExecuteUseType {
|
|
1298
|
+
/** Global application instance @keywords global, singleton */
|
|
783
1299
|
global = "global",
|
|
1300
|
+
/** Provide/inject shared instance @keywords provide, inject */
|
|
784
1301
|
provide = "provide",
|
|
1302
|
+
/** Local closure instance @keywords local, closure */
|
|
785
1303
|
local = "local"
|
|
786
1304
|
}
|
|
787
|
-
|
|
788
|
-
* The object returned by the factory function
|
|
789
|
-
*/
|
|
1305
|
+
|
|
790
1306
|
export type ExecuteUseReturn<R> = Readonly<R & {
|
|
1307
|
+
/** Returns raw instance @keywords init, raw */
|
|
791
1308
|
init(): Readonly<R>;
|
|
1309
|
+
/** Resets cached instance @keywords destroy, reset */
|
|
792
1310
|
destroyExecute?(): void;
|
|
793
1311
|
}>;
|
|
1312
|
+
|
|
794
1313
|
/**
|
|
795
|
-
* Creates a managed singleton
|
|
796
|
-
*
|
|
797
|
-
* It supports three initialization strategies:
|
|
798
|
-
* - `global`: A single instance for the entire application.
|
|
799
|
-
* - `provide`: Shared via provide/inject in the component tree (standard for Vue 3).
|
|
800
|
-
* - `local`: A single instance within the closure of the returned function.
|
|
801
|
-
*
|
|
802
|
-
* @template R return type of the factory function
|
|
803
|
-
* @template O argument types for the factory function
|
|
804
|
-
* @template RI instance type with management methods
|
|
805
|
-
* @param callback initialization function
|
|
806
|
-
* @param type initialization strategy (defaults to provide)
|
|
807
|
-
* @returns accessor function for the singleton
|
|
808
|
-
*
|
|
809
|
-
* @remarks
|
|
810
|
-
* Use this function in the following cases:
|
|
811
|
-
* - **API Services:** Always wrap API clients to ensure a single connection point and unified state.
|
|
812
|
-
* - **Resource Optimization:** For functions where creating multiple instances is undesirable (e.g., heavy objects, event buses).
|
|
813
|
-
* - **Shared State:** To share reactive state within a component tree using the `provide` strategy.
|
|
814
|
-
* - **External SDKs:** Initializing third-party libraries (analytics, maps, charts) that should be singletons.
|
|
815
|
-
*
|
|
816
|
-
* @example
|
|
817
|
-
* // 1. Global API singleton (useApiGet)
|
|
818
|
-
* export const useUserApi = executeUseGlobal(() => {
|
|
819
|
-
* return useApiGet('/api/user');
|
|
820
|
-
* });
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* // 2. Shared Reactive State
|
|
824
|
-
* export const useFeatureState = executeUseProvide(() => {
|
|
825
|
-
* const items = [];
|
|
826
|
-
* const addItem = (item) => items.push(item);
|
|
827
|
-
* return { items, addItem };
|
|
828
|
-
* });
|
|
829
|
-
*
|
|
830
|
-
* @example
|
|
831
|
-
* // 3. Local Caching
|
|
832
|
-
* export const useHeavyResource = executeUseLocal((config) => {
|
|
833
|
-
* return new HeavyResource(config);
|
|
834
|
-
* });
|
|
835
|
-
*
|
|
836
|
-
* @example
|
|
837
|
-
* // 4. Complex API Service (useApiManagementRef)
|
|
838
|
-
* export const useUserManagement = executeUseGlobal(() => {
|
|
839
|
-
* return useApiManagementRef(
|
|
840
|
-
* { path: '/api/users' }, // GET setup
|
|
841
|
-
* { date: (v) => new Date(v).toLocaleString() }, // Formatters
|
|
842
|
-
* { columns: ['name', 'email'] }, // Search
|
|
843
|
-
* { path: '/api/users' }, // POST (create)
|
|
844
|
-
* { path: (o) => `/api/users/${o.id}` }, // PUT (update)
|
|
845
|
-
* { path: (o) => `/api/users/${o.id}` } // DELETE (remove)
|
|
846
|
-
* );
|
|
847
|
-
* });
|
|
848
|
-
*
|
|
849
|
-
* // Usage in component:
|
|
850
|
-
* // const { list, loading, sendPost, sendDelete } = useUserManagement();
|
|
1314
|
+
* Creates a managed singleton with initialization strategies.
|
|
1315
|
+
* @keywords execute, use, singleton, factory
|
|
851
1316
|
*/
|
|
852
1317
|
export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
|
|
1318
|
+
|
|
853
1319
|
/**
|
|
854
1320
|
* Creates a global singleton.
|
|
855
|
-
*
|
|
856
|
-
* @remarks
|
|
857
|
-
* See {@link executeUse} for more details.
|
|
858
|
-
*
|
|
859
|
-
* @param callback Initialization function
|
|
1321
|
+
* @keywords execute, use, global, singleton
|
|
860
1322
|
*/
|
|
861
1323
|
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
|
|
862
1324
|
init(): Readonly<R>;
|
|
@@ -865,14 +1327,10 @@ export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<
|
|
|
865
1327
|
init(): Readonly<R>;
|
|
866
1328
|
destroyExecute?(): void;
|
|
867
1329
|
}>);
|
|
1330
|
+
|
|
868
1331
|
/**
|
|
869
1332
|
* Creates a component-scoped singleton.
|
|
870
|
-
*
|
|
871
|
-
* @remarks
|
|
872
|
-
* Best for sharing state within a component sub-tree.
|
|
873
|
-
* See {@link executeUse} for more details.
|
|
874
|
-
*
|
|
875
|
-
* @param callback Initialization function
|
|
1333
|
+
* @keywords execute, use, provide, singleton
|
|
876
1334
|
*/
|
|
877
1335
|
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
878
1336
|
init(): Readonly<R>;
|
|
@@ -881,14 +1339,10 @@ export declare function executeUseProvide<R, O extends any[]>(callback: (...args
|
|
|
881
1339
|
init(): Readonly<R>;
|
|
882
1340
|
destroyExecute?(): void;
|
|
883
1341
|
}>);
|
|
1342
|
+
|
|
884
1343
|
/**
|
|
885
1344
|
* Creates a local singleton.
|
|
886
|
-
*
|
|
887
|
-
* @remarks
|
|
888
|
-
* Best for internal state preservation within a closure.
|
|
889
|
-
* See {@link executeUse} for more details.
|
|
890
|
-
*
|
|
891
|
-
* @param callback Initialization function
|
|
1345
|
+
* @keywords execute, use, local, singleton
|
|
892
1346
|
*/
|
|
893
1347
|
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
894
1348
|
init(): Readonly<R>;
|
|
@@ -896,391 +1350,297 @@ export declare function executeUseLocal<R, O extends any[]>(callback: (...args:
|
|
|
896
1350
|
}>) | (() => Readonly<R & {
|
|
897
1351
|
init(): Readonly<R>;
|
|
898
1352
|
destroyExecute?(): void;
|
|
899
|
-
}>);itialization function/ Функция инициализации
|
|
900
|
-
*/
|
|
901
|
-
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
|
|
902
|
-
/**
|
|
903
|
-
* Returns the raw instance without management methods/
|
|
904
|
-
* Возвращает чистый экземпляр без методов управления
|
|
905
|
-
*/
|
|
906
|
-
init(): Readonly<R>;
|
|
907
|
-
/**
|
|
908
|
-
* Resets the cached instance (available for local and global)/
|
|
909
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
910
|
-
*/
|
|
911
|
-
destroyExecute?(): void;
|
|
912
|
-
}>) | (() => Readonly<R & {
|
|
913
|
-
/**
|
|
914
|
-
* Returns the raw instance without management methods/
|
|
915
|
-
* Возвращает чистый экземпляр без методов управления
|
|
916
|
-
*/
|
|
917
|
-
init(): Readonly<R>;
|
|
918
|
-
/**
|
|
919
|
-
* Resets the cached instance (available for local and global)/
|
|
920
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
921
|
-
*/
|
|
922
|
-
destroyExecute?(): void;
|
|
923
1353
|
}>);
|
|
1354
|
+
|
|
924
1355
|
/**
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
* Создает компонентный синглтон.
|
|
928
|
-
*
|
|
929
|
-
* @remarks
|
|
930
|
-
* Best for sharing state within a component sub-tree.
|
|
931
|
-
* See {@link executeUse} for more details.
|
|
932
|
-
*
|
|
933
|
-
* Лучше всего подходит для совместного использования состояния внутри поддерева компонентов.
|
|
934
|
-
* Подробнее см. {@link executeUse}.
|
|
935
|
-
*
|
|
936
|
-
* @param callback Initialization function/ Функция инициализации
|
|
1356
|
+
* Initializes all global callbacks.
|
|
1357
|
+
* @keywords execute, use, global, init
|
|
937
1358
|
*/
|
|
938
|
-
export declare function
|
|
939
|
-
|
|
940
|
-
* Returns the raw instance without management methods/
|
|
941
|
-
* Возвращает чистый экземпляр без методов управления
|
|
942
|
-
*/
|
|
943
|
-
init(): Readonly<R>;
|
|
944
|
-
/**
|
|
945
|
-
* Resets the cached instance (available for local and global)/
|
|
946
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
947
|
-
*/
|
|
948
|
-
destroyExecute?(): void;
|
|
949
|
-
}>) | (() => Readonly<R & {
|
|
950
|
-
/**
|
|
951
|
-
* Returns the raw instance without management methods/
|
|
952
|
-
* Возвращает чистый экземпляр без методов управления
|
|
953
|
-
*/
|
|
954
|
-
init(): Readonly<R>;
|
|
955
|
-
/**
|
|
956
|
-
* Resets the cached instance (available for local and global)/
|
|
957
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
958
|
-
*/
|
|
959
|
-
destroyExecute?(): void;
|
|
960
|
-
}>);
|
|
1359
|
+
export declare function executeUseGlobalInit(): void;
|
|
1360
|
+
|
|
961
1361
|
/**
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
* Создает локальный синглтон.
|
|
965
|
-
*
|
|
966
|
-
* @remarks
|
|
967
|
-
* Best for internal state preservation within a closure.
|
|
968
|
-
* See {@link executeUse} for more details.
|
|
969
|
-
*
|
|
970
|
-
* Лучше всего подходит для сохранения внутреннего состояния внутри замыкания.
|
|
971
|
-
* Подробнее см. {@link executeUse}.
|
|
972
|
-
*
|
|
973
|
-
* @param callback Initialization function/ Функция инициализации
|
|
1362
|
+
* Get injected value by name.
|
|
1363
|
+
* @keywords get_inject dependency injection
|
|
974
1364
|
*/
|
|
975
|
-
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
976
|
-
/**
|
|
977
|
-
* Returns the raw instance without management methods/
|
|
978
|
-
* Возвращает чистый экземпляр без методов управления
|
|
979
|
-
*/
|
|
980
|
-
init(): Readonly<R>;
|
|
981
|
-
/**
|
|
982
|
-
* Resets the cached instance (available for local and global)/
|
|
983
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
984
|
-
*/
|
|
985
|
-
destroyExecute?(): void;
|
|
986
|
-
}>) | (() => Readonly<R & {
|
|
987
|
-
/**
|
|
988
|
-
* Returns the raw instance without management methods/
|
|
989
|
-
* Возвращает чистый экземпляр без методов управления
|
|
990
|
-
*/
|
|
991
|
-
init(): Readonly<R>;
|
|
992
|
-
/**
|
|
993
|
-
* Resets the cached instance (available for local and global)/
|
|
994
|
-
* Сбрасывает закешированный экземпляр (доступно для local и global)
|
|
995
|
-
*/
|
|
996
|
-
destroyExecute?(): void;
|
|
997
|
-
}>);
|
|
998
|
-
export declare function executeUseGlobalInit(): void;
|
|
999
1365
|
export declare function getInject<T>(name: string): T | undefined;
|
|
1366
|
+
|
|
1367
|
+
/** Get request options. @keywords get_options request api */
|
|
1000
1368
|
export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
|
|
1369
|
+
|
|
1001
1370
|
/**
|
|
1002
|
-
* Executes a function if
|
|
1003
|
-
*
|
|
1004
|
-
* @param data reactive reference, plain value, or a function returning them
|
|
1005
|
-
* @returns the resolved and unwrapped value
|
|
1371
|
+
* Executes a function if provided and unwraps the resulting Vue Ref.
|
|
1372
|
+
* @keywords execute, function, ref, unwrap, reactive
|
|
1006
1373
|
*/
|
|
1007
1374
|
export declare function executeFunctionRef<T>(data: RefOrNormalOrFunction<T>): T;
|
|
1375
|
+
|
|
1376
|
+
import { ComputedRef } from 'vue';
|
|
1377
|
+
import { ApiData, ApiErrorItem } from '@dxtmisha/functional-basic';
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Returns the error item for the Api ref.
|
|
1381
|
+
* @keywords api error ref reactive getApiErrorRef
|
|
1382
|
+
*/
|
|
1008
1383
|
export declare function getApiErrorRef<R>(data: RefType<ApiData<R> | undefined>): ComputedRef<ApiErrorItem | undefined>;
|
|
1384
|
+
|
|
1385
|
+
import { ComputedRef } from 'vue';
|
|
1386
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Generates a computed reference for subcomponent bindings.
|
|
1390
|
+
* @keywords get_bind_ref reactive properties computed binding
|
|
1391
|
+
*/
|
|
1009
1392
|
export declare function getBindRef<T, R extends ItemList>(value: RefOrNormal<T | R> | undefined, nameExtra?: RefOrNormal<ItemList> | string, name?: string): ComputedRef<R>;
|
|
1393
|
+
|
|
1394
|
+
/** Returns the value of a reactive ref or the value itself if not reactive. @keywords get ref value unwrap */
|
|
1010
1395
|
export declare function getRef<T>(item: RefOrNormal<T>): T;
|
|
1396
|
+
|
|
1397
|
+
import { VNode } from 'vue';
|
|
1398
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1399
|
+
|
|
1400
|
+
/** Render virtual node with cached properties. @keywords render, vnode, components */
|
|
1011
1401
|
export declare function render<T extends ItemList>(name: string | any, props?: T, children?: RawChildren | RawSlots, index?: string): VNode;
|
|
1402
|
+
|
|
1403
|
+
import { Ref } from 'vue';
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* Changes the value of a reactive reference.
|
|
1407
|
+
* @keywords set ref value update
|
|
1408
|
+
*/
|
|
1012
1409
|
export declare function setRef<T>(item: Ref<T>, value: T): void;
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns a reference or wraps the value in a reference.
|
|
1413
|
+
* @keywords ref toRefItem wrap reactive variable
|
|
1414
|
+
*/
|
|
1013
1415
|
export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Generates component binding properties.
|
|
1419
|
+
* @keywords getBind bind properties component attributes
|
|
1420
|
+
*/
|
|
1014
1421
|
export declare function getBind<T, R extends ItemList>(value: T | R | undefined | null, nameExtra?: ItemList | string, name?: string, except?: boolean): ConstrBind<R>;
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Returns the class name from the provided properties object.
|
|
1425
|
+
* @keywords get class name props
|
|
1426
|
+
*/
|
|
1015
1427
|
export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
|
|
1428
|
+
|
|
1429
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1430
|
+
|
|
1016
1431
|
/**
|
|
1017
|
-
* Returns or generates a
|
|
1018
|
-
*
|
|
1019
|
-
* Возвращает или генерирует новый элемент.
|
|
1020
|
-
* @param name name of the component/ названия компонента
|
|
1021
|
-
* @param props property of the component/ свойство компонента
|
|
1022
|
-
* @param index the name of the key/ названия ключа
|
|
1432
|
+
* Returns or generates a render index string.
|
|
1433
|
+
* @keywords render, index, key, generator
|
|
1023
1434
|
*/
|
|
1024
1435
|
export declare function getIndexForRender<T extends ItemList>(name: string | any, props?: T, index?: string): string | undefined;
|
|
1025
|
-
|
|
1436
|
+
|
|
1026
1437
|
/**
|
|
1027
1438
|
* Merges two objects with properties, taking into account their classes and styles
|
|
1028
|
-
*
|
|
1029
|
-
* Объединяет два объекта со свойствами с учётом классов и стилей в них
|
|
1030
|
-
* @param extra additional property/ дополнительное свойство
|
|
1031
|
-
* @param value input value/ входное значение
|
|
1439
|
+
* @keywords toBind merge objects class style bind
|
|
1032
1440
|
*/
|
|
1033
1441
|
export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* Merges multiple objects with properties, taking into account their classes and styles
|
|
1037
|
-
*
|
|
1038
|
-
* Объединяет несколько объектов со свойствами с учётом классов и стилей в них
|
|
1039
|
-
* @param values list of input values/ список входных значений
|
|
1040
|
-
*/
|
|
1442
|
+
|
|
1443
|
+
/** Merges multiple objects into a single bound object with combined classes and styles. @keywords toBinds merge bind styles classes */
|
|
1041
1444
|
export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
1045
1448
|
export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
1046
|
-
/**
|
|
1047
|
-
* Base type for API management values, either a single value or an array.
|
|
1048
|
-
*
|
|
1049
|
-
* Базовый тип для значений управления API: одиночное значение или массив.
|
|
1050
|
-
*/
|
|
1051
1449
|
export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
1052
|
-
/**
|
|
1053
|
-
* Configuration for the main GET request in API management.
|
|
1054
|
-
*/
|
|
1055
1450
|
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
1056
|
-
/** API endpoint path */
|
|
1057
1451
|
path?: RefOrNormal<string | undefined>;
|
|
1058
|
-
/** Additional request options */
|
|
1059
1452
|
options?: ApiOptions;
|
|
1060
|
-
/** Enable reactive updates when path or options change */
|
|
1061
1453
|
reactivity?: boolean;
|
|
1062
|
-
/** Condition to trigger the request */
|
|
1063
1454
|
conditions?: RefType<boolean>;
|
|
1064
|
-
/** Custom transformation for the fetched data */
|
|
1065
1455
|
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
1066
|
-
/** Function to validate response data contract */
|
|
1067
1456
|
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
1068
|
-
/** Storage of response error contracts */
|
|
1069
1457
|
errorContract?: ApiErrorStorageList;
|
|
1070
|
-
/** Validation function or class constructor for data */
|
|
1071
1458
|
typeData?: ((data: Return) => boolean) | any;
|
|
1072
|
-
/** Whether to clear data when the component is unmounted */
|
|
1073
1459
|
unmounted?: boolean;
|
|
1074
|
-
/** Function to provide skeleton data during loading */
|
|
1075
1460
|
skeleton?: () => Return;
|
|
1076
1461
|
};
|
|
1077
|
-
/**
|
|
1078
|
-
* Configuration for client-side search across API data.
|
|
1079
|
-
*/
|
|
1080
1462
|
export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
|
|
1081
|
-
/** List of columns to search through */
|
|
1082
1463
|
columns: K;
|
|
1083
|
-
/** Reactive search query */
|
|
1084
1464
|
value?: Ref<string>;
|
|
1085
|
-
/** Additional search algorithm options */
|
|
1086
1465
|
options?: SearchOptions;
|
|
1087
1466
|
};
|
|
1088
|
-
/**
|
|
1089
|
-
* Configuration for mutation requests (POST, PUT, DELETE).
|
|
1090
|
-
*/
|
|
1091
1467
|
export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
|
|
1092
|
-
/** Target API endpoint path */
|
|
1093
1468
|
path?: RefOrNormal<string | undefined>;
|
|
1094
|
-
/** Action to perform after a successful request */
|
|
1095
1469
|
action?: (data: Return | undefined) => Promise<void> | void;
|
|
1096
|
-
/** Transformation before sending data */
|
|
1097
1470
|
transformation?: (data: T) => Return;
|
|
1098
|
-
/** Request contract validation function */
|
|
1099
1471
|
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
1100
|
-
/** Response contract validation function */
|
|
1101
1472
|
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
1102
|
-
/** Storage of response error contracts */
|
|
1103
1473
|
errorContract?: ApiErrorStorageList;
|
|
1104
|
-
/** Whether to wrap the payload in a 'data' property */
|
|
1105
1474
|
toData?: boolean;
|
|
1106
|
-
/** Additional mutation request options */
|
|
1107
1475
|
options?: ApiOptions;
|
|
1108
1476
|
};
|
|
1109
|
-
|
|
1110
|
-
import { Undefined } from '@dxtmisha/functional-basic';
|
|
1111
|
-
/** Generic record type for constructor items */
|
|
1477
|
+
|
|
1112
1478
|
export type ConstrItem = Record<string, any>;
|
|
1113
|
-
/** Constructor value wrapper with optional value property */
|
|
1114
1479
|
export type ConstrValue<T = any> = {
|
|
1115
|
-
/** Optional value of type T */
|
|
1116
1480
|
value?: T;
|
|
1117
1481
|
};
|
|
1118
|
-
/** Generic record type for constructor components */
|
|
1119
1482
|
export type ConstrComponent = Record<string, any>;
|
|
1120
|
-
/** Constructor component modification type with reactive or normal values */
|
|
1121
1483
|
export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
|
|
1122
1484
|
[K in keyof P]?: RefOrNormal<P[K]>;
|
|
1123
1485
|
};
|
|
1124
1486
|
export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
|
|
1125
1487
|
elementHtml?: ComputedRef<E | undefined>;
|
|
1126
1488
|
};
|
|
1127
|
-
/** Utility type to convert union types to intersection types */
|
|
1128
1489
|
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
1129
|
-
/** Extract emit item type from constructor item */
|
|
1130
1490
|
export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
1131
|
-
/** Constructor emit type with proper event handler signatures */
|
|
1132
1491
|
export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
1133
1492
|
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
1134
1493
|
}>>;
|
|
1135
|
-
/** Object type for CSS class names with boolean values */
|
|
1136
1494
|
export type ConstrClassObject = Record<string, boolean | undefined>;
|
|
1137
|
-
/** Constructor class type supporting strings, arrays, and objects */
|
|
1138
1495
|
export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
1139
|
-
/** Record type for mapping class names to class definitions */
|
|
1140
1496
|
export type ConstrClassList = Record<string, ConstrClass>;
|
|
1141
|
-
/** Constructor classes with required main class and additional class list */
|
|
1142
1497
|
export type ConstrClasses = {
|
|
1143
1498
|
main: ConstrClass;
|
|
1144
1499
|
} & ConstrClassList;
|
|
1145
|
-
/** Constructor style item type for individual style properties */
|
|
1146
1500
|
export type ConstrStylesItem = string | null;
|
|
1147
|
-
/** Constructor styles type supporting objects and arrays of style definitions */
|
|
1148
1501
|
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
1149
|
-
/** Constructor options
|
|
1502
|
+
/** Constructor options for component configuration @keywords options setup component */
|
|
1150
1503
|
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
1151
|
-
/** Optional components configuration */
|
|
1152
1504
|
components?: COMP;
|
|
1153
|
-
/** Optional component modifications */
|
|
1154
1505
|
compMod?: ConstrComponentMod<P>;
|
|
1155
|
-
/** Optional emit handlers */
|
|
1156
1506
|
emits?: ConstrEmit<EMITS>;
|
|
1157
|
-
/** Optional reactive classes */
|
|
1158
1507
|
classes?: RefType<ConstrClasses>;
|
|
1159
|
-
/** Optional reactive styles */
|
|
1160
1508
|
styles?: RefType<ConstrStyles>;
|
|
1161
1509
|
};
|
|
1162
|
-
/** Constructor setup
|
|
1510
|
+
/** Constructor setup structure for component initialization @keywords setup initialization */
|
|
1163
1511
|
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
1164
|
-
/** Component name */
|
|
1165
1512
|
name: string;
|
|
1166
|
-
/** Reactive element reference */
|
|
1167
1513
|
element: Ref<E | undefined>;
|
|
1168
|
-
/** Reactive classes */
|
|
1169
1514
|
classes: RefType<CLASSES>;
|
|
1170
|
-
/** Reactive styles */
|
|
1171
1515
|
styles: RefType<ConstrStyles>;
|
|
1172
1516
|
} & SETUP;
|
|
1173
|
-
/** Constructor registration configuration */
|
|
1174
1517
|
export type ConstrRegistration = {
|
|
1175
|
-
/** Optional flag for registration */
|
|
1176
1518
|
flag?: boolean;
|
|
1177
|
-
/** Optional translation map */
|
|
1178
1519
|
translate?: Record<string, string>;
|
|
1179
1520
|
};
|
|
1180
|
-
/** Constructor bind type
|
|
1521
|
+
/** Constructor bind type with class and style support @keywords bind attributes */
|
|
1181
1522
|
export type ConstrBind<T> = T & Record<string, any> & {
|
|
1182
|
-
/** Optional key */
|
|
1183
1523
|
key?: string;
|
|
1184
|
-
/** Optional CSS classes */
|
|
1185
1524
|
class?: ConstrClass;
|
|
1186
|
-
/** Optional styles */
|
|
1187
1525
|
style?: ConstrStyles;
|
|
1188
1526
|
};
|
|
1189
|
-
/** Constructor prop item options for Vue prop definitions */
|
|
1190
1527
|
export type ConstrPropItemOptions<T = any> = {
|
|
1191
|
-
/** Vue prop type */
|
|
1192
1528
|
type?: PropType<T>;
|
|
1193
|
-
/** Required flag */
|
|
1194
1529
|
required?: boolean;
|
|
1195
|
-
/** Default value */
|
|
1196
1530
|
default?: any;
|
|
1197
|
-
/** Custom validator function */
|
|
1198
1531
|
validator?(value: any, props: any): boolean;
|
|
1199
1532
|
};
|
|
1200
|
-
/** Constructor prop item type with options or direct PropType */
|
|
1201
1533
|
export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
1202
|
-
/** Constructor props type for component prop definitions */
|
|
1203
1534
|
export type ConstrProps<P = Record<string, any>> = {
|
|
1204
1535
|
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
1205
1536
|
};
|
|
1206
|
-
/**
|
|
1537
|
+
/** Hyperlink props definition @keywords href link properties */
|
|
1207
1538
|
export type ConstrHrefProps = {
|
|
1208
|
-
/** Hyperlink reference */
|
|
1209
1539
|
href?: string;
|
|
1210
1540
|
};
|
|
1211
|
-
|
|
1541
|
+
|
|
1542
|
+
import { NumberOrString, NumberOrStringOrBoolean } from '@dxtmisha/functional-basic';
|
|
1543
|
+
|
|
1544
|
+
/** Type of list item @keywords list, type, item */
|
|
1212
1545
|
export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
|
|
1213
|
-
|
|
1546
|
+
|
|
1547
|
+
/** Basic data structure for list item @keywords list, data, basic */
|
|
1214
1548
|
export type ListDataBasic = {
|
|
1215
|
-
/** Optional display label */
|
|
1216
1549
|
label?: NumberOrString;
|
|
1217
|
-
/** Any value associated with the item */
|
|
1218
1550
|
value?: any;
|
|
1219
|
-
/** Search text for filtering */
|
|
1220
1551
|
search?: string;
|
|
1221
1552
|
};
|
|
1222
|
-
|
|
1553
|
+
|
|
1554
|
+
/** Extended list item with type and index @keywords list, item, extended */
|
|
1223
1555
|
export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
|
|
1224
|
-
/** Parent item identifier */
|
|
1225
1556
|
parent?: string;
|
|
1226
|
-
/** Type of list item */
|
|
1227
1557
|
type: ListType;
|
|
1228
|
-
/** Unique item identifier */
|
|
1229
1558
|
index: string;
|
|
1230
|
-
/** Whether the item is disabled */
|
|
1231
1559
|
disabled?: boolean;
|
|
1232
1560
|
}>;
|
|
1233
|
-
|
|
1561
|
+
|
|
1562
|
+
/** Array of list data items @keywords list, items, array */
|
|
1234
1563
|
export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
|
|
1235
|
-
|
|
1564
|
+
|
|
1565
|
+
/** List or record structure for list data @keywords list, record, structure */
|
|
1236
1566
|
export type ListRecord<Item extends ListDataBasic = ListDataBasic> = Item[] | Record<string, Item>;
|
|
1237
|
-
|
|
1567
|
+
|
|
1568
|
+
/** Extended list item with additional state properties @keywords list, item, full, state */
|
|
1238
1569
|
export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
|
|
1239
|
-
/** Whether the item has focus */
|
|
1240
1570
|
focus: boolean;
|
|
1241
|
-
/** Highlighted text portion */
|
|
1242
1571
|
highlight?: string;
|
|
1243
|
-
/** Whether the item is selected */
|
|
1244
1572
|
selected: boolean;
|
|
1245
|
-
/** Whether the item is disabled */
|
|
1246
1573
|
disabled?: boolean;
|
|
1247
1574
|
};
|
|
1248
|
-
|
|
1575
|
+
|
|
1576
|
+
/** Array of extended list items with state @keywords list, data, full, state */
|
|
1249
1577
|
export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
1250
|
-
|
|
1578
|
+
|
|
1579
|
+
/** Input item for list creation @keywords list, input, item */
|
|
1251
1580
|
export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
1252
|
-
|
|
1581
|
+
|
|
1582
|
+
/** Various input formats for list creation @keywords list, input, formats */
|
|
1253
1583
|
export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
1254
|
-
|
|
1584
|
+
|
|
1585
|
+
/** Single selected item identifier @keywords list, selected, item */
|
|
1255
1586
|
export type ListSelectedItem = NumberOrStringOrBoolean;
|
|
1256
|
-
|
|
1587
|
+
|
|
1588
|
+
/** Single or multiple selected items @keywords list, selected, list */
|
|
1257
1589
|
export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
1258
|
-
|
|
1590
|
+
|
|
1591
|
+
/** Name of selected list item @keywords list, name */
|
|
1259
1592
|
export type ListName = string | number | undefined;
|
|
1260
|
-
|
|
1593
|
+
|
|
1594
|
+
/** Array of list item names @keywords list, names, array */
|
|
1261
1595
|
export type ListNames = ListName[];
|
|
1262
|
-
|
|
1596
|
+
|
|
1597
|
+
import { ComputedRef, Ref, VNode, VNodeArrayChildren } from 'vue';
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Union type for Vue reactive references (computed or ref)
|
|
1601
|
+
* @keywords ref type computed reactive
|
|
1602
|
+
*/
|
|
1263
1603
|
export type RefType<T> = ComputedRef<T> | Ref<T>;
|
|
1264
|
-
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* Union type for Vue reactive references that can be undefined
|
|
1607
|
+
* @keywords ref undefined computed reactive
|
|
1608
|
+
*/
|
|
1265
1609
|
export type RefUndefined<T> = RefType<T | undefined>;
|
|
1266
|
-
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Union type that can be either a Vue reactive reference or a normal value
|
|
1613
|
+
* @keywords ref normal value reactive
|
|
1614
|
+
*/
|
|
1267
1615
|
export type RefOrNormal<T> = RefType<T> | T;
|
|
1268
|
-
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* Union type that can be a Vue reactive reference, normal value, or function returning them
|
|
1619
|
+
* @keywords ref normal function reactive
|
|
1620
|
+
*/
|
|
1269
1621
|
export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
|
|
1270
|
-
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Union type for Vue raw children content
|
|
1625
|
+
* @keywords raw children vnode array
|
|
1626
|
+
*/
|
|
1271
1627
|
export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
1272
|
-
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Type for Vue raw slots with optional stability flag
|
|
1631
|
+
* @keywords raw slots stable vue
|
|
1632
|
+
*/
|
|
1273
1633
|
export type RawSlots = {
|
|
1274
|
-
/** Slot name mapping to unknown content */
|
|
1275
1634
|
[name: string]: unknown;
|
|
1276
|
-
/** Optional stability flag for performance optimization */
|
|
1277
1635
|
$stable?: boolean;
|
|
1278
1636
|
};
|
|
1279
|
-
|
|
1637
|
+
|
|
1638
|
+
import { SearchColumns, SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
|
|
1639
|
+
/** Search list value reference @keywords search list value ref */
|
|
1280
1640
|
export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
|
|
1281
|
-
/** Search list input */
|
|
1641
|
+
/** Search list input configuration @keywords search list input */
|
|
1282
1642
|
export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
|
|
1283
|
-
/** Search columns ref */
|
|
1643
|
+
/** Search columns reference @keywords search columns ref */
|
|
1284
1644
|
export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
|
|
1285
|
-
/** Search columns input */
|
|
1645
|
+
/** Search columns input configuration @keywords search columns input */
|
|
1286
1646
|
export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
|