enkot / nuxt-open-fetch

Generate zero-overhead, typed OpenAPI clients for Nuxt.
https://nuxt-open-fetch.vercel.app
MIT License
114 stars 10 forks source link

Add docs for disableNitroPlugin #43

Open letoast opened 1 month ago

letoast commented 1 month ago

https://github.com/enkot/nuxt-open-fetch/blob/main/src/module.ts#L32

It would be also nice to document the ${client} = useNitroApp() server functionality in general.

And also extending the type of useNitroApp(). Currently I'm solving this locally by adding a:

// open-api-fetch.d.ts
declare module 'nitropack' {
    interface NitroApp {
        $pets: OpenFetchClient<PetsPaths>
    }
}

export {}
enkot commented 1 week ago

@letoast Updated the docs - https://nuxt-open-fetch.vercel.app/utils/dollarclient. Types should work out of the box, could you please recheck?