@vesperjs/shared 0.9.0 → 0.9.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/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.0",
3
+ "version": "0.9.1",
4
4
  "keywords": [
5
5
  "Nuxt",
6
6
  "vue.js"