-
Notifications
You must be signed in to change notification settings - Fork 172
Closed
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)parametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility
Description
Summary
The implementation for the upcoming Parameters utility's BaseProvider
contains some method overrides as well as some aliased method in the children.
i.e. BaseProvider.ts
class BaseProvider {
public async get(name: string, options?: SecretsGetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>>;
public async get(name: string, options?: GetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>> {
// ... method implementation
}
}
i.e. SecretsProvider.ts
class SecretsProvider extends BaseProvider {
public constructor() {
super();
}
public async get(name: string, options?: SecretsGetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>> {
super.get(name, options);
}
}
The alias in the child class (i.e. SecretsProvider
) is needed so that, once build and exported, customers get the correct typings:
This however, causes type issues when the same parent class (BaseProvider
) is extended by multiple child classes.
Why is this needed?
We need to remove the overrides and leave to the children classes the responsibility of giving the correct types.
Which area does this relate to?
Parameters
Solution
No response
Acknowledgment
- This request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Python, Java
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)parametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility