Webroute

@webroute/clientType aliases

TypedClient

TypedClient<TApp, TFetcher>: <TKey>(key) => TApp[TKey] extends infer TEndpoint ? TFetcher extends Fetcher<infer TOpts, infer TResponse> ? (config, ...args) => Promise<FetcherReturn<TEndpoint["Output"], TResponse>> : never : never

Type Parameters

Type Parameter
TApp extends AppDef
TFetcher extends Fetcher<any, any>

Type Parameters

Type Parameter
TKey extends keyof TApp & string

Parameters

ParameterType
keyTKey

Returns

TApp[TKey] extends infer TEndpoint ? TFetcher extends Fetcher<infer TOpts, infer TResponse> ? (config, ...args) => Promise<FetcherReturn<TEndpoint["Output"], TResponse>> : never : never

On this page