package @vue/runtime-core

Interfaces

Name Summary

AllowedComponentProps

Default allowed non-declared props on component in TSX

App

AppConfig

AppContext

AsyncComponentOptions

BaseTransitionProps

ComponentCustomOptions

Interface for declaring custom options.

ComponentCustomProperties

Custom properties added to component instances in any way and can be accessed through this

ComponentCustomProps

For extending allowed non-declared props on components in TSX

ComponentInternalInstance

We expose a subset of properties on the internal instance as they are useful for advanced external libraries and tools.

ComponentOptionsBase

DirectiveBinding

FunctionalComponent

HMRRuntime

HydrationRenderer

InjectionKey

KeepAliveProps

MethodOptions

ObjectDirective

Renderer

RendererElement

RendererNode

RendererOptions

RuntimeCompilerOptions

Subset of compiler options that makes sense for the runtime.

SetupContext

SuspenseBoundary

SuspenseProps

TeleportProps

TransitionHooks

TransitionState

VNode

WatchOptions

WatchOptionsBase

Enumerations

Functions

callWithAsyncErrorHandling(fn, instance, type, args)

Parameters
Name Type Description

fn

Function | Function[]

instance

ComponentInternalInstance | null

type

ErrorTypes

args

unknown[]

Returns

any[]

Signature
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];

callWithErrorHandling(fn, instance, type, args)

Parameters
Name Type Description

fn

Function

instance

ComponentInternalInstance | null

type

ErrorTypes

args

unknown[]

Returns

any

Signature
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;

cloneVNode(vnode, extraProps, mergeRef)

Parameters
Name Type Description

vnode

VNode<T, U>

extraProps

(Data & VNodeProps) | null

mergeRef

boolean

Returns

VNode<T, U>

Signature
export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;

createBlock(type, props, children, patchFlag, dynamicProps)

Create a block root vnode. Takes the same exact arguments as createVNode. A block root keeps track of dynamic nodes within the block in the dynamicChildren array.

Parameters
Name Type Description

type

VNodeTypes | ClassComponent

props

Record<string, any> | null

children

any

patchFlag

number

dynamicProps

string[]

Returns

VNode

Signature
export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;

createCommentVNode(text, asBlock)

Parameters
Name Type Description

text

string

asBlock

boolean

Returns

VNode

Signature
export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;

createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag)

Parameters
Name Type Description

type

string | typeof Fragment

props

Record<string, any> | null

children

any

patchFlag

number

dynamicProps

string[]

shapeFlag

number

Returns

VNode<RendererNode, RendererElement, { [key: string]: any; }>

Signature
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode<RendererNode, RendererElement, {
    [key: string]: any;
}>;

createElementVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, needFullChildrenNormalization)

Parameters
Name Type Description

type

VNodeTypes | ClassComponent

typeof NULL_DYNAMIC_COMPONENT

props

(Data & VNodeProps) | null

children

unknown

patchFlag

number

dynamicProps

string[] | null

shapeFlag

number | ShapeFlags

isBlockNode

boolean

needFullChildrenNormalization

boolean

Returns

VNode<RendererNode, RendererElement, { [key: string]: any; }>

Signature
declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number | ShapeFlags, isBlockNode?: boolean, needFullChildrenNormalization?: boolean): VNode<RendererNode, RendererElement, {
    [key: string]: any;
}>;

createHydrationRenderer(options)

Parameters
Name Type Description

options

RendererOptions<Node, Element>

Returns

HydrationRenderer

Signature
export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;

createRenderer(options)

The createRenderer function accepts two generic arguments: HostNode and HostElement, corresponding to Node and Element types in the host environment. For example, for runtime-dom, HostNode would be the DOM Node interface and HostElement would be the DOM Element interface.

Custom renderers can pass in the platform specific types like this:

const { render, createApp } = createRenderer<Node, Element>({
  patchProp,
  ...nodeOps
})
Parameters
Name Type Description

options

RendererOptions<HostNode, HostElement>

Returns

Renderer<HostElement>

Signature
export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;

createSlots(slots, dynamicSlots)

Compiler runtime helper for creating dynamic slots object

Parameters
Name Type Description

slots

Record<string, Slot>

dynamicSlots

