Skip to content

Conversation

@pklito
Copy link

@pklito pklito commented Jan 1, 2026

BarSelectM and BarSelectOptions's attribute value stores the currently selected / default key in the options attribute, which is of type Record<string, T>.
This PR just changes the typing of the attributes in the BarSelectOptions class and the BarSelect class to reflect their usage.

currently:

let barItem1 = new BarSelect<number>('select_id', {
  options: {
      "a": 1,
      "b": 2
  },
 //linter error: "The expected type comes from property 'value' which is declared here on type 'BarSelectOptions<number>'"
      value: "a",   
  });

This previously gave a linter error but compiles and has no runtime errors, and conversely, value: 1 showed no linter error yet raised an error at runtime

Let me know if I'm wrong or I've made a mistake here, as I've only recently started learning plugins for blockbench,
Thanks!

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

Successfully merging this pull request may close these issues.

1 participant