Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow more than two states #37

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;