Skip to content

Conversation

@rschristian
Copy link
Member

@rschristian rschristian commented Aug 10, 2025

Apparently module augmentation affects how consumers within node_modules get augmented types, as the following in user code wouldn't work:

declare module "preact" {
    interface HeadingHTMLAttributes {
        foo?: string;
    }
}

As jsx.d.ts imports from dom.d.ts, the snippet above wouldn't augment that interface and so the JSX types would remain unchanged for the user; instead, jsx.d.ts needs to import everything from the preact namespace directly to ensure users can overwrite/extend easily.

@coveralls
Copy link

coveralls commented Aug 10, 2025

Coverage Status

coverage: 99.536%. remained the same
when pulling 25a05c9 on types/fix-module-agumentation
into c242faf on main.

@rschristian rschristian merged commit 68b30fe into main Aug 10, 2025
4 checks passed
@rschristian rschristian deleted the types/fix-module-agumentation branch August 10, 2025 05:24
@JoviDeCroock JoviDeCroock mentioned this pull request Aug 19, 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.

4 participants