fix(components): augment 'vue' module rather than overwriting (#305)

This commit is contained in:
Daniel Roe 2021-07-07 19:41:51 +01:00 committed by GitHub
parent 2abac1d78c
commit b53d8a77ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 26 deletions

View File

@ -3,35 +3,33 @@ import { $Fetch } from 'ohmyfetch'
import { Nuxt } from '../dist'
declare global {
// eslint-disable-next-line no-var
var $fetch: $Fetch
// eslint-disable-next-line no-var
var $fetch: $Fetch
namespace NodeJS {
interface Global {
$fetch: $Fetch
}
interface Process {
browser: boolean
client: boolean
mode: 'spa' | 'universal'
server: boolean
static: boolean
}
namespace NodeJS {
interface Global {
$fetch: $Fetch
}
interface Process {
browser: boolean
client: boolean
mode: 'spa' | 'universal'
server: boolean
static: boolean
}
}
interface Window {
__NUXT__?: Record<string, any>
}
interface Window {
__NUXT__?: Record<string, any>
}
}
declare module '*.vue' {
export default Vue
export default Vue
}
declare module 'vue' {
interface App {
$nuxt: Nuxt
}
interface App {
$nuxt: Nuxt
}
}
export {}

View File

@ -5,3 +5,6 @@ declare module 'vue' {
}).join(',\n') %>
}
}
// export required to turn this into a module for TS augmentation purposes
export { }

View File

@ -7,5 +7,5 @@ declare global {
}
}
// type export required to turn this into a module for TS augmentation purposes
export type A = {}
// export required to turn this into a module for TS augmentation purposes
export { }

View File

@ -21,5 +21,3 @@ declare module '#assets' {
export function statAsset(id: string): Promise<AssetMeta>
export function getAsset<T=any>(id: string): { read: () => Promise<T>, meta: AssetMeta }
}
export {}