types: improve type exports

This commit is contained in:
Evan You
2019-09-06 12:58:31 -04:00
parent d87bed0138
commit 360f3b4f37
25 changed files with 253 additions and 204 deletions

View File

@@ -1,14 +1,20 @@
import { ComponentInstance, FunctionalComponent, Data } from './component'
import {
ComponentInternalInstance,
FunctionalComponent,
Data
} from './component'
import { VNode, normalizeVNode, createVNode, Empty } from './vnode'
import { ShapeFlags } from './shapeFlags'
import { handleError, ErrorTypes } from './errorHandling'
import { handleError, ErrorCodes } from './errorHandling'
import { PatchFlags } from './patchFlags'
// mark the current rendering instance for asset resolution (e.g.
// resolveComponent, resolveDirective) during render
export let currentRenderingInstance: ComponentInstance | null = null
export let currentRenderingInstance: ComponentInternalInstance | null = null
export function renderComponentRoot(instance: ComponentInstance): VNode {
export function renderComponentRoot(
instance: ComponentInternalInstance
): VNode {
const {
type: Component,
vnode,
@@ -38,7 +44,7 @@ export function renderComponentRoot(instance: ComponentInstance): VNode {
)
}
} catch (err) {
handleError(err, instance, ErrorTypes.RENDER_FUNCTION)
handleError(err, instance, ErrorCodes.RENDER_FUNCTION)
result = createVNode(Empty)
}
currentRenderingInstance = null