Skip to content

DI Bag API / index / Renamed

Type Alias: Renamed<P extends object, Old extends string, New extends string> ​

ts
type Renamed<P extends object, Old extends string, New extends string> = {
    [K in keyof P as K extends Old ? New : K]: P[K];
};

Defined in: module-types.ts:160

Rename one string key in an object contract.

Type Parameters ​

Type ParameterDescription
P-
Old-
New-

See ​

https://dany-fedorov.github.io/di-bag/guides/tutorial.html#reuse-named-modules

Ordinary services. Checked composition. Explicit ownership.