mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(components): augment 'vue' module rather than overwriting (#305)
This commit is contained in:
parent
2abac1d78c
commit
b53d8a77ff
42
packages/app/types/shims.d.ts
vendored
42
packages/app/types/shims.d.ts
vendored
@ -3,35 +3,33 @@ import { $Fetch } from 'ohmyfetch'
|
|||||||
import { Nuxt } from '../dist'
|
import { Nuxt } from '../dist'
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
var $fetch: $Fetch
|
var $fetch: $Fetch
|
||||||
|
|
||||||
namespace NodeJS {
|
namespace NodeJS {
|
||||||
interface Global {
|
interface Global {
|
||||||
$fetch: $Fetch
|
$fetch: $Fetch
|
||||||
}
|
|
||||||
interface Process {
|
|
||||||
browser: boolean
|
|
||||||
client: boolean
|
|
||||||
mode: 'spa' | 'universal'
|
|
||||||
server: boolean
|
|
||||||
static: boolean
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
interface Process {
|
||||||
|
browser: boolean
|
||||||
|
client: boolean
|
||||||
|
mode: 'spa' | 'universal'
|
||||||
|
server: boolean
|
||||||
|
static: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
__NUXT__?: Record<string, any>
|
__NUXT__?: Record<string, any>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '*.vue' {
|
declare module '*.vue' {
|
||||||
export default Vue
|
export default Vue
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
interface App {
|
interface App {
|
||||||
$nuxt: Nuxt
|
$nuxt: Nuxt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {}
|
|
||||||
|
@ -5,3 +5,6 @@ declare module 'vue' {
|
|||||||
}).join(',\n') %>
|
}).join(',\n') %>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// export required to turn this into a module for TS augmentation purposes
|
||||||
|
export { }
|
||||||
|
4
packages/nitro/src/runtime/types.d.ts
vendored
4
packages/nitro/src/runtime/types.d.ts
vendored
@ -7,5 +7,5 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// type export required to turn this into a module for TS augmentation purposes
|
// export required to turn this into a module for TS augmentation purposes
|
||||||
export type A = {}
|
export { }
|
||||||
|
2
packages/nitro/types/shims.d.ts
vendored
2
packages/nitro/types/shims.d.ts
vendored
@ -21,5 +21,3 @@ declare module '#assets' {
|
|||||||
export function statAsset(id: string): Promise<AssetMeta>
|
export function statAsset(id: string): Promise<AssetMeta>
|
||||||
export function getAsset<T=any>(id: string): { read: () => Promise<T>, meta: AssetMeta }
|
export function getAsset<T=any>(id: string): { read: () => Promise<T>, meta: AssetMeta }
|
||||||
}
|
}
|
||||||
|
|
||||||
export {}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user