NuxtN
Nuxt3y ago
3 replies
soymilk

Typing nitro plugin helper

How do we add types NitroApp helpers? I currently do this and it does not work. (Nuxt 3.7.0 with Nitro 2.6.2)
// ~/types/shim.d.ts
import { S3Client } from '@aws-sdk/client-s3';

declare module 'nitropack' {
  interface NitroApp {
    s3: S3Client;
  }
}

export default {};

// ~/tsconfig.json
{
  "extends": "./.nuxt/tsconfig.json",
  "files": ["./types/shim.d.ts"]
}
// ~/server/tsconfig.json
{
  "extends": "../.nuxt/tsconfig.server.json"
}
image.png
Was this page helpful?