Type Alias: ServiceType<S, K>
ServiceType<
S,K> = [S[K]] extends [Namespace|AsyncNamespace] ? [keyofS[K]] extends [typeofnamespaceBrand] ? [S[K]] extends [AsyncNamespace] ?AsyncServiceProvider<ServicesInNamespace<S,K>> :ServiceProvider<ServicesInNamespace<S,K>> :S[K] :S[K]
Defined in: src/types.ts:468
What resolving K from service map S returns: the registered type, or for a namespace key a provider of the namespace's services.
Type Parameters
S
S
K
K extends keyof S
Example
ts
type S = { Billing: Namespace; 'Billing.currency': string; db: Database };
type Db = ServiceType<S, 'db'>; // Database
type Billing = ServiceType<S, 'Billing'>; // ServiceProvider<{ currency: string }>