I'm trying to build a JS full stack framework so, as the 2nd step, I wanna import something globally. let me explain, I'm tryna use tsx without react, so I needed a lib to give me createElement
function.
so I used this lib type-html
as tHTML. it just works fine. my query here is, how to avoid manual import tHTML file into every .tsx?
eg:
// Home.tsx
import * as tHTML from "typed-html";
{*...code...*}
// Button.tsx
import * as tHTML from "typed-html";
{*...code...*}
So, I wanna remove the part of manually importing tHTML. i wanna make the users to directly write their tsx and not importing thtml on every tsx they make
Here's what ive tried:
I created a .ts file named "global" and inside that, i wrote:
declare global {
const tHTML = type import("typed-html")
}
it kinda worked ig. coz it made all Cannot find name 'tHTML'
errors disappear. but when i checked the browser, it said Can't find variable: tHTML