runtime-core.d.ts 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635
  1. import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, Ref, ReactiveEffect, ComputedRef, DebuggerOptions, reactive } from '@vue/reactivity';
  2. export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
  3. import { IfAny, Prettify, Awaited, UnionToIntersection, LooseRequired } from '@vue/shared';
  4. export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
  5. export declare const computed: typeof computed$1;
  6. export type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
  7. type InternalSlots = {
  8. [name: string]: Slot | undefined;
  9. };
  10. export type Slots = Readonly<InternalSlots>;
  11. declare const SlotSymbol: unique symbol;
  12. export type SlotsType<T extends Record<string, any> = Record<string, any>> = {
  13. [SlotSymbol]?: T;
  14. };
  15. type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T>;
  16. type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{
  17. [K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>;
  18. }>>;
  19. type RawSlots = {
  20. [name: string]: unknown;
  21. $stable?: boolean;
  22. };
  23. interface SchedulerJob extends Function {
  24. id?: number;
  25. pre?: boolean;
  26. active?: boolean;
  27. computed?: boolean;
  28. /**
  29. * Indicates whether the effect is allowed to recursively trigger itself
  30. * when managed by the scheduler.
  31. *
  32. * By default, a job cannot trigger itself because some built-in method calls,
  33. * e.g. Array.prototype.push actually performs reads as well (#1740) which
  34. * can lead to confusing infinite loops.
  35. * The allowed cases are component update functions and watch callbacks.
  36. * Component update functions may update child component props, which in turn
  37. * trigger flush: "pre" watch callbacks that mutates state that the parent
  38. * relies on (#1801). Watch callbacks doesn't track its dependencies so if it
  39. * triggers itself again, it's likely intentional and it is the user's
  40. * responsibility to perform recursive state mutation that eventually
  41. * stabilizes (#1727).
  42. */
  43. allowRecurse?: boolean;
  44. /**
  45. * Attached by renderer.ts when setting up a component's render effect
  46. * Used to obtain component information when reporting max recursive updates.
  47. * dev only.
  48. */
  49. ownerInstance?: ComponentInternalInstance;
  50. }
  51. type SchedulerJobs = SchedulerJob | SchedulerJob[];
  52. export declare function nextTick<T = void, R = void>(this: T, fn?: (this: T) => R): Promise<Awaited<R>>;
  53. export declare function queuePostFlushCb(cb: SchedulerJobs): void;
  54. export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
  55. export type EmitsOptions = ObjectEmitsOptions | string[];
  56. type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
  57. [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
  58. } : T extends ObjectEmitsOptions ? {
  59. [K in string & `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? T[Uncapitalize<C>] extends null ? (...args: any[]) => any : (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : never) => any : never;
  60. } : {};
  61. type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> ? (event: V, ...args: any[]) => void : {} extends Options ? (event: string, ...args: any[]) => void : UnionToIntersection<{
  62. [key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
  63. }[Event]>;
  64. /**
  65. * Custom properties added to component instances in any way and can be accessed through `this`
  66. *
  67. * @example
  68. * Here is an example of adding a property `$router` to every component instance:
  69. * ```ts
  70. * import { createApp } from 'vue'
  71. * import { Router, createRouter } from 'vue-router'
  72. *
  73. * declare module '@vue/runtime-core' {
  74. * interface ComponentCustomProperties {
  75. * $router: Router
  76. * }
  77. * }
  78. *
  79. * // effectively adding the router to every component instance
  80. * const app = createApp({})
  81. * const router = createRouter()
  82. * app.config.globalProperties.$router = router
  83. *
  84. * const vm = app.mount('#app')
  85. * // we can access the router from the instance
  86. * vm.$router.push('/')
  87. * ```
  88. */
  89. export interface ComponentCustomProperties {
  90. }
  91. type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
  92. type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
  93. type ExtractMixin<T> = {
  94. Mixin: MixinToOptionTypes<T>;
  95. }[T extends ComponentOptionsMixin ? 'Mixin' : never];
  96. type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>;
  97. type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
  98. type EnsureNonVoid<T> = T extends void ? {} : T;
  99. type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
  100. __isFragment?: never;
  101. __isTeleport?: never;
  102. __isSuspense?: never;
  103. new (...args: any[]): T;
  104. };
  105. export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S>, I, S>;
  106. export type ComponentPublicInstance<P = {}, // props type extracted from props option
  107. B = {}, // raw bindings returned from setup()
  108. D = {}, // return from data()
  109. C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}> = {
  110. $: ComponentInternalInstance;
  111. $data: D;
  112. $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
  113. $attrs: Data;
  114. $refs: Data;
  115. $slots: UnwrapSlotsType<S>;
  116. $root: ComponentPublicInstance | null;
  117. $parent: ComponentPublicInstance | null;
  118. $emit: EmitFn<E>;
  119. $el: any;
  120. $options: Options & MergedComponentOptionsOverride;
  121. $forceUpdate: () => void;
  122. $nextTick: typeof nextTick;
  123. $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R]) => any : (...args: any) => any, options?: WatchOptions): WatchStopHandle;
  124. } & IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
  125. declare const enum LifecycleHooks {
  126. BEFORE_CREATE = "bc",
  127. CREATED = "c",
  128. BEFORE_MOUNT = "bm",
  129. MOUNTED = "m",
  130. BEFORE_UPDATE = "bu",
  131. UPDATED = "u",
  132. BEFORE_UNMOUNT = "bum",
  133. UNMOUNTED = "um",
  134. DEACTIVATED = "da",
  135. ACTIVATED = "a",
  136. RENDER_TRIGGERED = "rtg",
  137. RENDER_TRACKED = "rtc",
  138. ERROR_CAPTURED = "ec",
  139. SERVER_PREFETCH = "sp"
  140. }
  141. export interface SuspenseProps {
  142. onResolve?: () => void;
  143. onPending?: () => void;
  144. onFallback?: () => void;
  145. timeout?: string | number;
  146. /**
  147. * Allow suspense to be captured by parent suspense
  148. *
  149. * @default false
  150. */
  151. suspensible?: boolean;
  152. }
  153. declare const SuspenseImpl: {
  154. name: string;
  155. __isSuspense: boolean;
  156. process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
  157. hydrate: typeof hydrateSuspense;
  158. create: typeof createSuspenseBoundary;
  159. normalize: typeof normalizeSuspenseChildren;
  160. };
  161. export declare const Suspense: {
  162. new (): {
  163. $props: VNodeProps & SuspenseProps;
  164. $slots: {
  165. default(): VNode[];
  166. fallback(): VNode[];
  167. };
  168. };
  169. __isSuspense: true;
  170. };
  171. export interface SuspenseBoundary {
  172. vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
  173. parent: SuspenseBoundary | null;
  174. parentComponent: ComponentInternalInstance | null;
  175. isSVG: boolean;
  176. container: RendererElement;
  177. hiddenContainer: RendererElement;
  178. anchor: RendererNode | null;
  179. activeBranch: VNode | null;
  180. pendingBranch: VNode | null;
  181. deps: number;
  182. pendingId: number;
  183. timeout: number;
  184. isInFallback: boolean;
  185. isHydrating: boolean;
  186. isUnmounted: boolean;
  187. effects: Function[];
  188. resolve(force?: boolean, sync?: boolean): void;
  189. fallback(fallbackVNode: VNode): void;
  190. move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
  191. next(): RendererNode | null;
  192. registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
  193. unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
  194. }
  195. declare function createSuspenseBoundary(vnode: VNode, parentSuspense: SuspenseBoundary | null, parentComponent: ComponentInternalInstance | null, container: RendererElement, hiddenContainer: RendererElement, anchor: RendererNode | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, isHydrating?: boolean): SuspenseBoundary;
  196. declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
  197. declare function normalizeSuspenseChildren(vnode: VNode): void;
  198. export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Element | ShadowRoot) & {
  199. _vnode?: VNode;
  200. }) => void;
  201. type Hook<T = () => void> = T | T[];
  202. export interface BaseTransitionProps<HostElement = RendererElement> {
  203. mode?: 'in-out' | 'out-in' | 'default';
  204. appear?: boolean;
  205. persisted?: boolean;
  206. onBeforeEnter?: Hook<(el: HostElement) => void>;
  207. onEnter?: Hook<(el: HostElement, done: () => void) => void>;
  208. onAfterEnter?: Hook<(el: HostElement) => void>;
  209. onEnterCancelled?: Hook<(el: HostElement) => void>;
  210. onBeforeLeave?: Hook<(el: HostElement) => void>;
  211. onLeave?: Hook<(el: HostElement, done: () => void) => void>;
  212. onAfterLeave?: Hook<(el: HostElement) => void>;
  213. onLeaveCancelled?: Hook<(el: HostElement) => void>;
  214. onBeforeAppear?: Hook<(el: HostElement) => void>;
  215. onAppear?: Hook<(el: HostElement, done: () => void) => void>;
  216. onAfterAppear?: Hook<(el: HostElement) => void>;
  217. onAppearCancelled?: Hook<(el: HostElement) => void>;
  218. }
  219. export interface TransitionHooks<HostElement = RendererElement> {
  220. mode: BaseTransitionProps['mode'];
  221. persisted: boolean;
  222. beforeEnter(el: HostElement): void;
  223. enter(el: HostElement): void;
  224. leave(el: HostElement, remove: () => void): void;
  225. clone(vnode: VNode): TransitionHooks<HostElement>;
  226. afterLeave?(): void;
  227. delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
  228. delayedLeave?(): void;
  229. }
  230. export interface TransitionState {
  231. isMounted: boolean;
  232. isLeaving: boolean;
  233. isUnmounting: boolean;
  234. leavingVNodes: Map<any, Record<string, VNode>>;
  235. }
  236. export declare function useTransitionState(): TransitionState;
  237. export declare const BaseTransitionPropsValidators: {
  238. mode: StringConstructor;
  239. appear: BooleanConstructor;
  240. persisted: BooleanConstructor;
  241. onBeforeEnter: (ArrayConstructor | FunctionConstructor)[];
  242. onEnter: (ArrayConstructor | FunctionConstructor)[];
  243. onAfterEnter: (ArrayConstructor | FunctionConstructor)[];
  244. onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
  245. onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
  246. onLeave: (ArrayConstructor | FunctionConstructor)[];
  247. onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
  248. onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
  249. onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
  250. onAppear: (ArrayConstructor | FunctionConstructor)[];
  251. onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
  252. onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
  253. };
  254. export declare const BaseTransition: new () => {
  255. $props: BaseTransitionProps<any>;
  256. $slots: {
  257. default(): VNode[];
  258. };
  259. };
  260. export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
  261. export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
  262. export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
  263. export interface Renderer<HostElement = RendererElement> {
  264. render: RootRenderFunction<HostElement>;
  265. createApp: CreateAppFunction<HostElement>;
  266. }
  267. export interface HydrationRenderer extends Renderer<Element | ShadowRoot> {
  268. hydrate: RootHydrateFunction;
  269. }
  270. export type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement, isSVG?: boolean) => void;
  271. export interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
  272. patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, isSVG?: boolean, prevChildren?: VNode<HostNode, HostElement>[], parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, unmountChildren?: UnmountChildrenFn): void;
  273. insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
  274. remove(el: HostNode): void;
  275. createElement(type: string, isSVG?: boolean, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
  276. [key: string]: any;
  277. }) | null): HostElement;
  278. createText(text: string): HostNode;
  279. createComment(text: string): HostNode;
  280. setText(node: HostNode, text: string): void;
  281. setElementText(node: HostElement, text: string): void;
  282. parentNode(node: HostNode): HostElement | null;
  283. nextSibling(node: HostNode): HostNode | null;
  284. querySelector?(selector: string): HostElement | null;
  285. setScopeId?(el: HostElement, id: string): void;
  286. cloneNode?(node: HostNode): HostNode;
  287. insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, isSVG: boolean, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
  288. }
  289. export interface RendererNode {
  290. [key: string]: any;
  291. }
  292. export interface RendererElement extends RendererNode {
  293. }
  294. interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
  295. p: PatchFn;
  296. um: UnmountFn;
  297. r: RemoveFn;
  298. m: MoveFn;
  299. mt: MountComponentFn;
  300. mc: MountChildrenFn;
  301. pc: PatchChildrenFn;
  302. pbc: PatchBlockChildrenFn;
  303. n: NextFn;
  304. o: RendererOptions<HostNode, HostElement>;
  305. }
  306. type PatchFn = (n1: VNode | null, // null means this is a mount
  307. n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, isSVG?: boolean, slotScopeIds?: string[] | null, optimized?: boolean) => void;
  308. type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
  309. type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean) => void;
  310. type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null) => void;
  311. type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
  312. type NextFn = (vnode: VNode) => RendererNode | null;
  313. type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
  314. type RemoveFn = (vnode: VNode) => void;
  315. type UnmountChildrenFn = (children: VNode[], parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean, start?: number) => void;
  316. type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
  317. type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
  318. declare const enum MoveType {
  319. ENTER = 0,
  320. LEAVE = 1,
  321. REORDER = 2
  322. }
  323. /**
  324. * The createRenderer function accepts two generic arguments:
  325. * HostNode and HostElement, corresponding to Node and Element types in the
  326. * host environment. For example, for runtime-dom, HostNode would be the DOM
  327. * `Node` interface and HostElement would be the DOM `Element` interface.
  328. *
  329. * Custom renderers can pass in the platform specific types like this:
  330. *
  331. * ``` js
  332. * const { render, createApp } = createRenderer<Node, Element>({
  333. * patchProp,
  334. * ...nodeOps
  335. * })
  336. * ```
  337. */
  338. export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
  339. export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
  340. type MatchPattern = string | RegExp | (string | RegExp)[];
  341. export interface KeepAliveProps {
  342. include?: MatchPattern;
  343. exclude?: MatchPattern;
  344. max?: number | string;
  345. }
  346. export declare const KeepAlive: {
  347. new (): {
  348. $props: VNodeProps & KeepAliveProps;
  349. $slots: {
  350. default(): VNode[];
  351. };
  352. };
  353. __isKeepAlive: true;
  354. };
  355. export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
  356. export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
  357. export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  358. export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  359. export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  360. export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  361. export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  362. export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  363. export declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  364. type DebuggerHook = (e: DebuggerEvent) => void;
  365. export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
  366. export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
  367. type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
  368. export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
  369. export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
  370. export type ComponentObjectPropsOptions<P = Data> = {
  371. [K in keyof P]: Prop<P[K]> | null;
  372. };
  373. export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
  374. type DefaultFactory<T> = (props: Data) => T | null | undefined;
  375. interface PropOptions<T = any, D = T> {
  376. type?: PropType<T> | true | null;
  377. required?: boolean;
  378. default?: D | DefaultFactory<D> | null | undefined | object;
  379. validator?(value: unknown): boolean;
  380. }
  381. export type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
  382. type PropConstructor<T = any> = {
  383. new (...args: any[]): T & {};
  384. } | {
  385. (): T;
  386. } | PropMethod<T>;
  387. type PropMethod<T, TConstructor = any> = [T] extends [
  388. ((...args: any) => any) | undefined
  389. ] ? {
  390. new (): TConstructor;
  391. (): T;
  392. readonly prototype: TConstructor;
  393. } : never;
  394. type RequiredKeys<T> = {
  395. [K in keyof T]: T[K] extends {
  396. required: true;
  397. } | {
  398. default: any;
  399. } | BooleanConstructor | {
  400. type: BooleanConstructor;
  401. } ? T[K] extends {
  402. default: undefined | (() => undefined);
  403. } ? never : K : never;
  404. }[keyof T];
  405. type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
  406. type DefaultKeys<T> = {
  407. [K in keyof T]: T[K] extends {
  408. default: any;
  409. } | BooleanConstructor | {
  410. type: BooleanConstructor;
  411. } ? T[K] extends {
  412. type: BooleanConstructor;
  413. required: true;
  414. } ? never : K : never;
  415. }[keyof T];
  416. type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
  417. type: null | true;
  418. }] ? any : [T] extends [ObjectConstructor | {
  419. type: ObjectConstructor;
  420. }] ? Record<string, any> : [T] extends [BooleanConstructor | {
  421. type: BooleanConstructor;
  422. }] ? boolean : [T] extends [DateConstructor | {
  423. type: DateConstructor;
  424. }] ? Date : [T] extends [(infer U)[] | {
  425. type: (infer U)[];
  426. }] ? U extends DateConstructor ? Date | InferPropType<U> : InferPropType<U> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? IfAny<V, V, D> : V : T;
  427. /**
  428. * Extract prop types from a runtime props options object.
  429. * The extracted types are **internal** - i.e. the resolved props received by
  430. * the component.
  431. * - Boolean props are always present
  432. * - Props with default values are always present
  433. *
  434. * To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
  435. */
  436. export type ExtractPropTypes<O> = {
  437. [K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
  438. } & {
  439. [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
  440. };
  441. type PublicRequiredKeys<T> = {
  442. [K in keyof T]: T[K] extends {
  443. required: true;
  444. } ? K : never;
  445. }[keyof T];
  446. type PublicOptionalKeys<T> = Exclude<keyof T, PublicRequiredKeys<T>>;
  447. /**
  448. * Extract prop types from a runtime props options object.
  449. * The extracted types are **public** - i.e. the expected props that can be
  450. * passed to component.
  451. */
  452. export type ExtractPublicPropTypes<O> = {
  453. [K in keyof Pick<O, PublicRequiredKeys<O>>]: InferPropType<O[K]>;
  454. } & {
  455. [K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>;
  456. };
  457. export type ExtractDefaultPropTypes<O> = O extends object ? {
  458. [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
  459. } : {};
  460. /**
  461. Runtime helper for applying directives to a vnode. Example usage:
  462. const comp = resolveComponent('comp')
  463. const foo = resolveDirective('foo')
  464. const bar = resolveDirective('bar')
  465. return withDirectives(h(comp), [
  466. [foo, this.x],
  467. [bar, this.y]
  468. ])
  469. */
  470. export interface DirectiveBinding<V = any> {
  471. instance: ComponentPublicInstance | null;
  472. value: V;
  473. oldValue: V | null;
  474. arg?: string;
  475. modifiers: DirectiveModifiers;
  476. dir: ObjectDirective<any, V>;
  477. }
  478. export type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
  479. type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
  480. export interface ObjectDirective<T = any, V = any> {
  481. created?: DirectiveHook<T, null, V>;
  482. beforeMount?: DirectiveHook<T, null, V>;
  483. mounted?: DirectiveHook<T, null, V>;
  484. beforeUpdate?: DirectiveHook<T, VNode<any, T>, V>;
  485. updated?: DirectiveHook<T, VNode<any, T>, V>;
  486. beforeUnmount?: DirectiveHook<T, null, V>;
  487. unmounted?: DirectiveHook<T, null, V>;
  488. getSSRProps?: SSRDirectiveHook;
  489. deep?: boolean;
  490. }
  491. export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
  492. export type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
  493. type DirectiveModifiers = Record<string, boolean>;
  494. export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
  495. /**
  496. * Adds directives to a VNode.
  497. */
  498. export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
  499. export declare const enum DeprecationTypes {
  500. GLOBAL_MOUNT = "GLOBAL_MOUNT",
  501. GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
  502. GLOBAL_EXTEND = "GLOBAL_EXTEND",
  503. GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
  504. GLOBAL_SET = "GLOBAL_SET",
  505. GLOBAL_DELETE = "GLOBAL_DELETE",
  506. GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
  507. GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
  508. CONFIG_SILENT = "CONFIG_SILENT",
  509. CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
  510. CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
  511. CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
  512. CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
  513. CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
  514. CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
  515. INSTANCE_SET = "INSTANCE_SET",
  516. INSTANCE_DELETE = "INSTANCE_DELETE",
  517. INSTANCE_DESTROY = "INSTANCE_DESTROY",
  518. INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
  519. INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
  520. INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
  521. INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
  522. INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
  523. INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
  524. OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
  525. OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
  526. OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
  527. OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
  528. WATCH_ARRAY = "WATCH_ARRAY",
  529. PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
  530. V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
  531. CUSTOM_DIR = "CUSTOM_DIR",
  532. ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
  533. ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
  534. TRANSITION_CLASSES = "TRANSITION_CLASSES",
  535. TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
  536. COMPONENT_ASYNC = "COMPONENT_ASYNC",
  537. COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
  538. COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
  539. RENDER_FUNCTION = "RENDER_FUNCTION",
  540. FILTERS = "FILTERS",
  541. PRIVATE_APIS = "PRIVATE_APIS"
  542. }
  543. type CompatConfig = Partial<Record<DeprecationTypes, boolean | 'suppress-warning'>> & {
  544. MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
  545. };
  546. declare function configureCompat(config: CompatConfig): void;
  547. /**
  548. * Interface for declaring custom options.
  549. *
  550. * @example
  551. * ```ts
  552. * declare module '@vue/runtime-core' {
  553. * interface ComponentCustomOptions {
  554. * beforeRouteUpdate?(
  555. * to: Route,
  556. * from: Route,
  557. * next: () => void
  558. * ): void
  559. * }
  560. * }
  561. * ```
  562. */
  563. export interface ComponentCustomOptions {
  564. }
  565. export type RenderFunction = () => VNodeChild;
  566. export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>, ComponentInternalOptions, ComponentCustomOptions {
  567. setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
  568. name?: string;
  569. template?: string | object;
  570. render?: Function;
  571. components?: Record<string, Component>;
  572. directives?: Record<string, Directive>;
  573. inheritAttrs?: boolean;
  574. emits?: (E | EE[]) & ThisType<void>;
  575. slots?: S;
  576. expose?: string[];
  577. serverPrefetch?(): void | Promise<any>;
  578. compilerOptions?: RuntimeCompilerOptions;
  579. call?: (this: unknown, ...args: unknown[]) => never;
  580. __isFragment?: never;
  581. __isTeleport?: never;
  582. __isSuspense?: never;
  583. __defaults?: Defaults;
  584. }
  585. /**
  586. * Subset of compiler options that makes sense for the runtime.
  587. */
  588. export interface RuntimeCompilerOptions {
  589. isCustomElement?: (tag: string) => boolean;
  590. whitespace?: 'preserve' | 'condense';
  591. comments?: boolean;
  592. delimiters?: [string, string];
  593. }
  594. export type ComponentOptionsWithoutProps<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, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
  595. props?: undefined;
  596. } & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I, S>>;
  597. export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, Props = Prettify<Readonly<{
  598. [key in PropNames]?: any;
  599. } & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
  600. props: PropNames[];
  601. } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S>>;
  602. export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions> & EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S> & {
  603. props: PropsOptions & ThisType<void>;
  604. } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S>>;
  605. export type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any, S extends SlotsType = any> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, string, S> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
  606. export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any>;
  607. export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
  608. export interface MethodOptions {
  609. [key: string]: Function;
  610. }
  611. type ExtractComputedReturns<T extends any> = {
  612. [key in keyof T]: T[key] extends {
  613. get: (...args: any[]) => infer TReturn;
  614. } ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
  615. };
  616. type ObjectWatchOptionItem = {
  617. handler: WatchCallback | string;
  618. } & WatchOptions;
  619. type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
  620. type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
  621. type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
  622. export type ComponentProvideOptions = ObjectProvideOptions | Function;
  623. type ObjectProvideOptions = Record<string | symbol, unknown>;
  624. export type ComponentInjectOptions = string[] | ObjectInjectOptions;
  625. type ObjectInjectOptions = Record<string | symbol, string | symbol | {
  626. from?: string | symbol;
  627. default?: unknown;
  628. }>;
  629. type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
  630. [K in T[number]]?: unknown;
  631. } : T extends ObjectInjectOptions ? {
  632. [K in keyof T]?: unknown;
  633. } : never;
  634. interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
  635. compatConfig?: CompatConfig;
  636. [key: string]: any;
  637. data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
  638. computed?: C;
  639. methods?: M;
  640. watch?: ComponentWatchOptions;
  641. provide?: ComponentProvideOptions;
  642. inject?: I | II[];
  643. filters?: Record<string, Function>;
  644. mixins?: Mixin[];
  645. extends?: Extends;
  646. beforeCreate?(): void;
  647. created?(): void;
  648. beforeMount?(): void;
  649. mounted?(): void;
  650. beforeUpdate?(): void;
  651. updated?(): void;
  652. activated?(): void;
  653. deactivated?(): void;
  654. /** @deprecated use `beforeUnmount` instead */
  655. beforeDestroy?(): void;
  656. beforeUnmount?(): void;
  657. /** @deprecated use `unmounted` instead */
  658. destroyed?(): void;
  659. unmounted?(): void;
  660. renderTracked?: DebuggerHook;
  661. renderTriggered?: DebuggerHook;
  662. errorCaptured?: ErrorCapturedHook;
  663. /**
  664. * runtime compile only
  665. * @deprecated use `compilerOptions.delimiters` instead.
  666. */
  667. delimiters?: [string, string];
  668. /**
  669. * #3468
  670. *
  671. * type-only, used to assist Mixin's type inference,
  672. * typescript will try to simplify the inferred `Mixin` type,
  673. * with the `__differentiator`, typescript won't be able to combine different mixins,
  674. * because the `__differentiator` will be different
  675. */
  676. __differentiator?: keyof D | keyof C | keyof M;
  677. }
  678. type MergedHook<T = () => void> = T | T[];
  679. type MergedComponentOptionsOverride = {
  680. beforeCreate?: MergedHook;
  681. created?: MergedHook;
  682. beforeMount?: MergedHook;
  683. mounted?: MergedHook;
  684. beforeUpdate?: MergedHook;
  685. updated?: MergedHook;
  686. activated?: MergedHook;
  687. deactivated?: MergedHook;
  688. /** @deprecated use `beforeUnmount` instead */
  689. beforeDestroy?: MergedHook;
  690. beforeUnmount?: MergedHook;
  691. /** @deprecated use `unmounted` instead */
  692. destroyed?: MergedHook;
  693. unmounted?: MergedHook;
  694. renderTracked?: MergedHook<DebuggerHook>;
  695. renderTriggered?: MergedHook<DebuggerHook>;
  696. errorCaptured?: MergedHook<ErrorCapturedHook>;
  697. };
  698. type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
  699. type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
  700. P: P;
  701. B: B;
  702. D: D;
  703. C: C;
  704. M: M;
  705. Defaults: Defaults;
  706. };
  707. export interface InjectionKey<T> extends Symbol {
  708. }
  709. export declare function provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): void;
  710. export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
  711. export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
  712. export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
  713. /**
  714. * Returns true if `inject()` can be used without warning about being called in the wrong place (e.g. outside of
  715. * setup()). This is used by libraries that want to use `inject()` internally without triggering a warning to the end
  716. * user. One example is `useRoute()` in `vue-router`.
  717. */
  718. export declare function hasInjectionContext(): boolean;
  719. type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
  720. type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
  721. export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
  722. export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
  723. props?: (keyof Props)[];
  724. emits?: E | EE[];
  725. slots?: S;
  726. }): (props: Props & EmitsToProps<E>) => any;
  727. export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
  728. props?: ComponentObjectPropsOptions<Props>;
  729. emits?: E | EE[];
  730. slots?: S;
  731. }): (props: Props & EmitsToProps<E>) => any;
  732. export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
  733. 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 = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
  734. [key in PropNames]?: any;
  735. }>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
  736. 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 = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
  737. export interface App<HostElement = any> {
  738. version: string;
  739. config: AppConfig;
  740. use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): this;
  741. use<Options>(plugin: Plugin<Options>, options: Options): this;
  742. mixin(mixin: ComponentOptions): this;
  743. component(name: string): Component | undefined;
  744. component(name: string, component: Component | DefineComponent): this;
  745. directive(name: string): Directive | undefined;
  746. directive(name: string, directive: Directive): this;
  747. mount(rootContainer: HostElement | string, isHydrate?: boolean, isSVG?: boolean): ComponentPublicInstance;
  748. unmount(): void;
  749. provide<T>(key: InjectionKey<T> | string, value: T): this;
  750. /**
  751. * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
  752. * to variables provided via `app.provide()`.
  753. *
  754. * @param fn - function to run with the app as active instance
  755. */
  756. runWithContext<T>(fn: () => T): T;
  757. _uid: number;
  758. _component: ConcreteComponent;
  759. _props: Data | null;
  760. _container: HostElement | null;
  761. _context: AppContext;
  762. _instance: ComponentInternalInstance | null;
  763. /**
  764. * v2 compat only
  765. */
  766. filter?(name: string): Function | undefined;
  767. filter?(name: string, filter: Function): this;
  768. }
  769. export type OptionMergeFunction = (to: unknown, from: unknown) => any;
  770. export interface AppConfig {
  771. readonly isNativeTag?: (tag: string) => boolean;
  772. performance: boolean;
  773. optionMergeStrategies: Record<string, OptionMergeFunction>;
  774. globalProperties: ComponentCustomProperties & Record<string, any>;
  775. errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
  776. warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
  777. /**
  778. * Options to pass to `@vue/compiler-dom`.
  779. * Only supported in runtime compiler build.
  780. */
  781. compilerOptions: RuntimeCompilerOptions;
  782. /**
  783. * @deprecated use config.compilerOptions.isCustomElement
  784. */
  785. isCustomElement?: (tag: string) => boolean;
  786. /**
  787. * Temporary config for opt-in to unwrap injected refs.
  788. * @deprecated this no longer has effect. 3.3 always unwraps injected refs.
  789. */
  790. unwrapInjectedRef?: boolean;
  791. }
  792. export interface AppContext {
  793. app: App;
  794. config: AppConfig;
  795. mixins: ComponentOptions[];
  796. components: Record<string, Component>;
  797. directives: Record<string, Directive>;
  798. provides: Record<string | symbol, any>;
  799. }
  800. type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
  801. export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
  802. install?: PluginInstallFunction<Options>;
  803. }) | {
  804. install: PluginInstallFunction<Options>;
  805. };
  806. export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
  807. type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
  808. export interface TeleportProps {
  809. to: string | RendererElement | null | undefined;
  810. disabled?: boolean;
  811. }
  812. declare const TeleportImpl: {
  813. name: string;
  814. __isTeleport: boolean;
  815. process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
  816. remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
  817. move: typeof moveTeleport;
  818. hydrate: typeof hydrateTeleport;
  819. };
  820. declare const enum TeleportMoveTypes {
  821. TARGET_CHANGE = 0,
  822. TOGGLE = 1,
  823. REORDER = 2
  824. }
  825. declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
  826. declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector } }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
  827. export declare const Teleport: {
  828. new (): {
  829. $props: VNodeProps & TeleportProps;
  830. $slots: {
  831. default(): VNode[];
  832. };
  833. };
  834. __isTeleport: true;
  835. };
  836. /**
  837. * @private
  838. */
  839. export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
  840. declare const NULL_DYNAMIC_COMPONENT: unique symbol;
  841. /**
  842. * @private
  843. */
  844. export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
  845. /**
  846. * @private
  847. */
  848. export declare function resolveDirective(name: string): Directive | undefined;
  849. export declare const Fragment: {
  850. new (): {
  851. $props: VNodeProps;
  852. };
  853. __isFragment: true;
  854. };
  855. export declare const Text: unique symbol;
  856. export declare const Comment: unique symbol;
  857. export declare const Static: unique symbol;
  858. export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
  859. export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
  860. type VNodeNormalizedRefAtom = {
  861. i: ComponentInternalInstance;
  862. r: VNodeRef;
  863. k?: string;
  864. f?: boolean;
  865. };
  866. type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
  867. type VNodeMountHook = (vnode: VNode) => void;
  868. type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
  869. export type VNodeProps = {
  870. key?: string | number | symbol;
  871. ref?: VNodeRef;
  872. ref_for?: boolean;
  873. ref_key?: string;
  874. onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
  875. onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
  876. onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
  877. onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
  878. onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
  879. onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
  880. };
  881. type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
  882. export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
  883. export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
  884. export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
  885. export interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
  886. [key: string]: any;
  887. }> {
  888. type: VNodeTypes;
  889. props: (VNodeProps & ExtraProps) | null;
  890. key: string | number | symbol | null;
  891. ref: VNodeNormalizedRef | null;
  892. /**
  893. * SFC only. This is assigned on vnode creation using currentScopeId
  894. * which is set alongside currentRenderingInstance.
  895. */
  896. scopeId: string | null;
  897. children: VNodeNormalizedChildren;
  898. component: ComponentInternalInstance | null;
  899. dirs: DirectiveBinding[] | null;
  900. transition: TransitionHooks<HostElement> | null;
  901. el: HostNode | null;
  902. anchor: HostNode | null;
  903. target: HostElement | null;
  904. targetAnchor: HostNode | null;
  905. suspense: SuspenseBoundary | null;
  906. shapeFlag: number;
  907. patchFlag: number;
  908. appContext: AppContext | null;
  909. }
  910. /**
  911. * Open a block.
  912. * This must be called before `createBlock`. It cannot be part of `createBlock`
  913. * because the children of the block are evaluated before `createBlock` itself
  914. * is called. The generated code typically looks like this:
  915. *
  916. * ```js
  917. * function render() {
  918. * return (openBlock(),createBlock('div', null, [...]))
  919. * }
  920. * ```
  921. * disableTracking is true when creating a v-for fragment block, since a v-for
  922. * fragment always diffs its children.
  923. *
  924. * @private
  925. */
  926. export declare function openBlock(disableTracking?: boolean): void;
  927. /**
  928. * Block tracking sometimes needs to be disabled, for example during the
  929. * creation of a tree that needs to be cached by v-once. The compiler generates
  930. * code like this:
  931. *
  932. * ``` js
  933. * _cache[1] || (
  934. * setBlockTracking(-1),
  935. * _cache[1] = createVNode(...),
  936. * setBlockTracking(1),
  937. * _cache[1]
  938. * )
  939. * ```
  940. *
  941. * @private
  942. */
  943. export declare function setBlockTracking(value: number): void;
  944. /**
  945. * @private
  946. */
  947. export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode<RendererNode, RendererElement, {
  948. [key: string]: any;
  949. }>;
  950. /**
  951. * Create a block root vnode. Takes the same exact arguments as `createVNode`.
  952. * A block root keeps track of dynamic nodes within the block in the
  953. * `dynamicChildren` array.
  954. *
  955. * @private
  956. */
  957. export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
  958. export declare function isVNode(value: any): value is VNode;
  959. declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined;
  960. /**
  961. * Internal API for registering an arguments transform for createVNode
  962. * used for creating stubs in the test-utils
  963. * It is *internal* but needs to be exposed for test-utils to pick up proper
  964. * typings
  965. */
  966. export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
  967. export declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number, isBlockNode?: boolean, needFullChildrenNormalization?: boolean): VNode<RendererNode, RendererElement, {
  968. [key: string]: any;
  969. }>;
  970. export declare const createVNode: typeof _createVNode;
  971. declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
  972. export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
  973. export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
  974. /**
  975. * @private
  976. */
  977. export declare function createTextVNode(text?: string, flag?: number): VNode;
  978. /**
  979. * @private
  980. */
  981. export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
  982. /**
  983. * @private
  984. */
  985. export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
  986. export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
  987. type Data = Record<string, unknown>;
  988. /**
  989. * For extending allowed non-declared props on components in TSX
  990. */
  991. export interface ComponentCustomProps {
  992. }
  993. /**
  994. * Default allowed non-declared props on component in TSX
  995. */
  996. export interface AllowedComponentProps {
  997. class?: unknown;
  998. style?: unknown;
  999. }
  1000. interface ComponentInternalOptions {
  1001. /**
  1002. * Compat build only, for bailing out of certain compatibility behavior
  1003. */
  1004. __isBuiltIn?: boolean;
  1005. /**
  1006. * This one should be exposed so that devtools can make use of it
  1007. */
  1008. __file?: string;
  1009. /**
  1010. * name inferred from filename
  1011. */
  1012. __name?: string;
  1013. }
  1014. export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}, S extends Record<string, any> = any> extends ComponentInternalOptions {
  1015. (props: P & EmitsToProps<E>, ctx: Omit<SetupContext<E, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
  1016. props?: ComponentPropsOptions<P>;
  1017. emits?: E | (keyof E)[];
  1018. slots?: IfAny<S, Slots, SlotsType<S>>;
  1019. inheritAttrs?: boolean;
  1020. displayName?: string;
  1021. compatConfig?: CompatConfig;
  1022. }
  1023. interface ClassComponent {
  1024. new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
  1025. __vccOpts: ComponentOptions;
  1026. }
  1027. /**
  1028. * Concrete component type matches its actual value: it's either an options
  1029. * object, or a function. Use this where the code expects to work with actual
  1030. * values, e.g. checking if its a function or not. This is mostly for internal
  1031. * implementation code.
  1032. */
  1033. export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, any>;
  1034. /**
  1035. * A type used in public APIs where a component type is expected.
  1036. * The constructor type is an artificial type returned by defineComponent().
  1037. */
  1038. export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ConcreteComponent<Props, RawBindings, D, C, M> | ComponentPublicInstanceConstructor<Props>;
  1039. export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
  1040. attrs: Data;
  1041. slots: UnwrapSlotsType<S>;
  1042. emit: EmitFn<E>;
  1043. expose: (exposed?: Record<string, any>) => void;
  1044. } : never;
  1045. /**
  1046. * We expose a subset of properties on the internal instance as they are
  1047. * useful for advanced external libraries and tools.
  1048. */
  1049. export interface ComponentInternalInstance {
  1050. uid: number;
  1051. type: ConcreteComponent;
  1052. parent: ComponentInternalInstance | null;
  1053. root: ComponentInternalInstance;
  1054. appContext: AppContext;
  1055. /**
  1056. * Vnode representing this component in its parent's vdom tree
  1057. */
  1058. vnode: VNode;
  1059. /**
  1060. * Root vnode of this component's own vdom tree
  1061. */
  1062. subTree: VNode;
  1063. /**
  1064. * Render effect instance
  1065. */
  1066. effect: ReactiveEffect;
  1067. /**
  1068. * Bound effect runner to be passed to schedulers
  1069. */
  1070. update: SchedulerJob;
  1071. proxy: ComponentPublicInstance | null;
  1072. exposed: Record<string, any> | null;
  1073. exposeProxy: Record<string, any> | null;
  1074. data: Data;
  1075. props: Data;
  1076. attrs: Data;
  1077. slots: InternalSlots;
  1078. refs: Data;
  1079. emit: EmitFn;
  1080. attrsProxy: Data | null;
  1081. slotsProxy: Slots | null;
  1082. isMounted: boolean;
  1083. isUnmounted: boolean;
  1084. isDeactivated: boolean;
  1085. }
  1086. export declare const getCurrentInstance: () => ComponentInternalInstance | null;
  1087. /**
  1088. * For runtime-dom to register the compiler.
  1089. * Note the exported method uses any to avoid d.ts relying on the compiler types.
  1090. */
  1091. export declare function registerRuntimeCompiler(_compile: any): void;
  1092. export declare const isRuntimeOnly: () => boolean;
  1093. export type WatchEffect = (onCleanup: OnCleanup) => void;
  1094. export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
  1095. export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
  1096. type MapSources<T, Immediate> = {
  1097. [K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : T[K] extends object ? Immediate extends true ? T[K] | undefined : T[K] : never;
  1098. };
  1099. type OnCleanup = (cleanupFn: () => void) => void;
  1100. export interface WatchOptionsBase extends DebuggerOptions {
  1101. flush?: 'pre' | 'post' | 'sync';
  1102. }
  1103. export interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
  1104. immediate?: Immediate;
  1105. deep?: boolean;
  1106. }
  1107. export type WatchStopHandle = () => void;
  1108. export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
  1109. export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
  1110. export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
  1111. type MultiWatchSources = (WatchSource<unknown> | object)[];
  1112. 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;
  1113. 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;
  1114. 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;
  1115. 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;
  1116. type AsyncComponentResolveResult<T = Component> = T | {
  1117. default: T;
  1118. };
  1119. export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
  1120. export interface AsyncComponentOptions<T = any> {
  1121. loader: AsyncComponentLoader<T>;
  1122. loadingComponent?: Component;
  1123. errorComponent?: Component;
  1124. delay?: number;
  1125. timeout?: number;
  1126. suspensible?: boolean;
  1127. onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
  1128. }
  1129. /*! #__NO_SIDE_EFFECTS__ */
  1130. export declare function defineAsyncComponent<T extends Component = {
  1131. new (): ComponentPublicInstance;
  1132. }>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
  1133. /**
  1134. * Vue `<script setup>` compiler macro for declaring component props. The
  1135. * expected argument is the same as the component `props` option.
  1136. *
  1137. * Example runtime declaration:
  1138. * ```js
  1139. * // using Array syntax
  1140. * const props = defineProps(['foo', 'bar'])
  1141. * // using Object syntax
  1142. * const props = defineProps({
  1143. * foo: String,
  1144. * bar: {
  1145. * type: Number,
  1146. * required: true
  1147. * }
  1148. * })
  1149. * ```
  1150. *
  1151. * Equivalent type-based declaration:
  1152. * ```ts
  1153. * // will be compiled into equivalent runtime declarations
  1154. * const props = defineProps<{
  1155. * foo?: string
  1156. * bar: number
  1157. * }>()
  1158. * ```
  1159. *
  1160. * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
  1161. *
  1162. * This is only usable inside `<script setup>`, is compiled away in the
  1163. * output and should **not** be actually called at runtime.
  1164. */
  1165. export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
  1166. [key in PropNames]?: any;
  1167. }>>;
  1168. export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
  1169. export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
  1170. type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
  1171. readonly [K in BKeys]-?: boolean;
  1172. };
  1173. type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
  1174. /**
  1175. * Vue `<script setup>` compiler macro for declaring a component's emitted
  1176. * events. The expected argument is the same as the component `emits` option.
  1177. *
  1178. * Example runtime declaration:
  1179. * ```js
  1180. * const emit = defineEmits(['change', 'update'])
  1181. * ```
  1182. *
  1183. * Example type-based declaration:
  1184. * ```ts
  1185. * const emit = defineEmits<{
  1186. * // <eventName>: <expected arguments>
  1187. * change: []
  1188. * update: [value: string] // named tuple syntax
  1189. * }>()
  1190. *
  1191. * emit('change')
  1192. * emit('update', 1)
  1193. * ```
  1194. *
  1195. * This is only usable inside `<script setup>`, is compiled away in the
  1196. * output and should **not** be actually called at runtime.
  1197. *
  1198. * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
  1199. */
  1200. export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
  1201. export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
  1202. export declare function defineEmits<T extends ((...args: any[]) => any) | Record<string, any[]>>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
  1203. type RecordToUnion<T extends Record<string, any>> = T[keyof T];
  1204. type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
  1205. [K in keyof T]: (evt: K, ...args: T[K]) => void;
  1206. }>>;
  1207. /**
  1208. * Vue `<script setup>` compiler macro for declaring a component's exposed
  1209. * instance properties when it is accessed by a parent component via template
  1210. * refs.
  1211. *
  1212. * `<script setup>` components are closed by default - i.e. variables inside
  1213. * the `<script setup>` scope is not exposed to parent unless explicitly exposed
  1214. * via `defineExpose`.
  1215. *
  1216. * This is only usable inside `<script setup>`, is compiled away in the
  1217. * output and should **not** be actually called at runtime.
  1218. *
  1219. * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
  1220. */
  1221. export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
  1222. /**
  1223. * Vue `<script setup>` compiler macro for declaring a component's additional
  1224. * options. This should be used only for options that cannot be expressed via
  1225. * Composition API - e.g. `inheritAttrs`.
  1226. *
  1227. * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
  1228. */
  1229. export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends> & {
  1230. emits?: undefined;
  1231. expose?: undefined;
  1232. slots?: undefined;
  1233. }): void;
  1234. export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
  1235. /**
  1236. * (**Experimental**) Vue `<script setup>` compiler macro for declaring a
  1237. * two-way binding prop that can be consumed via `v-model` from the parent
  1238. * component. This will declare a prop with the same name and a corresponding
  1239. * `update:propName` event.
  1240. *
  1241. * If the first argument is a string, it will be used as the prop name;
  1242. * Otherwise the prop name will default to "modelValue". In both cases, you
  1243. * can also pass an additional object which will be used as the prop's options.
  1244. *
  1245. * The options object can also specify an additional option, `local`. When set
  1246. * to `true`, the ref can be locally mutated even if the parent did not pass
  1247. * the matching `v-model`.
  1248. *
  1249. * @example
  1250. * ```ts
  1251. * // default model (consumed via `v-model`)
  1252. * const modelValue = defineModel<string>()
  1253. * modelValue.value = "hello"
  1254. *
  1255. * // default model with options
  1256. * const modelValue = defineModel<string>({ required: true })
  1257. *
  1258. * // with specified name (consumed via `v-model:count`)
  1259. * const count = defineModel<number>('count')
  1260. * count.value++
  1261. *
  1262. * // with specified name and default value
  1263. * const count = defineModel<number>('count', { default: 0 })
  1264. *
  1265. * // local mutable model, can be mutated locally
  1266. * // even if the parent did not pass the matching `v-model`.
  1267. * const count = defineModel<number>('count', { local: true, default: 0 })
  1268. * ```
  1269. */
  1270. export declare function defineModel<T>(options: {
  1271. required: true;
  1272. } & PropOptions<T> & DefineModelOptions): Ref<T>;
  1273. export declare function defineModel<T>(options: {
  1274. default: any;
  1275. } & PropOptions<T> & DefineModelOptions): Ref<T>;
  1276. export declare function defineModel<T>(options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
  1277. export declare function defineModel<T>(name: string, options: {
  1278. required: true;
  1279. } & PropOptions<T> & DefineModelOptions): Ref<T>;
  1280. export declare function defineModel<T>(name: string, options: {
  1281. default: any;
  1282. } & PropOptions<T> & DefineModelOptions): Ref<T>;
  1283. export declare function defineModel<T>(name: string, options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
  1284. interface DefineModelOptions {
  1285. local?: boolean;
  1286. }
  1287. type NotUndefined<T> = T extends undefined ? never : T;
  1288. type InferDefaults<T> = {
  1289. [K in keyof T]?: InferDefault<T, T[K]>;
  1290. };
  1291. type NativeType = null | number | string | boolean | symbol | Function;
  1292. type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
  1293. type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<Omit<T, keyof Defaults>> & {
  1294. readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
  1295. } & {
  1296. readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
  1297. };
  1298. /**
  1299. * Vue `<script setup>` compiler macro for providing props default values when
  1300. * using type-based `defineProps` declaration.
  1301. *
  1302. * Example usage:
  1303. * ```ts
  1304. * withDefaults(defineProps<{
  1305. * size?: number
  1306. * labels?: string[]
  1307. * }>(), {
  1308. * size: 3,
  1309. * labels: () => ['default label']
  1310. * })
  1311. * ```
  1312. *
  1313. * This is only usable inside `<script setup>`, is compiled away in the output
  1314. * and should **not** be actually called at runtime.
  1315. *
  1316. * @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
  1317. */
  1318. export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
  1319. export declare function useSlots(): SetupContext['slots'];
  1320. export declare function useAttrs(): SetupContext['attrs'];
  1321. export declare function useModel<T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: {
  1322. local?: boolean;
  1323. }): Ref<T[K]>;
  1324. type RawProps = VNodeProps & {
  1325. __v_isVNode?: never;
  1326. [Symbol.iterator]?: never;
  1327. } & Record<string, any>;
  1328. type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
  1329. interface Constructor<P = any> {
  1330. __isFragment?: never;
  1331. __isTeleport?: never;
  1332. __isSuspense?: never;
  1333. new (...args: any[]): {
  1334. $props: P;
  1335. };
  1336. }
  1337. export declare function h(type: string, children?: RawChildren): VNode;
  1338. export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
  1339. export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
  1340. export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;
  1341. export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
  1342. export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
  1343. export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
  1344. export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
  1345. export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
  1346. export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = {}>(type: FunctionalComponent<P, E, S>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  1347. export declare function h(type: Component, children?: RawChildren): VNode;
  1348. export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
  1349. export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
  1350. export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
  1351. export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  1352. export declare function h(type: Constructor, children?: RawChildren): VNode;
  1353. export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  1354. export declare function h(type: DefineComponent, children?: RawChildren): VNode;
  1355. export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  1356. export declare function h(type: string | Component, children?: RawChildren): VNode;
  1357. export declare function h<P>(type: string | Component<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  1358. export declare const ssrContextKey: unique symbol;
  1359. export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
  1360. export declare function warn(msg: string, ...args: any[]): void;
  1361. export declare const enum ErrorCodes {
  1362. SETUP_FUNCTION = 0,
  1363. RENDER_FUNCTION = 1,
  1364. WATCH_GETTER = 2,
  1365. WATCH_CALLBACK = 3,
  1366. WATCH_CLEANUP = 4,
  1367. NATIVE_EVENT_HANDLER = 5,
  1368. COMPONENT_EVENT_HANDLER = 6,
  1369. VNODE_HOOK = 7,
  1370. DIRECTIVE_HOOK = 8,
  1371. TRANSITION_HOOK = 9,
  1372. APP_ERROR_HANDLER = 10,
  1373. APP_WARN_HANDLER = 11,
  1374. FUNCTION_REF = 12,
  1375. ASYNC_COMPONENT_LOADER = 13,
  1376. SCHEDULER = 14
  1377. }
  1378. type ErrorTypes = LifecycleHooks | ErrorCodes;
  1379. export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
  1380. export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
  1381. export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
  1382. export declare function initCustomFormatter(): void;
  1383. interface AppRecord {
  1384. id: number;
  1385. app: App;
  1386. version: string;
  1387. types: Record<string, string | Symbol>;
  1388. }
  1389. interface DevtoolsHook {
  1390. enabled?: boolean;
  1391. emit: (event: string, ...payload: any[]) => void;
  1392. on: (event: string, handler: Function) => void;
  1393. once: (event: string, handler: Function) => void;
  1394. off: (event: string, handler: Function) => void;
  1395. appRecords: AppRecord[];
  1396. /**
  1397. * Added at https://github.com/vuejs/devtools/commit/f2ad51eea789006ab66942e5a27c0f0986a257f9
  1398. * Returns whether the arg was buffered or not
  1399. */
  1400. cleanupBuffer?: (matchArg: unknown) => boolean;
  1401. }
  1402. export declare let devtools: DevtoolsHook;
  1403. export declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
  1404. type HMRComponent = ComponentOptions | ClassComponent;
  1405. export interface HMRRuntime {
  1406. createRecord: typeof createRecord;
  1407. rerender: typeof rerender;
  1408. reload: typeof reload;
  1409. }
  1410. declare function createRecord(id: string, initialDef: HMRComponent): boolean;
  1411. declare function rerender(id: string, newRender?: Function): void;
  1412. declare function reload(id: string, newComp: HMRComponent): void;
  1413. /**
  1414. * Set scope id when creating hoisted vnodes.
  1415. * @private compiler helper
  1416. */
  1417. export declare function pushScopeId(id: string | null): void;
  1418. /**
  1419. * Technically we no longer need this after 3.0.8 but we need to keep the same
  1420. * API for backwards compat w/ code generated by compilers.
  1421. * @private
  1422. */
  1423. export declare function popScopeId(): void;
  1424. /**
  1425. * Only for backwards compat
  1426. * @private
  1427. */
  1428. export declare const withScopeId: (_id: string) => typeof withCtx;
  1429. /**
  1430. * Wrap a slot function to memoize current rendering instance
  1431. * @private compiler helper
  1432. */
  1433. export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
  1434. /**
  1435. * v-for string
  1436. * @private
  1437. */
  1438. export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
  1439. /**
  1440. * v-for number
  1441. */
  1442. export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
  1443. /**
  1444. * v-for array
  1445. */
  1446. export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
  1447. /**
  1448. * v-for iterable
  1449. */
  1450. export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
  1451. /**
  1452. * v-for object
  1453. */
  1454. export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
  1455. /**
  1456. * For prefixing keys in v-on="obj" with "on"
  1457. * @private
  1458. */
  1459. export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
  1460. /**
  1461. * Compiler runtime helper for rendering `<slot/>`
  1462. * @private
  1463. */
  1464. export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
  1465. type SSRSlot = (...args: any[]) => VNode[] | undefined;
  1466. interface CompiledSlotDescriptor {
  1467. name: string;
  1468. fn: SSRSlot;
  1469. key?: string;
  1470. }
  1471. /**
  1472. * Compiler runtime helper for creating dynamic slots object
  1473. * @private
  1474. */
  1475. export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
  1476. export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
  1477. [key: string]: any;
  1478. }>;
  1479. export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
  1480. export type LegacyConfig = {
  1481. /**
  1482. * @deprecated `config.silent` option has been removed
  1483. */
  1484. silent?: boolean;
  1485. /**
  1486. * @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead
  1487. * https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags
  1488. */
  1489. devtools?: boolean;
  1490. /**
  1491. * @deprecated use `config.isCustomElement` instead
  1492. * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
  1493. */
  1494. ignoredElements?: (string | RegExp)[];
  1495. /**
  1496. * @deprecated
  1497. * https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
  1498. */
  1499. keyCodes?: Record<string, number | number[]>;
  1500. /**
  1501. * @deprecated
  1502. * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
  1503. */
  1504. productionTip?: boolean;
  1505. };
  1506. type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
  1507. interface LegacyPublicProperties {
  1508. $set(target: object, key: string, value: any): void;
  1509. $delete(target: object, key: string): void;
  1510. $mount(el?: string | Element): this;
  1511. $destroy(): void;
  1512. $scopedSlots: Slots;
  1513. $on(event: string | string[], fn: Function): this;
  1514. $once(event: string, fn: Function): this;
  1515. $off(event?: string | string[], fn?: Function): this;
  1516. $children: LegacyPublicProperties[];
  1517. $listeners: Record<string, Function | Function[]>;
  1518. }
  1519. /**
  1520. * @deprecated the default `Vue` export has been removed in Vue 3. The type for
  1521. * the default export is provided only for migration purposes. Please use
  1522. * named imports instead - e.g. `import { createApp } from 'vue'`.
  1523. */
  1524. export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
  1525. configureCompat: typeof configureCompat;
  1526. new (options?: ComponentOptions): LegacyPublicInstance;
  1527. version: string;
  1528. config: AppConfig & LegacyConfig;
  1529. nextTick: typeof nextTick;
  1530. use(plugin: Plugin, ...options: any[]): CompatVue;
  1531. mixin(mixin: ComponentOptions): CompatVue;
  1532. component(name: string): Component | undefined;
  1533. component(name: string, component: Component): CompatVue;
  1534. directive(name: string): Directive | undefined;
  1535. directive(name: string, directive: Directive): CompatVue;
  1536. compile(template: string): RenderFunction;
  1537. /**
  1538. * @deprecated Vue 3 no longer supports extending constructors.
  1539. */
  1540. extend: (options?: ComponentOptions) => CompatVue;
  1541. /**
  1542. * @deprecated Vue 3 no longer needs set() for adding new properties.
  1543. */
  1544. set(target: any, key: string | number | symbol, value: any): void;
  1545. /**
  1546. * @deprecated Vue 3 no longer needs delete() for property deletions.
  1547. */
  1548. delete(target: any, key: string | number | symbol): void;
  1549. /**
  1550. * @deprecated use `reactive` instead.
  1551. */
  1552. observable: typeof reactive;
  1553. /**
  1554. * @deprecated filters have been removed from Vue 3.
  1555. */
  1556. filter(name: string, arg?: any): null;
  1557. };
  1558. export declare const version: string;
  1559. declare module '@vue/reactivity' {
  1560. interface RefUnwrapBailTypes {
  1561. runtimeCoreBailTypes: VNode | {
  1562. $: ComponentInternalInstance;
  1563. };
  1564. }
  1565. }
  1566. export { createBaseVNode as createElementVNode, };
  1567. // Note: this file is auto concatenated to the end of the bundled d.ts during
  1568. // build.
  1569. type _defineProps = typeof defineProps
  1570. type _defineEmits = typeof defineEmits
  1571. type _defineExpose = typeof defineExpose
  1572. type _defineOptions = typeof defineOptions
  1573. type _defineSlots = typeof defineSlots
  1574. type _defineModel = typeof defineModel
  1575. type _withDefaults = typeof withDefaults
  1576. declare global {
  1577. const defineProps: _defineProps
  1578. const defineEmits: _defineEmits
  1579. const defineExpose: _defineExpose
  1580. const defineOptions: _defineOptions
  1581. const defineSlots: _defineSlots
  1582. const defineModel: _defineModel
  1583. const withDefaults: _withDefaults
  1584. }