types(runtime-core): adjust Renderer's type declaration (#1566)
This commit is contained in:
parent
836b273f5f
commit
09f61b4049
@ -66,7 +66,7 @@ import { invokeDirectiveHook } from './directives'
|
|||||||
import { startMeasure, endMeasure } from './profiling'
|
import { startMeasure, endMeasure } from './profiling'
|
||||||
import { ComponentPublicInstance } from './componentProxy'
|
import { ComponentPublicInstance } from './componentProxy'
|
||||||
|
|
||||||
export interface Renderer<HostElement = any> {
|
export interface Renderer<HostElement = RendererElement> {
|
||||||
render: RootRenderFunction<HostElement>
|
render: RootRenderFunction<HostElement>
|
||||||
createApp: CreateAppFunction<HostElement>
|
createApp: CreateAppFunction<HostElement>
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,12 @@ const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps)
|
|||||||
|
|
||||||
// lazy create the renderer - this makes core renderer logic tree-shakable
|
// lazy create the renderer - this makes core renderer logic tree-shakable
|
||||||
// in case the user only imports reactivity utilities from Vue.
|
// in case the user only imports reactivity utilities from Vue.
|
||||||
let renderer: Renderer | HydrationRenderer
|
let renderer: Renderer<Element> | HydrationRenderer
|
||||||
|
|
||||||
let enabledHydration = false
|
let enabledHydration = false
|
||||||
|
|
||||||
function ensureRenderer() {
|
function ensureRenderer() {
|
||||||
return renderer || (renderer = createRenderer(rendererOptions))
|
return renderer || (renderer = createRenderer<Node, Element>(rendererOptions))
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureHydrationRenderer() {
|
function ensureHydrationRenderer() {
|
||||||
|
Loading…
Reference in New Issue
Block a user