@@ -5,11 +5,12 @@ import {
55 createFetch ,
66} from '@vueuse/core'
77import { 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 ,
1314} from '#/utils/fetch'
1415
1516type MethodOption < M , P > = 'get' extends keyof P ? { method ?: M } : { method : M }
@@ -44,7 +45,7 @@ export type UseOpenFetchClient<Paths> = <
4445 ResT = FetchResponseData < Methods [ DefaultMethod ] > ,
4546> (
4647 path : Path | ( ( ) => Path ) ,
47- options : RequestInit & UseOpenFetchOptions < Method , LowercasedMethod , Methods > ,
48+ options : UseOpenFetchOptions < Method , LowercasedMethod , Methods > ,
4849 useFetchOptions ?: UseFetchOptions ,
4950) => UseFetchReturn < ResT > & PromiseLike < UseFetchReturn < ResT > >
5051
@@ -62,7 +63,7 @@ export function createUseOpenFetch<Paths>(
6263
6364 return (
6465 url : MaybeRefOrGetter < string > ,
65- requests : RequestInit ,
66+ requests : any , //TODO: find a way to type this
6667 useFetchOptions ?: UseFetchOptions ,
6768 ) => {
6869 return useFetch ( toValue ( url ) , requests , useFetchOptions )
0 commit comments