runtime-core.d.ts 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410
  1. import { camelize } from '@vue/shared';
  2. import { capitalize } from '@vue/shared';
  3. import { ComputedGetter } from '@vue/reactivity';
  4. import { ComputedRef } from '@vue/reactivity';
  5. import { customRef } from '@vue/reactivity';
  6. import { DebuggerEvent } from '@vue/reactivity';
  7. import { DeepReadonly } from '@vue/reactivity';
  8. import { isProxy } from '@vue/reactivity';
  9. import { isReactive } from '@vue/reactivity';
  10. import { isReadonly } from '@vue/reactivity';
  11. import { isRef } from '@vue/reactivity';
  12. import { markRaw } from '@vue/reactivity';
  13. import { proxyRefs } from '@vue/reactivity';
  14. import { reactive } from '@vue/reactivity';
  15. import { ReactiveEffect } from '@vue/reactivity';
  16. import { ReactiveEffectOptions } from '@vue/reactivity';
  17. import { ReactiveFlags } from '@vue/reactivity';
  18. import { readonly } from '@vue/reactivity';
  19. import { Ref } from '@vue/reactivity';
  20. import { ref } from '@vue/reactivity';
  21. import { shallowReactive } from '@vue/reactivity';
  22. import { shallowReadonly } from '@vue/reactivity';
  23. import { shallowRef } from '@vue/reactivity';
  24. import { ShallowUnwrapRef } from '@vue/reactivity';
  25. import { SlotFlags } from '@vue/shared';
  26. import { toDisplayString } from '@vue/shared';
  27. import { toHandlerKey } from '@vue/shared';
  28. import { toRaw } from '@vue/reactivity';
  29. import { toRef } from '@vue/reactivity';
  30. import { ToRefs } from '@vue/reactivity';
  31. import { toRefs } from '@vue/reactivity';
  32. import { TrackOpTypes } from '@vue/reactivity';
  33. import { TriggerOpTypes } from '@vue/reactivity';
  34. import { triggerRef } from '@vue/reactivity';
  35. import { unref } from '@vue/reactivity';
  36. import { UnwrapRef } from '@vue/reactivity';
  37. import { WritableComputedOptions } from '@vue/reactivity';
  38. import { WritableComputedRef } from '@vue/reactivity';
  39. /**
  40. * Default allowed non-declared props on component in TSX
  41. */
  42. export declare interface AllowedComponentProps {
  43. class?: unknown;
  44. style?: unknown;
  45. }
  46. export declare interface App<HostElement = any> {
  47. version: string;
  48. config: AppConfig;
  49. use(plugin: Plugin_2, ...options: any[]): this;
  50. mixin(mixin: ComponentOptions): this;
  51. component(name: string): Component | undefined;
  52. component(name: string, component: Component): this;
  53. directive(name: string): Directive | undefined;
  54. directive(name: string, directive: Directive): this;
  55. mount(rootContainer: HostElement | string, isHydrate?: boolean): ComponentPublicInstance;
  56. unmount(): void;
  57. provide<T>(key: InjectionKey<T> | string, value: T): this;
  58. _uid: number;
  59. _component: ConcreteComponent;
  60. _props: Data | null;
  61. _container: HostElement | null;
  62. _context: AppContext;
  63. }
  64. export declare interface AppConfig {
  65. readonly isNativeTag?: (tag: string) => boolean;
  66. performance: boolean;
  67. optionMergeStrategies: Record<string, OptionMergeFunction>;
  68. globalProperties: Record<string, any>;
  69. isCustomElement: (tag: string) => boolean;
  70. errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
  71. warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
  72. }
  73. export declare interface AppContext {
  74. app: App;
  75. config: AppConfig;
  76. mixins: ComponentOptions[];
  77. components: Record<string, Component>;
  78. directives: Record<string, Directive>;
  79. provides: Record<string | symbol, any>;
  80. /* Excluded from this release type: deopt */
  81. /* Excluded from this release type: reload */
  82. }
  83. declare interface AppRecord {
  84. id: number;
  85. app: App;
  86. version: string;
  87. types: Record<string, string | Symbol>;
  88. }
  89. export declare type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
  90. export declare interface AsyncComponentOptions<T = any> {
  91. loader: AsyncComponentLoader<T>;
  92. loadingComponent?: Component;
  93. errorComponent?: Component;
  94. delay?: number;
  95. timeout?: number;
  96. suspensible?: boolean;
  97. onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
  98. }
  99. declare type AsyncComponentResolveResult<T = Component> = T | {
  100. default: T;
  101. };
  102. export declare const BaseTransition: new () => {
  103. $props: BaseTransitionProps<any>;
  104. };
  105. export declare interface BaseTransitionProps<HostElement = RendererElement> {
  106. mode?: 'in-out' | 'out-in' | 'default';
  107. appear?: boolean;
  108. persisted?: boolean;
  109. onBeforeEnter?: (el: HostElement) => void;
  110. onEnter?: (el: HostElement, done: () => void) => void;
  111. onAfterEnter?: (el: HostElement) => void;
  112. onEnterCancelled?: (el: HostElement) => void;
  113. onBeforeLeave?: (el: HostElement) => void;
  114. onLeave?: (el: HostElement, done: () => void) => void;
  115. onAfterLeave?: (el: HostElement) => void;
  116. onLeaveCancelled?: (el: HostElement) => void;
  117. onBeforeAppear?: (el: HostElement) => void;
  118. onAppear?: (el: HostElement, done: () => void) => void;
  119. onAfterAppear?: (el: HostElement) => void;
  120. onAppearCancelled?: (el: HostElement) => void;
  121. }
  122. declare const enum BooleanFlags {
  123. shouldCast = 0,
  124. shouldCastTrue = 1
  125. }
  126. export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
  127. export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
  128. export { camelize }
  129. export { capitalize }
  130. declare interface ClassComponent {
  131. new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
  132. __vccOpts: ComponentOptions;
  133. }
  134. export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: Data & VNodeProps | null, mergeRef?: boolean): VNode<T, U>;
  135. declare const Comment_2: unique symbol;
  136. export { Comment_2 as Comment }
  137. declare interface CompiledSlotDescriptor {
  138. name: string;
  139. fn: Slot;
  140. }
  141. /**
  142. * A type used in public APIs where a component type is expected.
  143. * The constructor type is an artificial type returned by defineComponent().
  144. */
  145. export declare type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ConcreteComponent<Props, RawBindings, D, C, M> | ComponentPublicInstanceConstructor<Props>;
  146. /**
  147. * Interface for declaring custom options.
  148. *
  149. * @example
  150. * ```ts
  151. * declare module '@vue/runtime-core' {
  152. * interface ComponentCustomOptions {
  153. * beforeRouteUpdate?(
  154. * to: Route,
  155. * from: Route,
  156. * next: () => void
  157. * ): void
  158. * }
  159. * }
  160. * ```
  161. */
  162. export declare interface ComponentCustomOptions {
  163. }
  164. /**
  165. * Custom properties added to component instances in any way and can be accessed through `this`
  166. *
  167. * @example
  168. * Here is an example of adding a property `$router` to every component instance:
  169. * ```ts
  170. * import { createApp } from 'vue'
  171. * import { Router, createRouter } from 'vue-router'
  172. *
  173. * declare module '@vue/runtime-core' {
  174. * interface ComponentCustomProperties {
  175. * $router: Router
  176. * }
  177. * }
  178. *
  179. * // effectively adding the router to every component instance
  180. * const app = createApp({})
  181. * const router = createRouter()
  182. * app.config.globalProperties.$router = router
  183. *
  184. * const vm = app.mount('#app')
  185. * // we can access the router from the instance
  186. * vm.$router.push('/')
  187. * ```
  188. */
  189. export declare interface ComponentCustomProperties {
  190. }
  191. /**
  192. * For extending allowed non-declared props on components in TSX
  193. */
  194. export declare interface ComponentCustomProps {
  195. }
  196. declare type ComponentInjectOptions = string[] | Record<string | symbol, string | symbol | {
  197. from?: string | symbol;
  198. default?: unknown;
  199. }>;
  200. /**
  201. * We expose a subset of properties on the internal instance as they are
  202. * useful for advanced external libraries and tools.
  203. */
  204. export declare interface ComponentInternalInstance {
  205. uid: number;
  206. type: ConcreteComponent;
  207. parent: ComponentInternalInstance | null;
  208. root: ComponentInternalInstance;
  209. appContext: AppContext;
  210. /**
  211. * Vnode representing this component in its parent's vdom tree
  212. */
  213. vnode: VNode;
  214. /* Excluded from this release type: next */
  215. /**
  216. * Root vnode of this component's own vdom tree
  217. */
  218. subTree: VNode;
  219. /**
  220. * The reactive effect for rendering and patching the component. Callable.
  221. */
  222. update: ReactiveEffect;
  223. /* Excluded from this release type: render */
  224. /* Excluded from this release type: ssrRender */
  225. /* Excluded from this release type: provides */
  226. /* Excluded from this release type: effects */
  227. /* Excluded from this release type: accessCache */
  228. /* Excluded from this release type: renderCache */
  229. /* Excluded from this release type: components */
  230. /* Excluded from this release type: directives */
  231. /* Excluded from this release type: propsOptions */
  232. /* Excluded from this release type: emitsOptions */
  233. proxy: ComponentPublicInstance | null;
  234. exposed: Record<string, any> | null;
  235. /* Excluded from this release type: withProxy */
  236. /* Excluded from this release type: ctx */
  237. data: Data;
  238. props: Data;
  239. attrs: Data;
  240. slots: InternalSlots;
  241. refs: Data;
  242. emit: EmitFn;
  243. /* Excluded from this release type: emitted */
  244. /* Excluded from this release type: setupState */
  245. /* Excluded from this release type: devtoolsRawSetupState */
  246. /* Excluded from this release type: setupContext */
  247. /* Excluded from this release type: suspense */
  248. /* Excluded from this release type: suspenseId */
  249. /* Excluded from this release type: asyncDep */
  250. /* Excluded from this release type: asyncResolved */
  251. isMounted: boolean;
  252. isUnmounted: boolean;
  253. isDeactivated: boolean;
  254. /* Excluded from this release type: bc */
  255. /* Excluded from this release type: c */
  256. /* Excluded from this release type: bm */
  257. /* Excluded from this release type: m */
  258. /* Excluded from this release type: bu */
  259. /* Excluded from this release type: u */
  260. /* Excluded from this release type: bum */
  261. /* Excluded from this release type: um */
  262. /* Excluded from this release type: rtc */
  263. /* Excluded from this release type: rtg */
  264. /* Excluded from this release type: a */
  265. /* Excluded from this release type: da */
  266. /* Excluded from this release type: ec */
  267. }
  268. declare interface ComponentInternalOptions {
  269. /* Excluded from this release type: __props */
  270. /* Excluded from this release type: __emits */
  271. /* Excluded from this release type: __scopeId */
  272. /* Excluded from this release type: __cssModules */
  273. /* Excluded from this release type: __hmrId */
  274. /**
  275. * This one should be exposed so that devtools can make use of it
  276. */
  277. __file?: string;
  278. }
  279. export declare type ComponentObjectPropsOptions<P = Data> = {
  280. [K in keyof P]: Prop<P[K]> | null;
  281. };
  282. export declare 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> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
  283. export declare 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 = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends>, ComponentInternalOptions, ComponentCustomOptions {
  284. setup?: (this: void, props: Props & UnionToIntersection<ExtractOptionProp<Mixin>> & UnionToIntersection<ExtractOptionProp<Extends>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
  285. name?: string;
  286. template?: string | object;
  287. render?: Function;
  288. components?: Record<string, Component>;
  289. directives?: Record<string, Directive>;
  290. inheritAttrs?: boolean;
  291. emits?: (E | EE[]) & ThisType<void>;
  292. expose?: string[];
  293. serverPrefetch?(): Promise<any>;
  294. /* Excluded from this release type: ssrRender */
  295. /* Excluded from this release type: __ssrInlineRender */
  296. /* Excluded from this release type: __asyncLoader */
  297. /* Excluded from this release type: __merged */
  298. call?: (this: unknown, ...args: unknown[]) => never;
  299. __isFragment?: never;
  300. __isTeleport?: never;
  301. __isSuspense?: never;
  302. __defaults?: Defaults;
  303. }
  304. export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>;
  305. export declare 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, Props = Readonly<{
  306. [key in PropNames]?: any;
  307. }>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
  308. props: PropNames[];
  309. } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>;
  310. export declare 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, Props = Readonly<ExtractPropTypes<PropsOptions>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & {
  311. props: PropsOptions & ThisType<void>;
  312. } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false>>;
  313. export declare 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> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
  314. props?: undefined;
  315. } & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E>>;
  316. export declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
  317. export declare type ComponentPublicInstance<P = {}, // props type extracted from props option
  318. B = {}, // raw bindings returned from setup()
  319. D = {}, // return from data()
  320. 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>> = {
  321. $: ComponentInternalInstance;
  322. $data: D;
  323. $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps;
  324. $attrs: Data;
  325. $refs: Data;
  326. $slots: Slots;
  327. $root: ComponentPublicInstance | null;
  328. $parent: ComponentPublicInstance | null;
  329. $emit: EmitFn<E>;
  330. $el: any;
  331. $options: Options;
  332. $forceUpdate: ReactiveEffect;
  333. $nextTick: typeof nextTick;
  334. $watch(source: string | Function, cb: Function, options?: WatchOptions): WatchStopHandle;
  335. } & P & ShallowUnwrapRef<B> & D & ExtractComputedReturns<C> & M & ComponentCustomProperties;
  336. declare 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> = {
  337. __isFragment?: never;
  338. __isTeleport?: never;
  339. __isSuspense?: never;
  340. new (...args: any[]): T;
  341. };
  342. declare type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
  343. declare type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
  344. export declare function computed<T>(getter: ComputedGetter<T>): ComputedRef<T>;
  345. export declare function computed<T>(options: WritableComputedOptions<T>): WritableComputedRef<T>;
  346. export declare type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
  347. export { ComputedRef }
  348. /**
  349. * Concrete component type matches its actual value: it's either an options
  350. * object, or a function. Use this where the code expects to work with actual
  351. * values, e.g. checking if its a function or not. This is mostly for internal
  352. * implementation code.
  353. */
  354. export declare type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, any>;
  355. declare interface Constructor<P = any> {
  356. __isFragment?: never;
  357. __isTeleport?: never;
  358. __isSuspense?: never;
  359. new (...args: any[]): {
  360. $props: P;
  361. };
  362. }
  363. export declare type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
  364. /**
  365. * Create a block root vnode. Takes the same exact arguments as `createVNode`.
  366. * A block root keeps track of dynamic nodes within the block in the
  367. * `dynamicChildren` array.
  368. *
  369. * @private
  370. */
  371. export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
  372. /**
  373. * @private
  374. */
  375. export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
  376. declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
  377. declare 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, 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>>;
  378. export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
  379. declare function createRecord(id: string, component: ComponentOptions | ClassComponent): boolean;
  380. /**
  381. * The createRenderer function accepts two generic arguments:
  382. * HostNode and HostElement, corresponding to Node and Element types in the
  383. * host environment. For example, for runtime-dom, HostNode would be the DOM
  384. * `Node` interface and HostElement would be the DOM `Element` interface.
  385. *
  386. * Custom renderers can pass in the platform specific types like this:
  387. *
  388. * ``` js
  389. * const { render, createApp } = createRenderer<Node, Element>({
  390. * patchProp,
  391. * ...nodeOps
  392. * })
  393. * ```
  394. */
  395. export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
  396. /**
  397. * Compiler runtime helper for creating dynamic slots object
  398. * @private
  399. */
  400. export declare function createSlots(slots: Record<string, Slot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, Slot>;
  401. /**
  402. * @private
  403. */
  404. export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
  405. declare function createSuspenseBoundary(vnode: VNode, parent: SuspenseBoundary | null, parentComponent: ComponentInternalInstance | null, container: RendererElement, hiddenContainer: RendererElement, anchor: RendererNode | null, isSVG: boolean, optimized: boolean, rendererInternals: RendererInternals, isHydrating?: boolean): SuspenseBoundary;
  406. /**
  407. * @private
  408. */
  409. export declare function createTextVNode(text?: string, flag?: number): VNode;
  410. export declare const createVNode: typeof _createVNode;
  411. declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
  412. export { customRef }
  413. declare type Data = Record<string, unknown>;
  414. export { DebuggerEvent }
  415. declare type DebuggerHook = (e: DebuggerEvent) => void;
  416. export { DeepReadonly }
  417. declare type DefaultFactory<T> = (props: Data) => T | null | undefined;
  418. declare type DefaultKeys<T> = {
  419. [K in keyof T]: T[K] extends {
  420. default: any;
  421. } | BooleanConstructor | {
  422. type: BooleanConstructor;
  423. } ? T[K] extends {
  424. type: BooleanConstructor;
  425. required: true;
  426. } ? never : K : never;
  427. }[keyof T];
  428. export declare function defineAsyncComponent<T extends Component = {
  429. new (): ComponentPublicInstance;
  430. }>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
  431. export declare type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string, PP = PublicProps, Props = Readonly<ExtractPropTypes<PropsOrPropOptions>>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & PP;
  432. export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>;
  433. export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
  434. export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Readonly<{
  435. [key in PropNames]?: any;
  436. }>, RawBindings, D, C, M, Mixin, Extends, E, EE>;
  437. export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
  438. export declare function defineEmit<TypeEmit = undefined, E extends EmitsOptions = EmitsOptions, EE extends string = string, InferredEmit = EmitFn<E>>(emitOptions?: E | EE[]): TypeEmit extends undefined ? InferredEmit : TypeEmit;
  439. /**
  440. * Compile-time-only helper used for declaring props inside `<script setup>`.
  441. * This is stripped away in the compiled code and should never be actually
  442. * called at runtime.
  443. */
  444. export declare function defineProps<TypeProps = undefined, PropNames extends string = string, InferredProps = {
  445. [key in PropNames]?: any;
  446. }>(props?: PropNames[]): Readonly<TypeProps extends undefined ? InferredProps : TypeProps>;
  447. export declare function defineProps<TypeProps = undefined, PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, InferredProps = ExtractPropTypes<PP>>(props?: PP): Readonly<TypeProps extends undefined ? InferredProps : TypeProps>;
  448. export declare let devtools: DevtoolsHook;
  449. declare interface DevtoolsHook {
  450. emit: (event: string, ...payload: any[]) => void;
  451. on: (event: string, handler: Function) => void;
  452. once: (event: string, handler: Function) => void;
  453. off: (event: string, handler: Function) => void;
  454. appRecords: AppRecord[];
  455. }
  456. export declare type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
  457. export declare type DirectiveArguments = Array<[Directive] | [Directive, any] | [Directive, any, string] | [Directive, any, string, DirectiveModifiers]>;
  458. export declare interface DirectiveBinding<V = any> {
  459. instance: ComponentPublicInstance | null;
  460. value: V;
  461. oldValue: V | null;
  462. arg?: string;
  463. modifiers: DirectiveModifiers;
  464. dir: ObjectDirective<any, V>;
  465. }
  466. export declare type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
  467. declare type DirectiveModifiers = Record<string, boolean>;
  468. declare 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<{
  469. [key in Event]: Options[key] extends ((...args: infer Args) => any) ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
  470. }[Event]>;
  471. export declare type EmitsOptions = ObjectEmitsOptions | string[];
  472. declare type EnsureNonVoid<T> = T extends void ? {} : T;
  473. declare type ErrorCapturedHook = (err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void;
  474. export declare const enum ErrorCodes {
  475. SETUP_FUNCTION = 0,
  476. RENDER_FUNCTION = 1,
  477. WATCH_GETTER = 2,
  478. WATCH_CALLBACK = 3,
  479. WATCH_CLEANUP = 4,
  480. NATIVE_EVENT_HANDLER = 5,
  481. COMPONENT_EVENT_HANDLER = 6,
  482. VNODE_HOOK = 7,
  483. DIRECTIVE_HOOK = 8,
  484. TRANSITION_HOOK = 9,
  485. APP_ERROR_HANDLER = 10,
  486. APP_WARN_HANDLER = 11,
  487. FUNCTION_REF = 12,
  488. ASYNC_COMPONENT_LOADER = 13,
  489. SCHEDULER = 14
  490. }
  491. declare type ErrorTypes = LifecycleHooks | ErrorCodes;
  492. declare type ExtractComputedReturns<T extends any> = {
  493. [key in keyof T]: T[key] extends {
  494. get: (...args: any[]) => infer TReturn;
  495. } ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
  496. };
  497. export declare type ExtractDefaultPropTypes<O> = O extends object ? {
  498. [K in DefaultKeys<O>]: InferPropType<O[K]>;
  499. } : {};
  500. declare type ExtractMixin<T> = {
  501. Mixin: MixinToOptionTypes<T>;
  502. }[T extends ComponentOptionsMixin ? 'Mixin' : never];
  503. declare type ExtractOptionProp<T> = T extends ComponentOptionsBase<infer P, any, any, any, any, any, any, any> ? unknown extends P ? {} : P : {};
  504. export declare type ExtractPropTypes<O> = O extends object ? {
  505. [K in RequiredKeys<O>]: InferPropType<O[K]>;
  506. } & {
  507. [K in OptionalKeys<O>]?: InferPropType<O[K]>;
  508. } : {
  509. [K in string]: any;
  510. };
  511. export declare const Fragment: {
  512. new (): {
  513. $props: VNodeProps;
  514. };
  515. __isFragment: true;
  516. };
  517. export declare interface FunctionalComponent<P = {}, E extends EmitsOptions = {}> extends ComponentInternalOptions {
  518. (props: P, ctx: Omit<SetupContext<E>, 'expose'>): any;
  519. props?: ComponentPropsOptions<P>;
  520. emits?: E | (keyof E)[];
  521. inheritAttrs?: boolean;
  522. displayName?: string;
  523. }
  524. export declare type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
  525. export declare const getCurrentInstance: () => ComponentInternalInstance | null;
  526. export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean): VNode[];
  527. export declare function h(type: string, children?: RawChildren): VNode;
  528. export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
  529. export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
  530. export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
  531. export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren): VNode;
  532. export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
  533. export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
  534. export declare function h<P, E extends EmitsOptions = {}>(type: FunctionalComponent<P, E>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  535. export declare function h(type: Component, children?: RawChildren): VNode;
  536. export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
  537. export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
  538. export declare function h(type: Component, props: null, children?: RawChildren | RawSlots): VNode;
  539. export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  540. export declare function h(type: Constructor, children?: RawChildren): VNode;
  541. export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  542. export declare function h(type: DefineComponent, children?: RawChildren): VNode;
  543. export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
  544. export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
  545. export declare interface HMRRuntime {
  546. createRecord: typeof createRecord;
  547. rerender: typeof rerender;
  548. reload: typeof reload;
  549. }
  550. declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean) => Node | null): Node | null;
  551. declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector } }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean) => Node | null): Node | null;
  552. export declare interface HydrationRenderer extends Renderer<Element> {
  553. hydrate: RootHydrateFunction;
  554. }
  555. declare type InferPropType<T> = T extends null ? any : T extends {
  556. type: null | true;
  557. } ? any : T extends ObjectConstructor | {
  558. type: ObjectConstructor;
  559. } ? Record<string, any> : T extends BooleanConstructor | {
  560. type: BooleanConstructor;
  561. } ? boolean : T extends DateConstructor | {
  562. type: DateConstructor;
  563. } ? Date : T extends Prop<infer V, infer D> ? (unknown extends V ? D : V) : T;
  564. export declare function initCustomFormatter(): void;
  565. export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
  566. export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
  567. export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
  568. export declare interface InjectionKey<T> extends Symbol {
  569. }
  570. /* Excluded from this release type: InternalRenderFunction */
  571. declare type InternalSlots = {
  572. [name: string]: Slot | undefined;
  573. };
  574. declare type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType<{}, {}, {}, {}, {}> : UnionToIntersection<ExtractMixin<T>>;
  575. declare type InvalidateCbRegistrator = (cb: () => void) => void;
  576. declare type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
  577. export { isProxy }
  578. export { isReactive }
  579. export { isReadonly }
  580. export { isRef }
  581. export declare function isVNode(value: any): value is VNode;
  582. export declare const KeepAlive: {
  583. new (): {
  584. $props: VNodeProps & KeepAliveProps;
  585. };
  586. __isKeepAlive: true;
  587. };
  588. export declare interface KeepAliveProps {
  589. include?: MatchPattern;
  590. exclude?: MatchPattern;
  591. max?: number | string;
  592. }
  593. declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin> {
  594. [key: string]: any;
  595. data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
  596. computed?: C;
  597. methods?: M;
  598. watch?: ComponentWatchOptions;
  599. provide?: Data | Function;
  600. inject?: ComponentInjectOptions;
  601. mixins?: Mixin[];
  602. extends?: Extends;
  603. beforeCreate?(): void;
  604. created?(): void;
  605. beforeMount?(): void;
  606. mounted?(): void;
  607. beforeUpdate?(): void;
  608. updated?(): void;
  609. activated?(): void;
  610. deactivated?(): void;
  611. /** @deprecated use `beforeUnmount` instead */
  612. beforeDestroy?(): void;
  613. beforeUnmount?(): void;
  614. /** @deprecated use `unmounted` instead */
  615. destroyed?(): void;
  616. unmounted?(): void;
  617. renderTracked?: DebuggerHook;
  618. renderTriggered?: DebuggerHook;
  619. errorCaptured?: ErrorCapturedHook;
  620. delimiters?: [string, string];
  621. }
  622. declare type LifecycleHook = Function[] | null;
  623. declare const enum LifecycleHooks {
  624. BEFORE_CREATE = "bc",
  625. CREATED = "c",
  626. BEFORE_MOUNT = "bm",
  627. MOUNTED = "m",
  628. BEFORE_UPDATE = "bu",
  629. UPDATED = "u",
  630. BEFORE_UNMOUNT = "bum",
  631. UNMOUNTED = "um",
  632. DEACTIVATED = "da",
  633. ACTIVATED = "a",
  634. RENDER_TRIGGERED = "rtg",
  635. RENDER_TRACKED = "rtc",
  636. ERROR_CAPTURED = "ec"
  637. }
  638. declare type MapSources<T, Immediate> = {
  639. [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;
  640. };
  641. export { markRaw }
  642. declare type MatchPattern = string | RegExp | string[] | RegExp[];
  643. export declare function mergeProps(...args: (Data & VNodeProps)[]): Record<string, unknown> & VNodeProps;
  644. export declare interface MethodOptions {
  645. [key: string]: Function;
  646. }
  647. declare type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
  648. declare type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean, start?: number) => void;
  649. declare type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
  650. declare type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
  651. declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
  652. declare const enum MoveType {
  653. ENTER = 0,
  654. LEAVE = 1,
  655. REORDER = 2
  656. }
  657. declare type MultiWatchSources = (WatchSource<unknown> | object)[];
  658. declare type NextFn = (vnode: VNode) => RendererNode | null;
  659. export declare function nextTick(this: ComponentPublicInstance | void, fn?: () => void): Promise<void>;
  660. declare type NormalizedProp = null | (PropOptions & {
  661. [BooleanFlags.shouldCast]?: boolean;
  662. [BooleanFlags.shouldCastTrue]?: boolean;
  663. });
  664. declare type NormalizedProps = Record<string, NormalizedProp>;
  665. declare type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
  666. declare function normalizeVNode(child: VNodeChild): VNode;
  667. declare const NULL_DYNAMIC_COMPONENT: unique symbol;
  668. export declare interface ObjectDirective<T = any, V = any> {
  669. created?: DirectiveHook<T, null, V>;
  670. beforeMount?: DirectiveHook<T, null, V>;
  671. mounted?: DirectiveHook<T, null, V>;
  672. beforeUpdate?: DirectiveHook<T, VNode<any, T>, V>;
  673. updated?: DirectiveHook<T, VNode<any, T>, V>;
  674. beforeUnmount?: DirectiveHook<T, null, V>;
  675. unmounted?: DirectiveHook<T, null, V>;
  676. getSSRProps?: SSRDirectiveHook;
  677. }
  678. export declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
  679. export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
  680. export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  681. export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  682. export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  683. export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
  684. export declare const onErrorCaptured: (hook: ErrorCapturedHook, target?: ComponentInternalInstance | null) => void;
  685. export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  686. export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
  687. export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
  688. export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  689. export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
  690. /**
  691. * Open a block.
  692. * This must be called before `createBlock`. It cannot be part of `createBlock`
  693. * because the children of the block are evaluated before `createBlock` itself
  694. * is called. The generated code typically looks like this:
  695. *
  696. * ```js
  697. * function render() {
  698. * return (openBlock(),createBlock('div', null, [...]))
  699. * }
  700. * ```
  701. * disableTracking is true when creating a v-for fragment block, since a v-for
  702. * fragment always diffs its children.
  703. *
  704. * @private
  705. */
  706. export declare function openBlock(disableTracking?: boolean): void;
  707. declare type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
  708. export declare type OptionMergeFunction = (to: unknown, from: unknown, instance: any, key: string) => any;
  709. declare type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
  710. declare type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
  711. P: P;
  712. B: B;
  713. D: D;
  714. C: C;
  715. M: M;
  716. Defaults: Defaults;
  717. };
  718. declare type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean) => void;
  719. declare type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized?: boolean) => void;
  720. declare type PatchFn = (n1: VNode | null, // null means this is a mount
  721. n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, isSVG?: boolean, optimized?: boolean) => void;
  722. declare type Plugin_2 = PluginInstallFunction & {
  723. install?: PluginInstallFunction;
  724. } | {
  725. install: PluginInstallFunction;
  726. };
  727. export { Plugin_2 as Plugin }
  728. declare type PluginInstallFunction = (app: App, ...options: any[]) => any;
  729. /**
  730. * @private
  731. */
  732. export declare function popScopeId(): void;
  733. export declare type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
  734. declare type PropConstructor<T = any> = {
  735. new (...args: any[]): T & object;
  736. } | {
  737. (): T;
  738. } | PropMethod<T>;
  739. declare type PropMethod<T, TConstructor = any> = T extends (...args: any) => any ? {
  740. new (): TConstructor;
  741. (): T;
  742. readonly prototype: TConstructor;
  743. } : never;
  744. declare interface PropOptions<T = any, D = T> {
  745. type?: PropType<T> | true | null;
  746. required?: boolean;
  747. default?: D | DefaultFactory<D> | null | undefined | object;
  748. validator?(value: unknown): boolean;
  749. }
  750. export declare type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
  751. export declare function provide<T>(key: InjectionKey<T> | string | number, value: T): void;
  752. export { proxyRefs }
  753. declare type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
  754. /**
  755. * @private
  756. */
  757. export declare function pushScopeId(id: string): void;
  758. export declare function queuePostFlushCb(cb: SchedulerCbs): void;
  759. declare type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
  760. declare type RawProps = VNodeProps & {
  761. __v_isVNode?: never;
  762. [Symbol.iterator]?: never;
  763. } & Record<string, any>;
  764. declare type RawSlots = {
  765. [name: string]: unknown;
  766. $stable?: boolean;
  767. /* Excluded from this release type: _ctx */
  768. /* Excluded from this release type: _ */
  769. };
  770. export { reactive }
  771. export { ReactiveEffect }
  772. export { ReactiveEffectOptions }
  773. export { readonly }
  774. export { Ref }
  775. export { ref }
  776. /**
  777. * For runtime-dom to register the compiler.
  778. * Note the exported method uses any to avoid d.ts relying on the compiler types.
  779. */
  780. export declare function registerRuntimeCompiler(_compile: any): void;
  781. declare function reload(id: string, newComp: ComponentOptions | ClassComponent): void;
  782. declare type RemoveFn = (vnode: VNode) => void;
  783. declare function renderComponentRoot(instance: ComponentInternalInstance): VNode;
  784. export declare interface Renderer<HostElement = RendererElement> {
  785. render: RootRenderFunction<HostElement>;
  786. createApp: CreateAppFunction<HostElement>;
  787. }
  788. export declare interface RendererElement extends RendererNode {
  789. }
  790. declare interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
  791. p: PatchFn;
  792. um: UnmountFn;
  793. r: RemoveFn;
  794. m: MoveFn;
  795. mt: MountComponentFn;
  796. mc: MountChildrenFn;
  797. pc: PatchChildrenFn;
  798. pbc: PatchBlockChildrenFn;
  799. n: NextFn;
  800. o: RendererOptions<HostNode, HostElement>;
  801. }
  802. export declare interface RendererNode {
  803. [key: string]: any;
  804. }
  805. export declare interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
  806. patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, isSVG?: boolean, prevChildren?: VNode<HostNode, HostElement>[], parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, unmountChildren?: UnmountChildrenFn): void;
  807. forcePatchProp?(el: HostElement, key: string): boolean;
  808. insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
  809. remove(el: HostNode): void;
  810. createElement(type: string, isSVG?: boolean, isCustomizedBuiltIn?: string): HostElement;
  811. createText(text: string): HostNode;
  812. createComment(text: string): HostNode;
  813. setText(node: HostNode, text: string): void;
  814. setElementText(node: HostElement, text: string): void;
  815. parentNode(node: HostNode): HostElement | null;
  816. nextSibling(node: HostNode): HostNode | null;
  817. querySelector?(selector: string): HostElement | null;
  818. setScopeId?(el: HostElement, id: string): void;
  819. cloneNode?(node: HostNode): HostNode;
  820. insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, isSVG: boolean): HostElement[];
  821. }
  822. export declare type RenderFunction = () => VNodeChild;
  823. /**
  824. * v-for string
  825. * @private
  826. */
  827. export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
  828. /**
  829. * v-for number
  830. */
  831. export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
  832. /**
  833. * v-for array
  834. */
  835. export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
  836. /**
  837. * v-for iterable
  838. */
  839. export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
  840. /**
  841. * v-for object
  842. */
  843. export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
  844. /**
  845. * Compiler runtime helper for rendering `<slot/>`
  846. * @private
  847. */
  848. export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren): VNode;
  849. declare type RequiredKeys<T> = {
  850. [K in keyof T]: T[K] extends {
  851. required: true;
  852. } | {
  853. default: any;
  854. } | BooleanConstructor | {
  855. type: BooleanConstructor;
  856. } ? K : never;
  857. }[keyof T];
  858. declare function rerender(id: string, newRender?: Function): void;
  859. /**
  860. * @private
  861. */
  862. export declare function resolveComponent(name: string): ConcreteComponent | string;
  863. /**
  864. * @private
  865. */
  866. export declare function resolveDirective(name: string): Directive | undefined;
  867. /**
  868. * @private
  869. */
  870. export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
  871. export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
  872. export declare type RootHydrateFunction = (vnode: VNode<Node, Element>, container: Element) => void;
  873. export declare type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement) => void;
  874. declare type SchedulerCb = Function & {
  875. id?: number;
  876. };
  877. declare type SchedulerCbs = SchedulerCb | SchedulerCb[];
  878. /**
  879. * Block tracking sometimes needs to be disabled, for example during the
  880. * creation of a tree that needs to be cached by v-once. The compiler generates
  881. * code like this:
  882. *
  883. * ``` js
  884. * _cache[1] || (
  885. * setBlockTracking(-1),
  886. * _cache[1] = createVNode(...),
  887. * setBlockTracking(1),
  888. * _cache[1]
  889. * )
  890. * ```
  891. *
  892. * @private
  893. */
  894. export declare function setBlockTracking(value: number): void;
  895. declare function setCurrentRenderingInstance(instance: ComponentInternalInstance | null): void;
  896. export declare function setDevtoolsHook(hook: DevtoolsHook): void;
  897. export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
  898. declare function setupComponent(instance: ComponentInternalInstance, isSSR?: boolean): Promise<void> | undefined;
  899. export declare interface SetupContext<E = EmitsOptions> {
  900. attrs: Data;
  901. slots: Slots;
  902. emit: EmitFn<E>;
  903. expose: (exposed: Record<string, any>) => void;
  904. }
  905. declare type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
  906. export { shallowReactive }
  907. export { shallowReadonly }
  908. export { shallowRef }
  909. export { ShallowUnwrapRef }
  910. export declare type Slot = (...args: any[]) => VNode[];
  911. export declare type Slots = Readonly<InternalSlots>;
  912. export declare const ssrContextKey: unique symbol;
  913. declare type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
  914. /* Excluded from this release type: ssrUtils */
  915. export declare const Static: unique symbol;
  916. export declare const Suspense: {
  917. new (): {
  918. $props: VNodeProps & SuspenseProps;
  919. };
  920. __isSuspense: true;
  921. };
  922. export declare interface SuspenseBoundary {
  923. vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
  924. parent: SuspenseBoundary | null;
  925. parentComponent: ComponentInternalInstance | null;
  926. isSVG: boolean;
  927. container: RendererElement;
  928. hiddenContainer: RendererElement;
  929. anchor: RendererNode | null;
  930. activeBranch: VNode | null;
  931. pendingBranch: VNode | null;
  932. deps: number;
  933. pendingId: number;
  934. timeout: number;
  935. isInFallback: boolean;
  936. isHydrating: boolean;
  937. isUnmounted: boolean;
  938. effects: Function[];
  939. resolve(force?: boolean): void;
  940. fallback(fallbackVNode: VNode): void;
  941. move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
  942. next(): RendererNode | null;
  943. registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
  944. unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
  945. }
  946. declare const SuspenseImpl: {
  947. __isSuspense: boolean;
  948. process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean, rendererInternals: RendererInternals): void;
  949. hydrate: typeof hydrateSuspense;
  950. create: typeof createSuspenseBoundary;
  951. };
  952. export declare interface SuspenseProps {
  953. onResolve?: () => void;
  954. onPending?: () => void;
  955. onFallback?: () => void;
  956. timeout?: string | number;
  957. }
  958. export declare const Teleport: {
  959. new (): {
  960. $props: VNodeProps & TeleportProps;
  961. };
  962. __isTeleport: true;
  963. };
  964. declare const TeleportImpl: {
  965. __isTeleport: boolean;
  966. process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean, internals: RendererInternals): void;
  967. remove(vnode: VNode, { r: remove, o: { remove: hostRemove } }: RendererInternals): void;
  968. move: typeof moveTeleport;
  969. hydrate: typeof hydrateTeleport;
  970. };
  971. declare const enum TeleportMoveTypes {
  972. TARGET_CHANGE = 0,
  973. TOGGLE = 1,
  974. REORDER = 2
  975. }
  976. export declare interface TeleportProps {
  977. to: string | RendererElement | null | undefined;
  978. disabled?: boolean;
  979. }
  980. declare type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
  981. declare const Text_2: unique symbol;
  982. export { Text_2 as Text }
  983. export { toDisplayString }
  984. export { toHandlerKey }
  985. /**
  986. * For prefixing keys in v-on="obj" with "on"
  987. * @private
  988. */
  989. export declare function toHandlers(obj: Record<string, any>): Record<string, any>;
  990. export { toRaw }
  991. export { toRef }
  992. export { ToRefs }
  993. export { toRefs }
  994. export { TrackOpTypes }
  995. /**
  996. * Internal API for registering an arguments transform for createVNode
  997. * used for creating stubs in the test-utils
  998. * It is *internal* but needs to be exposed for test-utils to pick up proper
  999. * typings
  1000. */
  1001. export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
  1002. export declare interface TransitionHooks<HostElement extends RendererElement = RendererElement> {
  1003. mode: BaseTransitionProps['mode'];
  1004. persisted: boolean;
  1005. beforeEnter(el: HostElement): void;
  1006. enter(el: HostElement): void;
  1007. leave(el: HostElement, remove: () => void): void;
  1008. clone(vnode: VNode): TransitionHooks<HostElement>;
  1009. afterLeave?(): void;
  1010. delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
  1011. delayedLeave?(): void;
  1012. }
  1013. export declare interface TransitionState {
  1014. isMounted: boolean;
  1015. isLeaving: boolean;
  1016. isUnmounting: boolean;
  1017. leavingVNodes: Map<any, Record<string, VNode>>;
  1018. }
  1019. export { TriggerOpTypes }
  1020. export { triggerRef }
  1021. declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
  1022. declare type UnmountChildrenFn = (children: VNode[], parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean, start?: number) => void;
  1023. declare type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
  1024. export { unref }
  1025. declare type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
  1026. export { UnwrapRef }
  1027. export declare function useContext(): SetupContext;
  1028. export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
  1029. export declare function useTransitionState(): TransitionState;
  1030. export declare const version: string;
  1031. export declare interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
  1032. [key: string]: any;
  1033. }> {
  1034. /* Excluded from this release type: __v_isVNode */
  1035. /* Excluded from this release type: __v_skip */
  1036. type: VNodeTypes;
  1037. props: (VNodeProps & ExtraProps) | null;
  1038. key: string | number | null;
  1039. ref: VNodeNormalizedRef | null;
  1040. scopeId: string | null;
  1041. children: VNodeNormalizedChildren;
  1042. component: ComponentInternalInstance | null;
  1043. dirs: DirectiveBinding[] | null;
  1044. transition: TransitionHooks<HostElement> | null;
  1045. el: HostNode | null;
  1046. anchor: HostNode | null;
  1047. target: HostElement | null;
  1048. targetAnchor: HostNode | null;
  1049. staticCount: number;
  1050. suspense: SuspenseBoundary | null;
  1051. ssContent: VNode | null;
  1052. ssFallback: VNode | null;
  1053. shapeFlag: number;
  1054. patchFlag: number;
  1055. dynamicProps: string[] | null;
  1056. dynamicChildren: VNode[] | null;
  1057. appContext: AppContext | null;
  1058. }
  1059. declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined;
  1060. export declare type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
  1061. export declare type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
  1062. declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
  1063. declare type VNodeMountHook = (vnode: VNode) => void;
  1064. export declare type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
  1065. declare type VNodeNormalizedRef = VNodeNormalizedRefAtom | (VNodeNormalizedRefAtom)[];
  1066. declare type VNodeNormalizedRefAtom = {
  1067. i: ComponentInternalInstance;
  1068. r: VNodeRef;
  1069. };
  1070. export declare type VNodeProps = {
  1071. key?: string | number;
  1072. ref?: VNodeRef;
  1073. onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
  1074. onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
  1075. onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
  1076. onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
  1077. onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
  1078. onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
  1079. };
  1080. declare type VNodeRef = string | Ref | ((ref: object | null, refs: Record<string, any>) => void);
  1081. export declare type VNodeTypes = string | VNode | Component | typeof Text_2 | typeof Static | typeof Comment_2 | typeof Fragment | typeof TeleportImpl | typeof SuspenseImpl;
  1082. declare type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
  1083. export declare function warn(msg: string, ...args: any[]): void;
  1084. 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;
  1085. 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;
  1086. 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;
  1087. 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;
  1088. export declare type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onInvalidate: InvalidateCbRegistrator) => any;
  1089. export declare type WatchEffect = (onInvalidate: InvalidateCbRegistrator) => void;
  1090. export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
  1091. declare type WatchOptionItem = string | WatchCallback | {
  1092. handler: WatchCallback | string;
  1093. } & WatchOptions;
  1094. export declare interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
  1095. immediate?: Immediate;
  1096. deep?: boolean;
  1097. }
  1098. export declare interface WatchOptionsBase {
  1099. flush?: 'pre' | 'post' | 'sync';
  1100. onTrack?: ReactiveEffectOptions['onTrack'];
  1101. onTrigger?: ReactiveEffectOptions['onTrigger'];
  1102. }
  1103. export declare type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
  1104. export declare type WatchStopHandle = () => void;
  1105. /**
  1106. * Wrap a slot function to memoize current rendering instance
  1107. * @private
  1108. */
  1109. export declare function withCtx(fn: Slot, ctx?: ComponentInternalInstance | null): Slot;
  1110. /**
  1111. * Adds directives to a VNode.
  1112. */
  1113. export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
  1114. /**
  1115. * @private
  1116. */
  1117. export declare function withScopeId(id: string): <T extends Function>(fn: T) => T;
  1118. export { WritableComputedOptions }
  1119. export { WritableComputedRef }
  1120. export { }
  1121. // Note: this file is auto concatenated to the end of the bundled d.ts during
  1122. // build.
  1123. declare module '@vue/reactivity' {
  1124. export interface RefUnwrapBailTypes {
  1125. runtimeCoreBailTypes:
  1126. | VNode
  1127. | {
  1128. // directly bailing on ComponentPublicInstance results in recursion
  1129. // so we use this as a bail hint
  1130. $: ComponentInternalInstance
  1131. }
  1132. }
  1133. }