Documents injecute 1.x · Migrating from 0.x
Skip to content

Type Alias: ServicesInNamespace<S, N> ​

ServicesInNamespace<S, N> = { [K in keyof S as K extends `${N & string}.${infer R}` ? R : never]: S[K] }

Defined in: src/types.ts:453

The services of namespace N in service map S, without the N. prefix. Nested namespaces keep their inner prefix (Read, Read.key).

Type Parameters ​

S ​

S

N ​

N extends ServiceKey

Example ​

ts
type S = { Billing: Namespace; 'Billing.currency': string; db: Database };
type Billing = ServicesInNamespace<S, 'Billing'>; // { currency: string }

Released under the MIT License.