(\~CompiledSlotDescriptor

~CompiledSlotDescriptor[]

undefined)[]

Returns

Signature
export declare function createSlots(slots: Record<string, Slot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, Slot>;

createStaticVNode(content, numberOfNodes)

Parameters
Name Type Description

content

string

numberOfNodes

number

Returns

VNode

Signature
export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;

createTextVNode(text, flag)

Parameters
Name Type Description

text

string

flag

number

Returns

VNode

Signature
export declare function createTextVNode(text?: string, flag?: number): VNode;

defineAsyncComponent(source)

Parameters
Name Type Description

source

AsyncComponentLoader<T> | AsyncComponentOptions<T>

Returns

T

Signature
export declare function defineAsyncComponent<T extends Component = {
    new (): ComponentPublicInstance;
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;

defineComponent(setup)

Parameters
Name Type Description

setup

(props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction

Returns

DefineComponent<Props, RawBindings>

Signature
export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>;

defineComponent(options)

Parameters
Name Type Description

options

ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>

Returns

DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>

Signature
export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;

defineComponent(options)

Parameters
Name Type Description

options

ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>

Returns

DefineComponent<Readonly<{ [key in PropNames]?: any; }>, RawBindings, D, C, M, Mixin, Extends, E, EE>

Signature
export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Readonly<{
    [key in PropNames]?: any;
}>, RawBindings, D, C, M, Mixin, Extends, E, EE>;

defineComponent(options)

Parameters
Name Type Description

options

ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>

Returns

DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>

Signature
export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;

defineEmits(emitOptions)

Vue <script setup> compiler macro for declaring a component’s emitted events. The expected argument is the same as the component emits option.

Example runtime declaration:

const emit = defineEmits(['change', 'update'])

Example type-based declaration:

const emit = defineEmits<{
  (event: 'change'): void
  (event: 'update', id: number): void
}>()

emit('change')
emit('update', 1)

This is only usable inside <script setup>, is compiled away in the output and should *\*not\*\* be actually called at runtime.

Parameters
Name Type Description

emitOptions

EE[]

Returns

EmitFn<EE[]>

Signature
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;

defineEmits(emitOptions)

Parameters
Name Type Description

emitOptions

E

Returns

EmitFn<E>

Signature
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;

defineEmits()

Signature
export declare function defineEmits<TypeEmit>(): TypeEmit;

defineExpose(exposed)

Vue <script setup> compiler macro for declaring a component’s exposed instance properties when it is accessed by a parent component via template refs.

<script setup> components are closed by default - i.e. varaibles inside the <script setup> scope is not exposed to parent unless explicitly exposed via defineExpose.

This is only usable inside <script setup>, is compiled away in the output and should *\*not\*\* be actually called at runtime.

Parameters
Name Type Description

exposed

Record<string, any>

Returns

void

Signature
export declare function defineExpose(exposed?: Record<string, any>): void;

defineProps(props)

Vue <script setup> compiler macro for declaring component props. The expected argument is the same as the component props option.

Example runtime declaration:

// using Array syntax
const props = defineProps(['foo', 'bar'])
// using Object syntax
const props = defineProps({
  foo: String,
  bar: {
    type: Number,
    required: true
  }
})

Equivalent type-based declaration:

// will be compiled into equivalent runtime declarations
const props = defineProps<{
  foo?: string
  bar: number
}>()

This is only usable inside <script setup>, is compiled away in the output and should *\*not\*\* be actually called at runtime.

Parameters
Name Type Description

props

PropNames[]

Returns

Readonly<{ [key in PropNames]?: any; }>

Signature
export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Readonly<{
    [key in PropNames]?: any;
}>;

defineProps(props)

Parameters
Name Type Description

props

PP

Returns

Readonly<ExtractPropTypes<PP>>

Signature
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Readonly<ExtractPropTypes<PP>>;

defineProps()

Signature
export declare function defineProps<TypeProps>(): Readonly<TypeProps>;

getTransitionRawChildren(children, keepComment)

Parameters
Name Type Description

children

VNode[]

keepComment

boolean

Returns

VNode[]

Signature
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean): VNode[];

guardReactiveProps(props)

Parameters
Name Type Description

props

(Data & VNodeProps) | null

Returns

(Data & VNodeProps) | null

Signature
export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;

h(type, children)

Parameters
Name Type Description

type

string

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: string, children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

FunctionalComponent<P, E>

props

(\~RawProps & P)

({} extends P ? null : never)

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h<P, E extends EmitsOptions = {}>(type: FunctionalComponent<P, E>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;

h(type, children)

Parameters
Name Type Description

type

Component

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: Component, children?: RawChildren): VNode;

h(type, children)

Parameters
Name Type Description

type

ConcreteComponent | string

children

\~RawChildren

Returns

VNode

Signature
export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

ConcreteComponent<P> | string

props

(\~RawProps & P)

({} extends P ? null : never)

children

\~RawChildren

Returns

VNode

Signature
export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

Component

props

null

children

\~RawChildren

RawSlots

Returns

VNode

Signature
export declare function h(type: Component, props: null, children?: RawChildren | RawSlots): VNode;

h(type, props, children)

Parameters
Name Type Description

type

ComponentOptions<P>

props

(\~RawProps & P)

({} extends P ? null : never)

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;

h(type, children)

Parameters
Name Type Description

type

\~Constructor

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: Constructor, children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

\~Constructor<P>

props

(\~RawProps & P)

({} extends P ? null : never)

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;

h(type, children)

Parameters
Name Type Description

type

DefineComponent

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: DefineComponent, children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

DefineComponent<P>

props

(\~RawProps & P)

({} extends P ? null : never)

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;

h(type, props, children)

Parameters
Name Type Description

type

string

props

\~RawProps

null

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;

h(type, children)

Parameters
Name Type Description

type

typeof Text | typeof Comment

children

string | number

boolean

Returns

VNode

Signature
export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;

h(type, props, children)

Parameters
Name Type Description

type

typeof Text | typeof Comment

props

null

children

string | number

boolean

Returns

VNode

Signature
export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;

h(type, children)

Parameters
Name Type Description

type

typeof Fragment

children

VNodeArrayChildren

Returns

VNode

Signature
export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

typeof Fragment

props

\~RawProps

null

children

VNodeArrayChildren

Returns

VNode

Signature
export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

typeof Teleport

props

\~RawProps & TeleportProps

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren): VNode;

h(type, children)

Parameters
Name Type Description

type

typeof Suspense

children

\~RawChildren

Returns

VNode

Signature
export declare function h(type: typeof Suspense, children?: RawChildren): VNode;

h(type, props, children)

Parameters
Name Type Description

type

typeof Suspense

props

(\~RawProps & SuspenseProps)

null

children

\~RawChildren

RawSlots

Returns

Signature
export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;

handleError(err, instance, type, throwInDev)

Parameters
Name Type Description

err

unknown

instance

ComponentInternalInstance | null

type

ErrorTypes

throwInDev

boolean

Returns

void

Signature
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;

initCustomFormatter()

Signature
export declare function initCustomFormatter(): void;

inject(key)

Parameters
Name Type Description

key

InjectionKey<T> | string

Returns

T | undefined

Signature
export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;

inject(key, defaultValue, treatDefaultAsFactory)

Parameters
Name Type Description

key

InjectionKey<T> | string

defaultValue

T

treatDefaultAsFactory

false

Returns

T

Signature
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;

inject(key, defaultValue, treatDefaultAsFactory)

Parameters
Name Type Description

key

InjectionKey<T> | string

defaultValue

T | (() => T)

treatDefaultAsFactory

true

Returns

T

Signature
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;

isMemoSame(cached, memo)

Parameters
Name Type Description

cached

VNode

memo

any[]

Returns

boolean

Signature
export declare function isMemoSame(cached: VNode, memo: any[]): boolean;

isVNode(value)

Parameters
Name Type Description

value

any

Returns

@vue/runtime-core!\~value is VNode

Signature
export declare function isVNode(value: any): value is VNode;

mergeProps(args)

Parameters
Name Type Description

args

(Data & VNodeProps)[]

Returns

Data

Signature
export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;

nextTick(this, fn)

Parameters
Name Type Description

this

T

fn

(this: T) => void

Returns

Promise<void>

Signature
export declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;

onActivated(hook, target)

Parameters
Name Type Description

hook

Function

target

ComponentInternalInstance | null

Returns

void

Signature
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;

onDeactivated(hook, target)

Parameters
Name Type Description

hook

Function

target

ComponentInternalInstance | null

Returns

void

Signature
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;

onErrorCaptured(hook, target)

Parameters
Name Type Description

hook

ErrorCapturedHook<TError>

target

ComponentInternalInstance | null

Returns

void

Signature
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;

openBlock(disableTracking)

Open a block. This must be called before createBlock. It cannot be part of createBlock because the children of the block are evaluated before createBlock itself is called. The generated code typically looks like this:

function render() {
  return (openBlock(),createBlock('div', null, [...]))
}

disableTracking is true when creating a v-for fragment block, since a v-for fragment always diffs its children.

Parameters
Name Type Description

disableTracking

boolean

Returns

void

Signature
export declare function openBlock(disableTracking?: boolean): void;

popScopeId()

Technically we no longer need this after 3.0.8 but we need to keep the same API for backwards compat w/ code generated by compilers.

Signature
export declare function popScopeId(): void;

provide(key, value)

Parameters
Name Type Description

key

InjectionKey<T> | string

number

value

T

Returns

void

Signature
export declare function provide<T>(key: InjectionKey<T> | string | number, value: T): void;

pushScopeId(id)

Set scope id when creating hoisted vnodes. compiler helper

Parameters
Name Type Description

id

string | null

Returns

void

Signature
export declare function pushScopeId(id: string | null): void;

queuePostFlushCb(cb)

Parameters
Name Type Description

cb

SchedulerJobs

Returns

void

Signature
export declare function queuePostFlushCb(cb: SchedulerJobs): void;

registerRuntimeCompiler(_compile)

For runtime-dom to register the compiler. Note the exported method uses any to avoid d.ts relying on the compiler types.

Parameters
Name Type Description

_compile

any

Returns

void

Signature
export declare function registerRuntimeCompiler(_compile: any): void;

renderList(source, renderItem)

v-for string

Parameters
Name Type Description

source

string

renderItem

(value: string, index: number) => VNodeChild

Returns

VNodeChild[]

Signature
export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];

