types(runtime-core): adjust Renderer's type declaration (#1566)

This commit is contained in:
Pick 2020-07-14 00:44:37 +08:00 committed by GitHub
parent 836b273f5f
commit 09f61b4049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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>
} }

View File

@ -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() {