Skip to content

update types to fix component cast requirement. - #65

Merged
koculu merged 1 commit into
mainfrom
type-update-components-require-cast
Feb 22, 2026
Merged

koculu merged 1 commit into
mainfrom
type-update-components-require-cast

Conversation

@koculu

@koculu koculu commented Feb 22, 2026 •

Copy link
Copy Markdown
Member

Changed Component.context in src/api/types.ts from a function property to a method signature:

  • Before: context: (head: ComponentHead<TContext>) => TContext
  • After: context(head: ComponentHead<TContext>): TContext

This preserves TContext extends IRegorContext = IRegorContext and fixes TypeScript variance so components: { ... } can be passed to createApp without as unknown as Record<string, Component> casts.

@koculu
koculu merged commit 4bd664a into main Feb 22, 2026
1 check passed
@koculu
koculu deleted the type-update-components-require-cast branch February 22, 2026 07:45
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