renderList(source, renderItem)

v-for number

Parameters
Name Type Description

source

number

renderItem

(value: number, index: number) => VNodeChild

Returns

VNodeChild[]

Signature
export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];

renderList(source, renderItem)

v-for array

Parameters
Name Type Description

source

T[]

renderItem

(value: T, index: number) => VNodeChild

Returns

VNodeChild[]

Signature
export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];

renderList(source, renderItem)

v-for iterable

Parameters
Name Type Description

source

Iterable<T>

renderItem

(value: T, index: number) => VNodeChild

Returns

VNodeChild[]

Signature
export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];

renderList(source, renderItem)

v-for object

Parameters
Name Type Description

source

T

renderItem

<K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild

Returns

VNodeChild[]

Signature
export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];

renderSlot(slots, name, props, fallback, noSlotted)

Compiler runtime helper for rendering <slot/>

Parameters
Name Type Description

slots

Slots

name

string

props

Data

fallback

() => VNodeArrayChildren

noSlotted

boolean

Returns

VNode

Signature
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;

resolveComponent(name, maybeSelfReference)

Parameters
Name Type Description

name

string

maybeSelfReference

boolean

Returns

ConcreteComponent | string

Signature
export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;

resolveDirective(name)

Parameters
Name Type Description

name

string

