@@ -5,11 +5,12 @@ import {
5
5
createFetch ,
6
6
} from '@vueuse/core'
7
7
import { type MaybeRefOrGetter , toValue } from 'vue'
8
- import type {
9
- FetchResponseData ,
10
- FilterMethods ,
11
- ParamsOption ,
12
- RequestBodyOption ,
8
+ import {
9
+ type FetchResponseData ,
10
+ type FilterMethods ,
11
+ type ParamsOption ,
12
+ type RequestBodyOption ,
13
+ createOpenFetch ,
13
14
} from '#/utils/fetch'
14
15
15
16
type MethodOption < M , P > = 'get' extends keyof P ? { method ?: M } : { method : M }
@@ -44,7 +45,7 @@ export type UseOpenFetchClient<Paths> = <
44
45
ResT = FetchResponseData < Methods [ DefaultMethod ] > ,
45
46
> (
46
47
path : Path | ( ( ) => Path ) ,
47
- options : RequestInit & UseOpenFetchOptions < Method , LowercasedMethod , Methods > ,
48
+ options : UseOpenFetchOptions < Method , LowercasedMethod , Methods > ,
48
49
useFetchOptions ?: UseFetchOptions ,
49
50
) => UseFetchReturn < ResT > & PromiseLike < UseFetchReturn < ResT > >
50
51
@@ -62,7 +63,7 @@ export function createUseOpenFetch<Paths>(
62
63
63
64
return (
64
65
url : MaybeRefOrGetter < string > ,
65
- requests : RequestInit ,
66
+ requests : any , //TODO: find a way to type this
66
67
useFetchOptions ?: UseFetchOptions ,
67
68
) => {
68
69
return useFetch ( toValue ( url ) , requests , useFetchOptions )
0 commit comments