Skip to content

Commit

Permalink
Convert BaseConfig, BaseState` interfaces to types
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Feb 22, 2024
1 parent 3302ffc commit 93a997b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 5 additions & 0 deletions packages/base-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- **BREAKING:** Convert `BaseConfig`, `BaseState` interfaces to types.
- As types, `BaseConfig`, `BaseState` now extend `Record` and have an index signature of `string`.

## [4.1.1]

### Changed
Expand Down
14 changes: 4 additions & 10 deletions packages/base-controller/src/BaseControllerV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ export type Listener<T> = (state: T) => void;
* Base controller configuration
* @property disabled - Determines if this controller is enabled
*/
// This interface was created before this ESLint rule was added.
// Convert to a `type` in a future major version.
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface BaseConfig {
export type BaseConfig = {
disabled?: boolean;
}
};

/**
* @type BaseState
*
* Base state representation
* @property name - Unique name for this controller
*/
// This interface was created before this ESLint rule was added.
// Convert to a `type` in a future major version.
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface BaseState {
export type BaseState = {
name?: string;
}
};

/**
* @deprecated This class has been renamed to BaseControllerV1 and is no longer recommended for use for controllers. Please use BaseController (formerly BaseControllerV2) instead.
Expand Down

0 comments on commit 93a997b

Please sign in to comment.