Returns

Directive | undefined

Signature
export declare function resolveDirective(name: string): Directive | undefined;

resolveDynamicComponent(component)

Parameters
Name Type Description

component

unknown

Returns

VNodeTypes

Signature
export declare function resolveDynamicComponent(component: unknown): VNodeTypes;

resolveTransitionHooks(vnode, props, state, instance)

Parameters
Name Type Description

vnode

VNode

props

BaseTransitionProps<any>

state

TransitionState

instance

ComponentInternalInstance

Returns

TransitionHooks

Signature
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;

setBlockTracking(value)

Block tracking sometimes needs to be disabled, for example during the creation of a tree that needs to be cached by v-once. The compiler generates code like this:

_cache[1] || (
  setBlockTracking(-1),
  _cache[1] = createVNode(...),
  setBlockTracking(1),
  _cache[1]
)
Parameters
Name Type Description

value

number

Returns

void

Signature
export declare function setBlockTracking(value: number): void;

setDevtoolsHook(hook)

Parameters
Name Type Description

hook

\~DevtoolsHook

Returns

void

Signature
export declare function setDevtoolsHook(hook: DevtoolsHook): void;

setTransitionHooks(vnode, hooks)

Parameters
Name Type Description

vnode

VNode

hooks

TransitionHooks

