@dxtmisha/functional 1.10.3 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/ai-types.txt +812 -0
- package/dist/library.d.ts +33 -25
- package/dist/library.js +377 -369
- package/package.json +2 -1
package/ai-types.txt
ADDED
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
1) All these methods are in the @dxtmisha/functional library.
|
|
2
|
+
2) Everything that is exported can be used.
|
|
3
|
+
3) Use what is in this library if it exists; do not use other libraries if there is an analogue here. Do not create new ones if an analogue already exists here.
|
|
4
|
+
|
|
5
|
+
The following is the content of "exports" from package.json:
|
|
6
|
+
{
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/library.js",
|
|
9
|
+
"types": "./dist/library.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./flags": {
|
|
12
|
+
"import": "./dist/flags.js",
|
|
13
|
+
"types": "./dist/flags.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./types/*": "./dist/*"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// File: library.d.ts
|
|
19
|
+
|
|
20
|
+
/** Config for main API GET request. */
|
|
21
|
+
export declare type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
22
|
+
/** API endpoint path. */
|
|
23
|
+
path?: RefOrNormal<string | undefined>;
|
|
24
|
+
/** Request options. */
|
|
25
|
+
options?: ApiOptions;
|
|
26
|
+
/** Enable reactive updates on path/options change. */
|
|
27
|
+
reactivity?: boolean;
|
|
28
|
+
/** Trigger condition. */
|
|
29
|
+
conditions?: RefType<boolean>;
|
|
30
|
+
/** Custom data transformation. */
|
|
31
|
+
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
32
|
+
/** Response contract validation. */
|
|
33
|
+
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
34
|
+
/** Data type validation or constructor. */
|
|
35
|
+
typeData?: ((data: Return) => boolean) | any;
|
|
36
|
+
/** Clear data on unmount. */
|
|
37
|
+
unmounted?: boolean;
|
|
38
|
+
/** Loading skeleton data. */
|
|
39
|
+
skeleton?: () => Return;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Config for POST, PUT, DELETE requests. */
|
|
43
|
+
export declare type ApiManagementRequest<T, Return extends ApiData<T> = ApiData<T>> = {
|
|
44
|
+
/** API endpoint path. */
|
|
45
|
+
path?: RefOrNormal<string | undefined>;
|
|
46
|
+
/** Success callback. */
|
|
47
|
+
action?: (data: Return | undefined) => Promise<void> | void;
|
|
48
|
+
/** Pre-send transformation. */
|
|
49
|
+
transformation?: (data: T) => Return;
|
|
50
|
+
/** Wrap payload in 'data' property. */
|
|
51
|
+
toData?: boolean;
|
|
52
|
+
/** Request options. */
|
|
53
|
+
options?: ApiOptions;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** Config for client-side search. */
|
|
57
|
+
export declare type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
|
|
58
|
+
/** Searchable columns. */
|
|
59
|
+
columns: K;
|
|
60
|
+
/** Reactive search query. */
|
|
61
|
+
value?: Ref<string>;
|
|
62
|
+
/** Search algorithm options. */
|
|
63
|
+
options?: SearchOptions;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** API value or array of values. */
|
|
67
|
+
export declare type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
68
|
+
|
|
69
|
+
/** API request options. */
|
|
70
|
+
export declare type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
71
|
+
|
|
72
|
+
declare type BroadcastValueItem<T> = T | string | undefined;
|
|
73
|
+
|
|
74
|
+
/** Creates computed property for async getters. */
|
|
75
|
+
export declare function computedAsync<R>(getter: (() => Promise<R>) | (() => R) | R, ignore?: R, debugOptions?: DebuggerOptions): ComputedRef<R | undefined>;
|
|
76
|
+
|
|
77
|
+
/** Creates computed property that reacts to language changes. */
|
|
78
|
+
export declare function computedByLanguage<T, R extends (T | undefined) = T | undefined>(getter: ComputedGetter<R>, getterNone?: R | (() => R), conditions?: () => boolean, debugOptions?: DebuggerOptions): ComputedRef<R>;
|
|
79
|
+
|
|
80
|
+
/** Creates on-demand cached computed property. Watcher stays active for app life. */
|
|
81
|
+
export declare function computedEternity<T>(getter: () => Promise<T> | T): Ref<T, T>;
|
|
82
|
+
|
|
83
|
+
/** Component binding with class/style support. */
|
|
84
|
+
export declare type ConstrBind<T> = T & Record<string, any> & {
|
|
85
|
+
key?: string;
|
|
86
|
+
class?: ConstrClass;
|
|
87
|
+
style?: ConstrStyles;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** Constructor class type (string, array, or object). */
|
|
91
|
+
export declare type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
92
|
+
|
|
93
|
+
/** Main class and additional class list. */
|
|
94
|
+
export declare type ConstrClasses = {
|
|
95
|
+
main: ConstrClass;
|
|
96
|
+
} & ConstrClassList;
|
|
97
|
+
|
|
98
|
+
/** Record mapping class names. */
|
|
99
|
+
export declare type ConstrClassList = Record<string, ConstrClass>;
|
|
100
|
+
|
|
101
|
+
/** CSS class object (boolean values). */
|
|
102
|
+
export declare type ConstrClassObject = Record<string, boolean | undefined>;
|
|
103
|
+
|
|
104
|
+
/** Constructor component record. */
|
|
105
|
+
export declare type ConstrComponent = Record<string, any>;
|
|
106
|
+
|
|
107
|
+
/** Component modification with reactive values. */
|
|
108
|
+
export declare type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
|
|
109
|
+
[K in keyof P]?: RefOrNormal<P[K]>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** Constructor emit signatures. */
|
|
113
|
+
export declare type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
114
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
115
|
+
}>>;
|
|
116
|
+
|
|
117
|
+
/** Extract emit item type. */
|
|
118
|
+
export declare type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
119
|
+
|
|
120
|
+
export declare type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
|
|
121
|
+
elementHtml?: ComputedRef<E | undefined>;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** Props for links. */
|
|
125
|
+
export declare type ConstrHrefProps = {
|
|
126
|
+
href?: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** Constructor item record. */
|
|
130
|
+
export declare type ConstrItem = Record<string, any>;
|
|
131
|
+
|
|
132
|
+
/** Constructor configuration options. */
|
|
133
|
+
export declare type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
134
|
+
components?: COMP;
|
|
135
|
+
compMod?: ConstrComponentMod<P>;
|
|
136
|
+
emits?: ConstrEmit<EMITS>;
|
|
137
|
+
classes?: RefType<ConstrClasses>;
|
|
138
|
+
styles?: RefType<ConstrStyles>;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/** Constructor prop item (options or PropType). */
|
|
142
|
+
export declare type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
143
|
+
|
|
144
|
+
/** Vue prop definition options. */
|
|
145
|
+
export declare type ConstrPropItemOptions<T = any> = {
|
|
146
|
+
type?: PropType<T>;
|
|
147
|
+
required?: boolean;
|
|
148
|
+
default?: any;
|
|
149
|
+
validator?(value: any, props: any): boolean;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** Component prop definitions. */
|
|
153
|
+
export declare type ConstrProps<P = Record<string, any>> = {
|
|
154
|
+
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** Constructor registration config. */
|
|
158
|
+
export declare type ConstrRegistration = {
|
|
159
|
+
flag?: boolean;
|
|
160
|
+
translate?: Record<string, string>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** Component setup interface. */
|
|
164
|
+
export declare type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
165
|
+
name: string;
|
|
166
|
+
element: Ref<E | undefined>;
|
|
167
|
+
classes: RefType<CLASSES>;
|
|
168
|
+
styles: RefType<ConstrStyles>;
|
|
169
|
+
} & SETUP;
|
|
170
|
+
|
|
171
|
+
/** Style definitions (object or array). */
|
|
172
|
+
export declare type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
173
|
+
|
|
174
|
+
/** Individual style property. */
|
|
175
|
+
export declare type ConstrStylesItem = string | null;
|
|
176
|
+
|
|
177
|
+
/** Value wrapper. */
|
|
178
|
+
export declare type ConstrValue<T = any> = {
|
|
179
|
+
value?: T;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/** Class for date processing. */
|
|
183
|
+
export declare class DatetimeRef {
|
|
184
|
+
constructor(date: RefOrNormal<NumberOrStringOrDate>, type?: RefOrNormal<GeoDate>, code?: RefOrNormal<string>);
|
|
185
|
+
/** Get base date data. */
|
|
186
|
+
getItem(): Ref<NumberOrStringOrDate>;
|
|
187
|
+
/** Get Date object. */
|
|
188
|
+
getDate(): Ref<Date>;
|
|
189
|
+
/** Get base Datetime class instance. */
|
|
190
|
+
getDatetime(): Datetime;
|
|
191
|
+
/** Get hour format. */
|
|
192
|
+
getHoursType(): ComputedRef<GeoHours>;
|
|
193
|
+
/** Get first day of week code. */
|
|
194
|
+
getFirstDayCode(): ComputedRef<GeoFirstDay>;
|
|
195
|
+
/** Get year. */
|
|
196
|
+
getYear(): ComputedRef<number>;
|
|
197
|
+
/** Get zero-based month. */
|
|
198
|
+
getMonth(): ComputedRef<number>;
|
|
199
|
+
/** Get day of month. */
|
|
200
|
+
getDay(): ComputedRef<number>;
|
|
201
|
+
/** Get hour. */
|
|
202
|
+
getHour(): ComputedRef<number>;
|
|
203
|
+
/** Get minutes. */
|
|
204
|
+
getMinute(): ComputedRef<number>;
|
|
205
|
+
/** Get seconds. */
|
|
206
|
+
getSecond(): ComputedRef<number>;
|
|
207
|
+
/** Get last day of week. */
|
|
208
|
+
getMaxDay(): ComputedRef<number>;
|
|
209
|
+
/** Get language-sensitive formatting. */
|
|
210
|
+
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): ComputedRef<string>;
|
|
211
|
+
/** Standard data output. */
|
|
212
|
+
standard(timeZone?: boolean): ComputedRef<string>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Abstract base for constructor logic. */
|
|
216
|
+
export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
|
|
217
|
+
constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
|
|
218
|
+
/** Executes callback. */
|
|
219
|
+
make(compelled?: boolean): this;
|
|
220
|
+
/** Executes callback. */
|
|
221
|
+
makeCallback(compelled?: boolean): void;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Abstract base for async constructor logic. */
|
|
225
|
+
export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
|
|
226
|
+
make(compelled?: boolean): this;
|
|
227
|
+
makeCallback(compelled?: boolean): Promise<void>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Checks for edited values. */
|
|
231
|
+
export declare class DesignChanged<T extends Record<string, any>> {
|
|
232
|
+
constructor(props: T, watch?: string[]);
|
|
233
|
+
/** Check if specific property updated. */
|
|
234
|
+
is(name: string | string[]): boolean;
|
|
235
|
+
/** Check if any data changed. */
|
|
236
|
+
isChanged(): boolean;
|
|
237
|
+
/** Update all cached values. */
|
|
238
|
+
update(): void;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Manager for connected components. */
|
|
245
|
+
export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
|
|
246
|
+
constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
|
|
247
|
+
/** Check component presence. */
|
|
248
|
+
is<K extends keyof COMP>(name: K): name is K;
|
|
249
|
+
/** Get component object. */
|
|
250
|
+
get<K extends keyof COMP>(name: K): COMP[K];
|
|
251
|
+
/** Get modified input data. */
|
|
252
|
+
getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
|
|
253
|
+
/** Render component in array. */
|
|
254
|
+
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[];
|
|
255
|
+
/** Render single component. */
|
|
256
|
+
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;
|
|
257
|
+
/** Add rendered component to array. */
|
|
258
|
+
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;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Base class for functional component assembly. */
|
|
262
|
+
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> {
|
|
263
|
+
protected constructor(name: string, props: Readonly<P>, options?: ConstrOptions<COMP, EMITS, P> | undefined);
|
|
264
|
+
protected init(): this;
|
|
265
|
+
/** Get class name. */
|
|
266
|
+
getName(): string;
|
|
267
|
+
/** Get design name. */
|
|
268
|
+
getDesign(): string;
|
|
269
|
+
/** Get sub-class name. */
|
|
270
|
+
getSubClass(name: string | string[]): string;
|
|
271
|
+
/** Get status-specific class name. */
|
|
272
|
+
getStatusClass(name: string | string[]): string;
|
|
273
|
+
/** Get style property name. */
|
|
274
|
+
getStyle(name: string | string[]): string;
|
|
275
|
+
/** Get extra parameters. */
|
|
276
|
+
getAttrs(): ConstrItem;
|
|
277
|
+
/** Expose public variables. */
|
|
278
|
+
expose(): ConstrExpose<E, EXPOSE>;
|
|
279
|
+
/** Vue setup render method. */
|
|
280
|
+
render(): () => VNode | (VNode | any)[] | undefined;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Vue plugin for initializing global services.
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* app.use(dxtFunctionalPlugin, { api: { url: '...' }, router })
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
export declare const dxtFunctionalPlugin: Plugin_2;
|
|
291
|
+
|
|
292
|
+
/** Global effect scope utility. */
|
|
293
|
+
export declare class EffectScopeGlobal {
|
|
294
|
+
/** Run function in global scope. */
|
|
295
|
+
static run<T>(fn: () => T): T | undefined;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** Reactive event handling class. */
|
|
299
|
+
export declare class EventRef<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> extends EventItem<E, O, D> {
|
|
300
|
+
constructor(elementSelector?: RefOrNormal<ElementOrString<E> | undefined>, elementSelectorControl?: RefOrNormal<ElementOrString<HTMLElement>>, type?: string | string[], listener?: EventListenerDetail<O, D>, options?: EventOptions, detail?: D);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Creates a managed singleton (global, provide, or local).
|
|
305
|
+
* @remarks
|
|
306
|
+
* Use for API services, resource optimization, shared state, or SDK initialization.
|
|
307
|
+
* @example
|
|
308
|
+
* export const useUserApi = executeUseGlobal(() => useApiGet('/api/user'));
|
|
309
|
+
*/
|
|
310
|
+
export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
|
|
311
|
+
|
|
312
|
+
/** Creates a global singleton. */
|
|
313
|
+
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
|
|
314
|
+
init(): Readonly<R>;
|
|
315
|
+
destroyExecute?(): void;
|
|
316
|
+
}>);
|
|
317
|
+
|
|
318
|
+
/** Initializes global callbacks. */
|
|
319
|
+
export declare function executeUseGlobalInit(): void;
|
|
320
|
+
|
|
321
|
+
/** Creates a local singleton. */
|
|
322
|
+
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
323
|
+
init(): Readonly<R>;
|
|
324
|
+
destroyExecute?(): void;
|
|
325
|
+
}>);
|
|
326
|
+
|
|
327
|
+
/** Creates a component-scoped singleton. */
|
|
328
|
+
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
329
|
+
init(): Readonly<R>;
|
|
330
|
+
destroyExecute?(): void;
|
|
331
|
+
}>);
|
|
332
|
+
|
|
333
|
+
/** Managed singleton return type. */
|
|
334
|
+
export declare type ExecuteUseReturn<R> = Readonly<R & {
|
|
335
|
+
init(): Readonly<R>;
|
|
336
|
+
destroyExecute?(): void;
|
|
337
|
+
}>;
|
|
338
|
+
|
|
339
|
+
/** Singleton initialization strategies. */
|
|
340
|
+
export declare enum ExecuteUseType {
|
|
341
|
+
global = "global",
|
|
342
|
+
provide = "provide",
|
|
343
|
+
local = "local"
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** Options for the functional plugin. */
|
|
347
|
+
export declare interface FunctionalPluginOptions {
|
|
348
|
+
api?: ApiConfig;
|
|
349
|
+
translate?: TranslateConfig;
|
|
350
|
+
metaSuffix?: string;
|
|
351
|
+
icons?: IconsConfig;
|
|
352
|
+
router?: Router;
|
|
353
|
+
errorCauses?: ErrorCenterCauseList;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** Reactive Flag management. */
|
|
357
|
+
export declare class GeoFlagRef {
|
|
358
|
+
constructor(code?: RefOrNormal<string>);
|
|
359
|
+
/** Get reactive country code. */
|
|
360
|
+
getCode(): Ref<string>;
|
|
361
|
+
/** Get country/flag info. */
|
|
362
|
+
get(code?: string): ComputedRef<GeoFlagItem | undefined>;
|
|
363
|
+
/** Get flag link. */
|
|
364
|
+
getFlag(code?: string): ComputedRef<string | undefined>;
|
|
365
|
+
/** Get list by country codes. */
|
|
366
|
+
getList(codes?: string[]): ComputedRef<GeoFlagItem[]>;
|
|
367
|
+
/** Get list in national language. */
|
|
368
|
+
getNational(codes?: string[]): ComputedRef<GeoFlagNational[]>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** Reactive formatting for numbers and dates. */
|
|
372
|
+
export declare class GeoIntlRef {
|
|
373
|
+
constructor(code?: RefOrNormal<string>);
|
|
374
|
+
/** Display names for languages/regions. */
|
|
375
|
+
display(value?: RefOrNormal<string>, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): ComputedRef<string>;
|
|
376
|
+
/** Language display name. */
|
|
377
|
+
languageName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
378
|
+
/** Region display name. */
|
|
379
|
+
countryName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
380
|
+
/** Number formatting. */
|
|
381
|
+
number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
382
|
+
/** Decimal point symbol. */
|
|
383
|
+
decimal(): ComputedRef<string>;
|
|
384
|
+
/** Currency formatting. */
|
|
385
|
+
currency(value: RefOrNormal<NumberOrString>, currencyOptions?: RefOrNormal<string | Intl.NumberFormatOptions>, numberOnly?: boolean): ComputedRef<string>;
|
|
386
|
+
/** Currency symbol or code. */
|
|
387
|
+
currencySymbol(currency: RefOrNormal<string>, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): ComputedRef<string>;
|
|
388
|
+
/** Unit formatting. */
|
|
389
|
+
unit(value: RefOrNormal<NumberOrString>, unitOptions?: string | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
390
|
+
/** Formatted file size. */
|
|
391
|
+
sizeFile(value: RefOrNormal<NumberOrString>, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
392
|
+
/** Percentage formatting. */
|
|
393
|
+
percent(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
394
|
+
/** Percentage formatting (unit). */
|
|
395
|
+
percentBy100(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
396
|
+
/** Plural rule formatting. */
|
|
397
|
+
plural(value: RefOrNormal<NumberOrString>, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
398
|
+
/** Date/time formatting. */
|
|
399
|
+
date(value: RefOrNormal<NumberOrStringOrDate>, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): ComputedRef<string>;
|
|
400
|
+
/** Relative time formatting. */
|
|
401
|
+
relative(value: RefOrNormal<NumberOrStringOrDate>, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): ComputedRef<string>;
|
|
402
|
+
/** Relative time formatting with fallback limit. */
|
|
403
|
+
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>;
|
|
404
|
+
/** Relative time by specific unit. */
|
|
405
|
+
relativeByValue(value: RefOrNormal<NumberOrString>, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): ComputedRef<string>;
|
|
406
|
+
/** Month name. */
|
|
407
|
+
month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
|
|
408
|
+
/** List of all months. */
|
|
409
|
+
months(style?: Intl.DateTimeFormatOptions['month']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
410
|
+
/** Weekday name. */
|
|
411
|
+
weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
|
|
412
|
+
/** List of all weekdays. */
|
|
413
|
+
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
414
|
+
/** Time formatting. */
|
|
415
|
+
time(value: RefOrNormal<NumberOrStringOrDate>): ComputedRef<string>;
|
|
416
|
+
/** Locale-aware array sorting. */
|
|
417
|
+
sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Static reactive geographic data access. */
|
|
421
|
+
export declare class GeoRef {
|
|
422
|
+
/** Get full geo info. */
|
|
423
|
+
static get(): Ref<GeoItemFull>;
|
|
424
|
+
/** Get country code. */
|
|
425
|
+
static getCountry(): ComputedRef<string>;
|
|
426
|
+
/** Get language code. */
|
|
427
|
+
static getLanguage(): ComputedRef<string>;
|
|
428
|
+
/** Get standard locale string. */
|
|
429
|
+
static getStandard(): ComputedRef<string>;
|
|
430
|
+
/** Get first day of week. */
|
|
431
|
+
static getFirstDay(): ComputedRef<string>;
|
|
432
|
+
/** Set locale by code. */
|
|
433
|
+
static set(code: string): void;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** Generates properties for subcomponents. */
|
|
437
|
+
export declare function getBind<T, R extends ItemList>(value: T | R | undefined | null, nameExtra?: ItemList | string, name?: string, except?: boolean): ConstrBind<R>;
|
|
438
|
+
|
|
439
|
+
/** Generates reactive properties for subcomponents. */
|
|
440
|
+
export declare function getBindRef<T, R extends ItemList>(value: RefOrNormal<T | R> | undefined, nameExtra?: RefOrNormal<ItemList> | string, name?: string): ComputedRef<R>;
|
|
441
|
+
|
|
442
|
+
/** Get class name from props. */
|
|
443
|
+
export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
|
|
444
|
+
|
|
445
|
+
/** Get or generate element index for rendering. */
|
|
446
|
+
export declare function getIndexForRender<T extends ItemList>(name: string | any, props?: T, index?: string): string | undefined;
|
|
447
|
+
|
|
448
|
+
/** Get API request options. */
|
|
449
|
+
export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
|
|
450
|
+
|
|
451
|
+
/** Unwrap ref or return value. */
|
|
452
|
+
export declare function getRef<T>(item: RefOrNormal<T>): T;
|
|
453
|
+
|
|
454
|
+
export declare type LazyItem = {
|
|
455
|
+
status: ShallowRef<boolean>;
|
|
456
|
+
ratio: ShallowRef<number>;
|
|
457
|
+
entry: ShallowRef<IntersectionObserverEntry | undefined>;
|
|
458
|
+
stopWatch: () => void;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
export declare type LazyItemByMargin = {
|
|
462
|
+
rootMargin: string;
|
|
463
|
+
item: any;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
export declare type LazyList = Record<string, LazyItem>;
|
|
467
|
+
|
|
468
|
+
/** List item base structure. */
|
|
469
|
+
export declare type ListDataBasic = {
|
|
470
|
+
label?: NumberOrString;
|
|
471
|
+
value?: any;
|
|
472
|
+
search?: string;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
/** List items with state. */
|
|
476
|
+
export declare type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
477
|
+
|
|
478
|
+
/** List item with focus/selection state. */
|
|
479
|
+
export declare type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
|
|
480
|
+
focus: boolean;
|
|
481
|
+
highlight?: string;
|
|
482
|
+
selected: boolean;
|
|
483
|
+
disabled?: boolean;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
/** List item with metadata. */
|
|
487
|
+
export declare type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
|
|
488
|
+
parent?: string;
|
|
489
|
+
type: ListType;
|
|
490
|
+
index: string;
|
|
491
|
+
}>;
|
|
492
|
+
|
|
493
|
+
/** List data manager. */
|
|
494
|
+
export declare class ListDataRef {
|
|
495
|
+
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);
|
|
496
|
+
readonly data: ComputedRef<ListList>;
|
|
497
|
+
readonly liteData: ComputedRef<ListList>;
|
|
498
|
+
readonly fullData: ComputedRef<ListDataFull>;
|
|
499
|
+
readonly map: ComputedRef<ListList>;
|
|
500
|
+
readonly mapItems: ComputedRef<ListList>;
|
|
501
|
+
readonly items: ComputedRef<ListList>;
|
|
502
|
+
readonly highlightFirstItem: ComputedRef<number>;
|
|
503
|
+
readonly isSelected: ComputedRef<boolean>;
|
|
504
|
+
readonly isSelectedMin: ComputedRef<boolean>;
|
|
505
|
+
readonly isSelectedMax: ComputedRef<boolean>;
|
|
506
|
+
readonly selectedList: ComputedRef<ListList>;
|
|
507
|
+
readonly selectedListInGroup: ComputedRef<ListList>;
|
|
508
|
+
readonly selectedNames: ComputedRef<ListNames>;
|
|
509
|
+
readonly selectedValues: ComputedRef<any[]>;
|
|
510
|
+
isLite(): boolean;
|
|
511
|
+
isFocus(): boolean;
|
|
512
|
+
isHighlight(): boolean;
|
|
513
|
+
isHighlightActive(): boolean;
|
|
514
|
+
getLength(): number;
|
|
515
|
+
getLengthByMap(): number;
|
|
516
|
+
getLengthByItems(): number;
|
|
517
|
+
getFocus(): ListSelectedItem | undefined;
|
|
518
|
+
getHighlight(): string | undefined;
|
|
519
|
+
getHighlightLengthStart(): number;
|
|
520
|
+
getSelected(): ListSelectedList | undefined;
|
|
521
|
+
getSelectedByStep(step: number): ListSelectedItem | undefined;
|
|
522
|
+
getSelectedNext(): ListSelectedItem | undefined;
|
|
523
|
+
getSelectedPrev(): ListSelectedItem | undefined;
|
|
524
|
+
getItemByStep(item: ListDataItem, step: number): ListDataItem | undefined;
|
|
525
|
+
getItemNext(item: ListDataItem): ListDataItem | undefined;
|
|
526
|
+
getItemPrev(item: ListDataItem): ListDataItem | undefined;
|
|
527
|
+
getIndexByStep(index: string, step: number): ListDataItem | undefined;
|
|
528
|
+
getIndexNext(index: string): ListDataItem | undefined;
|
|
529
|
+
getIndexPrev(index: string): ListDataItem | undefined;
|
|
530
|
+
getItemByIndex(index?: string): {
|
|
531
|
+
key: number;
|
|
532
|
+
item: ListDataItem;
|
|
533
|
+
} | undefined;
|
|
534
|
+
getItemByKey(key: number): ListDataItem | undefined;
|
|
535
|
+
getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
536
|
+
getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
537
|
+
getSubList(item: ListDataItem): ListDataRef;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export declare type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
|
|
541
|
+
|
|
542
|
+
export declare type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
543
|
+
|
|
544
|
+
export declare type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
545
|
+
|
|
546
|
+
export declare type ListName = string | number | undefined;
|
|
547
|
+
|
|
548
|
+
export declare type ListNames = ListName[];
|
|
549
|
+
|
|
550
|
+
export declare type ListRecord<Item extends ListDataBasic = ListDataBasic> = ListList<Item> | Record<string, any>;
|
|
551
|
+
|
|
552
|
+
export declare type ListSelectedItem = NumberOrStringOrBoolean;
|
|
553
|
+
|
|
554
|
+
export declare type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
555
|
+
|
|
556
|
+
export declare type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
|
|
557
|
+
|
|
558
|
+
/** Vue raw children union. */
|
|
559
|
+
export declare type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
560
|
+
|
|
561
|
+
/** Vue raw slots object. */
|
|
562
|
+
export declare type RawSlots = {
|
|
563
|
+
[name: string]: unknown;
|
|
564
|
+
$stable?: boolean;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
/** Type supporting Ref or raw value. */
|
|
568
|
+
export declare type RefOrNormal<T> = RefType<T> | T;
|
|
569
|
+
|
|
570
|
+
/** Ref or ComputedRef union. */
|
|
571
|
+
export declare type RefType<T> = ComputedRef<T> | Ref<T>;
|
|
572
|
+
|
|
573
|
+
/** Optional Ref union. */
|
|
574
|
+
export declare type RefUndefined<T> = RefType<T | undefined>;
|
|
575
|
+
|
|
576
|
+
/** Render cached immutable data. */
|
|
577
|
+
export declare function render<T extends ItemList>(name: string | any, props?: T, children?: RawChildren | RawSlots, index?: string): VNode;
|
|
578
|
+
|
|
579
|
+
/** Router navigation and link utility. */
|
|
580
|
+
export declare class RouterItemRef {
|
|
581
|
+
static get(): Router;
|
|
582
|
+
static getLink(name: string, params?: any, query?: any): string | undefined;
|
|
583
|
+
static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
|
|
584
|
+
static push(to: string | RouteLocationRaw): void;
|
|
585
|
+
static set(router: Router): void;
|
|
586
|
+
static setOneTime(router: Router): void;
|
|
587
|
+
static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** Reactive scrollbar width. */
|
|
591
|
+
export declare class ScrollbarWidthRef {
|
|
592
|
+
readonly item: Ref<boolean | undefined, boolean | undefined>;
|
|
593
|
+
readonly width: Ref<number, number>;
|
|
594
|
+
constructor();
|
|
595
|
+
readonly is: ComputedRef<boolean>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export declare type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
|
|
599
|
+
|
|
600
|
+
export declare type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
|
|
601
|
+
|
|
602
|
+
/** Set global conditions for API requests. */
|
|
603
|
+
export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
|
|
604
|
+
|
|
605
|
+
/** Update Ref value. */
|
|
606
|
+
export declare function setRef<T>(item: Ref<T>, value: T): void;
|
|
607
|
+
|
|
608
|
+
/** Shorthand for useTranslateRef. Use 'as const' for arrays. */
|
|
609
|
+
export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
|
|
610
|
+
|
|
611
|
+
/** Merges objects preserving classes/styles. */
|
|
612
|
+
export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
|
|
613
|
+
|
|
614
|
+
/** Merges multiple objects preserving classes/styles. */
|
|
615
|
+
export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;
|
|
616
|
+
|
|
617
|
+
/** Ensures value is wrapped in a Ref. */
|
|
618
|
+
export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
|
|
619
|
+
|
|
620
|
+
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
621
|
+
|
|
622
|
+
/** API DELETE request hook. */
|
|
623
|
+
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(path?: RefOrNormal<string | undefined>, action?: (data: Return | undefined) => Promise<void> | void, transformation?: (data: T) => Return, toData?: boolean, options?: ApiOptions, apiInstance?: ApiInstance): {
|
|
624
|
+
loading: Ref<boolean, boolean>;
|
|
625
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
/** API GET request hook. */
|
|
629
|
+
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(path?: RefOrNormal<string | undefined>, action?: (data: Return | undefined) => Promise<void> | void, transformation?: (data: T) => Return, toData?: boolean, options?: ApiOptions, apiInstance?: ApiInstance): {
|
|
630
|
+
loading: Ref<boolean, boolean>;
|
|
631
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Orchestrates API loading (GET), formatting, searching, and mutations (POST/PUT/DELETE).
|
|
636
|
+
* @note Use with `executeUse` for central state.
|
|
637
|
+
* @remarks Recommended for formatting values (prices, dates) but not technical IDs.
|
|
638
|
+
* @example
|
|
639
|
+
* const products = useApiManagementRef({ path: '/api/v1/products' }, { price: (v) => `${v}$` });
|
|
640
|
+
*/
|
|
641
|
+
export declare function useApiManagementRef<Return extends ApiManagementValue, FormattersOptions extends FormattersOptionsList, Post extends Record<string, any>, Put extends Record<string, any>, Delete extends Record<string, any>, Type extends ApiManagementValue = Return, Item extends ArrayToItem<Return> = ArrayToItem<Return>, ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number], Columns extends SearchColumns<ItemFormatters> = []>(propsGet: ApiManagementGet<Return, Type>, formattersOptions?: FormattersOptions, searchOptions?: ApiManagementSearch<Item, Columns>, postRequest?: ApiManagementRequest<Post>, putRequest?: ApiManagementRequest<Put>, deleteRequest?: ApiManagementRequest<Delete>, action?: () => Promise<void> | void, apiInstance?: ApiInstance): {
|
|
642
|
+
isValid: ComputedRef<boolean>;
|
|
643
|
+
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
644
|
+
readonly data: ComputedRef<ApiData<Return> | undefined>;
|
|
645
|
+
readonly length: ComputedRef<number>;
|
|
646
|
+
lengthData: ComputedRef<number>;
|
|
647
|
+
starting: ComputedRef<boolean>;
|
|
648
|
+
reading: Ref<boolean, boolean>;
|
|
649
|
+
loading: Ref<boolean, boolean>;
|
|
650
|
+
loadingSearch: Ref<boolean, boolean> | undefined;
|
|
651
|
+
loadingPost: Ref<boolean, boolean> | undefined;
|
|
652
|
+
loadingPut: Ref<boolean, boolean> | undefined;
|
|
653
|
+
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
654
|
+
isSearch: ComputedRef<boolean> | undefined;
|
|
655
|
+
search: Ref<string, string> | undefined;
|
|
656
|
+
reset: () => Promise<void>;
|
|
657
|
+
abort: () => void;
|
|
658
|
+
sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>;
|
|
659
|
+
sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
|
|
660
|
+
sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
/** API POST request hook. */
|
|
664
|
+
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(path?: RefOrNormal<string | undefined>, action?: (data: Return | undefined) => Promise<void> | void, transformation?: (data: T) => Return, toData?: boolean, options?: ApiOptions, apiInstance?: ApiInstance): {
|
|
665
|
+
loading: Ref<boolean, boolean>;
|
|
666
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/** API PUT request hook. */
|
|
670
|
+
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(path?: RefOrNormal<string | undefined>, action?: (data: Return | undefined) => Promise<void> | void, transformation?: (data: T) => Return, toData?: boolean, options?: ApiOptions, apiInstance?: ApiInstance): {
|
|
671
|
+
loading: Ref<boolean, boolean>;
|
|
672
|
+
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
/** Return type for useApiRef. */
|
|
676
|
+
export declare interface UseApiRef<R> {
|
|
677
|
+
data: ComputedRef<ApiData<R> | undefined>;
|
|
678
|
+
item: Ref<ApiData<R> | undefined>;
|
|
679
|
+
isResponseContractValid: ComputedRef<boolean>;
|
|
680
|
+
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
681
|
+
length: ComputedRef<number>;
|
|
682
|
+
starting: ComputedRef<boolean>;
|
|
683
|
+
loading: Ref<boolean>;
|
|
684
|
+
reading: Ref<boolean>;
|
|
685
|
+
isStarting(): boolean;
|
|
686
|
+
isLoading(): boolean;
|
|
687
|
+
isReading(): boolean;
|
|
688
|
+
getItem(): ApiData<R> | undefined;
|
|
689
|
+
init(): void;
|
|
690
|
+
reset(): Promise<void>;
|
|
691
|
+
stop(): void;
|
|
692
|
+
abort(): void;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/** Reactive request handling hook. */
|
|
696
|
+
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, unmounted?: boolean, apiInstance?: ApiInstance): UseApiRef<R>;
|
|
697
|
+
|
|
698
|
+
/** Generic API request hook. */
|
|
699
|
+
export declare function useApiRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(path?: RefOrNormal<string | undefined>, method?: ApiMethodItem, action?: (data: Return | undefined) => Promise<void> | void, transformation?: (data: T) => Return, toData?: boolean, options?: ApiOptions, apiInstance?: ApiInstance): {
|
|
700
|
+
loading: Ref<boolean, boolean>;
|
|
701
|
+
send(request?: Request): Promise<Return | undefined>;
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
/** Reactive value sync across tabs. */
|
|
705
|
+
export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
|
|
706
|
+
|
|
707
|
+
/** Reactive cookie management. */
|
|
708
|
+
export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
|
|
709
|
+
|
|
710
|
+
/** Reactive list formatting based on property rules. */
|
|
711
|
+
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
|
|
712
|
+
listFormat: ComputedRef<FormattersReturn<List, Options>>;
|
|
713
|
+
length: ComputedRef<number>;
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
/** Returns GeoIntlRef instance. */
|
|
717
|
+
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
718
|
+
|
|
719
|
+
/** Reactive URL hash management. */
|
|
720
|
+
export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
721
|
+
|
|
722
|
+
/** Track element appearance by margin. */
|
|
723
|
+
export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin: string) => {
|
|
724
|
+
lazyItemStatus: any;
|
|
725
|
+
readonly lazyItem: any;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
/** Generic visibility tracking hook. */
|
|
729
|
+
export declare const useLazyRef: (options?: IntersectionObserverInit) => {
|
|
730
|
+
intersectionObserver: IntersectionObserver | undefined;
|
|
731
|
+
getItem(element: HTMLElement): LazyItem;
|
|
732
|
+
addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>;
|
|
733
|
+
removeLazyItem: (element?: HTMLElement) => void;
|
|
734
|
+
disconnectLazy: () => void | undefined;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
/** Returns loading status Ref. */
|
|
738
|
+
export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
|
|
739
|
+
|
|
740
|
+
/** Reactive meta tag manager with DOM sync. */
|
|
741
|
+
export declare const useMeta: () => Readonly<{
|
|
742
|
+
meta: Meta;
|
|
743
|
+
title: Ref<string, string>;
|
|
744
|
+
keyword: Ref<string, string>;
|
|
745
|
+
description: Ref<string, string>;
|
|
746
|
+
author: Ref<string, string>;
|
|
747
|
+
image: Ref<string, string>;
|
|
748
|
+
canonical: Ref<string, string>;
|
|
749
|
+
robots: Ref<MetaRobots, MetaRobots>;
|
|
750
|
+
siteName: Ref<string, string>;
|
|
751
|
+
getHtmlMeta: () => string;
|
|
752
|
+
setSuffix: (suffix: string) => void;
|
|
753
|
+
} & {
|
|
754
|
+
init(): Readonly<{
|
|
755
|
+
meta: Meta;
|
|
756
|
+
title: Ref<string, string>;
|
|
757
|
+
keyword: Ref<string, string>;
|
|
758
|
+
description: Ref<string, string>;
|
|
759
|
+
author: Ref<string, string>;
|
|
760
|
+
image: Ref<string, string>;
|
|
761
|
+
canonical: Ref<string, string>;
|
|
762
|
+
robots: Ref<MetaRobots, MetaRobots>;
|
|
763
|
+
siteName: Ref<string, string>;
|
|
764
|
+
getHtmlMeta: () => string;
|
|
765
|
+
setSuffix: (suffix: string) => void;
|
|
766
|
+
}>;
|
|
767
|
+
destroyExecute?(): void;
|
|
768
|
+
}>;
|
|
769
|
+
|
|
770
|
+
/** Router link list manager. */
|
|
771
|
+
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
|
|
772
|
+
item: ComputedRef<T | undefined>;
|
|
773
|
+
selected: Ref<string, string>;
|
|
774
|
+
label: ComputedRef<NumberOrString>;
|
|
775
|
+
list: ComputedRef<ConstrBind<T>[]>;
|
|
776
|
+
to: (name?: string) => void;
|
|
777
|
+
toMain(): void;
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
/** Reactive search logic hook. */
|
|
781
|
+
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns: K, value?: Ref<string>, options?: SearchOptions): {
|
|
782
|
+
isSearch: ComputedRef<boolean>;
|
|
783
|
+
search: Ref<string, string>;
|
|
784
|
+
loading: Ref<boolean, boolean>;
|
|
785
|
+
listSearch: ComputedRef<SearchFormatList<T, K>>;
|
|
786
|
+
length: ComputedRef<number>;
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/** Manages search value with debounce/delay. */
|
|
790
|
+
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
|
|
791
|
+
search: Ref<string, string>;
|
|
792
|
+
searchDelay: Ref<string, string>;
|
|
793
|
+
loading: Ref<boolean, boolean>;
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
/** Reactive session storage manager. */
|
|
797
|
+
export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
|
|
798
|
+
|
|
799
|
+
/** Reactive local storage manager. */
|
|
800
|
+
export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Returns reactive translation list. Updates on language change.
|
|
804
|
+
* @example
|
|
805
|
+
* const t = useTranslateRef(['home.title'] as const);
|
|
806
|
+
*/
|
|
807
|
+
export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
|
|
808
|
+
|
|
809
|
+
export * from "@dxtmisha/functional-basic";
|
|
810
|
+
export { }
|
|
811
|
+
|
|
812
|
+
go!
|