2020-05-01 22:37:40 +08:00
|
|
|
// Core API ------------------------------------------------------------------
|
2019-08-22 23:12:37 +08:00
|
|
|
|
2019-11-05 07:38:55 +08:00
|
|
|
export const version = __VERSION__
|
2020-02-14 13:13:54 +08:00
|
|
|
export {
|
2020-04-16 04:45:20 +08:00
|
|
|
// core
|
|
|
|
reactive,
|
2020-02-14 13:13:54 +08:00
|
|
|
ref,
|
2020-04-16 04:45:20 +08:00
|
|
|
readonly,
|
|
|
|
// utilities
|
2020-02-22 11:39:32 +08:00
|
|
|
unref,
|
2020-02-14 13:13:54 +08:00
|
|
|
isRef,
|
2020-04-15 08:49:18 +08:00
|
|
|
toRef,
|
2020-02-14 13:13:54 +08:00
|
|
|
toRefs,
|
2020-04-16 04:45:20 +08:00
|
|
|
isProxy,
|
2020-02-14 13:13:54 +08:00
|
|
|
isReactive,
|
|
|
|
isReadonly,
|
2020-04-16 04:45:20 +08:00
|
|
|
// advanced
|
|
|
|
customRef,
|
2020-04-23 06:00:10 +08:00
|
|
|
triggerRef,
|
2020-04-16 04:45:20 +08:00
|
|
|
shallowRef,
|
2020-02-14 13:13:54 +08:00
|
|
|
shallowReactive,
|
2020-04-15 11:49:46 +08:00
|
|
|
shallowReadonly,
|
2020-04-16 04:45:20 +08:00
|
|
|
markRaw,
|
2020-04-15 08:45:41 +08:00
|
|
|
toRaw
|
2020-02-14 13:13:54 +08:00
|
|
|
} from '@vue/reactivity'
|
|
|
|
export { computed } from './apiComputed'
|
2020-02-22 15:19:10 +08:00
|
|
|
export { watch, watchEffect } from './apiWatch'
|
2020-02-14 13:13:54 +08:00
|
|
|
export {
|
|
|
|
onBeforeMount,
|
|
|
|
onMounted,
|
|
|
|
onBeforeUpdate,
|
|
|
|
onUpdated,
|
|
|
|
onBeforeUnmount,
|
|
|
|
onUnmounted,
|
|
|
|
onActivated,
|
|
|
|
onDeactivated,
|
|
|
|
onRenderTracked,
|
|
|
|
onRenderTriggered,
|
|
|
|
onErrorCaptured
|
|
|
|
} from './apiLifecycle'
|
|
|
|
export { provide, inject } from './apiInject'
|
2019-11-03 00:18:35 +08:00
|
|
|
export { nextTick } from './scheduler'
|
2019-12-22 23:58:12 +08:00
|
|
|
export { defineComponent } from './apiDefineComponent'
|
2020-03-26 23:59:54 +08:00
|
|
|
export { defineAsyncComponent } from './apiAsyncComponent'
|
2019-08-22 23:12:37 +08:00
|
|
|
|
2019-08-23 09:38:00 +08:00
|
|
|
// Advanced API ----------------------------------------------------------------
|
|
|
|
|
2019-11-03 00:18:35 +08:00
|
|
|
// For getting a hold of the internal instance in setup() - useful for advanced
|
|
|
|
// plugins
|
|
|
|
export { getCurrentInstance } from './component'
|
|
|
|
|
2019-08-23 09:38:00 +08:00
|
|
|
// For raw render function users
|
2019-08-24 03:27:17 +08:00
|
|
|
export { h } from './h'
|
2020-05-01 22:37:40 +08:00
|
|
|
// Advanced render function utilities
|
2020-05-11 23:09:36 +08:00
|
|
|
export { createVNode, cloneVNode, mergeProps, isVNode } from './vnode'
|
2020-05-01 22:37:40 +08:00
|
|
|
// VNode types
|
|
|
|
export { Fragment, Text, Comment, Static } from './vnode'
|
|
|
|
// Built-in components
|
2020-03-31 22:52:42 +08:00
|
|
|
export { Teleport, TeleportProps } from './components/Teleport'
|
2019-11-05 07:38:55 +08:00
|
|
|
export { Suspense, SuspenseProps } from './components/Suspense'
|
|
|
|
export { KeepAlive, KeepAliveProps } from './components/KeepAlive'
|
2019-11-25 05:00:46 +08:00
|
|
|
export {
|
|
|
|
BaseTransition,
|
|
|
|
BaseTransitionProps
|
|
|
|
} from './components/BaseTransition'
|
2020-05-02 22:19:40 +08:00
|
|
|
// For using custom directives
|
|
|
|
export { withDirectives } from './directives'
|
2019-12-18 10:28:24 +08:00
|
|
|
// SFC CSS Modules
|
|
|
|
export { useCSSModule } from './helpers/useCssModule'
|
2020-02-19 02:26:15 +08:00
|
|
|
// SSR context
|
|
|
|
export { useSSRContext, ssrContextKey } from './helpers/useSsrContext'
|
|
|
|
|
2020-05-01 05:04:35 +08:00
|
|
|
// Custom Renderer API ---------------------------------------------------------
|
2020-02-14 13:13:54 +08:00
|
|
|
|
2020-02-14 14:30:08 +08:00
|
|
|
export { createRenderer, createHydrationRenderer } from './renderer'
|
2020-05-01 02:58:50 +08:00
|
|
|
export { queuePostFlushCb } from './scheduler'
|
2019-10-11 06:02:51 +08:00
|
|
|
export { warn } from './warning'
|
2019-08-31 03:05:39 +08:00
|
|
|
export {
|
|
|
|
handleError,
|
|
|
|
callWithErrorHandling,
|
2020-03-15 23:40:58 +08:00
|
|
|
callWithAsyncErrorHandling,
|
|
|
|
ErrorCodes
|
2019-08-31 03:05:39 +08:00
|
|
|
} from './errorHandling'
|
2020-05-04 20:52:59 +08:00
|
|
|
export {
|
|
|
|
resolveComponent,
|
|
|
|
resolveDirective,
|
|
|
|
resolveDynamicComponent
|
|
|
|
} from './helpers/resolveAssets'
|
|
|
|
// For integration with runtime compiler
|
|
|
|
export { registerRuntimeCompiler } from './component'
|
2019-11-29 07:41:01 +08:00
|
|
|
export {
|
|
|
|
useTransitionState,
|
|
|
|
resolveTransitionHooks,
|
2020-06-30 00:04:28 +08:00
|
|
|
setTransitionHooks,
|
|
|
|
getTransitionRawChildren
|
2019-11-29 07:41:01 +08:00
|
|
|
} from './components/BaseTransition'
|
2019-08-23 09:38:00 +08:00
|
|
|
|
|
|
|
// Types -----------------------------------------------------------------------
|
|
|
|
|
2020-05-02 04:14:30 +08:00
|
|
|
import { VNode } from './vnode'
|
|
|
|
import { ComponentInternalInstance } from './component'
|
|
|
|
|
|
|
|
// Augment Ref unwrap bail types.
|
|
|
|
// Note: if updating this, also update `types/refBail.d.ts`.
|
|
|
|
declare module '@vue/reactivity' {
|
|
|
|
export interface RefUnwrapBailTypes {
|
|
|
|
runtimeCoreBailTypes:
|
|
|
|
| VNode
|
|
|
|
| {
|
|
|
|
// directly bailing on ComponentPublicInstance results in recursion
|
|
|
|
// so we use this as a bail hint
|
|
|
|
$: ComponentInternalInstance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-14 13:13:54 +08:00
|
|
|
export {
|
|
|
|
ReactiveEffect,
|
|
|
|
ReactiveEffectOptions,
|
|
|
|
DebuggerEvent,
|
|
|
|
TrackOpTypes,
|
|
|
|
TriggerOpTypes,
|
|
|
|
Ref,
|
|
|
|
ComputedRef,
|
|
|
|
UnwrapRef,
|
2020-04-25 01:10:16 +08:00
|
|
|
WritableComputedOptions,
|
|
|
|
ToRefs
|
2020-02-14 13:13:54 +08:00
|
|
|
} from '@vue/reactivity'
|
|
|
|
export {
|
|
|
|
// types
|
2020-03-23 23:11:27 +08:00
|
|
|
WatchEffect,
|
2020-02-14 13:13:54 +08:00
|
|
|
WatchOptions,
|
2020-04-28 01:33:57 +08:00
|
|
|
WatchOptionsBase,
|
2020-02-14 13:13:54 +08:00
|
|
|
WatchCallback,
|
|
|
|
WatchSource,
|
2020-04-28 01:33:57 +08:00
|
|
|
WatchStopHandle
|
2020-02-14 13:13:54 +08:00
|
|
|
} from './apiWatch'
|
|
|
|
export { InjectionKey } from './apiInject'
|
2020-01-24 04:05:38 +08:00
|
|
|
export {
|
|
|
|
App,
|
|
|
|
AppConfig,
|
|
|
|
AppContext,
|
|
|
|
Plugin,
|
2020-03-24 23:59:00 +08:00
|
|
|
CreateAppFunction,
|
|
|
|
OptionMergeFunction
|
2020-01-24 04:05:38 +08:00
|
|
|
} from './apiCreateApp'
|
2020-01-29 11:58:02 +08:00
|
|
|
export {
|
|
|
|
VNode,
|
2020-05-01 22:37:40 +08:00
|
|
|
VNodeChild,
|
2020-01-29 11:58:02 +08:00
|
|
|
VNodeTypes,
|
|
|
|
VNodeProps,
|
|
|
|
VNodeArrayChildren,
|
|
|
|
VNodeNormalizedChildren
|
|
|
|
} from './vnode'
|
2019-09-07 00:58:31 +08:00
|
|
|
export {
|
|
|
|
Component,
|
|
|
|
FunctionalComponent,
|
2019-09-21 00:16:19 +08:00
|
|
|
ComponentInternalInstance,
|
2019-11-23 02:15:59 +08:00
|
|
|
SetupContext
|
2019-09-07 00:58:31 +08:00
|
|
|
} from './component'
|
|
|
|
export {
|
|
|
|
ComponentOptions,
|
2020-06-15 23:13:00 +08:00
|
|
|
ComponentOptionsMixin,
|
2019-09-07 00:58:31 +08:00
|
|
|
ComponentOptionsWithoutProps,
|
2020-04-17 21:41:36 +08:00
|
|
|
ComponentOptionsWithObjectProps,
|
|
|
|
ComponentOptionsWithArrayProps,
|
2020-04-28 01:31:40 +08:00
|
|
|
ComponentCustomOptions,
|
2020-05-01 22:37:40 +08:00
|
|
|
ComponentOptionsBase,
|
|
|
|
RenderFunction
|
2020-04-04 07:08:17 +08:00
|
|
|
} from './componentOptions'
|
2020-04-17 21:12:50 +08:00
|
|
|
export {
|
|
|
|
ComponentPublicInstance,
|
|
|
|
ComponentCustomProperties
|
|
|
|
} from './componentProxy'
|
2020-02-15 01:33:32 +08:00
|
|
|
export {
|
|
|
|
Renderer,
|
2020-03-27 21:30:49 +08:00
|
|
|
RendererNode,
|
|
|
|
RendererElement,
|
2020-02-15 01:33:32 +08:00
|
|
|
HydrationRenderer,
|
|
|
|
RendererOptions,
|
|
|
|
RootRenderFunction
|
|
|
|
} from './renderer'
|
|
|
|
export { RootHydrateFunction } from './hydration'
|
2019-08-23 09:38:00 +08:00
|
|
|
export { Slot, Slots } from './componentSlots'
|
2019-10-08 21:26:09 +08:00
|
|
|
export {
|
|
|
|
Prop,
|
|
|
|
PropType,
|
|
|
|
ComponentPropsOptions,
|
2020-04-17 21:00:25 +08:00
|
|
|
ComponentObjectPropsOptions,
|
|
|
|
ExtractPropTypes
|
2019-10-08 21:26:09 +08:00
|
|
|
} from './componentProps'
|
2019-09-07 00:58:31 +08:00
|
|
|
export {
|
|
|
|
Directive,
|
|
|
|
DirectiveBinding,
|
|
|
|
DirectiveHook,
|
2019-10-16 14:12:26 +08:00
|
|
|
ObjectDirective,
|
|
|
|
FunctionDirective,
|
2019-09-07 00:58:31 +08:00
|
|
|
DirectiveArguments
|
|
|
|
} from './directives'
|
2019-11-05 07:38:55 +08:00
|
|
|
export { SuspenseBoundary } from './components/Suspense'
|
2020-02-14 13:13:54 +08:00
|
|
|
export { TransitionState, TransitionHooks } from './components/BaseTransition'
|
2020-03-22 04:01:08 +08:00
|
|
|
export {
|
|
|
|
AsyncComponentOptions,
|
|
|
|
AsyncComponentLoader
|
|
|
|
} from './apiAsyncComponent'
|
2019-12-17 06:57:34 +08:00
|
|
|
export { HMRRuntime } from './hmr'
|
2020-05-01 05:04:35 +08:00
|
|
|
|
|
|
|
// Internal API ----------------------------------------------------------------
|
|
|
|
|
|
|
|
// **IMPORTANT** Internal APIs may change without notice between versions and
|
|
|
|
// user code should avoid relying on them.
|
|
|
|
|
|
|
|
// For compiler generated code
|
|
|
|
// should sync with '@vue/compiler-core/src/runtimeConstants.ts'
|
|
|
|
export { withCtx } from './helpers/withRenderContext'
|
|
|
|
export { renderList } from './helpers/renderList'
|
|
|
|
export { toHandlers } from './helpers/toHandlers'
|
|
|
|
export { renderSlot } from './helpers/renderSlot'
|
|
|
|
export { createSlots } from './helpers/createSlots'
|
|
|
|
export { pushScopeId, popScopeId, withScopeId } from './helpers/scopeId'
|
|
|
|
export {
|
2020-05-01 22:37:40 +08:00
|
|
|
openBlock,
|
|
|
|
createBlock,
|
2020-05-01 05:04:35 +08:00
|
|
|
setBlockTracking,
|
|
|
|
createTextVNode,
|
|
|
|
createCommentVNode,
|
|
|
|
createStaticVNode
|
|
|
|
} from './vnode'
|
2020-05-01 21:19:30 +08:00
|
|
|
|
|
|
|
// a bit of ceremony to mark these internal only here because we need to include
|
|
|
|
// them in @vue/shared's typings
|
|
|
|
import { toDisplayString, camelize } from '@vue/shared'
|
|
|
|
/**
|
2020-06-11 02:57:21 +08:00
|
|
|
* @private
|
2020-05-01 21:19:30 +08:00
|
|
|
*/
|
|
|
|
const _toDisplayString = toDisplayString
|
|
|
|
/**
|
2020-06-11 02:57:21 +08:00
|
|
|
* @private
|
2020-05-01 21:19:30 +08:00
|
|
|
*/
|
|
|
|
const _camelize = camelize
|
|
|
|
export { _toDisplayString as toDisplayString, _camelize as camelize }
|
|
|
|
|
2020-05-01 05:04:35 +08:00
|
|
|
// For test-utils
|
|
|
|
export { transformVNodeArgs } from './vnode'
|
|
|
|
|
|
|
|
// SSR -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// **IMPORTANT** These APIs are exposed solely for @vue/server-renderer and may
|
|
|
|
// change without notice between versions. User code should never rely on them.
|
|
|
|
|
|
|
|
import { createComponentInstance, setupComponent } from './component'
|
|
|
|
import {
|
|
|
|
renderComponentRoot,
|
|
|
|
setCurrentRenderingInstance
|
|
|
|
} from './componentRenderUtils'
|
|
|
|
import { isVNode, normalizeVNode } from './vnode'
|
|
|
|
import { normalizeSuspenseChildren } from './components/Suspense'
|
|
|
|
|
|
|
|
const _ssrUtils = {
|
|
|
|
createComponentInstance,
|
|
|
|
setupComponent,
|
|
|
|
renderComponentRoot,
|
|
|
|
setCurrentRenderingInstance,
|
|
|
|
isVNode,
|
|
|
|
normalizeVNode,
|
|
|
|
normalizeSuspenseChildren
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
export const ssrUtils = (__NODE_JS__ ? _ssrUtils : null) as typeof _ssrUtils
|