TheBejbiborn
TheBejbiborn
DDeno
Created by TheBejbiborn on 8/6/2023 in #help
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 {}
}
}
8 replies