Skip to content

fix(types): Add TypeScript types to exports for moduleResolution bundler compatibility - #327

Closed
joao-imi wants to merge 2 commits into
masterfrom
fix-types-export
Closed

joao-imi wants to merge 2 commits into
masterfrom
fix-types-export

Conversation

@joao-imi

@joao-imi joao-imi commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor

Description

TypeScript projects using moduleResolution: "bundler" cannot resolve type declarations because the exports field doesn't include types entries.

Changes

  • Add types entries to exports field in package.json (must be first in each export object);
  • Create types/hooks/index.d.ts with type definitions for HCaptchaProvider and useHCaptcha;
  • Fix incorrect file extensions in hooks exports (.jsx → .js to match Babel output);

@joao-imi joao-imi changed the title fix: types fix(types): Add missing "types" entries in package.json exports field Dec 9, 2025
@joao-imi
joao-imi marked this pull request as ready for review December 9, 2025 13:07
@joao-imi
joao-imi requested a review from a team as a code owner December 9, 2025 13:07
@joao-imi joao-imi changed the title fix(types): Add missing "types" entries in package.json exports field fix(types): Add TypeScript types to exports for moduleResolution bundler compatibility Dec 9, 2025
@joao-imi joao-imi closed this Dec 9, 2025
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