DenoDDeno
Powered by
TheBejbibornT
Denoβ€’3y agoβ€’
7 replies
TheBejbiborn

Declaration merging for external packages

Hi!
I'm using unoCSS with Deno Fresh and have been attempting to use the attributify preset (https://unocss.dev/presets/attributify#preact).
However for the type inference to work this preset requires to override preact's JSXInternal namespace declaration (which I think is quite a popular pattern with frontend / fullstack frameworks) and I can't quite get how to do it in Deno (and if it's even possible).

Tl;DR How can one do the following in Deno?
declare module 'preact' {
  namespace JSX {
    interface HTMLAttributes extends AttributifyAttributes {}
  }
}
declare module 'preact' {
  namespace JSX {
    interface HTMLAttributes extends AttributifyAttributes {}
  }
}
UnoCSS
The instant on-demand Atomic CSS engine
UnoCSS
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Packages for image creation
kit !!Kkit !! / help
10mo ago
Issues installing npm packages
spac3crawlerSspac3crawler / help
13mo ago
importing packages breaks types
lvinLlvin / help
4y ago