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

Align SignalQuality Interface with Actual API Data Structure #117

Open
iharuya opened this issue Mar 24, 2024 · 0 comments
Open

Align SignalQuality Interface with Actual API Data Structure #117

iharuya opened this issue Mar 24, 2024 · 0 comments

Comments

@iharuya
Copy link

iharuya commented Mar 24, 2024

Hello Neurosity team,

I've been working with this SDK and noticed an inconsistency between the SignalQuality interface definition and the actual data structure returned by the Neurosity API.

According to the SDK, the SignalQuality interface is defined as follows:

export interface SignalQuality {
  [channelName: string]: ChannelQuality;
}

This definition suggests that the object keys should be channel names (e.g., CP3, C3, etc.). However, the actual data I received
from the Neurosity API is indexed by numbers, as shown below:

[ChannelQuality, ChannelQuality, ...]

This discrepancy leads to type errors when trying to access the signal quality data in a Typescript project. To resolve this issue, I propose updating the SignalQuality interface to match the actual data structure returned by the API. Here's a possible revision:

export interface SignalQuality {
  [index: number]: ChannelQuality;
}

Alternatively, if the API is supposed to return channel names as keys and the current numeric indexing is a bug, it would be great to have that fixed on the API side.

I believe aligning the SDK's type definitions with the actual data structure is crucial for providing a seamless development experience. I'm looking forward to your thoughts on this matter.

Reproduction

The device type: CROWN 3

@iharuya iharuya changed the title API Error: Signal Quality Align SignalQuality Interface with Actual API Data Structure Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant