diff --git a/lib/config.service.ts b/lib/config.service.ts index 485e0713..131a044f 100644 --- a/lib/config.service.ts +++ b/lib/config.service.ts @@ -8,7 +8,7 @@ import { import { NoInferType } from './types'; @Injectable() -export class ConfigService { +export class ConfigService { constructor( @Optional() @Inject(CONFIGURATION_TOKEN) @@ -22,7 +22,7 @@ export class ConfigService { * @param propertyPath * @param defaultValue */ - get(propertyPath: string): T | undefined; + get(propertyPath: keyof K): T | undefined; /** * Get a configuration value (either custom configuration or process environment variable) * based on property path (you can use dot notation to traverse nested object, e.g. "database.host"). @@ -30,7 +30,7 @@ export class ConfigService { * @param propertyPath * @param defaultValue */ - get(propertyPath: string, defaultValue: NoInferType): T; + get(propertyPath: keyof K, defaultValue: NoInferType): T; /** * Get a configuration value (either custom configuration or process environment variable) * based on property path (you can use dot notation to traverse nested object, e.g. "database.host"). @@ -38,7 +38,7 @@ export class ConfigService { * @param propertyPath * @param defaultValue */ - get(propertyPath: string, defaultValue?: T): T | undefined { + get(propertyPath: keyof K, defaultValue?: T): T | undefined { const validatedEnvValue = get( this.internalConfig[VALIDATED_ENV_PROPNAME], propertyPath,