vue-use-async 1.12.1 → 1.13.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.
Files changed (2) hide show
  1. package/dist/useXhr.d.ts +12 -12
  2. package/package.json +29 -23
package/dist/useXhr.d.ts CHANGED
@@ -19,37 +19,37 @@ declare type UseXhr<T, Z extends TypeAllowed, A extends TypeAllowed[], F extends
19
19
  export default function <T, Z extends TypeAllowed, A extends TypeAllowed[], F extends ((..._args: A) => Promise<T>) | ((_args: Z) => Promise<T>), P extends RequiredParams<Parameters<F>[0], A>>(args?: UseXhr<T, Z, A, F, P>): {
20
20
  get: <TT = T, ZZ extends TypeAllowed = Z, AA extends TypeAllowed[] = A>(parametersObj: GetConfig<ZZ>, params?: RequiredParams<ZZ, AA>, enabled?: Enabled) => GetReturn<TT>;
21
21
  post: <TT = T, ZZ extends TypeAllowed = Z, AA extends TypeAllowed[] = A>(xhrConfig?: $UpdateConfigArgs, params?: RequiredParams<ZZ, AA>) => {
22
- xhr: Xhr<TT>;
23
22
  isPending: Ref<undefined | boolean>;
24
23
  data: ComputedRef<TT | null | undefined>;
25
24
  error: Ref<null | Error>;
26
25
  reload: () => Promise<TT> | null;
27
- onError: (cb: (e: null | Error, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
28
- onStart: (cb: (params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
29
- onEnd: (cb: (res: TT, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => unknown;
26
+ onError: (cb: (e: null | Error, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
27
+ onStart: (cb: (params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
28
+ onEnd: (cb: (res: TT, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => unknown;
30
29
  promise: ComputedRef<Promise<TT> | null>;
30
+ xhr: Xhr<TT>;
31
31
  };
32
32
  put: <TT = T, ZZ extends TypeAllowed = Z, AA extends TypeAllowed[] = A>(xhrConfig?: $UpdateConfigArgs, params?: RequiredParams<ZZ, AA>) => {
33
- xhr: Xhr<TT>;
34
33
  isPending: Ref<undefined | boolean>;
35
34
  data: ComputedRef<TT | null | undefined>;
36
35
  error: Ref<null | Error>;
37
36
  reload: () => Promise<TT> | null;
38
- onError: (cb: (e: null | Error, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
39
- onStart: (cb: (params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
40
- onEnd: (cb: (res: TT, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => unknown;
37
+ onError: (cb: (e: null | Error, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
38
+ onStart: (cb: (params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
39
+ onEnd: (cb: (res: TT, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => unknown;
41
40
  promise: ComputedRef<Promise<TT> | null>;
41
+ xhr: Xhr<TT>;
42
42
  };
43
43
  delete: <TT = T, ZZ extends TypeAllowed = Z, AA extends TypeAllowed[] = A>(xhrConfig?: $UpdateConfigArgs, params?: RequiredParams<ZZ, AA>) => {
44
- xhr: Xhr<TT>;
45
44
  isPending: Ref<undefined | boolean>;
46
45
  data: ComputedRef<TT | null | undefined>;
47
46
  error: Ref<null | Error>;
48
47
  reload: () => Promise<TT> | null;
49
- onError: (cb: (e: null | Error, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
50
- onStart: (cb: (params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => void;
51
- onEnd: (cb: (res: TT, params: [] | TypeAllowed | Ref<[] | TypeAllowed, [] | TypeAllowed>) => unknown) => unknown;
48
+ onError: (cb: (e: null | Error, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
49
+ onStart: (cb: (params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => void;
50
+ onEnd: (cb: (res: TT, params: Ref<[] | TypeAllowed, [] | TypeAllowed> | [] | TypeAllowed) => unknown) => unknown;
52
51
  promise: ComputedRef<Promise<TT> | null>;
52
+ xhr: Xhr<TT>;
53
53
  };
54
54
  };
55
55
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-use-async",
3
- "version": "1.12.1",
3
+ "version": "1.13.0",
4
4
  "description": "Xhr and async helpers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,49 +13,51 @@
13
13
  "types": "./dist/index.d.ts",
14
14
  "scripts": {
15
15
  "afterbuild": "node ./scripts/afterbuild.cjs",
16
- "beforebuild": "node ./scripts/beforeBuild.cjs && npm run tsc:export-types",
16
+ "beforebuild": "node ./scripts/beforeBuild.cjs && npm run tsgo:export-types",
17
17
  "build": "npm run beforebuild && npm run build:webpack && npm run afterbuild",
18
18
  "build:webpack": "webpack --mode=production",
19
- "lint": "npm run tsc:check-types && eslint scripts src tests",
20
- "lint:fix": "npm run tsc:check-types && eslint --fix scripts src tests",
21
- "lint:quiet": "eslint --quiet \"{tests,src}/**/*.{js,ts,tsx,vue}\" && npm run tsc:check-types",
19
+ "lint": "npm run tsgo:check-types && eslint scripts src tests",
20
+ "lint:fix": "npm run tsgo:check-types && eslint --fix scripts src tests",
21
+ "lint:quiet": "eslint --quiet \"{tests,src}/**/*.{js,ts,tsx,vue}\" && npm run tsgo:check-types",
22
22
  "precommit": "lint-staged",
23
23
  "prepare": "husky",
24
24
  "prepublishOnly": "npm run lint && npm run test && npm run build",
25
25
  "test": "NODE_OPTIONS=--unhandled-rejections=warn jest tests/** --no-cache",
26
- "tsc:check-types": "tsc --noemit",
27
- "tsc:export-types": "tsc --outDir types"
26
+ "tsgo:check-types": "tsgo --noemit",
27
+ "tsgo:export-types": "tsgo --outDir types"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/plugin-proposal-class-properties": "^7.18.6",
31
31
  "@babel/plugin-proposal-decorators": "^7.29.0",
32
- "@babel/preset-env": "^7.29.0",
32
+ "@babel/preset-env": "^7.29.5",
33
33
  "@babel/preset-typescript": "^7.28.5",
34
- "@eslint/compat": "^2.0.3",
34
+ "@eslint/compat": "^2.1.0",
35
35
  "@eslint/eslintrc": "^3.3.5",
36
36
  "@eslint/js": "^9.39.2",
37
37
  "@stylistic/eslint-plugin": "^5.10.0",
38
38
  "@types/jest": "^30.0.0",
39
- "@typescript-eslint/eslint-plugin": "^8.57.0",
40
- "@typescript-eslint/parser": "^8.57.0",
39
+ "@types/node": "^25.9.1",
40
+ "@typescript-eslint/eslint-plugin": "^8.59.4",
41
+ "@typescript-eslint/parser": "^8.59.4",
42
+ "@typescript/native-preview": "^7.0.0-dev.20260519.1",
41
43
  "babel-loader": "^10.1.1",
42
- "babel-plugin-module-resolver": "^5.0.2",
44
+ "babel-plugin-module-resolver": "^5.0.3",
43
45
  "eslint": "^9.39.2",
44
- "eslint-config-airbnb-extended": "^3.0.1",
46
+ "eslint-config-airbnb-extended": "^3.1.0",
45
47
  "eslint-import-resolver-typescript": "^4.4.4",
46
48
  "eslint-plugin-import-x": "^4.16.2",
47
- "eslint-plugin-jest": "^29.15.0",
48
- "eslint-plugin-n": "^17.24.0",
49
+ "eslint-plugin-jest": "^29.15.2",
50
+ "eslint-plugin-n": "^18.0.1",
49
51
  "husky": "^9.1.7",
50
- "jest": "^30.3.0",
51
- "jest-environment-jsdom": "^30.3.0",
52
- "lint-staged": "^16.4.0",
52
+ "jest": "^30.4.2",
53
+ "jest-environment-jsdom": "^30.4.1",
54
+ "lint-staged": "^17.0.5",
53
55
  "rimraf": "^6.1.3",
54
56
  "ts-node": "^10.9.2",
55
- "typescript": "^5.9.3",
56
- "typescript-eslint": "^8.57.0",
57
- "webpack": "^5.105.4",
58
- "webpack-cli": "^7.0.0"
57
+ "typescript": "^6.0.3",
58
+ "typescript-eslint": "^8.59.4",
59
+ "webpack": "^5.107.0",
60
+ "webpack-cli": "^7.0.2"
59
61
  },
60
62
  "peerDependencies": {
61
63
  "vue": "*"
@@ -63,5 +65,9 @@
63
65
  "os": [
64
66
  "darwin",
65
67
  "linux"
66
- ]
68
+ ],
69
+ "dependencies": {
70
+ "@eslint/config-helpers": "^0.6.0",
71
+ "@jest/globals": "^30.4.1"
72
+ }
67
73
  }