Skip to content

Commit

Permalink
Rename narrowest supertype for composable controller state to use "Co…
Browse files Browse the repository at this point in the history
…nstraint" suffix
  • Loading branch information
MajorLift committed Apr 17, 2024
1 parent e0069d4 commit 37137b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/composable-controller/src/ComposableController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ type LegacyControllerStateChangeEvent<
payload: [ControllerState, Patch[]];
};

/**
* A narrowest supertype for the composable controller state object.
*/
// TODO: Replace `any` with `Json` once `BaseControllerV2` migrations are completed for all controllers.
export type ComposableControllerState = {
export type ComposableControllerStateConstraint = {
// `any` is used here to disable the `BaseController` type constraint which expects state properties to extend `Record<string, Json>`.
// `ComposableController` state needs to accommodate `BaseControllerV1` state objects that may have properties wider than `Json`.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 37137b6

Please sign in to comment.