Skip to content

Maintenance: Remove overrides from Parameters' BaseProvider #1213

Closed
@dreamorosi

Description

@dreamorosi

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:
image

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

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)parametersThis item relates to the Parameters Utility

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions