mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt3): correct app types (#630)
* fix(nuxt3): correct app types * fix module augmentation * include all shims in types file * style: disable eslint rule
This commit is contained in:
parent
5cf293ea88
commit
768488f07d
@ -24,7 +24,7 @@ export interface RuntimeNuxtHooks {
|
||||
}
|
||||
|
||||
export interface NuxtApp {
|
||||
app: App
|
||||
app: App<Element>
|
||||
globalName: string
|
||||
|
||||
hooks: Hookable<RuntimeNuxtHooks>
|
||||
|
2
packages/nuxt3/src/app/types/index.d.ts
vendored
2
packages/nuxt3/src/app/types/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import './shims'
|
||||
|
||||
// eslint-disable-next-line
|
||||
export * from '../dist'
|
||||
export * from '../index'
|
||||
|
8
packages/nuxt3/src/app/types/shims.d.ts
vendored
8
packages/nuxt3/src/app/types/shims.d.ts
vendored
@ -1,5 +1,4 @@
|
||||
// eslint-disable-next-line import/default
|
||||
import Vue from 'vue'
|
||||
import { Component } from '@vue/runtime-core'
|
||||
import { $Fetch } from 'ohmyfetch'
|
||||
import { Nuxt } from '../dist'
|
||||
|
||||
@ -26,11 +25,12 @@ declare global {
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
export default Vue
|
||||
export default Component
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface App {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface App<HostElement> {
|
||||
$nuxt: Nuxt
|
||||
}
|
||||
}
|
||||
|
2
packages/nuxt3/types.d.ts
vendored
2
packages/nuxt3/types.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export * from './dist/index'
|
||||
export * from './dist/app/index'
|
||||
export * from './dist/app/types/index'
|
||||
|
Loading…
Reference in New Issue
Block a user