There is now new method of providing HttpClient as provideHttpClient function. This also can take withInterceptors() function to define interceptors.
I have shared module as a separate dependency that defines few interceptors but does not import HttpClient (I leave it to applications themselves). As using HTTP_INTERCEPTORS thing is marked as "can be phased out in future", is there any way to provide functional interceptors without importing whole HttpClient? Something like adding withInterceptors() to providers array.
I can't actually provide array of interceptors as module itself takes crucial required config that is then used by interceptors. Additionally module also exposes bunch of services so it's more comfortable to just import one module.
This is not possible and this is not wishable !
Interceptors should be define in a single point to ensure the predictability of their order.
So if you have a lib, you will have to export/expose them.
For more info, look at this issue.