I'm currently building out an an rtk-query package for an application, where I am making use of code-splitting (by using injectEndpoints, since there will likely be hundreds of endpoints involved). However, I'd also like to implement a prefetch hook similar to the automatic prefetch hook in the docs.
Is there a way to generate proper Typescript types for these endpoints? The above hook defines the endpoint types as type EndpointNames = keyof typeof api.endpoints, however all my endpoints are defined like this (as described by the docs):
export const emptySplitApi = createApi({
baseQuery: fetchBaseQuery({ baseUrl: '/' }),
endpoints: () => ({}), //
})
If this isn't possible, what's the best way to export multiple usePrefetch hooks from different injectEndpoints methods?