@vesperjs/shared 0.8.2 → 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
- import { ComputedRef, Ref, WritableComputedRef } from "@vue/reactivity";
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,23 +27,19 @@ interface Flash {
27
27
  alert?: string;
28
28
  }
29
29
  //#endregion
30
- //#region src/composables/backend/error/use-external-errors.d.ts
31
- declare const useExternalErrors: <P extends string>({
32
- flash
33
- }: {
34
- flash: Ref<Flash>;
35
- }) => {
36
- externalErrors: WritableComputedRef<Partial<Record<P, string[]>>, Partial<Record<P, string[]>>>;
37
- clearExternalErrors: () => void;
38
- isSuccess: () => boolean;
39
- };
40
- //#endregion
41
30
  //#region src/composables/backend/error/use-backend-error-info.d.ts
42
31
  declare const useBackendErrorInfo: <R extends object>() => {
43
- backendErrorInfo: ComputedRef<BackendErrorInfo<R>>;
32
+ backendErrorInfo: Ref<BackendErrorInfo<R>>;
44
33
  clearBackendErrorInfo: () => void;
45
34
  };
46
35
  //#endregion
36
+ //#region src/composables/backend/error/use-external-errors.d.ts
37
+ declare const useExternalErrors: <P extends string>(flash: Ref<Flash>) => {
38
+ externalErrors: WritableComputedRef<ErrorMessages<P>>;
39
+ clearExternalErrors: () => void;
40
+ isSuccess: () => boolean;
41
+ };
42
+ //#endregion
47
43
  //#region src/composables/util/use-date.d.ts
48
44
  declare const useDate: (fmtDate?: string, locale?: string) => {
49
45
  isValidDate: (value: string) => boolean;
@@ -67,13 +63,7 @@ declare const useEntity: <M extends object, R extends object = M>() => {
67
63
  //#endregion
68
64
  //#region src/composables/use-flash.d.ts
69
65
  declare const useFlash: () => {
70
- flash: Ref<{
71
- notice?: string | undefined;
72
- alert?: string | undefined;
73
- }, Flash | {
74
- notice?: string | undefined;
75
- alert?: string | undefined;
76
- }>;
66
+ flash: Ref<Flash>;
77
67
  clearFlash: () => void;
78
68
  };
79
69
  type UseFlashType = ReturnType<typeof useFlash>;
package/dist/index.mjs CHANGED
@@ -1,7 +1,19 @@
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
- const useExternalErrors = function({ flash }) {
16
+ const useExternalErrors = function(flash) {
5
17
  const errors = ref({});
6
18
  const externalErrors = computed({
7
19
  get() {
@@ -27,21 +39,6 @@ const useExternalErrors = function({ flash }) {
27
39
  };
28
40
  };
29
41
  //#endregion
30
- //#region src/composables/backend/error/use-backend-error-info.ts
31
- const useBackendErrorInfo = function() {
32
- const info = ref({});
33
- const backendErrorInfo = computed(() => {
34
- return info.value;
35
- });
36
- const clearBackendErrorInfo = () => {
37
- info.value = {};
38
- };
39
- return {
40
- backendErrorInfo,
41
- clearBackendErrorInfo
42
- };
43
- };
44
- //#endregion
45
42
  //#region src/composables/util/use-date.ts
46
43
  const useDate = function(fmtDate = "YYYY/MM/DD", locale) {
47
44
  const isValidDate = (value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesperjs/shared",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "keywords": [
5
5
  "Nuxt",
6
6
  "vue.js"
@@ -24,15 +24,15 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@eslint/js": "^10.0.1",
27
- "@typescript-eslint/eslint-plugin": "^8.59.4",
28
- "@typescript-eslint/parser": "^8.59.4",
27
+ "@typescript-eslint/eslint-plugin": "^8.60.0",
28
+ "@typescript-eslint/parser": "^8.60.0",
29
29
  "@vue/eslint-config-typescript": "^14.7.0",
30
30
  "eslint": "^10.4.0",
31
31
  "eslint-plugin-vue": "^10.9.1",
32
- "oxfmt": "^0.51.0",
32
+ "oxfmt": "^0.52.0",
33
33
  "tsdown": "^0.22.0",
34
34
  "typescript": "^6.0.3",
35
- "typescript-eslint": "^8.59.4"
35
+ "typescript-eslint": "^8.60.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@vue/reactivity": "^3.5.34 || ^3.6.0-beta.12"