@dxtmisha/functional 1.13.7 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/ai-description.md +11 -13
- package/ai-types.md +28 -210
- package/dist/library.js +181 -159
- package/dist/src/classes/ref/GeoFlagRef.d.ts +24 -0
- package/dist/src/composables/ref/useQueryRef.d.ts +9 -0
- package/dist/src/library.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.14.0] - 2026-06-22
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **useQueryRef**: Introduced a new Vue 3 reactive composable to manage URL query/GET parameters reactively, mimicking `useHashRef` behavior.
|
|
9
|
+
- **useQueryRef**: Added `useQueryRef.test.ts` unit test suite to validate parameter retrieval, reactive updates, and event callbacks.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **GeoRef**: Updated `GeoRef.test.ts` assertions for the `'en-VN'` locale to expect country `'VN'` and language `'vi'` to align with the country-first localization resolution updates.
|
|
13
|
+
|
|
5
14
|
## [1.13.7] - 2026-06-19
|
|
6
15
|
|
|
7
16
|
### Added
|
package/ai-description.md
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
Core Purpose:
|
|
1
|
+
Core Purpose: Provides a structured, reactive framework for Vue 3 component design and API orchestration. It simplifies complex UI state management, internationalization, and asynchronous API interactions through specialized classes and composables.
|
|
2
2
|
|
|
3
3
|
Key Expositions:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
- Design Construction: DesignAbstract, DesignAsyncAbstract, and DesignComponents for building complex component structures with lifecycle hooks and automated change tracking.
|
|
5
|
+
- API Orchestration: useApiRef, useApiManagementRef (and Async variants) for handling GET/POST/PUT/DELETE requests with built-in SSR support, validation (contract-based), reactivity, and skeleton states.
|
|
6
|
+
- Reactive Utilities: ListDataRef (list management/selection/navigation), DatetimeRef (reactive date manipulation), and GeoRef/GeoIntlRef (geo-data and internationalization).
|
|
7
|
+
- Global State: executeUse (Global/Provide/Local patterns) for managing singletons, useMeta (global SEO management), and various storage/browser-tab sync hooks (useCookieRef, useSessionRef, useBroadcastValueRef).
|
|
8
|
+
- Render Utilities: Helper functions for VNode rendering, class/style binding (getBind, toBind), and reactive property unwrapping (getRef, executeFunctionRef).
|
|
9
9
|
|
|
10
10
|
Triggers for Studying ai-types.md:
|
|
11
|
-
- When
|
|
12
|
-
- When
|
|
13
|
-
- When
|
|
14
|
-
- When
|
|
15
|
-
- When creating custom design classes inheriting from `DesignConstructorAbstract`.
|
|
11
|
+
- When encountering errors or ambiguity regarding Type constraints for API request/response contracts (`ApiDataValidation`, `ApiErrorStorageList`).
|
|
12
|
+
- When defining complex component Props or custom UI structures that require specific type inference for classes, styles, or slots.
|
|
13
|
+
- When implementing data lists (`ListDataRef`) or search logic that depends on strict structural compliance defined by `ListTypes` or `SearchTypes`.
|
|
14
|
+
- When integrating the `dxtFunctionalPlugin` or configuring custom API/Translate instances.
|
|
16
15
|
|
|
17
|
-
Integration Context:
|
|
18
|
-
This library serves as a middleware layer between raw API responses/browser APIs and Vue components. It is designed to work with `@dxtmisha/functional-basic` (the core utility provider) and relies on Vue's reactivity system. It is meant to be registered as a plugin (`dxtFunctionalPlugin`) to provide global configurations for API clients, translation services, and routing.
|
|
16
|
+
Integration Context: Built on top of Vue 3 and its reactivity system (Refs, Computed, EffectScope). It acts as a bridge between the `@dxtmisha/functional-basic` library and Vue, specifically handling the transformation of raw functional logic into Vue-compatible reactive objects, composables, and lifecycle-aware services.
|
package/ai-types.md
CHANGED
|
@@ -219,129 +219,34 @@ export declare function useApiAsyncRef<R, T = R>(path?: RefOrNormal<string | und
|
|
|
219
219
|
|
|
220
220
|
// File: src/composables/ref/useApiDelete.d.ts
|
|
221
221
|
export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
|
|
222
|
-
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
|
|
223
|
-
loading: Ref<boolean, boolean>;
|
|
224
|
-
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
225
|
-
};
|
|
222
|
+
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): { loading: Ref<boolean, boolean>; send(request?: Request | undefined): Promise<Return | undefined>; };
|
|
226
223
|
|
|
227
224
|
// File: src/composables/ref/useApiGet.d.ts
|
|
228
225
|
export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
|
|
229
|
-
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
|
|
230
|
-
loading: Ref<boolean, boolean>;
|
|
231
|
-
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
232
|
-
};
|
|
226
|
+
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): { loading: Ref<boolean, boolean>; send(request?: Request | undefined): Promise<Return | undefined>; };
|
|
233
227
|
|
|
234
228
|
// File: src/composables/ref/useApiManagementAsyncRef.d.ts
|
|
235
|
-
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): {
|
|
236
|
-
isValid: ComputedRef<boolean>;
|
|
237
|
-
isResponseContractValid: ComputedRef<boolean>;
|
|
238
|
-
responseValidationResult: ComputedRef< ApiDataValidation | undefined>;
|
|
239
|
-
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
240
|
-
readonly data: ComputedRef< ApiData<Return> | undefined>;
|
|
241
|
-
errorItem: ComputedRef< ApiErrorItem | undefined>;
|
|
242
|
-
readonly length: ComputedRef<number>;
|
|
243
|
-
lengthData: ComputedRef<number>;
|
|
244
|
-
starting: ComputedRef<boolean>;
|
|
245
|
-
reading: Ref<boolean, boolean>;
|
|
246
|
-
loading: Ref<boolean, boolean>;
|
|
247
|
-
loadingSearch: Ref<boolean, boolean> | undefined;
|
|
248
|
-
loadingPost: Ref<boolean, boolean> | undefined;
|
|
249
|
-
loadingPut: Ref<boolean, boolean> | undefined;
|
|
250
|
-
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
251
|
-
isSearch: ComputedRef<boolean> | undefined;
|
|
252
|
-
search: Ref<string>;
|
|
253
|
-
init: () => void;
|
|
254
|
-
initSsr: () => void;
|
|
255
|
-
reset: () => Promise<void>;
|
|
256
|
-
abort: () => void;
|
|
257
|
-
sendPost: (request?: ApiFetch["request"]) => Promise< ApiData<Post> | undefined>;
|
|
258
|
-
sendPut: (request?: ApiFetch["request"]) => Promise< ApiData<Put> | undefined>;
|
|
259
|
-
sendDelete: (request?: ApiFetch["request"]) => Promise< ApiData<Delete> | undefined>;
|
|
260
|
-
};
|
|
229
|
+
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): { isValid: ComputedRef<boolean>; isResponseContractValid: ComputedRef<boolean>; responseValidationResult: ComputedRef< ApiDataValidation | undefined>; list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>; readonly data: ComputedRef< ApiData<Return> | undefined>; errorItem: ComputedRef< ApiErrorItem | undefined>; readonly length: ComputedRef<number>; lengthData: ComputedRef<number>; starting: ComputedRef<boolean>; reading: Ref<boolean, boolean>; loading: Ref<boolean, boolean>; loadingSearch: Ref<boolean, boolean> | undefined; loadingPost: Ref<boolean, boolean> | undefined; loadingPut: Ref<boolean, boolean> | undefined; loadingDelete: Ref<boolean, boolean> | undefined; isSearch: ComputedRef<boolean> | undefined; search: Ref<string>; init: () => void; initSsr: () => void; reset: () => Promise<void>; abort: () => void; sendPost: (request?: ApiFetch["request"]) => Promise< ApiData<Post> | undefined>; sendPut: (request?: ApiFetch["request"]) => Promise< ApiData<Put> | undefined>; sendDelete: (request?: ApiFetch["request"]) => Promise< ApiData<Delete> | undefined>; };
|
|
261
230
|
|
|
262
231
|
// File: src/composables/ref/useApiManagementRef.d.ts
|
|
263
|
-
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): {
|
|
264
|
-
isValid: ComputedRef<boolean>;
|
|
265
|
-
isResponseContractValid: ComputedRef<boolean>;
|
|
266
|
-
responseValidationResult: ComputedRef< ApiDataValidation | undefined>;
|
|
267
|
-
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
268
|
-
readonly data: ComputedRef<ApiData<Return> | undefined>;
|
|
269
|
-
errorItem: ComputedRef< ApiErrorItem | undefined>;
|
|
270
|
-
readonly length: ComputedRef<number>;
|
|
271
|
-
lengthData: ComputedRef<number>;
|
|
272
|
-
starting: ComputedRef<boolean>;
|
|
273
|
-
reading: Ref<boolean, boolean>;
|
|
274
|
-
loading: Ref<boolean, boolean>;
|
|
275
|
-
loadingSearch: Ref<boolean, boolean> | undefined;
|
|
276
|
-
loadingPost: Ref<boolean, boolean> | undefined;
|
|
277
|
-
loadingPut: Ref<boolean, boolean> | undefined;
|
|
278
|
-
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
279
|
-
isSearch: ComputedRef<boolean> | undefined;
|
|
280
|
-
search: Ref<string>;
|
|
281
|
-
init: () => void;
|
|
282
|
-
initSsr: () => void;
|
|
283
|
-
reset: () => Promise<void>;
|
|
284
|
-
abort: () => void;
|
|
285
|
-
sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>;
|
|
286
|
-
sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
|
|
287
|
-
sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
|
|
288
|
-
};
|
|
232
|
+
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): { isValid: ComputedRef<boolean>; isResponseContractValid: ComputedRef<boolean>; responseValidationResult: ComputedRef< ApiDataValidation | undefined>; list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>; readonly data: ComputedRef<ApiData<Return> | undefined>; errorItem: ComputedRef< ApiErrorItem | undefined>; readonly length: ComputedRef<number>; lengthData: ComputedRef<number>; starting: ComputedRef<boolean>; reading: Ref<boolean, boolean>; loading: Ref<boolean, boolean>; loadingSearch: Ref<boolean, boolean> | undefined; loadingPost: Ref<boolean, boolean> | undefined; loadingPut: Ref<boolean, boolean> | undefined; loadingDelete: Ref<boolean, boolean> | undefined; isSearch: ComputedRef<boolean> | undefined; search: Ref<string>; init: () => void; initSsr: () => void; reset: () => Promise<void>; abort: () => void; sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>; sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>; sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>; };
|
|
289
233
|
|
|
290
234
|
// File: src/composables/ref/useApiPost.d.ts
|
|
291
235
|
export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
|
|
292
|
-
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
|
|
293
|
-
loading: Ref<boolean, boolean>;
|
|
294
|
-
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
295
|
-
};
|
|
236
|
+
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): { loading: Ref<boolean, boolean>; send(request?: Request | undefined): Promise<Return | undefined>; };
|
|
296
237
|
|
|
297
238
|
// File: src/composables/ref/useApiPut.d.ts
|
|
298
239
|
export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {}
|
|
299
|
-
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
|
|
300
|
-
loading: Ref<boolean, boolean>;
|
|
301
|
-
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
302
|
-
};
|
|
240
|
+
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): { loading: Ref<boolean, boolean>; send(request?: Request | undefined): Promise<Return | undefined>; };
|
|
303
241
|
|
|
304
242
|
// File: src/composables/ref/useApiRef.d.ts
|
|
305
|
-
export interface UseApiRef<R> {
|
|
306
|
-
data: ComputedRef<ApiData<R> | undefined>;
|
|
307
|
-
item: Ref<ApiData<R> | undefined>;
|
|
308
|
-
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
309
|
-
isResponseContractValid: ComputedRef<boolean>;
|
|
310
|
-
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
311
|
-
length: ComputedRef<number>;
|
|
312
|
-
starting: ComputedRef<boolean>;
|
|
313
|
-
loading: Ref<boolean>;
|
|
314
|
-
reading: Ref<boolean>;
|
|
315
|
-
isStarting(): boolean;
|
|
316
|
-
isLoading(): boolean;
|
|
317
|
-
isReading(): boolean;
|
|
318
|
-
getItem(): ApiData<R> | undefined;
|
|
319
|
-
init(): void;
|
|
320
|
-
initSsr(): void;
|
|
321
|
-
reset(): Promise<void>;
|
|
322
|
-
stop(): void;
|
|
323
|
-
abort(): void;
|
|
324
|
-
}
|
|
243
|
+
export interface UseApiRef<R> { data: ComputedRef<ApiData<R> | undefined>; item: Ref<ApiData<R> | undefined>; errorItem: ComputedRef<ApiErrorItem | undefined>; isResponseContractValid: ComputedRef<boolean>; responseValidationResult: ComputedRef<ApiDataValidation | undefined>; length: ComputedRef<number>; starting: ComputedRef<boolean>; loading: Ref<boolean>; reading: Ref<boolean>; isStarting(): boolean; isLoading(): boolean; isReading(): boolean; getItem(): ApiData<R> | undefined; init(): void; initSsr(): void; reset(): Promise<void>; stop(): void; abort(): void; }
|
|
325
244
|
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>;
|
|
326
245
|
export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
|
|
327
246
|
|
|
328
247
|
// File: src/composables/ref/useApiRequest.d.ts
|
|
329
|
-
export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
|
|
330
|
-
|
|
331
|
-
method?: ApiMethodItem;
|
|
332
|
-
action?: (data: Return | undefined) => Promise<void> | void;
|
|
333
|
-
transformation?: (data: T) => Return;
|
|
334
|
-
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
335
|
-
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
336
|
-
errorContract?: ApiErrorStorageList;
|
|
337
|
-
toData?: boolean;
|
|
338
|
-
options?: ApiOptions;
|
|
339
|
-
apiInstance?: ApiInstance;
|
|
340
|
-
}
|
|
341
|
-
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>): {
|
|
342
|
-
loading: Ref<boolean, boolean>;
|
|
343
|
-
send(request?: Request): Promise<Return | undefined>;
|
|
344
|
-
};
|
|
248
|
+
export interface UseApiRequestSetup<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; validateRequestContract?: (data: Request) => ApiDataValidation & Return; validateResponseContract?: (data: T) => ApiDataValidation & Return; errorContract?: ApiErrorStorageList; toData?: boolean; options?: ApiOptions; apiInstance?: ApiInstance; }
|
|
249
|
+
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>): { loading: Ref<boolean, boolean>; send(request?: Request): Promise<Return | undefined>; };
|
|
345
250
|
|
|
346
251
|
// File: src/composables/ref/useBroadcastValueRef.d.ts
|
|
347
252
|
export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<T | string | undefined>;
|
|
@@ -350,10 +255,7 @@ export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T |
|
|
|
350
255
|
export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
|
|
351
256
|
|
|
352
257
|
// File: src/composables/ref/useFormattersRef.d.ts
|
|
353
|
-
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
|
|
354
|
-
listFormat: ComputedRef<FormattersReturn<List, Options>>;
|
|
355
|
-
length: ComputedRef<number>;
|
|
356
|
-
};
|
|
258
|
+
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): { listFormat: ComputedRef<FormattersReturn<List, Options>>; length: ComputedRef<number>; };
|
|
357
259
|
|
|
358
260
|
// File: src/composables/ref/useGeoIntlRef.d.ts
|
|
359
261
|
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
@@ -367,71 +269,26 @@ export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | und
|
|
|
367
269
|
|
|
368
270
|
// File: src/composables/ref/useLazyRef.d.ts
|
|
369
271
|
export type LazyItem = { status: ShallowRef<boolean>; ratio: ShallowRef<number>; entry: ShallowRef<IntersectionObserverEntry | undefined>; stopWatch: () => void; };
|
|
370
|
-
export
|
|
371
|
-
|
|
372
|
-
getItem(element: HTMLElement): LazyItem;
|
|
373
|
-
addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>;
|
|
374
|
-
removeLazyItem: (element?: HTMLElement) => void;
|
|
375
|
-
disconnectLazy: () => void | undefined;
|
|
376
|
-
};
|
|
272
|
+
export type LazyList = Record<string, LazyItem>;
|
|
273
|
+
export declare const useLazyRef: (options?: IntersectionObserverInit) => { intersectionObserver: IntersectionObserver | undefined; getItem(element: HTMLElement): LazyItem; addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>; removeLazyItem: (element?: HTMLElement) => void; disconnectLazy: () => void | undefined; };
|
|
377
274
|
|
|
378
275
|
// File: src/composables/ref/useLoadingRef.d.ts
|
|
379
276
|
export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
|
|
380
277
|
|
|
381
278
|
// File: src/composables/ref/useMeta.d.ts
|
|
382
|
-
export declare const useMeta: () => Readonly<{
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
description: Ref<string, string>;
|
|
387
|
-
author: Ref<string, string>;
|
|
388
|
-
image: Ref<string, string>;
|
|
389
|
-
canonical: Ref<string, string>;
|
|
390
|
-
robots: Ref<MetaRobots, MetaRobots>;
|
|
391
|
-
siteName: Ref<string, string>;
|
|
392
|
-
getHtmlMeta: () => string;
|
|
393
|
-
sync: () => void;
|
|
394
|
-
update: () => void;
|
|
395
|
-
updateSsr: () => void;
|
|
396
|
-
setTitle: (value: string) => void;
|
|
397
|
-
setKeywords: (value: string) => void;
|
|
398
|
-
setDescription: (value: string) => void;
|
|
399
|
-
setAuthor: (value: string) => void;
|
|
400
|
-
setImage: (value: string) => void;
|
|
401
|
-
setCanonical: (value: string) => void;
|
|
402
|
-
setRobots: (value: MetaRobots) => void;
|
|
403
|
-
setSiteName: (value: string) => void;
|
|
404
|
-
setSuffix: (suffix: string) => typeof MetaStatic;
|
|
405
|
-
} & {
|
|
406
|
-
init(): any;
|
|
407
|
-
destroyExecute?(): void;
|
|
408
|
-
}>;
|
|
279
|
+
export declare const useMeta: () => Readonly<{ meta: typeof MetaStatic; title: Ref<string, string>; keyword: Ref<string, string>; description: Ref<string, string>; author: Ref<string, string>; image: Ref<string, string>; canonical: Ref<string, string>; robots: Ref<MetaRobots, MetaRobots>; siteName: Ref<string, string>; getHtmlMeta: () => string; sync: () => void; update: () => void; updateSsr: () => void; setTitle: (value: string) => void; setKeywords: (value: string) => void; setDescription: (value: string) => void; setAuthor: (value: string) => void; setImage: (value: string) => void; setCanonical: (value: string) => void; setRobots: (value: MetaRobots) => void; setSiteName: (value: string) => void; setSuffix: (suffix: string) => typeof MetaStatic; } & { init(): any; destroyExecute?(): void; }>;
|
|
280
|
+
|
|
281
|
+
// File: src/composables/ref/useQueryRef.d.ts
|
|
282
|
+
export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
409
283
|
|
|
410
284
|
// File: src/composables/ref/useRouterList.d.ts
|
|
411
|
-
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
|
|
412
|
-
item: ComputedRef<T | undefined>;
|
|
413
|
-
selected: Ref<string, string>;
|
|
414
|
-
label: ComputedRef<NumberOrString>;
|
|
415
|
-
list: ComputedRef<ConstrBind<T>[]>;
|
|
416
|
-
to: (name?: string) => void;
|
|
417
|
-
toMain(): void;
|
|
418
|
-
};
|
|
285
|
+
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => { item: ComputedRef<T | undefined>; selected: Ref<string, string>; label: ComputedRef<NumberOrString>; list: ComputedRef<ConstrBind<T>[]>; to: (name?: string) => void; toMain(): void; };
|
|
419
286
|
|
|
420
287
|
// File: src/composables/ref/useSearchRef.d.ts
|
|
421
|
-
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns: K, value?: Ref<string>, options?: SearchOptions): {
|
|
422
|
-
isSearch: ComputedRef<boolean>;
|
|
423
|
-
search: Ref<string, string>;
|
|
424
|
-
loading: Ref<boolean, boolean>;
|
|
425
|
-
listSearch: ComputedRef<SearchFormatList<T, K>>;
|
|
426
|
-
length: ComputedRef<number>;
|
|
427
|
-
};
|
|
288
|
+
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns: K, value?: Ref<string>, options?: SearchOptions): { isSearch: ComputedRef<boolean>; search: Ref<string, string>; loading: Ref<boolean, boolean>; listSearch: ComputedRef<SearchFormatList<T, K>>; length: ComputedRef<number>; };
|
|
428
289
|
|
|
429
290
|
// File: src/composables/ref/useSearchValueRef.d.ts
|
|
430
|
-
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
|
|
431
|
-
search: Ref<string, string>;
|
|
432
|
-
searchDelay: Ref<string, string>;
|
|
433
|
-
loading: Ref<boolean, boolean>;
|
|
434
|
-
};
|
|
291
|
+
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): { search: Ref<string, string>; searchDelay: Ref<string, string>; loading: Ref<boolean, boolean>; };
|
|
435
292
|
|
|
436
293
|
// File: src/composables/ref/useSessionRef.d.ts
|
|
437
294
|
export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
|
|
@@ -459,25 +316,16 @@ export declare function computedByLanguage<T, R extends (T | undefined) = T | un
|
|
|
459
316
|
export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
|
|
460
317
|
|
|
461
318
|
// File: src/functions/dxtFunctionalPlugin.d.ts
|
|
462
|
-
export interface FunctionalPluginOptions {
|
|
463
|
-
api?: ApiConfig;
|
|
464
|
-
translate?: TranslateConfig;
|
|
465
|
-
location?: string | (() => string);
|
|
466
|
-
metaSuffix?: string;
|
|
467
|
-
icons?: IconsConfig;
|
|
468
|
-
router?: Router;
|
|
469
|
-
errorCauses?: ErrorCenterCauseList;
|
|
470
|
-
errorHandlers?: ErrorCenterHandlerList;
|
|
471
|
-
}
|
|
319
|
+
export interface FunctionalPluginOptions { api?: ApiConfig; translate?: TranslateConfig; location?: string | (() => string); metaSuffix?: string; icons?: IconsConfig; router?: Router; errorCauses?: ErrorCenterCauseList; errorHandlers?: ErrorCenterHandlerList; }
|
|
472
320
|
export declare const dxtFunctionalPlugin: Plugin;
|
|
473
321
|
|
|
474
322
|
// File: src/functions/executeUse.d.ts
|
|
475
323
|
export declare enum ExecuteUseType { global = "global", provide = "provide", local = "local" }
|
|
476
324
|
export type ExecuteUseReturn<R> = Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>;
|
|
477
325
|
export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
|
|
478
|
-
export declare function executeUseGlobal<R>(callback: () => R):
|
|
479
|
-
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R):
|
|
480
|
-
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R):
|
|
326
|
+
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>) | (() => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>);
|
|
327
|
+
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>) | (() => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>);
|
|
328
|
+
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>) | (() => Readonly<R & { init(): Readonly<R>; destroyExecute?(): void; }>);
|
|
481
329
|
export declare function executeUseGlobalInit(): void;
|
|
482
330
|
|
|
483
331
|
// File: src/functions/getInject.d.ts
|
|
@@ -556,6 +404,7 @@ export * from './composables/ref/useLazyItemByMarginRef';
|
|
|
556
404
|
export * from './composables/ref/useLazyRef';
|
|
557
405
|
export * from './composables/ref/useLoadingRef';
|
|
558
406
|
export * from './composables/ref/useMeta';
|
|
407
|
+
export * from './composables/ref/useQueryRef';
|
|
559
408
|
export * from './composables/ref/useRouterList';
|
|
560
409
|
export * from './composables/ref/useSearchRef';
|
|
561
410
|
export * from './composables/ref/useSearchValueRef';
|
|
@@ -591,29 +440,9 @@ export * from './types/searchTypes';
|
|
|
591
440
|
// File: src/types/apiTypes.d.ts
|
|
592
441
|
export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
593
442
|
export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
594
|
-
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
595
|
-
path?: RefOrNormal<string | undefined>;
|
|
596
|
-
options?: ApiOptions;
|
|
597
|
-
reactivity?: boolean;
|
|
598
|
-
conditions?: RefType<boolean>;
|
|
599
|
-
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
600
|
-
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
601
|
-
errorContract?: ApiErrorStorageList;
|
|
602
|
-
typeData?: ((data: Return) => boolean) | any;
|
|
603
|
-
unmounted?: boolean;
|
|
604
|
-
skeleton?: () => Return;
|
|
605
|
-
};
|
|
443
|
+
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = { path?: RefOrNormal<string | undefined>; options?: ApiOptions; reactivity?: boolean; conditions?: RefType<boolean>; transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>; validateResponseContract?: (data: Type) => ApiDataValidation; errorContract?: ApiErrorStorageList; typeData?: ((data: Return) => boolean) | any; unmounted?: boolean; skeleton?: () => Return; };
|
|
606
444
|
export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = { columns: K; value?: Ref<string>; options?: SearchOptions; };
|
|
607
|
-
export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
|
|
608
|
-
path?: RefOrNormal<string | undefined>;
|
|
609
|
-
action?: (data: Return | undefined) => Promise<void> | void;
|
|
610
|
-
transformation?: (data: T) => Return;
|
|
611
|
-
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
612
|
-
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
613
|
-
errorContract?: ApiErrorStorageList;
|
|
614
|
-
toData?: boolean;
|
|
615
|
-
options?: ApiOptions;
|
|
616
|
-
};
|
|
445
|
+
export type ApiManagementRequest<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; validateRequestContract?: (data: Request) => ApiDataValidation & Return; validateResponseContract?: (data: T) => ApiDataValidation & Return; errorContract?: ApiErrorStorageList; toData?: boolean; options?: ApiOptions; };
|
|
617
446
|
|
|
618
447
|
// File: src/types/constructorTypes.d.ts
|
|
619
448
|
export type ConstrItem = Record<string, any>;
|
|
@@ -630,19 +459,8 @@ export type ConstrClassList = Record<string, ConstrClass>;
|
|
|
630
459
|
export type ConstrClasses = { main: ConstrClass; } & ConstrClassList;
|
|
631
460
|
export type ConstrStylesItem = string | null;
|
|
632
461
|
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
633
|
-
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
634
|
-
|
|
635
|
-
compMod?: ConstrComponentMod<P>;
|
|
636
|
-
emits?: ConstrEmit<EMITS>;
|
|
637
|
-
classes?: RefType<ConstrClasses>;
|
|
638
|
-
styles?: RefType<ConstrStyles>;
|
|
639
|
-
};
|
|
640
|
-
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
641
|
-
name: string;
|
|
642
|
-
element: Ref<E | undefined>;
|
|
643
|
-
classes: RefType<CLASSES>;
|
|
644
|
-
styles: RefType<ConstrStyles>;
|
|
645
|
-
} & SETUP;
|
|
462
|
+
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = { components?: COMP; compMod?: ConstrComponentMod<P>; emits?: ConstrEmit<EMITS>; classes?: RefType<ConstrClasses>; styles?: RefType<ConstrStyles>; };
|
|
463
|
+
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = { name: string; element: Ref<E | undefined>; classes: RefType<CLASSES>; styles: RefType<ConstrStyles>; } & SETUP;
|
|
646
464
|
export type ConstrRegistration = { flag?: boolean; translate?: Record<string, string>; };
|
|
647
465
|
export type ConstrBind<T> = T & Record<string, any> & { key?: string; class?: ConstrClass; style?: ConstrStyles; };
|
|
648
466
|
export type ConstrPropItemOptions<T = any> = { type?: PropType<T>; required?: boolean; default?: any; validator?(value: any, props: any): boolean; };
|