From adfa1e699d7e1b148fa1aac842cc0bdf2726070b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 2 Mar 2025 20:02:12 +0000 Subject: [PATCH] fix(nuxt): add back fallback nuxtlink type signature --- packages/nuxt/src/app/components/nuxt-link.ts | 4 ++-- test/fixtures/basic-types/types.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/components/nuxt-link.ts b/packages/nuxt/src/app/components/nuxt-link.ts index 3694b58df9..26a2a20b0b 100644 --- a/packages/nuxt/src/app/components/nuxt-link.ts +++ b/packages/nuxt/src/app/components/nuxt-link.ts @@ -497,11 +497,11 @@ export function defineNuxtLink (options: NuxtLinkOptions) { } }, // }) as unknown as DefineComponent> - }) as unknown as new(props: NuxtLinkProps) => InstanceType(props: NuxtLinkProps) => InstanceType, [], SlotsType> - >> + >>) & Record } export default defineNuxtLink(nuxtLinkDefaults) diff --git a/test/fixtures/basic-types/types.ts b/test/fixtures/basic-types/types.ts index d5e22f82ff..32ef39f438 100644 --- a/test/fixtures/basic-types/types.ts +++ b/test/fixtures/basic-types/types.ts @@ -254,6 +254,9 @@ describe('typed router integration', () => { // @ts-expect-error this is an invalid param h(NuxtLink, { to: { name: 'param-id', params: { bob: 23 } } }) h(NuxtLink, { to: { name: 'param-id', params: { id: 4 } } }) + + // doesn't throw an error when accessing properties of component + const _props = NuxtLink.props }) })