@dxtmisha/functional 1.15.14 → 1.15.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-types.md +1334 -1
- package/package.json +1 -1
package/ai-types.md
CHANGED
|
@@ -1,2 +1,1335 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional (v1.15.
|
|
1
|
+
All these methods are in the @dxtmisha/functional (v1.15.15) library.
|
|
2
2
|
|
|
3
|
+
/** Base abstract class for component design constructors. @keywords design abstract constructor */
|
|
4
|
+
export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
|
|
5
|
+
/** Initializes the design instance with properties, change callback, and watched keys. @keywords constructor init */
|
|
6
|
+
constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
|
|
7
|
+
/** Triggers updates and executes the callback function. @param compelled Forces data to update @keywords make update */
|
|
8
|
+
make(compelled?: boolean): this;
|
|
9
|
+
/** Executes the change callback function. @param compelled Forces data update execution @keywords callback invoke */
|
|
10
|
+
makeCallback(compelled?: boolean): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Base abstract class for working with asynchronous constructors. @keywords design, async, abstract, constructor */
|
|
14
|
+
export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
|
|
15
|
+
/** Triggers the async update process. @param compelled Forces data update. @keywords make, async, update */
|
|
16
|
+
make(compelled?: boolean): this;
|
|
17
|
+
/** Executes the asynchronous callback to update data. @param compelled Forces data update. @keywords make callback, async, promise */
|
|
18
|
+
makeCallback(compelled?: boolean): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Tracks and checks edited or modified values in a dataset. @keywords change detection, dirty check, watch, state tracker */
|
|
22
|
+
export declare class DesignChanged<T extends Record<string, any>> {
|
|
23
|
+
/** Initializes change tracker with base properties and optional watched keys. @keywords constructor, init */
|
|
24
|
+
constructor(props: T, watch?: string[]);
|
|
25
|
+
/** Checks if a specific property or list of properties has been modified. @keywords is modified, changed property, check */
|
|
26
|
+
is(name: string | string[]): boolean;
|
|
27
|
+
/** Checks if any tracked data has changed. @keywords is changed, dirty check, modified */
|
|
28
|
+
isChanged(): boolean;
|
|
29
|
+
/** Updates internal snapshot to current values, resetting change status. @keywords update, sync, reset snapshot */
|
|
30
|
+
update(): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Helper class extending DesignComponents for managing and rendering subcomponents. @keywords design components subcomponents render */
|
|
34
|
+
export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
import { type VNode } from 'vue';
|
|
38
|
+
/** Manages connected components, prop modifications, and dynamic rendering. @keywords design components, component registry, dynamic renderer */
|
|
39
|
+
export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
|
|
40
|
+
/** Initializes component registry and modification definitions. @keywords constructor, init components */
|
|
41
|
+
constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
|
|
42
|
+
/** Checks whether a component exists in the registry. @keywords check component, has component, component exists */
|
|
43
|
+
is<K extends keyof COMP>(name: K): name is K;
|
|
44
|
+
/** Retrieves a component definition by name. @keywords get component, component lookup */
|
|
45
|
+
get<K extends keyof COMP>(name: K): COMP[K];
|
|
46
|
+
/** Returns modified input properties for connected components. @keywords component modification, props override */
|
|
47
|
+
getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
|
|
48
|
+
/** Renders a component by name and returns an array containing the VNode. @keywords render component, vnode array */
|
|
49
|
+
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[];
|
|
50
|
+
/** Renders a single component VNode by name. @keywords render single component, render vnode */
|
|
51
|
+
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;
|
|
52
|
+
/** Renders a component and appends the resulting VNode to the target array. @keywords render add, append vnode */
|
|
53
|
+
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;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
import { type ComputedRef, type ToRefs, type VNode } from 'vue';
|
|
57
|
+
/** Abstract base constructor for collecting and managing functional design components. @keywords design constructor, abstract component */
|
|
58
|
+
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> {
|
|
59
|
+
/** Gets the component class name. @keywords component name, class name */
|
|
60
|
+
getName(): string;
|
|
61
|
+
/** Gets the design name. @keywords design name */
|
|
62
|
+
getDesign(): string;
|
|
63
|
+
/** Gets the sub-element class name by hierarchical level. @keywords sub class, class name */
|
|
64
|
+
getSubClass(name: string | string[]): string;
|
|
65
|
+
/** Gets the status modifier class name. @keywords status class, state */
|
|
66
|
+
getStatusClass(name: string | string[]): string;
|
|
67
|
+
/** Gets the style property name. @keywords style property */
|
|
68
|
+
getStyle(name: string | string[]): string;
|
|
69
|
+
/** Gets additional component attributes. @keywords attributes, attrs */
|
|
70
|
+
getAttrs(): ConstrItem;
|
|
71
|
+
/** Gets key and class attributes for a sub-element. @keywords key class, sub element */
|
|
72
|
+
getKeyClass<K extends keyof CLASSES>(name: K & string): {
|
|
73
|
+
key: K & string;
|
|
74
|
+
class: any;
|
|
75
|
+
};
|
|
76
|
+
/** Exposes public properties and methods to the component instance. @keywords expose, public api */
|
|
77
|
+
expose(): ConstrExpose<E, EXPOSE>;
|
|
78
|
+
/** Render function generator for the setup execution context. @keywords render, setup */
|
|
79
|
+
render(): () => VNode | (VNode | any)[] | undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
83
|
+
import { Datetime, type GeoDate, type GeoFirstDay, type GeoHours, type NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
84
|
+
|
|
85
|
+
/** Reactive wrapper for date operations and localization. @keywords datetime date time reactive vue */
|
|
86
|
+
export declare class DatetimeRef {
|
|
87
|
+
/** Initializes a new DatetimeRef instance. @keywords constructor datetime init */
|
|
88
|
+
constructor(date: RefOrNormal<NumberOrStringOrDate>, type?: RefOrNormal<GeoDate>, code?: RefOrNormal<string>);
|
|
89
|
+
/** Returns the raw reactive date value. @keywords item value raw */
|
|
90
|
+
getItem(): Ref<NumberOrStringOrDate>;
|
|
91
|
+
/** Returns the reactive Date object. @keywords date object */
|
|
92
|
+
getDate(): Ref<Date>;
|
|
93
|
+
/** Returns the underlying basic Datetime instance. @keywords datetime instance base */
|
|
94
|
+
getDatetime(): Datetime;
|
|
95
|
+
/** Returns the reactive hour format type. @keywords hours format type 12h 24h */
|
|
96
|
+
getHoursType(): ComputedRef<GeoHours>;
|
|
97
|
+
/** Returns the reactive first day of the week code. @keywords first day week code */
|
|
98
|
+
getFirstDayCode(): ComputedRef<GeoFirstDay>;
|
|
99
|
+
/** Returns the reactive year according to local time. @keywords year local */
|
|
100
|
+
getYear(): ComputedRef<number>;
|
|
101
|
+
/** Returns the reactive zero-based month index according to local time. @keywords month index local */
|
|
102
|
+
getMonth(): ComputedRef<number>;
|
|
103
|
+
/** Returns the reactive day of the month according to local time. @keywords day month local */
|
|
104
|
+
getDay(): ComputedRef<number>;
|
|
105
|
+
/** Returns the reactive hour according to local time. @keywords hour local */
|
|
106
|
+
getHour(): ComputedRef<number>;
|
|
107
|
+
/** Returns the reactive minutes according to local time. @keywords minute local */
|
|
108
|
+
getMinute(): ComputedRef<number>;
|
|
109
|
+
/** Returns the reactive seconds according to local time. @keywords second local */
|
|
110
|
+
getSecond(): ComputedRef<number>;
|
|
111
|
+
/** Returns the reactive maximum number of days in the month. @keywords max day month days */
|
|
112
|
+
getMaxDay(): ComputedRef<number>;
|
|
113
|
+
/** Returns localized date/time string based on format and style options. @keywords locale format intl */
|
|
114
|
+
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): ComputedRef<string>;
|
|
115
|
+
/** Returns standard formatted date string with optional time zone. @keywords standard format timezone */
|
|
116
|
+
standard(timeZone?: boolean): ComputedRef<string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Global effect scope container. @keywords effect scope, reactivity, global scope */
|
|
120
|
+
export declare class EffectScopeGlobal {
|
|
121
|
+
/** Runs a callback within the global effect scope. @keywords run, execute, global effect scope */
|
|
122
|
+
static run<T>(fn: () => T): T | undefined;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
import { type ElementOrString, type ElementOrWindow, EventItem, type EventListenerDetail, type EventOptions } from '@dxtmisha/functional-basic';
|
|
126
|
+
|
|
127
|
+
/** Class for managing DOM event listeners with reactive reference targets. @keywords event, listener, ref, dom, reactive */
|
|
128
|
+
export declare class EventRef<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> extends EventItem<E, O, D> {
|
|
129
|
+
/** Creates an instance of EventRef. @keywords constructor, event, ref */
|
|
130
|
+
constructor(elementSelector?: RefOrNormal<ElementOrString<E> | undefined>, elementSelectorControl?: RefOrNormal<ElementOrString<HTMLElement>>, type?: string | string[], listener?: EventListenerDetail<O, D>, options?: EventOptions, detail?: D);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
import { type ComputedRef } from 'vue';
|
|
134
|
+
import { type GeoFlagItem, type GeoFlagNational } from '@dxtmisha/functional-basic';
|
|
135
|
+
|
|
136
|
+
/** Reactive wrapper for managing geo flags and country/language information. @keywords geo, flag, country, language, reactive */
|
|
137
|
+
export declare class GeoFlagRef {
|
|
138
|
+
/** Initializes the reactive geo flag manager with an optional country or language code. @keywords constructor, init */
|
|
139
|
+
constructor(code?: RefOrNormal<string | undefined>);
|
|
140
|
+
/** Retrieves the resolved country code. @keywords country_code, get_code */
|
|
141
|
+
getCode(): string;
|
|
142
|
+
/** Retrieves reactive country and flag metadata. @keywords country, flag_item, metadata */
|
|
143
|
+
get(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
144
|
+
/** Retrieves reactive language and flag metadata. @keywords language, flag_item, metadata */
|
|
145
|
+
getLanguage(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
146
|
+
/** Retrieves a reactive link or URL to the flag asset. @keywords flag_url, flag_link */
|
|
147
|
+
getFlag(code?: RefOrNormal<string>): ComputedRef<string | undefined>;
|
|
148
|
+
/** Retrieves a reactive list of country flag items filtered by codes. @keywords country_list, flag_list */
|
|
149
|
+
getList(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
150
|
+
/** Retrieves a reactive list of language flag items filtered by codes. @keywords language_list, flag_list */
|
|
151
|
+
getListLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
152
|
+
/** Retrieves a reactive list of country flag items in their national language. @keywords national_names, country_national */
|
|
153
|
+
getNational(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
154
|
+
/** Retrieves a reactive list of language flag items in their national language. @keywords national_languages, language_national */
|
|
155
|
+
getNationalLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
import { type ComputedRef } from 'vue';
|
|
159
|
+
import { type GeoDate, type ItemValue, type NumberOrString, type NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
160
|
+
/**
|
|
161
|
+
* Reactive internationalization formatter for numbers, dates, currencies, and units.
|
|
162
|
+
* @remarks Use standard `GeoIntl` if reactivity is not required.
|
|
163
|
+
* @keywords i18n, intl, reactive, localization, format
|
|
164
|
+
*/
|
|
165
|
+
export declare class GeoIntlRef {
|
|
166
|
+
/** Initializes reactive GeoIntl instance with locale code. @keywords constructor, locale */
|
|
167
|
+
constructor(code?: RefOrNormal<string>);
|
|
168
|
+
/** Translates language, region, and script display names reactively. @keywords displayNames, translation, locale */
|
|
169
|
+
display(value?: RefOrNormal<string>, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): ComputedRef<string>;
|
|
170
|
+
/** Returns reactive display name of a language. @keywords language, displayNames, locale */
|
|
171
|
+
languageName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
172
|
+
/** Returns reactive display name of a region or country. @keywords country, region, displayNames, locale */
|
|
173
|
+
countryName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
174
|
+
/** Formats number reactively using locale rules. @keywords numberFormat, format, locale */
|
|
175
|
+
number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
176
|
+
/** Returns decimal point symbol for current locale. @keywords decimal, separator, symbol */
|
|
177
|
+
decimal(): ComputedRef<string>;
|
|
178
|
+
/** Formats currency amount reactively. @keywords currency, money, format */
|
|
179
|
+
currency(value: RefOrNormal<NumberOrString>, currencyOptions?: RefOrNormal<string | Intl.NumberFormatOptions>, numberOnly?: boolean): ComputedRef<string>;
|
|
180
|
+
/** Returns currency symbol or code for specified currency. @keywords currencySymbol, currencyCode */
|
|
181
|
+
currencySymbol(currency: RefOrNormal<string>, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): ComputedRef<string>;
|
|
182
|
+
/** Formats value with measurement unit reactively. @keywords unit, measurement, format */
|
|
183
|
+
unit(value: RefOrNormal<NumberOrString>, unitOptions?: string | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
184
|
+
/** Formats file size in bytes reactively. @keywords fileSize, bytes, format */
|
|
185
|
+
sizeFile(value: RefOrNormal<NumberOrString>, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
186
|
+
/** Formats number as percentage reactively. @keywords percent, percentage, format */
|
|
187
|
+
percent(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
188
|
+
/** Formats number multiplied by 100 as percentage reactively. @keywords percent, percentage, format */
|
|
189
|
+
percentBy100(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
190
|
+
/** Formats string applying locale-sensitive pluralization rules. @param words Format: "one|two|few|many|other|zero" @keywords plural, pluralRules */
|
|
191
|
+
plural(value: RefOrNormal<NumberOrString>, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
192
|
+
/** Formats date and time reactively. @keywords date, dateTime, format */
|
|
193
|
+
date(value: RefOrNormal<NumberOrStringOrDate>, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): ComputedRef<string>;
|
|
194
|
+
/** Formats relative time reactively. @keywords relativeTime, timeAgo, format */
|
|
195
|
+
relative(value: RefOrNormal<NumberOrStringOrDate>, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): ComputedRef<string>;
|
|
196
|
+
/** Formats relative time with fallback limit to standard date format. @keywords relativeLimit, relativeTime, fallback */
|
|
197
|
+
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>;
|
|
198
|
+
/** Formats relative time from a numerical value and unit. @keywords relativeByValue, relativeTime, unit */
|
|
199
|
+
relativeByValue(value: RefOrNormal<NumberOrString>, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): ComputedRef<string>;
|
|
200
|
+
/** Returns month name reactively. @keywords month, monthName */
|
|
201
|
+
month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
|
|
202
|
+
/** Returns list of all localized month names. @keywords months, monthList */
|
|
203
|
+
months(style?: Intl.DateTimeFormatOptions['month']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
204
|
+
/** Returns weekday name reactively. @keywords weekday, dayName */
|
|
205
|
+
weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
|
|
206
|
+
/** Returns list of all localized weekday names. @keywords weekdays, weekdayList */
|
|
207
|
+
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
208
|
+
/** Formats time reactively. @keywords time, timeFormat */
|
|
209
|
+
time(value: RefOrNormal<NumberOrStringOrDate>): ComputedRef<string>;
|
|
210
|
+
/** Sorts array elements taking into account locale collation rules. @keywords sort, collation, localeCompare */
|
|
211
|
+
sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
215
|
+
import { type GeoItemFull } from '@dxtmisha/functional-basic';
|
|
216
|
+
/** Reactive class for geographic and locale data management. @keywords geo, location, country, language, locale */
|
|
217
|
+
export declare class GeoRef {
|
|
218
|
+
/** Returns reactive object with full geographic information. @keywords geo, country, info, ref */
|
|
219
|
+
static get(): Ref<GeoItemFull>;
|
|
220
|
+
/** Returns reactive string with current country code. @keywords country, code, geo */
|
|
221
|
+
static getCountry(): ComputedRef<string>;
|
|
222
|
+
/** Returns reactive string with current language code. @keywords language, code, locale */
|
|
223
|
+
static getLanguage(): ComputedRef<string>;
|
|
224
|
+
/** Returns reactive string with full standard locale format. @keywords standard, locale, format */
|
|
225
|
+
static getStandard(): ComputedRef<string>;
|
|
226
|
+
/** Returns reactive string representing first day of the week. @keywords first day, week, calendar */
|
|
227
|
+
static getFirstDay(): ComputedRef<string>;
|
|
228
|
+
/** Returns reactive string with current location identifier. @keywords location, geo */
|
|
229
|
+
static getLocation(): ComputedRef<string>;
|
|
230
|
+
/** Returns reactive string with current country code from location. @keywords location, country */
|
|
231
|
+
static getLocationCountry(): ComputedRef<string>;
|
|
232
|
+
/** Returns reactive string with current language code from location. @keywords location, language */
|
|
233
|
+
static getLocationLanguage(): ComputedRef<string>;
|
|
234
|
+
/** Updates geographic data by locale or country code. @keywords set, update, locale, geo */
|
|
235
|
+
static set(code: string): void;
|
|
236
|
+
/** Sets default country code value or resolver function. @keywords default, fallback, country */
|
|
237
|
+
static setValueDefault(code?: string | (() => string)): void;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
241
|
+
import { GeoUnit, type NumberOrString } from '@dxtmisha/functional-basic';
|
|
242
|
+
/** Reactive manager for localized unit formatting and automatic conversions. @keywords geo, unit, format, localization, vue, reactive */
|
|
243
|
+
export declare class GeoUnitRef {
|
|
244
|
+
/** Initializes GeoUnitRef with an optional country or locale code. @keywords constructor, locale */
|
|
245
|
+
constructor(code?: RefOrNormal<string>);
|
|
246
|
+
/** Returns the standard location code as a computed reference. @keywords location, locale, computed */
|
|
247
|
+
getLocation(): ComputedRef<string>;
|
|
248
|
+
/** Formats millimeter value, converting to inches if required by locale. @keywords millimeter, mm, length, format */
|
|
249
|
+
millimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
250
|
+
/** Formats centimeter value, converting to inches if required by locale. @keywords centimeter, cm, length, format */
|
|
251
|
+
centimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
252
|
+
/** Formats meter value, converting to feet if required by locale. @keywords meter, length, format */
|
|
253
|
+
meter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
254
|
+
/** Formats kilometer value, converting to miles if required by locale. @keywords kilometer, km, distance, format */
|
|
255
|
+
kilometer(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
256
|
+
/** Formats square meter value, converting to square feet if required by locale. @keywords square meter, area, format */
|
|
257
|
+
squareMeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
258
|
+
/** Formats hectare value, converting to acres if required by locale. @keywords hectare, area, format */
|
|
259
|
+
hectare(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
260
|
+
/** Formats gram value, converting to ounces if required by locale. @keywords gram, weight, mass, format */
|
|
261
|
+
gram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
262
|
+
/** Formats kilogram value, converting to pounds if required by locale. @keywords kilogram, kg, weight, format */
|
|
263
|
+
kilogram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
264
|
+
/** Formats tonne value, converting to short tons if required by locale. @keywords tonne, weight, mass, format */
|
|
265
|
+
tonne(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
266
|
+
/** Formats milliliter value, converting to fluid ounces if required by locale. @keywords milliliter, ml, volume, format */
|
|
267
|
+
milliliter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
268
|
+
/** Formats liter value, converting to gallons if required by locale. @keywords liter, volume, format */
|
|
269
|
+
liter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
270
|
+
/** Formats celsius value, converting to fahrenheit if required by locale. @keywords celsius, temperature, format */
|
|
271
|
+
celsius(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
272
|
+
/** Formats kilometer per hour value, converting to mph if required by locale. @keywords speed, kilometerPerHour, velocity, format */
|
|
273
|
+
kilometerPerHour(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
274
|
+
/** Reactively formats a value for a specified unit according to locale settings. @keywords format, unit, locale */
|
|
275
|
+
format(value: RefOrNormal<NumberOrString>, unit: RefOrNormal<string>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Reactive data list management with search, focus, selection, and navigation. @keywords list, data, reactive, selection, focus */
|
|
279
|
+
export declare class ListDataRef {
|
|
280
|
+
/** Initializes list data manager with reactive configurations. @keywords constructor, init */
|
|
281
|
+
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);
|
|
282
|
+
/** Reactive list formatted for display. @keywords data, items, list */
|
|
283
|
+
readonly data: import("vue").ComputedRef<ListList>;
|
|
284
|
+
/** Simplified reactive list for fast rendering. @keywords lite, fast-load */
|
|
285
|
+
readonly liteData: import("vue").ComputedRef<ListList>;
|
|
286
|
+
/** Detailed reactive records including selection and focus state. @keywords full-data, records */
|
|
287
|
+
readonly fullData: import("vue").ComputedRef<ListDataFull>;
|
|
288
|
+
/** Flat map containing all records including sublists. @keywords map, flat */
|
|
289
|
+
readonly map: import("vue").ComputedRef<ListList>;
|
|
290
|
+
/** Flat list containing item-type entries only. @keywords map-items, entries */
|
|
291
|
+
readonly mapItems: import("vue").ComputedRef<ListList>;
|
|
292
|
+
/** Reactive selectable list items. @keywords items, selectable */
|
|
293
|
+
readonly items: import("vue").ComputedRef<ListList>;
|
|
294
|
+
/** Index of first item matching search highlight criteria. @keywords highlight, search-index */
|
|
295
|
+
readonly highlightFirstItem: import("vue").ComputedRef<number>;
|
|
296
|
+
/** Indicates whether any item is currently selected. @keywords selected, check */
|
|
297
|
+
readonly isSelected: import("vue").ComputedRef<boolean>;
|
|
298
|
+
/** Indicates whether minimum selection threshold is satisfied. @keywords min-selection, limit */
|
|
299
|
+
readonly isSelectedMin: import("vue").ComputedRef<boolean>;
|
|
300
|
+
/** Indicates whether maximum selection threshold is reached. @keywords max-selection, limit */
|
|
301
|
+
readonly isSelectedMax: import("vue").ComputedRef<boolean>;
|
|
302
|
+
/** List of currently selected items across full map. @keywords selected-list */
|
|
303
|
+
readonly selectedList: import("vue").ComputedRef<ListList>;
|
|
304
|
+
/** List of currently selected items within active group. @keywords selected-group */
|
|
305
|
+
readonly selectedListInGroup: import("vue").ComputedRef<ListList>;
|
|
306
|
+
/** List of display labels for selected items. @keywords labels, selected-names */
|
|
307
|
+
readonly selectedNames: import("vue").ComputedRef<ListNames>;
|
|
308
|
+
/** Array of raw values for selected items. @keywords values, selected-values */
|
|
309
|
+
readonly selectedValues: import("vue").ComputedRef<any[]>;
|
|
310
|
+
/** Checks if lite rendering mode is enabled. @keywords lite-check */
|
|
311
|
+
isLite(): boolean;
|
|
312
|
+
/** Checks if any item is focused. @keywords focus-check */
|
|
313
|
+
isFocus(): boolean;
|
|
314
|
+
/** Checks if search highlight matches exist. @keywords highlight-check */
|
|
315
|
+
isHighlight(): boolean;
|
|
316
|
+
/** Checks if search query meets minimum highlight length. @keywords highlight-active */
|
|
317
|
+
isHighlightActive(): boolean;
|
|
318
|
+
/** Total count of records in current view. @keywords length, count */
|
|
319
|
+
getLength(): number;
|
|
320
|
+
/** Total count of all mapped records. @keywords map-length, count */
|
|
321
|
+
getLengthByMap(): number;
|
|
322
|
+
/** Total count of selectable items. @keywords items-length, count */
|
|
323
|
+
getLengthByItems(): number;
|
|
324
|
+
/** Returns identifier of currently focused item. @keywords get-focus */
|
|
325
|
+
getFocus(): ListSelectedItem | undefined;
|
|
326
|
+
/** Returns record of currently focused item. @keywords get-focus-item */
|
|
327
|
+
getFocusItem(): ListDataItem | undefined;
|
|
328
|
+
/** Returns active highlight search string. @keywords get-highlight */
|
|
329
|
+
getHighlight(): string | undefined;
|
|
330
|
+
/** Returns minimum query length required to trigger highlight. @keywords highlight-length */
|
|
331
|
+
getHighlightLengthStart(): number;
|
|
332
|
+
/** Returns list of selected item identifiers. @keywords get-selected */
|
|
333
|
+
getSelected(): ListSelectedList | undefined;
|
|
334
|
+
/** Finds selected identifier offset by given step. @keywords selected-step */
|
|
335
|
+
getSelectedByStep(step: number): ListSelectedItem | undefined;
|
|
336
|
+
/** Finds next selected identifier. @keywords selected-next */
|
|
337
|
+
getSelectedNext(): ListSelectedItem | undefined;
|
|
338
|
+
/** Finds previous selected identifier. @keywords selected-prev */
|
|
339
|
+
getSelectedPrev(): ListSelectedItem | undefined;
|
|
340
|
+
/** Finds item offset by step count relative to given item. @keywords item-step */
|
|
341
|
+
getItemByStep(item: ListDataItem, step: number): ListDataItem | undefined;
|
|
342
|
+
/** Finds next sequential item from given item. @keywords item-next */
|
|
343
|
+
getItemNext(item: ListDataItem): ListDataItem | undefined;
|
|
344
|
+
/** Finds previous sequential item from given item. @keywords item-prev */
|
|
345
|
+
getItemPrev(item: ListDataItem): ListDataItem | undefined;
|
|
346
|
+
/** Finds item offset by step count relative to given index. @keywords index-step */
|
|
347
|
+
getIndexByStep(index: string, step: number): ListDataItem | undefined;
|
|
348
|
+
/** Finds next sequential item after given index. @keywords index-next */
|
|
349
|
+
getIndexNext(index: string): ListDataItem | undefined;
|
|
350
|
+
/** Finds previous sequential item before given index. @keywords index-prev */
|
|
351
|
+
getIndexPrev(index: string): ListDataItem | undefined;
|
|
352
|
+
/** Retrieves item record and key by index identifier. @keywords item-by-index */
|
|
353
|
+
getItemByIndex(index?: string): {
|
|
354
|
+
key: number;
|
|
355
|
+
item: ListDataItem;
|
|
356
|
+
} | undefined;
|
|
357
|
+
/** Retrieves item record by numeric key. @keywords item-by-key */
|
|
358
|
+
getItemByKey(key: number): ListDataItem | undefined;
|
|
359
|
+
/** Retrieves first child item under specified parent. @keywords first-child, parent */
|
|
360
|
+
getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
361
|
+
/** Retrieves last child item under specified parent. @keywords last-child, parent */
|
|
362
|
+
getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
363
|
+
/** Creates sublist manager for group item. @keywords sublist, group */
|
|
364
|
+
getSubList(item: ListDataItem): ListDataRef;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
import type { RouteLocationRaw, Router } from 'vue-router';
|
|
368
|
+
/** Router management and navigation utility. @keywords router, navigation, vue-router */
|
|
369
|
+
export declare class RouterItemRef {
|
|
370
|
+
/** Retrieves the active router instance. @keywords router instance, get router */
|
|
371
|
+
static get(): import("vue-router")._RouterClassic;
|
|
372
|
+
/** Resolves and returns a URL link path by route name. @keywords get link, route url, resolve route */
|
|
373
|
+
static getLink(name: string, params?: any, query?: any): string | undefined;
|
|
374
|
+
/** Resolves href properties for a route by name. @keywords get href, link props, route href */
|
|
375
|
+
static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
|
|
376
|
+
/** Navigates to a target route location. @keywords navigate, router push, route change */
|
|
377
|
+
static push(to: string | RouteLocationRaw): void;
|
|
378
|
+
/** Sets the global router instance. @keywords set router, register router */
|
|
379
|
+
static set(router: Router): void;
|
|
380
|
+
/** Sets the router instance only if it has not been set previously. @keywords set router once, init router */
|
|
381
|
+
static setOneTime(router: Router): void;
|
|
382
|
+
/** Converts a raw route location into href properties. @keywords raw to href, route location, href builder */
|
|
383
|
+
static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
387
|
+
|
|
388
|
+
/** Reactive scrollbar width tracker @keywords scrollbar, width, reactive, vue */
|
|
389
|
+
export declare class ScrollbarWidthRef {
|
|
390
|
+
/** Reactive state indicating measurement activity @keywords reactive, state */
|
|
391
|
+
readonly item: Ref<boolean | undefined>;
|
|
392
|
+
/** Reactive scrollbar width in pixels @keywords reactive, width, scrollbar */
|
|
393
|
+
readonly width: Ref<number>;
|
|
394
|
+
/** Initializes the reactive scrollbar width tracker @keywords constructor, init */
|
|
395
|
+
constructor();
|
|
396
|
+
/** Computed flag indicating if scrollbar width is measured and defined @keywords computed, check */
|
|
397
|
+
readonly is: ComputedRef<boolean>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
import { type ApiInstance, type ApiData, type ApiDataValidation, type ApiErrorStorageList } from '@dxtmisha/functional-basic';
|
|
401
|
+
/**
|
|
402
|
+
* Asynchronous reactive composable for API requests with built-in SSR pre-fetching support.
|
|
403
|
+
* @keywords api, composable, ssr, prefetch, useApiAsyncRef, useApiRef, reactive, fetch
|
|
404
|
+
* @example
|
|
405
|
+
* ```typescript
|
|
406
|
+
* const { data, loading, errorItem } = useApiAsyncRef('/users/1', { method: 'GET' });
|
|
407
|
+
* ```
|
|
408
|
+
* @param path Request path (string, Ref, or Getter)
|
|
409
|
+
* @param options Request options and headers
|
|
410
|
+
* @param reactivity Auto-refetch when reactive dependencies change
|
|
411
|
+
* @param conditions Execution conditions (waits until true)
|
|
412
|
+
* @param transformation Transforms received response data
|
|
413
|
+
* @param validateResponseContract Validates response data contract
|
|
414
|
+
* @param errorContract Predefined expected error contracts
|
|
415
|
+
* @param unmounted Aborts request and clears cache when component unmounts
|
|
416
|
+
* @param apiInstance Custom Api instance
|
|
417
|
+
*/
|
|
418
|
+
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>;
|
|
419
|
+
|
|
420
|
+
import { type ApiData, type ApiFetch } from '@dxtmisha/functional-basic';
|
|
421
|
+
export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
422
|
+
}
|
|
423
|
+
/** Wrapper over `useApiRequest` pre-configured for DELETE HTTP requests. @keywords api, delete, fetch, request, http */
|
|
424
|
+
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
|
|
425
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
426
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
import { type ApiData, type ApiFetch } from '@dxtmisha/functional-basic';
|
|
430
|
+
/** Setup options for API GET request. @keywords api, get, request, setup */
|
|
431
|
+
export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
432
|
+
}
|
|
433
|
+
/** Wrapper over `useApiRequest` pre-configured for GET requests. @keywords api, get, fetch, request, query */
|
|
434
|
+
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
|
|
435
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
436
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
import { type ApiInstance, type ArrayToItem, type FormattersListColumns, type FormattersOptionsList, type SearchColumns } from '@dxtmisha/functional-basic';
|
|
440
|
+
/** Asynchronous reactive composable for API management requests with SSR prefetching. @keywords api, management, ssr, reactive, fetch, composable */
|
|
441
|
+
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): {
|
|
442
|
+
isValid: import("vue").ComputedRef<boolean>;
|
|
443
|
+
isResponseContractValid: import("vue").ComputedRef<boolean>;
|
|
444
|
+
responseValidationResult: import("vue").ComputedRef<import("@dxtmisha/functional-basic").ApiDataValidation | undefined>;
|
|
445
|
+
list: import("vue").ComputedRef<import("@dxtmisha/functional-basic").SearchFormatList<ItemFormatters, Columns>>;
|
|
446
|
+
readonly data: import("vue").ComputedRef<import("@dxtmisha/functional-basic").ApiData<Return> | undefined>;
|
|
447
|
+
errorItem: import("vue").ComputedRef<import("@dxtmisha/functional-basic").ApiErrorItem | undefined>;
|
|
448
|
+
readonly length: import("vue").ComputedRef<number>;
|
|
449
|
+
lengthData: import("vue").ComputedRef<number>;
|
|
450
|
+
starting: import("vue").ComputedRef<boolean>;
|
|
451
|
+
reading: import("vue").Ref<boolean, boolean>;
|
|
452
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
453
|
+
loadingSearch: import("vue").Ref<boolean, boolean> | undefined;
|
|
454
|
+
loadingPost: import("vue").Ref<boolean, boolean> | undefined;
|
|
455
|
+
loadingPut: import("vue").Ref<boolean, boolean> | undefined;
|
|
456
|
+
loadingDelete: import("vue").Ref<boolean, boolean> | undefined;
|
|
457
|
+
isSearch: import("vue").ComputedRef<boolean> | undefined;
|
|
458
|
+
search: import("vue").Ref<string>;
|
|
459
|
+
init: () => void;
|
|
460
|
+
initSsr: () => void;
|
|
461
|
+
reset: () => Promise<void>;
|
|
462
|
+
abort: () => void;
|
|
463
|
+
sendPost: (request?: import("@dxtmisha/functional-basic").ApiFetch["request"]) => Promise<import("@dxtmisha/functional-basic").ApiData<Post> | undefined>;
|
|
464
|
+
sendPut: (request?: import("@dxtmisha/functional-basic").ApiFetch["request"]) => Promise<import("@dxtmisha/functional-basic").ApiData<Put> | undefined>;
|
|
465
|
+
sendDelete: (request?: import("@dxtmisha/functional-basic").ApiFetch["request"]) => Promise<import("@dxtmisha/functional-basic").ApiData<Delete> | undefined>;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
469
|
+
import {
|
|
470
|
+
type ApiData,
|
|
471
|
+
type ApiDataValidation,
|
|
472
|
+
type ApiErrorItem,
|
|
473
|
+
type ApiFetch,
|
|
474
|
+
type ApiInstance,
|
|
475
|
+
type ArrayToItem,
|
|
476
|
+
type FormattersListColumns,
|
|
477
|
+
type FormattersOptionsList,
|
|
478
|
+
type SearchColumns,
|
|
479
|
+
type SearchFormatList
|
|
480
|
+
} from '@dxtmisha/functional-basic';
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Orchestrates API requests, data loading (GET), list formatting, client-side search, and mutations (POST, PUT, DELETE).
|
|
484
|
+
* @note Recommended for use with `executeUse` for centralized state management.
|
|
485
|
+
* @remarks
|
|
486
|
+
* Data formatting guidelines for `formattersOptions`:
|
|
487
|
+
* - Recommended: values (prices, counts), dates, currency, units, statuses.
|
|
488
|
+
* - Not recommended: technical identifiers (ID, UUID, internal codes).
|
|
489
|
+
* @example
|
|
490
|
+
* const products = useApiManagementRef(
|
|
491
|
+
* { path: '/api/v1/products', skeleton: () => Array(5).fill({ id: 0, name: 'Loading...', price: 0 }) },
|
|
492
|
+
* { price: (v) => `${v} USD`, created_at: (v) => new Date(v).toLocaleDateString() },
|
|
493
|
+
* { columns: ['name', 'category'] },
|
|
494
|
+
* { path: '/api/v1/products' },
|
|
495
|
+
* { path: (data) => `/api/v1/products/${data.id}` },
|
|
496
|
+
* { path: (data) => `/api/v1/products/${data.id}` }
|
|
497
|
+
* );
|
|
498
|
+
* @keywords api, management, fetch, mutations, search, formatters, reactive
|
|
499
|
+
*/
|
|
500
|
+
export declare function useApiManagementRef<
|
|
501
|
+
Return extends ApiManagementValue,
|
|
502
|
+
FormattersOptions extends FormattersOptionsList,
|
|
503
|
+
Post extends Record<string, any>,
|
|
504
|
+
Put extends Record<string, any>,
|
|
505
|
+
Delete extends Record<string, any>,
|
|
506
|
+
Type extends ApiManagementValue = Return,
|
|
507
|
+
Item extends ArrayToItem<Return> = ArrayToItem<Return>,
|
|
508
|
+
ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number],
|
|
509
|
+
Columns extends SearchColumns<ItemFormatters> = []
|
|
510
|
+
>(
|
|
511
|
+
propsGet: ApiManagementGet<Return, Type>,
|
|
512
|
+
formattersOptions?: FormattersOptions,
|
|
513
|
+
searchOptions?: ApiManagementSearch<Item, Columns>,
|
|
514
|
+
postRequest?: ApiManagementRequest<Post>,
|
|
515
|
+
putRequest?: ApiManagementRequest<Put>,
|
|
516
|
+
deleteRequest?: ApiManagementRequest<Delete>,
|
|
517
|
+
action?: () => Promise<void> | void,
|
|
518
|
+
apiInstance?: ApiInstance
|
|
519
|
+
): {
|
|
520
|
+
/** Whether data passed type verification check. @keywords valid, validation */
|
|
521
|
+
isValid: ComputedRef<boolean>;
|
|
522
|
+
/** Status of response contract validation. @keywords contract, validation */
|
|
523
|
+
isResponseContractValid: ComputedRef<boolean>;
|
|
524
|
+
/** Result of response schema validation. @keywords response, validation, result */
|
|
525
|
+
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
526
|
+
/** Processed data array with skeleton, formatters, and search applied. @keywords list, formatted, search */
|
|
527
|
+
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
528
|
+
/** Raw reactive response data. @keywords raw data, response */
|
|
529
|
+
readonly data: ComputedRef<ApiData<Return> | undefined>;
|
|
530
|
+
/** Current request error item. @keywords error */
|
|
531
|
+
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
532
|
+
/** Current number of items in filtered list. @keywords length, count */
|
|
533
|
+
readonly length: ComputedRef<number>;
|
|
534
|
+
/** Total number of items in raw data. @keywords total length, raw count */
|
|
535
|
+
lengthData: ComputedRef<number>;
|
|
536
|
+
/** Initial loading flag before data is first fetched. @keywords starting, initial load */
|
|
537
|
+
starting: ComputedRef<boolean>;
|
|
538
|
+
/** Active read operation flag. @keywords reading, fetching */
|
|
539
|
+
reading: Ref<boolean, boolean>;
|
|
540
|
+
/** Loading state for the main GET request. @keywords loading, state */
|
|
541
|
+
loading: Ref<boolean, boolean>;
|
|
542
|
+
/** Loading state during search processing. @keywords search loading */
|
|
543
|
+
loadingSearch: Ref<boolean, boolean> | undefined;
|
|
544
|
+
/** Loading state for POST mutation. @keywords post loading */
|
|
545
|
+
loadingPost: Ref<boolean, boolean> | undefined;
|
|
546
|
+
/** Loading state for PUT mutation. @keywords put loading */
|
|
547
|
+
loadingPut: Ref<boolean, boolean> | undefined;
|
|
548
|
+
/** Loading state for DELETE mutation. @keywords delete loading */
|
|
549
|
+
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
550
|
+
/** Indicates whether search filter is active. @keywords is search, searching */
|
|
551
|
+
isSearch: ComputedRef<boolean> | undefined;
|
|
552
|
+
/** Reactive search query string proxy. @keywords search query */
|
|
553
|
+
search: Ref<string>;
|
|
554
|
+
/** Manually initializes API request. @keywords init, manual init */
|
|
555
|
+
init: () => void;
|
|
556
|
+
/** Initializes API request for SSR. @keywords ssr init */
|
|
557
|
+
initSsr: () => void;
|
|
558
|
+
/** Resets GET request and clears state. @keywords reset, reload */
|
|
559
|
+
reset: () => Promise<void>;
|
|
560
|
+
/** Aborts active network request. @keywords abort, cancel */
|
|
561
|
+
abort: () => void;
|
|
562
|
+
/** Executes POST mutation request. @keywords send post, create */
|
|
563
|
+
sendPost: (request?: ApiFetch['request']) => Promise<ApiData<Post> | undefined>;
|
|
564
|
+
/** Executes PUT mutation request. @keywords send put, update */
|
|
565
|
+
sendPut: (request?: ApiFetch['request']) => Promise<ApiData<Put> | undefined>;
|
|
566
|
+
/** Executes DELETE mutation request. @keywords send delete, remove */
|
|
567
|
+
sendDelete: (request?: ApiFetch['request']) => Promise<ApiData<Delete> | undefined>;
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
import { type ApiData, type ApiFetch } from '@dxtmisha/functional-basic';
|
|
571
|
+
export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
572
|
+
}
|
|
573
|
+
/** Composable wrapper over useApiRequest pre-configured for HTTP POST requests. @keywords api, post, http, fetch, request */
|
|
574
|
+
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
|
|
575
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
576
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
import { type ApiData, type ApiFetch } from '@dxtmisha/functional-basic';
|
|
580
|
+
|
|
581
|
+
export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
|
|
582
|
+
|
|
583
|
+
/** Setup and execute API PUT request with reactive loading state. @keywords api, put, request, fetch, http, vue */
|
|
584
|
+
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
|
|
585
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
586
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
590
|
+
import { type ApiInstance, type ApiData, type ApiDataValidation, type ApiErrorStorageList, ApiErrorItem, type ApiOptions, type RefOrNormal, type RefType } from '@dxtmisha/functional-basic';
|
|
591
|
+
|
|
592
|
+
export interface UseApiRef<R> {
|
|
593
|
+
data: ComputedRef<ApiData<R> | undefined>;
|
|
594
|
+
item: Ref<ApiData<R> | undefined>;
|
|
595
|
+
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
596
|
+
isResponseContractValid: ComputedRef<boolean>;
|
|
597
|
+
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
598
|
+
length: ComputedRef<number>;
|
|
599
|
+
starting: ComputedRef<boolean>;
|
|
600
|
+
loading: Ref<boolean>;
|
|
601
|
+
reading: Ref<boolean>;
|
|
602
|
+
/** Checks if the request is starting @keywords starting, status */
|
|
603
|
+
isStarting(): boolean;
|
|
604
|
+
/** Checks if the request is currently loading @keywords loading, status */
|
|
605
|
+
isLoading(): boolean;
|
|
606
|
+
/** Checks if the request is currently reading @keywords reading, status */
|
|
607
|
+
isReading(): boolean;
|
|
608
|
+
/** Gets current item data @keywords data, get */
|
|
609
|
+
getItem(): ApiData<R> | undefined;
|
|
610
|
+
/** Performs manual request initialization @keywords init, start */
|
|
611
|
+
init(): void;
|
|
612
|
+
/** Performs SSR request initialization @keywords ssr, init */
|
|
613
|
+
initSsr(): void;
|
|
614
|
+
/** Resets request state and data @keywords reset */
|
|
615
|
+
reset(): Promise<void>;
|
|
616
|
+
/** Stops the active request @keywords stop */
|
|
617
|
+
stop(): void;
|
|
618
|
+
/** Aborts the active request @keywords abort, cancel */
|
|
619
|
+
abort(): void;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Main reactive composable for working with API requests in Vue, handling reactivity, SSR, caching, validation, and error management.
|
|
624
|
+
* @keywords api, fetch, request, composable, vue, query
|
|
625
|
+
* @example
|
|
626
|
+
* ```typescript
|
|
627
|
+
* const { data, loading, errorItem } = useApiRef('/users/1', { method: 'GET' });
|
|
628
|
+
* ```
|
|
629
|
+
* @param path Request endpoint path, Ref, or getter
|
|
630
|
+
* @param options Request options (headers, method, body, etc.)
|
|
631
|
+
* @param reactivity Automatically re-fetch when reactive dependencies change
|
|
632
|
+
* @param conditions Execution conditions (request waits until evaluated to true)
|
|
633
|
+
* @param transformation Transforms received response data
|
|
634
|
+
* @param validateResponseContract Validates response data contract
|
|
635
|
+
* @param errorContract Predefined error contracts for error handling
|
|
636
|
+
* @param unmounted Stops request and clears cached data when component unmounts
|
|
637
|
+
* @param apiInstance Custom Api instance
|
|
638
|
+
*/
|
|
639
|
+
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>;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Defines global conditions for executing API requests.
|
|
643
|
+
* @keywords api, global, conditions
|
|
644
|
+
* @param conditions Conditions evaluated before request execution
|
|
645
|
+
*/
|
|
646
|
+
export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
|
|
647
|
+
|
|
648
|
+
import { type ApiInstance, ApiMethodItem, type ApiData, type ApiFetch, type ApiErrorStorageList, type ApiDataValidation } from '@dxtmisha/functional-basic';
|
|
649
|
+
|
|
650
|
+
/** API request setup configuration options. @keywords api, request, setup, options */
|
|
651
|
+
export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
|
|
652
|
+
/** Endpoint path or reactive ref. */
|
|
653
|
+
path?: RefOrNormal<string | undefined>;
|
|
654
|
+
/** HTTP method. Defaults to POST. */
|
|
655
|
+
method?: ApiMethodItem;
|
|
656
|
+
/** Callback executed upon successful request completion. */
|
|
657
|
+
action?: (data: Return | undefined) => Promise<void> | void;
|
|
658
|
+
/** Transforms raw response data before returning. */
|
|
659
|
+
transformation?: (data: T) => Return;
|
|
660
|
+
/** Validates request payload contract. */
|
|
661
|
+
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
662
|
+
/** Validates response data contract. */
|
|
663
|
+
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
664
|
+
/** Expected error contracts list for centralized handling. */
|
|
665
|
+
errorContract?: ApiErrorStorageList;
|
|
666
|
+
/** Extracts nested 'data' field from response envelope. Defaults to true. */
|
|
667
|
+
toData?: boolean;
|
|
668
|
+
/** Additional request options. */
|
|
669
|
+
options?: ApiOptions;
|
|
670
|
+
/** Custom Api instance. Defaults to global singleton. */
|
|
671
|
+
apiInstance?: ApiInstance;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/** Composable for managing and executing API requests with loading state. @keywords api, request, fetch, composable */
|
|
675
|
+
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>): {
|
|
676
|
+
/** Reactive loading state indicator. */
|
|
677
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
678
|
+
/** Executes the API request. @keywords send, execute, call */
|
|
679
|
+
send(request?: Request): Promise<Return | undefined>;
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
import { type Ref } from 'vue';
|
|
683
|
+
|
|
684
|
+
type BroadcastValueItem<T> = T | string | undefined;
|
|
685
|
+
|
|
686
|
+
/** Creates a reactive ref synchronized across browser tabs. @param name Channel/storage key name @param defaultValue Initial value or factory function @keywords broadcast channel sync cross tab reactive state */
|
|
687
|
+
export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
|
|
688
|
+
|
|
689
|
+
import { type Ref } from 'vue';
|
|
690
|
+
import { type CookieOptions } from '@dxtmisha/functional-basic';
|
|
691
|
+
/** Creates a reactive Vue ref synchronized with browser cookies. @param name Cookie name @param defaultValue Initial fallback value or getter function @param options Cookie configuration options @keywords cookie reactive state storage vue ref useCookieRef */
|
|
692
|
+
export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
|
|
693
|
+
|
|
694
|
+
import { type FormattersListProp, type FormattersOptionsList, type FormattersReturn } from '@dxtmisha/functional-basic';
|
|
695
|
+
|
|
696
|
+
/** Reactively formats data lists based on property rules. @keywords format, list, reactive, transform */
|
|
697
|
+
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
|
|
698
|
+
/** Formatted reactive data list. @keywords formatted list */
|
|
699
|
+
listFormat: import("vue").ComputedRef<FormattersReturn<List, Options>>;
|
|
700
|
+
/** Total count of records in the list. @keywords length, count */
|
|
701
|
+
length: import("vue").ComputedRef<number>;
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Returns a reactive instance for working with internationalization and data formatting.
|
|
706
|
+
* @remarks Avoid using this reactive composable if reactive updates are not required; use non-reactive `GeoIntl` instead.
|
|
707
|
+
* @keywords geointl, intl, format, localization, i18n, reactive
|
|
708
|
+
*/
|
|
709
|
+
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
710
|
+
|
|
711
|
+
/** Provides unit formatting and automatic conversion reference. @keywords geo unit conversion format measurement */
|
|
712
|
+
export declare function useGeoUnitRef(): GeoUnitRef;
|
|
713
|
+
|
|
714
|
+
import { type ShallowRef } from 'vue';
|
|
715
|
+
/** Creates a reactive shallow reference synchronized with the URL hash. @keywords hash reactive url state shallowRef */
|
|
716
|
+
export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
717
|
+
|
|
718
|
+
export type LazyItemByMargin = {
|
|
719
|
+
rootMargin: string;
|
|
720
|
+
item: ReturnType<typeof useLazyRef>;
|
|
721
|
+
};
|
|
722
|
+
/** Initializes element visibility tracking based on root margin. @keywords lazy loading, intersection observer, viewport, margin tracking */
|
|
723
|
+
export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
|
|
724
|
+
/** Lazy item visibility status. */
|
|
725
|
+
lazyItemStatus: import("vue").ShallowRef<boolean, boolean>;
|
|
726
|
+
/** Tracked lazy item instance. */
|
|
727
|
+
readonly lazyItem: LazyItem | undefined;
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
import { type Ref, type ShallowRef } from 'vue';
|
|
731
|
+
export type LazyItem = {
|
|
732
|
+
status: ShallowRef<boolean>;
|
|
733
|
+
ratio: ShallowRef<number>;
|
|
734
|
+
entry: ShallowRef<IntersectionObserverEntry | undefined>;
|
|
735
|
+
stopWatch: () => void;
|
|
736
|
+
};
|
|
737
|
+
export type LazyList = Record<string, LazyItem>;
|
|
738
|
+
/** Initializes tracking of element visibility using IntersectionObserver. @keywords intersection observer, lazy loading, visibility tracking, viewport */
|
|
739
|
+
export declare const useLazyRef: (options?: IntersectionObserverInit) => {
|
|
740
|
+
intersectionObserver: IntersectionObserver | undefined;
|
|
741
|
+
/** Retrieves tracked state for an element. @keywords get lazy item, tracking state */
|
|
742
|
+
getItem(element?: HTMLElement): LazyItem | undefined;
|
|
743
|
+
/** Registers an element for visibility tracking and returns its visibility status ref. @keywords add lazy item, observe, viewport visibility */
|
|
744
|
+
addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>;
|
|
745
|
+
/** Removes a specific element from tracking. @keywords remove lazy item, unobserve */
|
|
746
|
+
removeLazyItem: (element?: HTMLElement) => void;
|
|
747
|
+
/** Disconnects the observer and removes all tracked elements. @keywords disconnect, stop observing, clear lazy items */
|
|
748
|
+
disconnectLazy: () => void | undefined;
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
/** Returns a shallow reactive reference for the loading status. @keywords loading state, shallow ref, progress, status */
|
|
752
|
+
export declare function useLoadingRef(): import("vue").ShallowRef<boolean, boolean>;
|
|
753
|
+
|
|
754
|
+
import { Meta, MetaRobots } from '@dxtmisha/functional-basic';
|
|
755
|
+
import { Ref } from 'vue';
|
|
756
|
+
|
|
757
|
+
/** Reactive meta tag management composable with automatic DOM synchronization. @keywords useMeta, meta, seo, head, open graph */
|
|
758
|
+
export declare const useMeta: () => Readonly<{
|
|
759
|
+
meta: Meta;
|
|
760
|
+
title: Ref<string, string>;
|
|
761
|
+
keyword: Ref<string, string>;
|
|
762
|
+
description: Ref<string, string>;
|
|
763
|
+
author: Ref<string, string>;
|
|
764
|
+
image: Ref<string, string>;
|
|
765
|
+
canonical: Ref<string, string>;
|
|
766
|
+
robots: Ref<MetaRobots, MetaRobots>;
|
|
767
|
+
siteName: Ref<string, string>;
|
|
768
|
+
/** Generates HTML string for all meta tags for SSR. @keywords ssr, html, meta */
|
|
769
|
+
getHtmlMeta: () => string;
|
|
770
|
+
/** Synchronizes reactive state with current MetaStatic state. @keywords sync, meta */
|
|
771
|
+
sync: () => void;
|
|
772
|
+
/** Updates MetaStatic values with current reactive state. @keywords update, meta */
|
|
773
|
+
update: () => void;
|
|
774
|
+
/** Updates MetaStatic values in SSR environments. @keywords ssr, update */
|
|
775
|
+
updateSsr: () => void;
|
|
776
|
+
/** Sets the page title. @keywords title, seo */
|
|
777
|
+
setTitle: (value: string) => void;
|
|
778
|
+
/** Sets the keywords meta tag. @keywords keywords, seo */
|
|
779
|
+
setKeywords: (value: string) => void;
|
|
780
|
+
/** Sets the description meta tag. @keywords description, seo */
|
|
781
|
+
setDescription: (value: string) => void;
|
|
782
|
+
/** Sets the author meta tag. @keywords author, meta */
|
|
783
|
+
setAuthor: (value: string) => void;
|
|
784
|
+
/** Sets Open Graph and Twitter Card image URL. @keywords image, og, twitter */
|
|
785
|
+
setImage: (value: string) => void;
|
|
786
|
+
/** Sets the canonical URL. @keywords canonical, url */
|
|
787
|
+
setCanonical: (value: string) => void;
|
|
788
|
+
/** Sets the robots meta tag directive. @keywords robots, indexing */
|
|
789
|
+
setRobots: (value: MetaRobots) => void;
|
|
790
|
+
/** Sets site name for Open Graph and Twitter Card. @keywords siteName, og, twitter */
|
|
791
|
+
setSiteName: (value: string) => void;
|
|
792
|
+
/** Sets suffix for the page title. @keywords suffix, title */
|
|
793
|
+
setSuffix: (suffix: string) => void;
|
|
794
|
+
}> & {
|
|
795
|
+
/** Initializes meta manager instance. @keywords init, meta */
|
|
796
|
+
init(): Readonly<{
|
|
797
|
+
meta: Meta;
|
|
798
|
+
title: Ref<string, string>;
|
|
799
|
+
keyword: Ref<string, string>;
|
|
800
|
+
description: Ref<string, string>;
|
|
801
|
+
author: Ref<string, string>;
|
|
802
|
+
image: Ref<string, string>;
|
|
803
|
+
canonical: Ref<string, string>;
|
|
804
|
+
robots: Ref<MetaRobots, MetaRobots>;
|
|
805
|
+
siteName: Ref<string, string>;
|
|
806
|
+
/** Generates HTML string for all meta tags for SSR. @keywords ssr, html, meta */
|
|
807
|
+
getHtmlMeta: () => string;
|
|
808
|
+
/** Synchronizes reactive state with current MetaStatic state. @keywords sync, meta */
|
|
809
|
+
sync: () => void;
|
|
810
|
+
/** Updates MetaStatic values with current reactive state. @keywords update, meta */
|
|
811
|
+
update: () => void;
|
|
812
|
+
/** Updates MetaStatic values in SSR environments. @keywords ssr, update */
|
|
813
|
+
updateSsr: () => void;
|
|
814
|
+
/** Sets the page title. @keywords title, seo */
|
|
815
|
+
setTitle: (value: string) => void;
|
|
816
|
+
/** Sets the keywords meta tag. @keywords keywords, seo */
|
|
817
|
+
setKeywords: (value: string) => void;
|
|
818
|
+
/** Sets the description meta tag. @keywords description, seo */
|
|
819
|
+
setDescription: (value: string) => void;
|
|
820
|
+
/** Sets the author meta tag. @keywords author, meta */
|
|
821
|
+
setAuthor: (value: string) => void;
|
|
822
|
+
/** Sets Open Graph and Twitter Card image URL. @keywords image, og, twitter */
|
|
823
|
+
setImage: (value: string) => void;
|
|
824
|
+
/** Sets the canonical URL. @keywords canonical, url */
|
|
825
|
+
setCanonical: (value: string) => void;
|
|
826
|
+
/** Sets the robots meta tag directive. @keywords robots, indexing */
|
|
827
|
+
setRobots: (value: MetaRobots) => void;
|
|
828
|
+
/** Sets site name for Open Graph and Twitter Card. @keywords siteName, og, twitter */
|
|
829
|
+
setSiteName: (value: string) => void;
|
|
830
|
+
/** Sets suffix for the page title. @keywords suffix, title */
|
|
831
|
+
setSuffix: (suffix: string) => void;
|
|
832
|
+
}>;
|
|
833
|
+
/** Cleans up meta watchers and listeners. @keywords cleanup, destroy */
|
|
834
|
+
destroyExecute?(): void;
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
import { type ShallowRef } from 'vue';
|
|
838
|
+
|
|
839
|
+
/** Creates a reactive shallow ref synchronized with a URL query parameter. @keywords vue, query, url, search params, reactive ref */
|
|
840
|
+
export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
841
|
+
|
|
842
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
843
|
+
import { type NumberOrString } from '@dxtmisha/functional-basic';
|
|
844
|
+
|
|
845
|
+
/** Manages a list of router navigation links and selection state. @keywords router list navigation route */
|
|
846
|
+
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
|
|
847
|
+
item: ComputedRef<T | undefined>;
|
|
848
|
+
/** Selected item identifier. */
|
|
849
|
+
selected: Ref<string, string>;
|
|
850
|
+
label: ComputedRef<NumberOrString>;
|
|
851
|
+
/** Processed router link elements list. */
|
|
852
|
+
list: ComputedRef<ConstrBind<T>[]>;
|
|
853
|
+
/** Navigates to the target route item by name. @keywords navigate route to */
|
|
854
|
+
to: (name?: string) => void;
|
|
855
|
+
/** Navigates to the main root element. @keywords navigate main home route */
|
|
856
|
+
toMain(): void;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
860
|
+
import { type SearchColumns, type SearchFormatList, type SearchItem, type SearchOptions } from '@dxtmisha/functional-basic';
|
|
861
|
+
/** Composable for managing reactive search logic, match highlights, and loading status. @keywords vue search filter reactive useSearchRef */
|
|
862
|
+
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
|
|
863
|
+
/** Whether search is currently active and meets character threshold. @keywords isSearch active */
|
|
864
|
+
isSearch: ComputedRef<boolean>;
|
|
865
|
+
/** Reactive search query string reference. @keywords search query */
|
|
866
|
+
search: Ref<string, string>;
|
|
867
|
+
/** Search loading status during delayed execution. @keywords loading status */
|
|
868
|
+
loading: Ref<boolean, boolean>;
|
|
869
|
+
/** Formatted list of search results with match highlights. @keywords listSearch results highlight */
|
|
870
|
+
listSearch: ComputedRef<SearchFormatList<T, K>>;
|
|
871
|
+
/** Total count of matching search results. @keywords length count */
|
|
872
|
+
length: ComputedRef<number>;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
import { type Ref } from 'vue';
|
|
876
|
+
import { SearchList, type SearchColumns, type SearchItem } from '@dxtmisha/functional-basic';
|
|
877
|
+
|
|
878
|
+
/** Manages search query state, debounce delay, and loading status. @keywords search, query, debounce, delay, loading, search list */
|
|
879
|
+
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
|
|
880
|
+
/** Current search value */
|
|
881
|
+
search: Ref<string, string>;
|
|
882
|
+
/** Search value with applied debounce delay */
|
|
883
|
+
searchDelay: Ref<string, string>;
|
|
884
|
+
/** Loading state during debounce delay */
|
|
885
|
+
loading: Ref<boolean, boolean>;
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
import { type Ref } from 'vue';
|
|
889
|
+
|
|
890
|
+
/** Creates a reactive ref synchronized with sessionStorage. @keywords session storage, reactive ref, useSessionRef, vue */
|
|
891
|
+
export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
|
|
892
|
+
|
|
893
|
+
import { type Ref } from 'vue';
|
|
894
|
+
/** Creates a reactive ref synchronized with local storage. @keywords storage, localstorage, reactive, ref, state, cache */
|
|
895
|
+
export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
|
|
896
|
+
|
|
897
|
+
import { type ShallowRef } from 'vue';
|
|
898
|
+
import { type TranslateInstance, type TranslateList } from '@dxtmisha/functional-basic';
|
|
899
|
+
/**
|
|
900
|
+
* Returns a reactive ShallowRef of translated texts for given keys, auto-updating on locale change.
|
|
901
|
+
* @example const translations = useTranslateRef(['home.title', 'home.description'] as const);
|
|
902
|
+
* @keywords translate translation i18n vue composable shallowRef reactive
|
|
903
|
+
*/
|
|
904
|
+
export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
|
|
905
|
+
/** Shorthand for `useTranslateRef`. @keywords translate i18n t vue composable */
|
|
906
|
+
export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
|
|
907
|
+
|
|
908
|
+
/** Initializes UI flags configuration. @keywords ui, flags, make flags */
|
|
909
|
+
export declare const uiMakeFlags: () => void;
|
|
910
|
+
|
|
911
|
+
export * from '@dxtmisha/functional-basic';
|
|
912
|
+
|
|
913
|
+
import { type ComputedRef, type DebuggerOptions } from 'vue';
|
|
914
|
+
/** Creates a reactive computed property that supports asynchronous getters, initial states, and ignored values. @keywords computedAsync, async computed, vue reactivity, promise computed */
|
|
915
|
+
export declare function computedAsync<R>(getter: (() => Promise<R>) | (() => R) | R, initialState?: (() => R) | R, ignore?: R, debugOptions?: DebuggerOptions): ComputedRef<R | undefined>;
|
|
916
|
+
|
|
917
|
+
import { type ComputedGetter, type ComputedRef, type DebuggerOptions } from 'vue';
|
|
918
|
+
/** Creates a reactive computed property evaluated based on language and conditions, with fallback support. @keywords computed, i18n, language, localization, reactive, fallback */
|
|
919
|
+
export declare function computedByLanguage<T, R extends (T | undefined) = T | undefined>(getter: ComputedGetter<R>, getterNone?: R | (() => R), conditions?: () => boolean, debugOptions?: DebuggerOptions): ComputedRef<R>;
|
|
920
|
+
|
|
921
|
+
import { type Ref } from 'vue';
|
|
922
|
+
|
|
923
|
+
/** Creates a cached on-demand computed property with a persistent watcher active for the entire application lifecycle. @keywords computed, lazy, cache, persistent, watcher */
|
|
924
|
+
export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
|
|
925
|
+
|
|
926
|
+
import { type Plugin } from 'vue';
|
|
927
|
+
import { type InputSocialIcons } from '@dxtmisha/media';
|
|
928
|
+
import { type ApiConfig, type ErrorCenterCauseList, type ErrorCenterHandlerCallback, type ErrorCenterHandlerList, type IconsConfig, type TranslateConfig } from '@dxtmisha/functional-basic';
|
|
929
|
+
import type { Router } from 'vue-router';
|
|
930
|
+
|
|
931
|
+
/** Options for configuring the functional plugin. @keywords plugin, options, config */
|
|
932
|
+
export interface FunctionalPluginOptions {
|
|
933
|
+
/** Configuration for the API client. */
|
|
934
|
+
api?: ApiConfig;
|
|
935
|
+
/** Configuration for the translation service. */
|
|
936
|
+
translate?: TranslateConfig;
|
|
937
|
+
/** Default geographical location or language code. */
|
|
938
|
+
location?: string | (() => string);
|
|
939
|
+
/** Suffix appended to all page titles. */
|
|
940
|
+
metaSuffix?: string;
|
|
941
|
+
/** Configuration for the icon management service. */
|
|
942
|
+
icons?: IconsConfig;
|
|
943
|
+
/** Configuration for the social icons service. */
|
|
944
|
+
iconsSocial?: InputSocialIcons;
|
|
945
|
+
/** Vue Router instance for navigation state management. */
|
|
946
|
+
router?: Router;
|
|
947
|
+
/** Error causes list for error center. */
|
|
948
|
+
errorCauses?: ErrorCenterCauseList;
|
|
949
|
+
/** Error handlers list for error center. */
|
|
950
|
+
errorHandlers?: ErrorCenterHandlerList;
|
|
951
|
+
/** Global error callback functions for error center. */
|
|
952
|
+
errorCallbacks?: ErrorCenterHandlerCallback[];
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Vue plugin for initializing and configuring global functional services (API, Translate, Icons, Meta).
|
|
957
|
+
* @keywords vue, plugin, api, translate, icons, meta, error-center
|
|
958
|
+
* @example
|
|
959
|
+
* ```typescript
|
|
960
|
+
* import { createApp } from 'vue';
|
|
961
|
+
* import { dxtFunctionalPlugin } from '@dxtmisha/functional';
|
|
962
|
+
* import router from './router';
|
|
963
|
+
*
|
|
964
|
+
* const app = createApp(App);
|
|
965
|
+
* app.use(dxtFunctionalPlugin, {
|
|
966
|
+
* api: { url: 'https://api.example.com' },
|
|
967
|
+
* metaSuffix: ' | My App',
|
|
968
|
+
* router
|
|
969
|
+
* });
|
|
970
|
+
* ```
|
|
971
|
+
*/
|
|
972
|
+
export declare const dxtFunctionalPlugin: Plugin;
|
|
973
|
+
|
|
974
|
+
export declare enum ExecuteUseType {
|
|
975
|
+
global = "global",
|
|
976
|
+
provide = "provide",
|
|
977
|
+
local = "local"
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
export type ExecuteUseReturn<R> = Readonly<R & {
|
|
981
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
982
|
+
init(): Readonly<R>;
|
|
983
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
984
|
+
destroyExecute?(): void;
|
|
985
|
+
}>;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Creates a managed singleton encapsulating initialization logic and access strategy.
|
|
989
|
+
* @keywords singleton, provide-inject, global-state, factory, cache
|
|
990
|
+
* @remarks
|
|
991
|
+
* Supports three initialization strategies:
|
|
992
|
+
* - `global`: Single instance across the entire application.
|
|
993
|
+
* - `provide`: Shared via provide/inject in the component hierarchy.
|
|
994
|
+
* - `local`: Single instance scoped to the returned function closure.
|
|
995
|
+
* @example
|
|
996
|
+
* const useUserApi = executeUseGlobal(() => useApiGet('/api/user'));
|
|
997
|
+
*/
|
|
998
|
+
export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Creates an application-wide global singleton.
|
|
1002
|
+
* @keywords global, singleton, shared-instance
|
|
1003
|
+
* @remarks See {@link executeUse} for more details.
|
|
1004
|
+
*/
|
|
1005
|
+
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
|
|
1006
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1007
|
+
init(): Readonly<R>;
|
|
1008
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1009
|
+
destroyExecute?(): void;
|
|
1010
|
+
}>) | (() => Readonly<R & {
|
|
1011
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1012
|
+
init(): Readonly<R>;
|
|
1013
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1014
|
+
destroyExecute?(): void;
|
|
1015
|
+
}>);
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Creates a component-tree scoped singleton using provide/inject.
|
|
1019
|
+
* @keywords provide, inject, vue, scoped-state
|
|
1020
|
+
* @remarks Best for sharing state within a component sub-tree. See {@link executeUse}.
|
|
1021
|
+
*/
|
|
1022
|
+
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
1023
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1024
|
+
init(): Readonly<R>;
|
|
1025
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1026
|
+
destroyExecute?(): void;
|
|
1027
|
+
}>) | (() => Readonly<R & {
|
|
1028
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1029
|
+
init(): Readonly<R>;
|
|
1030
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1031
|
+
destroyExecute?(): void;
|
|
1032
|
+
}>);
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Creates a closure-scoped local singleton.
|
|
1036
|
+
* @keywords local, singleton, closure, memoize
|
|
1037
|
+
* @remarks Best for preserving internal state within a closure. See {@link executeUse}.
|
|
1038
|
+
*/
|
|
1039
|
+
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
1040
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1041
|
+
init(): Readonly<R>;
|
|
1042
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1043
|
+
destroyExecute?(): void;
|
|
1044
|
+
}>) | (() => Readonly<R & {
|
|
1045
|
+
/** Returns the raw instance without management methods. @keywords init, unwrap */
|
|
1046
|
+
init(): Readonly<R>;
|
|
1047
|
+
/** Resets the cached instance for local and global strategies. @keywords reset, destroy, cache */
|
|
1048
|
+
destroyExecute?(): void;
|
|
1049
|
+
}>);
|
|
1050
|
+
|
|
1051
|
+
/** Initializes all registered global singleton callbacks. @keywords initialize, bootstrap, global-init */
|
|
1052
|
+
export declare function executeUseGlobalInit(): void;
|
|
1053
|
+
|
|
1054
|
+
/** Retrieves an injected value by its key name. @keywords inject dependency injection di container get */
|
|
1055
|
+
export declare function getInject<T>(name: string): T | undefined;
|
|
1056
|
+
|
|
1057
|
+
import type { ApiFetch } from '@dxtmisha/functional-basic';
|
|
1058
|
+
/** Gets request options for API fetch calls. @keywords request, options, api, fetch */
|
|
1059
|
+
export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
|
|
1060
|
+
|
|
1061
|
+
/** Executes a function or unwraps a Vue ref or raw value to resolve its underlying value. @keywords execute, unwrap, ref, getter, reactive */
|
|
1062
|
+
export declare function executeFunctionRef<T>(data: RefOrNormalOrFunction<T>): T;
|
|
1063
|
+
|
|
1064
|
+
import { type ComputedRef } from 'vue';
|
|
1065
|
+
import { type ApiData, type ApiErrorItem } from '@dxtmisha/functional-basic';
|
|
1066
|
+
|
|
1067
|
+
/** Returns a computed ref containing the API error item. @keywords api, error, ref, computed */
|
|
1068
|
+
export declare function getApiErrorRef<R>(data: RefType<ApiData<R> | undefined>): ComputedRef<ApiErrorItem | undefined>;
|
|
1069
|
+
|
|
1070
|
+
import { type ComputedRef } from 'vue';
|
|
1071
|
+
import type { ItemList } from '@dxtmisha/functional-basic';
|
|
1072
|
+
|
|
1073
|
+
/** Generates reactive bound properties for a subcomponent. @keywords subcomponent, props binding, computed ref */
|
|
1074
|
+
export declare function getBindRef<T, R extends ItemList>(value: RefOrNormal<T | R> | undefined, nameExtra?: RefOrNormal<ItemList> | string, name?: string): ComputedRef<R>;
|
|
1075
|
+
|
|
1076
|
+
/** Unwraps a ref or returns the value directly if not reactive. @keywords unref, ref, reactive, unwrap */
|
|
1077
|
+
export declare function getRef<T>(item: RefOrNormal<T>): T;
|
|
1078
|
+
|
|
1079
|
+
import { type VNode } from 'vue';
|
|
1080
|
+
import type { ItemList } from '@dxtmisha/functional-basic';
|
|
1081
|
+
|
|
1082
|
+
/** Renders and caches immutable VNode component structures. @keywords render, vnode, component, cache */
|
|
1083
|
+
export declare function render<T extends ItemList>(name: string | any, props?: T, children?: RawChildren | RawSlots, index?: string): VNode;
|
|
1084
|
+
|
|
1085
|
+
import { type Ref } from 'vue';
|
|
1086
|
+
|
|
1087
|
+
/** Updates the value of a Vue Ref. @keywords vue ref reactivity set update */
|
|
1088
|
+
export declare function setRef<T>(item: Ref<T>, value: T): void;
|
|
1089
|
+
|
|
1090
|
+
import { type Ref } from 'vue';
|
|
1091
|
+
/** Converts a value or ref into a Vue Ref. @keywords vue, ref, toRef, reactivity */
|
|
1092
|
+
export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
|
|
1093
|
+
|
|
1094
|
+
import { type ItemList } from '@dxtmisha/functional-basic';
|
|
1095
|
+
/** Generates binding properties for a subcomponent. @keywords bind, props, subcomponent, generate */
|
|
1096
|
+
export declare function getBind<T, R extends ItemList>(value: T | R | undefined | null, nameExtra?: ItemList | string, name?: string, except?: boolean): ConstrBind<R>;
|
|
1097
|
+
|
|
1098
|
+
import type { ItemList } from '@dxtmisha/functional-basic';
|
|
1099
|
+
|
|
1100
|
+
/** Returns the class name from component properties. @keywords get class name, props, class extraction */
|
|
1101
|
+
export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
|
|
1102
|
+
|
|
1103
|
+
import { type ItemList } from '@dxtmisha/functional-basic';
|
|
1104
|
+
/** Resolves or generates a unique key index for rendering a component item. @keywords render index, component key, unique key */
|
|
1105
|
+
export declare function getIndexForRender<T extends ItemList>(name: string | any, props?: T, index?: string): string | undefined;
|
|
1106
|
+
|
|
1107
|
+
import type { ItemList } from '@dxtmisha/functional-basic';
|
|
1108
|
+
|
|
1109
|
+
/** Merges two property objects, combining their classes and styles. @keywords merge objects, classes, styles, bind properties */
|
|
1110
|
+
export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
|
|
1111
|
+
|
|
1112
|
+
import type { ItemList } from '@dxtmisha/functional-basic';
|
|
1113
|
+
/** Merges multiple objects with properties, intelligently combining their classes and styles. @keywords merge binds classes styles */
|
|
1114
|
+
export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;
|
|
1115
|
+
|
|
1116
|
+
import type { ApiData, ApiDataValidation, ApiDefaultValue, ApiErrorStorageList, ApiFetch, ApiMethodItem, SearchColumns, SearchItem, SearchOptions } from '@dxtmisha/functional-basic';
|
|
1117
|
+
import type { Ref } from 'vue';
|
|
1118
|
+
export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
1119
|
+
export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
1120
|
+
/** Configuration for GET requests in API management @keywords api, get, fetch, request */
|
|
1121
|
+
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
1122
|
+
/** API endpoint path */
|
|
1123
|
+
path?: RefOrNormal<string | undefined>;
|
|
1124
|
+
/** Additional request options */
|
|
1125
|
+
options?: ApiOptions;
|
|
1126
|
+
/** Enables reactive refetching on path or options change */
|
|
1127
|
+
reactivity?: boolean;
|
|
1128
|
+
/** Condition required to trigger the request */
|
|
1129
|
+
conditions?: RefType<boolean>;
|
|
1130
|
+
/** Custom transformation applied to fetched data */
|
|
1131
|
+
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
1132
|
+
/** Validates the response data contract */
|
|
1133
|
+
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
1134
|
+
/** Storage of response error contracts */
|
|
1135
|
+
errorContract?: ApiErrorStorageList;
|
|
1136
|
+
/** Validation function or constructor type for data */
|
|
1137
|
+
typeData?: ((data: Return) => boolean) | any;
|
|
1138
|
+
/** Clears data on component unmount */
|
|
1139
|
+
unmounted?: boolean;
|
|
1140
|
+
/** Provides skeleton placeholder data during loading */
|
|
1141
|
+
skeleton?: () => Return;
|
|
1142
|
+
};
|
|
1143
|
+
/** Configuration for client-side search across API data @keywords api, search, filter */
|
|
1144
|
+
export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
|
|
1145
|
+
/** Columns to search through */
|
|
1146
|
+
columns: K;
|
|
1147
|
+
/** Reactive search query string */
|
|
1148
|
+
value?: Ref<string>;
|
|
1149
|
+
/** Search algorithm configuration */
|
|
1150
|
+
options?: SearchOptions;
|
|
1151
|
+
};
|
|
1152
|
+
/** Configuration for mutation requests (POST, PUT, DELETE) @keywords api, mutation, request, post, put, delete */
|
|
1153
|
+
export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
|
|
1154
|
+
/** Target API endpoint path */
|
|
1155
|
+
path?: RefOrNormal<string | undefined>;
|
|
1156
|
+
/** Callback executed after successful request */
|
|
1157
|
+
action?: (data: Return | undefined) => Promise<void> | void;
|
|
1158
|
+
/** Transformation applied before sending data */
|
|
1159
|
+
transformation?: (data: T) => Return;
|
|
1160
|
+
/** Request contract validation function */
|
|
1161
|
+
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
1162
|
+
/** Response contract validation function */
|
|
1163
|
+
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
1164
|
+
/** Storage of response error contracts */
|
|
1165
|
+
errorContract?: ApiErrorStorageList;
|
|
1166
|
+
/** Wraps payload into a `data` property */
|
|
1167
|
+
toData?: boolean;
|
|
1168
|
+
/** Additional mutation request options */
|
|
1169
|
+
options?: ApiOptions;
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
import type { Ref, PropType, ComputedRef } from 'vue';
|
|
1173
|
+
import type { Undefined } from '@dxtmisha/functional-basic';
|
|
1174
|
+
|
|
1175
|
+
export type ConstrItem = Record<string, any>;
|
|
1176
|
+
|
|
1177
|
+
export type ConstrValue<T = any> = {
|
|
1178
|
+
value?: T;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
export type ConstrComponent = Record<string, any>;
|
|
1182
|
+
|
|
1183
|
+
/** Constructor component modification type with reactive or normal values. @keywords component, modifier, reactive */
|
|
1184
|
+
export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
|
|
1185
|
+
[K in keyof P]?: RefOrNormal<P[K]>;
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
|
|
1189
|
+
elementHtml?: ComputedRef<E | undefined>;
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
/** Converts union types to intersection types. @keywords union, intersection, utility */
|
|
1193
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
1194
|
+
|
|
1195
|
+
export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
1196
|
+
|
|
1197
|
+
/** Constructor emit type generating strongly-typed event handler signatures. @keywords emit, events, handler */
|
|
1198
|
+
export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
1199
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
1200
|
+
}>>;
|
|
1201
|
+
|
|
1202
|
+
export type ConstrClassObject = Record<string, boolean | undefined>;
|
|
1203
|
+
|
|
1204
|
+
export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
1205
|
+
|
|
1206
|
+
export type ConstrClassList = Record<string, ConstrClass>;
|
|
1207
|
+
|
|
1208
|
+
export type ConstrClasses = {
|
|
1209
|
+
main: ConstrClass;
|
|
1210
|
+
} & ConstrClassList;
|
|
1211
|
+
|
|
1212
|
+
export type ConstrStylesItem = string | null;
|
|
1213
|
+
|
|
1214
|
+
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
1215
|
+
|
|
1216
|
+
/** Constructor options interface for component configuration. @keywords options, configuration */
|
|
1217
|
+
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
1218
|
+
components?: COMP;
|
|
1219
|
+
compMod?: ConstrComponentMod<P>;
|
|
1220
|
+
emits?: ConstrEmit<EMITS>;
|
|
1221
|
+
classes?: RefType<ConstrClasses>;
|
|
1222
|
+
styles?: RefType<ConstrStyles>;
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
/** Constructor setup interface for component initialization. @keywords setup, initialize */
|
|
1226
|
+
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
1227
|
+
name: string;
|
|
1228
|
+
element: Ref<E | undefined>;
|
|
1229
|
+
classes: RefType<CLASSES>;
|
|
1230
|
+
styles: RefType<ConstrStyles>;
|
|
1231
|
+
} & SETUP;
|
|
1232
|
+
|
|
1233
|
+
export type ConstrRegistration = {
|
|
1234
|
+
flag?: boolean;
|
|
1235
|
+
translate?: Record<string, string>;
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
/** Constructor binding type supporting element attributes, classes, and styles. @keywords bind, template, attributes */
|
|
1239
|
+
export type ConstrBind<T = ConstrItem> = T & Record<string, any> & {
|
|
1240
|
+
key?: string;
|
|
1241
|
+
class?: ConstrClass;
|
|
1242
|
+
style?: ConstrStyles;
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
/** Constructor prop item options for Vue prop definitions. @keywords prop, options, vue */
|
|
1246
|
+
export type ConstrPropItemOptions<T = any> = {
|
|
1247
|
+
type?: PropType<T>;
|
|
1248
|
+
required?: boolean;
|
|
1249
|
+
default?: any;
|
|
1250
|
+
/** Validates the provided prop value. @keywords validator, prop */
|
|
1251
|
+
validator?(value: any, props: any): boolean;
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
1255
|
+
|
|
1256
|
+
export type ConstrProps<P = Record<string, any>> = {
|
|
1257
|
+
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
export type ConstrHrefProps = {
|
|
1261
|
+
href?: string;
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1264
|
+
import type { NumberOrString, NumberOrStringOrBoolean } from '@dxtmisha/functional-basic';
|
|
1265
|
+
|
|
1266
|
+
/** Type of list item @keywords list, type, item, space, line, subtitle, html, menu, group */
|
|
1267
|
+
export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
|
|
1268
|
+
|
|
1269
|
+
/** Basic data structure for list item @keywords list, data, basic, record */
|
|
1270
|
+
export type ListDataBasic = {
|
|
1271
|
+
label?: NumberOrString;
|
|
1272
|
+
value?: any;
|
|
1273
|
+
search?: string;
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
/** Extended list item with type and index @keywords list, data, item, index, parent */
|
|
1277
|
+
export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
|
|
1278
|
+
parent?: string;
|
|
1279
|
+
type: ListType;
|
|
1280
|
+
index: string;
|
|
1281
|
+
disabled?: boolean;
|
|
1282
|
+
}>;
|
|
1283
|
+
|
|
1284
|
+
export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
|
|
1285
|
+
|
|
1286
|
+
export type ListRecord<Item extends ListDataBasic = ListDataBasic> = Item[] | Record<string, Item>;
|
|
1287
|
+
|
|
1288
|
+
/** Extended list item with additional state properties @keywords list, item, focus, highlight, selected */
|
|
1289
|
+
export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
|
|
1290
|
+
focus: boolean;
|
|
1291
|
+
highlight?: string;
|
|
1292
|
+
selected: boolean;
|
|
1293
|
+
disabled?: boolean;
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
1297
|
+
|
|
1298
|
+
export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
1299
|
+
|
|
1300
|
+
/** Various input formats for list creation @keywords list, input, format, record */
|
|
1301
|
+
export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
1302
|
+
|
|
1303
|
+
export type ListSelectedItem = NumberOrStringOrBoolean;
|
|
1304
|
+
|
|
1305
|
+
export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
1306
|
+
|
|
1307
|
+
export type ListName = string | number | undefined;
|
|
1308
|
+
|
|
1309
|
+
export type ListNames = ListName[];
|
|
1310
|
+
|
|
1311
|
+
import { type ComputedRef, type Ref, type VNode, type VNodeArrayChildren } from 'vue';
|
|
1312
|
+
|
|
1313
|
+
/** Vue reactive reference (Ref or ComputedRef). @keywords vue ref computed */
|
|
1314
|
+
export type RefType<T> = ComputedRef<T> | Ref<T>;
|
|
1315
|
+
/** Vue reactive reference that can be undefined. @keywords vue ref undefined */
|
|
1316
|
+
export type RefUndefined<T> = RefType<T | undefined>;
|
|
1317
|
+
/** Vue reactive reference or raw unwrapped value. @keywords vue ref value */
|
|
1318
|
+
export type RefOrNormal<T> = RefType<T> | T;
|
|
1319
|
+
/** Vue reactive reference, raw value, or getter function. @keywords vue ref getter */
|
|
1320
|
+
export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
|
|
1321
|
+
/** Vue raw children content (primitives, VNodes, array, or render function). @keywords vue vnode children */
|
|
1322
|
+
export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
1323
|
+
/** Vue raw slots definition with optional stability flag. @keywords vue slots */
|
|
1324
|
+
export type RawSlots = {
|
|
1325
|
+
[name: string]: unknown;
|
|
1326
|
+
/** Stability flag for slot optimization. @keywords vue slot stable */
|
|
1327
|
+
$stable?: boolean;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
import type { SearchColumns, SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
|
|
1331
|
+
|
|
1332
|
+
export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
|
|
1333
|
+
export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
|
|
1334
|
+
export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
|
|
1335
|
+
export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
|