ClientServiceFactory type

Creates a service using the composed client's authenticated HTTP transport.

A factory must return synchronously; promise-like service types are excluded from its result. A plain (http) => service function is sufficient when the service owns no resources requiring cleanup.

type ClientServiceFactory<TService> = (
  http: ApiClient,
  lifecycle: ClientLifecycle
) => Exclude<TService, PromiseLike<unknown>> & {
  __synchronousServiceFactory?: true
}