Skip to content

Commit

Permalink
feat: allow more than two states (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Herman <[email protected]>
  • Loading branch information
GeekyEggo and GeekyEggo authored Apr 23, 2024
1 parent e343a79 commit 1fdb71f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Change Log

## vNext
## Unreleased

### ✨ New

Expand All @@ -32,6 +32,7 @@

- Update layout and manifest references to propagate from [`@elgato/schemas`](https://github.com/elgatosf/schemas).
- Localization lookup will now return the key if the resource is not defined.
- Update `State` type to allow for more than two states.

### ➡️ Migration

Expand Down
10 changes: 5 additions & 5 deletions src/api/events/__tests__/action.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Coordinates, WillAppear, WillDisappear } from "..";
import { Coordinates, WillAppear, WillDisappear, type State } from "..";
import { Expect, TypesAreEqual } from "../../../../tests/utils";
import { Settings } from "../../__mocks__/events";

Expand All @@ -21,7 +21,7 @@ describe("action event types", () => {
readonly controller: "Encoder" | "Keypad";
readonly coordinates: Coordinates;
settings: Settings;
readonly state?: 0 | 1;
readonly state?: State;
};
}
| {
Expand All @@ -33,7 +33,7 @@ describe("action event types", () => {
readonly isInMultiAction: true;
readonly controller: "Keypad";
settings: Settings;
readonly state?: 0 | 1;
readonly state?: State;
};
}
>
Expand All @@ -57,7 +57,7 @@ describe("action event types", () => {
readonly controller: "Encoder" | "Keypad";
readonly coordinates: Coordinates;
settings: Settings;
readonly state?: 0 | 1;
readonly state?: State;
};
}
| {
Expand All @@ -69,7 +69,7 @@ describe("action event types", () => {
readonly isInMultiAction: true;
readonly controller: "Keypad";
settings: Settings;
readonly state?: 0 | 1;
readonly state?: State;
};
}
>
Expand Down
2 changes: 1 addition & 1 deletion src/api/events/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ export type Coordinates = {
/**
* Possible states an action can be in. This only applies to actions that have multiple states defined in the plugin's manifest.json file.
*/
export type State = 0 | 1;
export type State = number;

0 comments on commit 1fdb71f

Please sign in to comment.