module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

incorrect type generation

Open rrd108 opened this issue 1 year ago • 0 comments

What happens?

My module.ts

import type { LogEntry } from "./runtime/server/types/LogEntry";

export interface ModuleOptions {
  delayOnBan: boolean;
  log: false | LogEntry;
}

export default defineNuxtModule<ModuleOptions>({
  meta: {
    name: "nuxt-api-shield",
    configKey: "nuxtApiShield",
  },
  defaults: {
    delayOnBan: true,
    log: false,
  },

After running yarn dev:prepare I get the following in .nuxt/types/schema.d.ts

interface PublicRuntimeConfig {
   nuxtApiShield: {
      delayOnBan: boolean,
      log: boolean,
   },
  }

What is expected?

log type should be false | LogEntry

rrd108 avatar Sep 11 '24 14:09 rrd108