Returns

void

Signature
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;

toHandlers(obj)

For prefixing keys in v-on="obj" with "on"

Parameters
Name Type Description

obj

Record<string, any>

Returns

Record<string, any>

Signature
export declare function toHandlers(obj: Record<string, any>): Record<string, any>;

transformVNodeArgs(transformer)

Internal API for registering an arguments transform for createVNode used for creating stubs in the test-utils It is *internal\* but needs to be exposed for test-utils to pick up proper typings

Parameters
Name Type Description

transformer

typeof \~vnodeArgsTransformer

Returns

void

Signature
export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;

useAttrs()

Signature
export declare function useAttrs(): SetupContext['attrs'];

useSlots()

Signature
export declare function useSlots(): SetupContext['slots'];

useTransitionState()

Signature
export declare function useTransitionState(): TransitionState;

warn(msg, args)

Parameters
Name Type Description

msg

string

args

any[]

Returns

void

Signature
export declare function warn(msg: string, ...args: any[]): void;

watch(sources, cb, options)

Parameters
Name Type Description

sources

[…​T]

cb

WatchCallback<\~MapSources<T, false>, ~MapSources<T, Immediate>>

options

WatchOptions<Immediate>

Returns

WatchStopHandle

Signature
export declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;

watch(source, cb, options)

Parameters
Name Type Description

source

T

cb

WatchCallback<\~MapSources<T, false>, ~MapSources<T, Immediate>>

options

WatchOptions<Immediate>

Returns

WatchStopHandle

Signature
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;

watch(source, cb, options)

Parameters
Name Type Description

source

WatchSource<T>

cb

WatchCallback<T, Immediate extends true ? T | undefined : T>

options

WatchOptions<Immediate>

Returns

WatchStopHandle

Signature
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;

watch(source, cb, options)

Parameters
Name Type Description

source

T

cb

WatchCallback<T, Immediate extends true ? T | undefined : T>

options

WatchOptions<Immediate>

Returns

WatchStopHandle

Signature
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;

watchEffect(effect, options)

Parameters
Name Type Description

effect

WatchEffect

options

WatchOptionsBase

Returns

WatchStopHandle

Signature
export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;

watchPostEffect(effect, options)

Parameters
Name Type Description

effect

WatchEffect

options

DebuggerOptions

Returns

WatchStopHandle

Signature
export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;

watchSyncEffect(effect, options)

Parameters
Name Type Description

effect

WatchEffect

options

DebuggerOptions

Returns

WatchStopHandle

Signature
export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;

withCtx(fn, ctx, isNonScopedSlot)

Wrap a slot function to memoize current rendering instance compiler helper

Parameters
Name Type Description

fn

Function

ctx

ComponentInternalInstance | null

isNonScopedSlot

boolean

Returns

Function

Signature
export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;

withDefaults(props, defaults)

Vue <script setup> compiler macro for providing props default values when using type-based defineProps declaration.

Example usage:

withDefaults(defineProps<{
  size?: number
  labels?: string[]
}>(), {
  size: 3,
  labels: () => ['default label']
})

This is only usable inside <script setup>, is compiled away in the output and should *\*not\*\* be actually called at runtime.

Parameters
Name Type Description

props

Props

defaults

Defaults

Returns

\~PropsWithDefaults<Props, Defaults>

Signature
export declare function withDefaults<Props, Defaults extends InferDefaults<Props>>(props: Props, defaults: Defaults): PropsWithDefaults<Props, Defaults>;

withDirectives(vnode, directives)

Adds directives to a VNode.

Parameters
Name Type Description

vnode

T

directives

DirectiveArguments

Returns

T

Signature
export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;

withMemo(memo, render, cache, index)

Parameters
Name Type Description

memo

any[]

render

() => VNode<any, any>

cache

any[]

index

number

Returns

VNode<any, any, { [key: string]: any; }>

Signature
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
    [key: string]: any;
}>;