index.ts 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // Public API ------------------------------------------------------------------
  2. export const version = __VERSION__
  3. export * from './apiReactivity'
  4. export * from './apiWatch'
  5. export * from './apiLifecycle'
  6. export * from './apiInject'
  7. export { nextTick } from './scheduler'
  8. export { defineComponent } from './apiDefineComponent'
  9. // Advanced API ----------------------------------------------------------------
  10. // For getting a hold of the internal instance in setup() - useful for advanced
  11. // plugins
  12. export { getCurrentInstance } from './component'
  13. // For raw render function users
  14. export { h } from './h'
  15. export {
  16. createVNode,
  17. cloneVNode,
  18. mergeProps,
  19. openBlock,
  20. createBlock
  21. } from './vnode'
  22. // VNode type symbols
  23. export { Text, Comment, Fragment, Portal } from './vnode'
  24. // Internal Components
  25. export { Suspense, SuspenseProps } from './components/Suspense'
  26. export { KeepAlive, KeepAliveProps } from './components/KeepAlive'
  27. export {
  28. BaseTransition,
  29. BaseTransitionProps
  30. } from './components/BaseTransition'
  31. // VNode flags
  32. export { PublicShapeFlags as ShapeFlags } from './shapeFlags'
  33. import { PublicPatchFlags } from '@vue/shared'
  34. export const PatchFlags = PublicPatchFlags as {
  35. // export patch flags as plain numbers to avoid d.ts relying on @vue/shared
  36. // the enum type is internal anyway.
  37. TEXT: number
  38. CLASS: number
  39. STYLE: number
  40. PROPS: number
  41. NEED_PATCH: number
  42. FULL_PROPS: number
  43. STABLE_FRAGMENT: number
  44. KEYED_FRAGMENT: number
  45. UNKEYED_FRAGMENT: number
  46. DYNAMIC_SLOTS: number
  47. BAIL: number
  48. }
  49. // SFC CSS Modules
  50. export { useCSSModule } from './helpers/useCssModule'
  51. // For custom renderers
  52. export { createRenderer, RootRenderFunction } from './renderer'
  53. export { warn } from './warning'
  54. export {
  55. handleError,
  56. callWithErrorHandling,
  57. callWithAsyncErrorHandling
  58. } from './errorHandling'
  59. export {
  60. useTransitionState,
  61. TransitionState,
  62. resolveTransitionHooks,
  63. setTransitionHooks,
  64. TransitionHooks
  65. } from './components/BaseTransition'
  66. // Internal API ----------------------------------------------------------------
  67. // For compiler generated code
  68. // should sync with '@vue/compiler-core/src/runtimeConstants.ts'
  69. export { withDirectives } from './directives'
  70. export {
  71. resolveComponent,
  72. resolveDirective,
  73. resolveDynamicComponent
  74. } from './helpers/resolveAssets'
  75. export { renderList } from './helpers/renderList'
  76. export { toHandlers } from './helpers/toHandlers'
  77. export { renderSlot } from './helpers/renderSlot'
  78. export { createSlots } from './helpers/createSlots'
  79. export { pushScopeId, popScopeId, withScopeId } from './helpers/scopeId'
  80. export { setBlockTracking, createTextVNode, createCommentVNode } from './vnode'
  81. // Since @vue/shared is inlined into final builds,
  82. // when re-exporting from @vue/shared we need to avoid relying on their original
  83. // types so that the bundled d.ts does not attempt to import from it.
  84. import {
  85. toDisplayString as _toDisplayString,
  86. camelize as _camelize
  87. } from '@vue/shared'
  88. export const toDisplayString = _toDisplayString as (s: unknown) => string
  89. export const camelize = _camelize as (s: string) => string
  90. // For integration with runtime compiler
  91. export { registerRuntimeCompiler } from './component'
  92. // SSR -------------------------------------------------------------------------
  93. import { createComponentInstance, setupComponent } from './component'
  94. import { renderComponentRoot } from './componentRenderUtils'
  95. import { isVNode, normalizeVNode } from './vnode'
  96. // SSR utils are only exposed in cjs builds.
  97. const _ssrUtils = {
  98. createComponentInstance,
  99. setupComponent,
  100. renderComponentRoot,
  101. isVNode,
  102. normalizeVNode
  103. }
  104. export const ssrUtils = (__NODE_JS__ ? _ssrUtils : null) as typeof _ssrUtils
  105. // Types -----------------------------------------------------------------------
  106. export {
  107. App,
  108. AppConfig,
  109. AppContext,
  110. Plugin,
  111. CreateAppFunction
  112. } from './apiCreateApp'
  113. export {
  114. VNode,
  115. VNodeTypes,
  116. VNodeProps,
  117. VNodeArrayChildren,
  118. VNodeNormalizedChildren
  119. } from './vnode'
  120. export {
  121. Component,
  122. FunctionalComponent,
  123. ComponentInternalInstance,
  124. RenderFunction,
  125. SetupContext
  126. } from './component'
  127. export {
  128. ComponentOptions,
  129. ComponentOptionsWithoutProps,
  130. ComponentOptionsWithObjectProps as ComponentOptionsWithProps,
  131. ComponentOptionsWithArrayProps
  132. } from './apiOptions'
  133. export { ComponentPublicInstance } from './componentProxy'
  134. export { RendererOptions } from './renderer'
  135. export { Slot, Slots } from './componentSlots'
  136. export {
  137. Prop,
  138. PropType,
  139. ComponentPropsOptions,
  140. ComponentObjectPropsOptions
  141. } from './componentProps'
  142. export {
  143. Directive,
  144. DirectiveBinding,
  145. DirectiveHook,
  146. ObjectDirective,
  147. FunctionDirective,
  148. DirectiveArguments
  149. } from './directives'
  150. export { SuspenseBoundary } from './components/Suspense'
  151. export { HMRRuntime } from './hmr'