JoxJ
Denoβ€’3y agoβ€’
4 replies
Jox

How do I get a d.ts file to be used?

I'm extending a type from hono by adding that code in a hono.d.ts file in my src folder.

declare module "hono" {
  interface ContextVariableMap {
    someNewProperty: string;
  }
}

But TypeScript still doesn't know about the new property so obviously I'm doing something wrong.

What steps am I missing or what am I missunderstanding when it comes to extending a type for a third party library?

Does the module name have to match something in the import maps of deno.json?

Any help would be much appreciated.
Was this page helpful?