Skip to content

Commit

Permalink
fix: augment runtime config types
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Apr 20, 2024
1 parent a7430e4 commit e5b1871
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export interface ModuleOptions {
}
}

declare module 'nuxt/schema' {
interface RuntimeConfig {
apiParty: ModuleOptions
}
}

export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'nuxt-api-party',
Expand Down Expand Up @@ -109,10 +115,8 @@ export default defineNuxtModule<ModuleOptions>({
logger.error('Missing any API endpoint configuration. Please check the `apiParty` module configuration in `nuxt.config.ts`.')

// Private runtime config
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/ban-ts-comment
// @ts-ignore: `client` types are not compatible
nuxt.options.runtimeConfig.apiParty = defu(
nuxt.options.runtimeConfig.apiParty as Required<ModuleOptions>,
nuxt.options.runtimeConfig.apiParty,

Check failure on line 119 in src/module.ts

View workflow job for this annotation

GitHub Actions / typecheck

Argument of type 'unknown' is not assignable to parameter of type 'IgnoredInput | Input'.
options,
)

Expand Down

0 comments on commit e5b1871

Please sign in to comment.