You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
enhance $fetch's request type infer from generated InternalApi interface #208
This will also provide Nuxt 3's useFetch and useLazyFetch to also have type hints on request parameters with little type changes. see issue nuxt/nuxt#13934 and PR nuxt/framework#4825
📚 Usage scenario
// assume the project contains routes/api/test.tsconstresult=await$fetch(/** IDE should show hint: '/api/test' */)constrequest: NitroFetchRequest=/** IDE should show hint: '/api/test' */
$fetch('/api/test')// ok$fetch('https://example.com/api')// ok$fetch(newRequest('api/test'))// ok// assume no routes/other.ts$fetch('other')// type error: Argument of type '"other"' is not assignable to parameter of type 'FetchRequestUrl | Ref<FetchRequestUrl> | (() => FetchRequestUrl)'.
Activity