johannschopplich / nuxt-gtag

🔸 Google Analytics & Ads integration made easy

Home Page:https://developers.google.com/tag-platform/gtagjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types for public runtime config

nandi95 opened this issue · comments

Environment

  • Nuxt Version: 3.6.5

Reproduction

use the package in a typescript setting.

Describe the bug

there are some values set on the public config that haven't been typed. Here specifically:

nuxt.options.runtimeConfig.public.gtag = defu(

it would be helpful if this was typed somehow. Is there a way to do this with nuxt type generation? if not, maybe module augmentation?

Additional context

No response

Logs

No response

Hi there!

Nuxt tries to automatically generate a typescript interface from provided runtime config using unjs/untyped. Although it is possible to manually type runtime configs, it shouldn't be needed in this case.

Once the plugin is added to the modules Nuxt config property, you should see the types:

Bildschirmfoto 2023-08-19 um 11 35 46