Skip to content

Commit

Permalink
Fix old use of DecodedStruct
Browse files Browse the repository at this point in the history
  • Loading branch information
noahm committed Apr 1, 2024
1 parent e978603 commit c45a3cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk/commands/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StructBuffer, bits, uint16_t, uint8_t } from "@nmann/struct-buffer";
import { StructBuffer, bits, uint8_t, uint16_t } from "@nmann/struct-buffer";
import { EnabledSensors } from "./enabled-sensors.ts";

type Decoded<Struct extends { decode(...args: unknown[]): unknown }> = ReturnType<Struct["decode"]>;
export type Decoded<Struct extends { decode(...args: unknown[]): unknown }> = ReturnType<Struct["decode"]>;

/**
* Each FSR panel has 4 sensors. Make read/write easier by
Expand Down
4 changes: 2 additions & 2 deletions sdk/commands/sensor_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StructBuffer, bitFields, bits, bool, int16_t, uint8_t, uint16_t } from "@nmann/struct-buffer";
import { API_COMMAND, char2byte } from "../api";
import type { DecodedStruct } from "./config";
import type { Decoded } from "./config";
import type { EachPanel, EachSensor } from "./inputs";

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ class SMXPanelTestData {
left: false,
};

constructor(data: DecodedStruct<typeof detail_data_t>) {
constructor(data: Decoded<typeof detail_data_t>) {
/**
* Check the header. this is always `false true false` to identify it as a response,
* and not as random steps from the player.
Expand Down

0 comments on commit c45a3cc

Please sign in to comment.