@vesperjs/shared 0.9.0 → 0.9.2
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/dist/index.d.mts +8 -2
- package/dist/index.mjs +13 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref, WritableComputedRef } from "@vue/reactivity";
|
|
2
2
|
|
|
3
3
|
//#region src/types/error/backend-error-info.d.ts
|
|
4
|
-
interface BackendErrorInfo<BER> {
|
|
4
|
+
interface BackendErrorInfo<BER extends object> {
|
|
5
5
|
error?: BER;
|
|
6
6
|
status?: number;
|
|
7
7
|
}
|
|
@@ -27,6 +27,12 @@ interface Flash {
|
|
|
27
27
|
alert?: string;
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
+
//#region src/composables/backend/error/use-backend-error-info.d.ts
|
|
31
|
+
declare const useBackendErrorInfo: <R extends object>() => {
|
|
32
|
+
backendErrorInfo: Ref<BackendErrorInfo<R>>;
|
|
33
|
+
clearBackendErrorInfo: () => void;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
30
36
|
//#region src/composables/backend/error/use-external-errors.d.ts
|
|
31
37
|
declare const useExternalErrors: <P extends string>(flash: Ref<Flash>) => {
|
|
32
38
|
externalErrors: WritableComputedRef<ErrorMessages<P>>;
|
|
@@ -62,4 +68,4 @@ declare const useFlash: () => {
|
|
|
62
68
|
};
|
|
63
69
|
type UseFlashType = ReturnType<typeof useFlash>;
|
|
64
70
|
//#endregion
|
|
65
|
-
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseFlashType, useDate, useEntity, useExternalErrors, useFlash };
|
|
71
|
+
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseFlashType, useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { computed, ref } from "@vue/reactivity";
|
|
2
2
|
import { parse } from "@formkit/tempo";
|
|
3
|
+
//#region src/composables/backend/error/use-backend-error-info.ts
|
|
4
|
+
const useBackendErrorInfo = function() {
|
|
5
|
+
const backendErrorInfo = ref({});
|
|
6
|
+
const clearBackendErrorInfo = () => {
|
|
7
|
+
backendErrorInfo.value = {};
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
backendErrorInfo,
|
|
11
|
+
clearBackendErrorInfo
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
3
15
|
//#region src/composables/backend/error/use-external-errors.ts
|
|
4
16
|
const useExternalErrors = function(flash) {
|
|
5
17
|
const errors = ref({});
|
|
@@ -68,4 +80,4 @@ const useFlash = function() {
|
|
|
68
80
|
};
|
|
69
81
|
};
|
|
70
82
|
//#endregion
|
|
71
|
-
export { useDate, useEntity, useExternalErrors, useFlash };
|
|
83
|
+
export { useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesperjs/shared",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Nuxt",
|
|
6
6
|
"vue.js"
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
28
28
|
"@typescript-eslint/parser": "^8.60.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
30
|
-
"eslint": "^10.4.
|
|
30
|
+
"eslint": "^10.4.1",
|
|
31
31
|
"eslint-plugin-vue": "^10.9.1",
|
|
32
32
|
"oxfmt": "^0.52.0",
|
|
33
|
-
"tsdown": "^0.22.
|
|
33
|
+
"tsdown": "^0.22.1",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
35
|
"typescript-eslint": "^8.60.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@vue/reactivity": "^3.5.
|
|
38
|
+
"@vue/reactivity": "^3.5.35 || ^3.6.0-beta.13"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown --dts",
|