userequestdemo 1.0.2 → 1.0.3

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/index.d.ts +15 -0
  2. package/package.json +1 -2
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ interface Result<T>{
2
+ data: Ref<T>
3
+ loading:Ref<boolean>
4
+ error: Ref<Error| null>
5
+ }
6
+ interface Options{
7
+ initData?:any,
8
+ onSuccess?:(data:any)=>void,
9
+ onError?:(error:Error)=>void
10
+ }
11
+ declare const useRequest:{
12
+ (requestFn:(...args:any[])=>Promise<T>, options:Options):Result<T>
13
+ }
14
+
15
+ export default useResize
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "userequestdemo",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A Vue hook for handling HTTP request",
5
5
  "main": "dist/userequestdemo.umd.js",
6
6
  "module": "dist/userequestdemo.mjs",
7
- "types": "dist/index.d.ts",
8
7
  "scripts": {
9
8
  "test": "echo \"Error: no test specified\" && exit 1",
10
9
  "build": "vite build"