@@ -16,7 +16,6 @@ import type {
1616 ValidateSerializableInput ,
1717 Validator ,
1818} from '@tanstack/router-core'
19- import type { JsonResponse } from '@tanstack/router-core/ssr/client'
2019import type {
2120 AnyFunctionMiddleware ,
2221 AnyRequestMiddleware ,
@@ -263,14 +262,14 @@ export interface OptionalFetcher<TMiddlewares, TInputValidator, TResponse>
263262 extends FetcherBase {
264263 (
265264 options ?: OptionalFetcherDataOptions < TMiddlewares , TInputValidator > ,
266- ) : Promise < FetcherData < TResponse > >
265+ ) : Promise < Awaited < TResponse > >
267266}
268267
269268export interface RequiredFetcher < TMiddlewares , TInputValidator , TResponse >
270269 extends FetcherBase {
271270 (
272271 opts : RequiredFetcherDataOptions < TMiddlewares , TInputValidator > ,
273- ) : Promise < FetcherData < TResponse > >
272+ ) : Promise < Awaited < TResponse > >
274273}
275274
276275export type FetcherBaseOptions = {
@@ -294,13 +293,6 @@ export type RscStream<T> = {
294293
295294export type Method = 'GET' | 'POST'
296295
297- export type FetcherData < TResponse > =
298- Awaited < TResponse > extends Response
299- ? Awaited < TResponse >
300- : Awaited < TResponse > extends JsonResponse < any >
301- ? ReturnType < Awaited < TResponse > [ 'json' ] >
302- : Awaited < TResponse >
303-
304296export type ServerFnReturnType < TRegister , TResponse > =
305297 Awaited < TResponse > extends Response
306298 ? TResponse
0 commit comments