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

@@ -2,14 +2,25 @@
> This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
``` ts
import { createRenderer, h } from '@vue/runtime-core'
For full exposed APIs, see `src/index.ts`. You can also run `yarn build runtime-core --types` from repo root, which will generate an API report at `temp/runtime-core.api.md`.
const { render } = createRenderer({
nodeOps,
patchData,
teardownVNode
## Building a Custom Renderer
``` ts
import { createRenderer, createAppAPI } from '@vue/runtime-core'
// low-level render method
export const render = createRenderer({
pathcProp,
insert,
remove,
createElement,
// ...
})
render(h('div'), container)
export const createApp = createAppAPI(render)
export * from '@vue/runtime-core'
```
See `@vue/runtime-dom` for how a DOM-targeting renderer is implemented.