Skip to content

Commit 93a997b

Browse files
committed
Convert BaseConfig, BaseState` interfaces to types
1 parent 3302ffc commit 93a997b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/base-controller/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING:** Convert `BaseConfig`, `BaseState` interfaces to types.
13+
- As types, `BaseConfig`, `BaseState` now extend `Record` and have an index signature of `string`.
14+
1015
## [4.1.1]
1116

1217
### Changed

packages/base-controller/src/BaseControllerV1.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,19 @@ export type Listener<T> = (state: T) => void;
99
* Base controller configuration
1010
* @property disabled - Determines if this controller is enabled
1111
*/
12-
// This interface was created before this ESLint rule was added.
13-
// Convert to a `type` in a future major version.
14-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
15-
export interface BaseConfig {
12+
export type BaseConfig = {
1613
disabled?: boolean;
17-
}
14+
};
1815

1916
/**
2017
* @type BaseState
2118
*
2219
* Base state representation
2320
* @property name - Unique name for this controller
2421
*/
25-
// This interface was created before this ESLint rule was added.
26-
// Convert to a `type` in a future major version.
27-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
28-
export interface BaseState {
22+
export type BaseState = {
2923
name?: string;
30-
}
24+
};
3125

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

0 commit comments

Comments
 (0)