Skip to content

feat!: move result type to the first type parameter - #6

Merged
devCrossNet merged 1 commit into
mainfrom
feat/result-first-type-param
Oct 8, 2026
Merged

devCrossNet merged 1 commit into
mainfrom
feat/result-first-type-param

Conversation

@devCrossNet

Copy link
Copy Markdown
Owner

What is accomplished by your PR?

The result type is now the first type parameter. TypeScript does not allow skipping leading type parameters, so before this change all defaults had to be repeated to set the result type.

// before
new Quaire<QuaireItem, QuaireQuestion, QuaireNavigationItem, MyResult>({ items });

// after
new Quaire<MyResult>({ items });

New order:

Type Order
Quaire <Result, Item, Question, NavigationItem>
QuaireBase <Result, Question, NavigationItem>
QuaireOptions <Result, Item, NavigationItem>
  • README and the extending-data-definition example are updated
  • New type test: the result type is inferred from the result option without explicit type arguments

Is there something controversial in your PR?

Breaking change for subclasses with custom types (planned for 1.0):

class MyQuaire extends Quaire<QuaireResult, MyItem, MyQuestion, MyNavigationItem> {}

Checklist

  • Run unit tests to ensure all existing tests are still passing
  • Add new passing unit tests to cover the code introduced by your PR
  • Change documentation for the code introduced by your PR

🤖 Generated with Claude Code

The result type is the type parameter that is set most often. As first
parameter it can be set without repeating the other defaults:
new Quaire<MyResult>({ items }).

BREAKING CHANGE: the type parameter order of Quaire is now
<Result, Item, Question, NavigationItem>, of QuaireBase
<Result, Question, NavigationItem> and of QuaireOptions
<Result, Item, NavigationItem>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devCrossNet
devCrossNet merged commit d10a71d into main Oct 8, 2026
2 checks passed
@devCrossNet
devCrossNet deleted the feat/result-first-type-param branch October 8, 2026 17:47
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