@histoire/vendors 0.17.17 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/b-floating-vue.js +2175 -2150
- package/dist/client/b-iconify.js +663 -850
- package/dist/client/b-pinia.js +130 -68
- package/dist/client/b-scroll.js +3 -52
- package/dist/client/b-vue-router.js +385 -237
- package/dist/client/b-vue-use.js +4578 -3115
- package/dist/client/b-vue.js +1 -1
- package/dist/client/index.js +162 -20
- package/dist/client/node_modules/@babel/helper-string-parser/package.json +31 -0
- package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/dist/client/node_modules/@babel/parser/package.json +10 -6
- package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +167 -188
- package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +2786 -0
- package/dist/client/node_modules/@babel/types/lib/index.d.ts +3286 -0
- package/dist/client/node_modules/@babel/types/package.json +39 -0
- package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +525 -0
- package/dist/client/node_modules/@floating-ui/core/package.json +32 -39
- package/dist/client/node_modules/@floating-ui/dom/package.json +23 -24
- package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +31 -0
- package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +11 -7
- package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +121 -20
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +12 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +4 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +3 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +7 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -2
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +3 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +1 -2
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +103 -0
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/package.json +6 -0
- package/dist/client/node_modules/@floating-ui/utils/package.json +70 -0
- package/dist/client/node_modules/@iconify/types/package.json +23 -0
- package/dist/client/node_modules/@iconify/types/provider.d.ts +44 -0
- package/dist/client/node_modules/@iconify/types/types.d.ts +272 -0
- package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +122 -327
- package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +36 -269
- package/dist/client/node_modules/@iconify/vue/package.json +64 -60
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +3 -2
- package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +33 -14
- package/dist/client/node_modules/@types/web-bluetooth/package.json +12 -12
- package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +218 -125
- package/dist/client/node_modules/@vue/compiler-core/package.json +20 -5
- package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +6 -3
- package/dist/client/node_modules/@vue/compiler-dom/package.json +17 -3
- package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +35 -25
- package/dist/client/node_modules/@vue/compiler-sfc/package.json +27 -18
- package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +2 -2
- package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/dist/client/node_modules/@vue/devtools-api/package.json +1 -1
- package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +268 -166
- package/dist/client/node_modules/@vue/reactivity/package.json +16 -2
- package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +728 -529
- package/dist/client/node_modules/@vue/runtime-core/package.json +17 -3
- package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +195 -86
- package/dist/client/node_modules/@vue/runtime-dom/package.json +22 -4
- package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +4 -8
- package/dist/client/node_modules/@vue/server-renderer/package.json +18 -4
- package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +45 -30
- package/dist/client/node_modules/@vue/shared/package.json +15 -1
- package/dist/client/node_modules/@vueuse/core/index.d.ts +2323 -666
- package/dist/client/node_modules/@vueuse/core/package.json +22 -12
- package/dist/client/node_modules/@vueuse/metadata/index.d.ts +7 -5
- package/dist/client/node_modules/@vueuse/metadata/package.json +14 -7
- package/dist/client/node_modules/@vueuse/shared/index.d.ts +451 -280
- package/dist/client/node_modules/@vueuse/shared/package.json +17 -6
- package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +75 -0
- package/dist/client/node_modules/compute-scroll-into-view/package.json +35 -45
- package/dist/client/node_modules/entities/lib/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/dist/client/node_modules/entities/lib/esm/package.json +1 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/index.d.ts +96 -0
- package/dist/client/node_modules/entities/package.json +90 -0
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +225 -105
- package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +471 -364
- package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +14 -25
- package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +392 -6
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +49 -10
- package/dist/client/node_modules/floating-vue/dist/config.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/dist/index.d.ts +2071 -247
- package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +2 -0
- package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/package.json +42 -33
- package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +250 -229
- package/dist/client/node_modules/magic-string/package.json +24 -26
- package/dist/client/node_modules/nanoid/package.json +1 -1
- package/dist/client/node_modules/picocolors/package.json +2 -2
- package/dist/client/node_modules/picocolors/types.d.ts +51 -0
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +116 -37
- package/dist/client/node_modules/pinia/package.json +7 -11
- package/dist/client/node_modules/postcss/lib/at-rule.d.ts +22 -19
- package/dist/client/node_modules/postcss/lib/comment.d.ts +6 -5
- package/dist/client/node_modules/postcss/lib/container.d.ts +72 -82
- package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/declaration.d.ts +16 -13
- package/dist/client/node_modules/postcss/lib/document.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/input.d.ts +28 -16
- package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +40 -40
- package/dist/client/node_modules/postcss/lib/list.d.ts +5 -2
- package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +5 -5
- package/dist/client/node_modules/postcss/lib/node.d.ts +19 -14
- package/dist/client/node_modules/postcss/lib/postcss.d.ts +25 -8
- package/dist/client/node_modules/postcss/lib/processor.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/result.d.ts +10 -11
- package/dist/client/node_modules/postcss/lib/root.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/rule.d.ts +22 -13
- package/dist/client/node_modules/postcss/package.json +4 -4
- package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +79 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/package.json +28 -67
- package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/package.json +1 -1
- package/dist/client/node_modules/source-map-js/source-map.d.ts +88 -99
- package/dist/client/node_modules/vue/dist/vue.d.ts +0 -4
- package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -1
- package/dist/client/node_modules/vue/jsx.d.ts +2 -1
- package/dist/client/node_modules/vue/package.json +13 -14
- package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +1 -1
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +410 -81
- package/dist/client/node_modules/vue-router/package.json +66 -37
- package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
- package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +4 -0
- package/dist/client/vue.runtime.esm-bundler.js +6458 -4714
- package/package.json +17 -17
- package/rollup.config.mjs +6 -6
- package/dist/client/index2.js +0 -168
- package/dist/client/node_modules/@floating-ui/core/index.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +0 -11
- package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +0 -10
- package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +0 -21
- package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +0 -32
- package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +0 -148
- package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +0 -1
- package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +0 -43
- package/dist/client/node_modules/@vue/reactivity-transform/package.json +0 -41
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +0 -19
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +0 -1
- package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +0 -5
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +0 -13
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +0 -19
- package/dist/client/node_modules/vue/macros-global.d.ts +0 -19
- package/dist/client/node_modules/vue/macros.d.ts +0 -112
- package/dist/client/node_modules/vue/ref-macros.d.ts +0 -2
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions,
|
|
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,
|
|
1
|
+
import { computed as computed$1, Ref, OnCleanup, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, WatchCallback, ReactiveEffect, DebuggerOptions, WatchEffect, WatchHandle, WatchSource, ReactiveMarker, ShallowRef, WatchErrorCodes, reactive } from '@vue/reactivity';
|
|
2
|
+
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
+
import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters, IsKeyValues } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
export declare const computed: typeof computed$1;
|
|
@@ -14,7 +14,7 @@ declare const SlotSymbol: unique symbol;
|
|
|
14
14
|
export type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
|
15
15
|
[SlotSymbol]?: T;
|
|
16
16
|
};
|
|
17
|
-
type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T
|
|
17
|
+
type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T> & T;
|
|
18
18
|
type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{
|
|
19
19
|
[K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>;
|
|
20
20
|
}>>;
|
|
@@ -23,11 +23,9 @@ type RawSlots = {
|
|
|
23
23
|
$stable?: boolean;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
active?: boolean;
|
|
30
|
-
computed?: boolean;
|
|
26
|
+
declare enum SchedulerJobFlags {
|
|
27
|
+
QUEUED = 1,
|
|
28
|
+
PRE = 2,
|
|
31
29
|
/**
|
|
32
30
|
* Indicates whether the effect is allowed to recursively trigger itself
|
|
33
31
|
* when managed by the scheduler.
|
|
@@ -43,29 +41,389 @@ interface SchedulerJob extends Function {
|
|
|
43
41
|
* responsibility to perform recursive state mutation that eventually
|
|
44
42
|
* stabilizes (#1727).
|
|
45
43
|
*/
|
|
46
|
-
|
|
44
|
+
ALLOW_RECURSE = 4,
|
|
45
|
+
DISPOSED = 8
|
|
46
|
+
}
|
|
47
|
+
interface SchedulerJob extends Function {
|
|
48
|
+
id?: number;
|
|
49
|
+
/**
|
|
50
|
+
* flags can technically be undefined, but it can still be used in bitwise
|
|
51
|
+
* operations just like 0.
|
|
52
|
+
*/
|
|
53
|
+
flags?: SchedulerJobFlags;
|
|
47
54
|
/**
|
|
48
55
|
* Attached by renderer.ts when setting up a component's render effect
|
|
49
56
|
* Used to obtain component information when reporting max recursive updates.
|
|
50
|
-
* dev only.
|
|
51
57
|
*/
|
|
52
|
-
|
|
58
|
+
i?: ComponentInternalInstance;
|
|
53
59
|
}
|
|
54
60
|
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
55
61
|
export declare function nextTick<T = void, R = void>(this: T, fn?: (this: T) => R): Promise<Awaited<R>>;
|
|
56
62
|
export declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
|
57
63
|
|
|
64
|
+
export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
65
|
+
export type ComponentObjectPropsOptions<P = Data> = {
|
|
66
|
+
[K in keyof P]: Prop<P[K]> | null;
|
|
67
|
+
};
|
|
68
|
+
export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
69
|
+
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
70
|
+
interface PropOptions<T = any, D = T> {
|
|
71
|
+
type?: PropType<T> | true | null;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
74
|
+
validator?(value: unknown, props: Data): boolean;
|
|
75
|
+
}
|
|
76
|
+
export type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
|
77
|
+
type PropConstructor<T = any> = {
|
|
78
|
+
new (...args: any[]): T & {};
|
|
79
|
+
} | {
|
|
80
|
+
(): T;
|
|
81
|
+
} | PropMethod<T>;
|
|
82
|
+
type PropMethod<T, TConstructor = any> = [T] extends [
|
|
83
|
+
((...args: any) => any) | undefined
|
|
84
|
+
] ? {
|
|
85
|
+
new (): TConstructor;
|
|
86
|
+
(): T;
|
|
87
|
+
readonly prototype: TConstructor;
|
|
88
|
+
} : never;
|
|
89
|
+
type RequiredKeys<T> = {
|
|
90
|
+
[K in keyof T]: T[K] extends {
|
|
91
|
+
required: true;
|
|
92
|
+
} | {
|
|
93
|
+
default: any;
|
|
94
|
+
} | BooleanConstructor | {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
} ? T[K] extends {
|
|
97
|
+
default: undefined | (() => undefined);
|
|
98
|
+
} ? never : K : never;
|
|
99
|
+
}[keyof T];
|
|
100
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
101
|
+
type DefaultKeys<T> = {
|
|
102
|
+
[K in keyof T]: T[K] extends {
|
|
103
|
+
default: any;
|
|
104
|
+
} | BooleanConstructor | {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
} ? T[K] extends {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
required: true;
|
|
109
|
+
} ? never : K : never;
|
|
110
|
+
}[keyof T];
|
|
111
|
+
type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
|
|
112
|
+
type: null | true;
|
|
113
|
+
}] ? any : [T] extends [ObjectConstructor | {
|
|
114
|
+
type: ObjectConstructor;
|
|
115
|
+
}] ? Record<string, any> : [T] extends [BooleanConstructor | {
|
|
116
|
+
type: BooleanConstructor;
|
|
117
|
+
}] ? boolean : [T] extends [DateConstructor | {
|
|
118
|
+
type: DateConstructor;
|
|
119
|
+
}] ? Date : [T] extends [(infer U)[] | {
|
|
120
|
+
type: (infer U)[];
|
|
121
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
122
|
+
/**
|
|
123
|
+
* Extract prop types from a runtime props options object.
|
|
124
|
+
* The extracted types are **internal** - i.e. the resolved props received by
|
|
125
|
+
* the component.
|
|
126
|
+
* - Boolean props are always present
|
|
127
|
+
* - Props with default values are always present
|
|
128
|
+
*
|
|
129
|
+
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
130
|
+
*/
|
|
131
|
+
export type ExtractPropTypes<O> = {
|
|
132
|
+
[K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
|
|
133
|
+
} & {
|
|
134
|
+
[K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
|
|
135
|
+
};
|
|
136
|
+
type PublicRequiredKeys<T> = {
|
|
137
|
+
[K in keyof T]: T[K] extends {
|
|
138
|
+
required: true;
|
|
139
|
+
} ? K : never;
|
|
140
|
+
}[keyof T];
|
|
141
|
+
type PublicOptionalKeys<T> = Exclude<keyof T, PublicRequiredKeys<T>>;
|
|
142
|
+
/**
|
|
143
|
+
* Extract prop types from a runtime props options object.
|
|
144
|
+
* The extracted types are **public** - i.e. the expected props that can be
|
|
145
|
+
* passed to component.
|
|
146
|
+
*/
|
|
147
|
+
export type ExtractPublicPropTypes<O> = {
|
|
148
|
+
[K in keyof Pick<O, PublicRequiredKeys<O>>]: InferPropType<O[K]>;
|
|
149
|
+
} & {
|
|
150
|
+
[K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>;
|
|
151
|
+
};
|
|
152
|
+
export type ExtractDefaultPropTypes<O> = O extends object ? {
|
|
153
|
+
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
|
154
|
+
} : {};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Vue `<script setup>` compiler macro for declaring component props. The
|
|
158
|
+
* expected argument is the same as the component `props` option.
|
|
159
|
+
*
|
|
160
|
+
* Example runtime declaration:
|
|
161
|
+
* ```js
|
|
162
|
+
* // using Array syntax
|
|
163
|
+
* const props = defineProps(['foo', 'bar'])
|
|
164
|
+
* // using Object syntax
|
|
165
|
+
* const props = defineProps({
|
|
166
|
+
* foo: String,
|
|
167
|
+
* bar: {
|
|
168
|
+
* type: Number,
|
|
169
|
+
* required: true
|
|
170
|
+
* }
|
|
171
|
+
* })
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* Equivalent type-based declaration:
|
|
175
|
+
* ```ts
|
|
176
|
+
* // will be compiled into equivalent runtime declarations
|
|
177
|
+
* const props = defineProps<{
|
|
178
|
+
* foo?: string
|
|
179
|
+
* bar: number
|
|
180
|
+
* }>()
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
184
|
+
*
|
|
185
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
186
|
+
* output and should **not** be actually called at runtime.
|
|
187
|
+
*/
|
|
188
|
+
export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
|
|
189
|
+
[key in PropNames]?: any;
|
|
190
|
+
}>>;
|
|
191
|
+
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
192
|
+
export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
|
193
|
+
export type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
194
|
+
readonly [K in BKeys]-?: boolean;
|
|
195
|
+
};
|
|
196
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
197
|
+
/**
|
|
198
|
+
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
199
|
+
* events. The expected argument is the same as the component `emits` option.
|
|
200
|
+
*
|
|
201
|
+
* Example runtime declaration:
|
|
202
|
+
* ```js
|
|
203
|
+
* const emit = defineEmits(['change', 'update'])
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* Example type-based declaration:
|
|
207
|
+
* ```ts
|
|
208
|
+
* const emit = defineEmits<{
|
|
209
|
+
* // <eventName>: <expected arguments>
|
|
210
|
+
* change: []
|
|
211
|
+
* update: [value: number] // named tuple syntax
|
|
212
|
+
* }>()
|
|
213
|
+
*
|
|
214
|
+
* emit('change')
|
|
215
|
+
* emit('update', 1)
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
219
|
+
* output and should **not** be actually called at runtime.
|
|
220
|
+
*
|
|
221
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
222
|
+
*/
|
|
223
|
+
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
224
|
+
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
225
|
+
export declare function defineEmits<T extends ComponentTypeEmits>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
|
226
|
+
export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
227
|
+
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
228
|
+
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
|
229
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
230
|
+
}>>;
|
|
231
|
+
/**
|
|
232
|
+
* Vue `<script setup>` compiler macro for declaring a component's exposed
|
|
233
|
+
* instance properties when it is accessed by a parent component via template
|
|
234
|
+
* refs.
|
|
235
|
+
*
|
|
236
|
+
* `<script setup>` components are closed by default - i.e. variables inside
|
|
237
|
+
* the `<script setup>` scope is not exposed to parent unless explicitly exposed
|
|
238
|
+
* via `defineExpose`.
|
|
239
|
+
*
|
|
240
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
241
|
+
* output and should **not** be actually called at runtime.
|
|
242
|
+
*
|
|
243
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
|
|
244
|
+
*/
|
|
245
|
+
export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
246
|
+
/**
|
|
247
|
+
* Vue `<script setup>` compiler macro for declaring a component's additional
|
|
248
|
+
* options. This should be used only for options that cannot be expressed via
|
|
249
|
+
* Composition API - e.g. `inheritAttrs`.
|
|
250
|
+
*
|
|
251
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
252
|
+
*/
|
|
253
|
+
export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsBase<{}, RawBindings, D, C, M, Mixin, Extends, {}> & {
|
|
254
|
+
/**
|
|
255
|
+
* props should be defined via defineProps().
|
|
256
|
+
*/
|
|
257
|
+
props?: never;
|
|
258
|
+
/**
|
|
259
|
+
* emits should be defined via defineEmits().
|
|
260
|
+
*/
|
|
261
|
+
emits?: never;
|
|
262
|
+
/**
|
|
263
|
+
* expose should be defined via defineExpose().
|
|
264
|
+
*/
|
|
265
|
+
expose?: never;
|
|
266
|
+
/**
|
|
267
|
+
* slots should be defined via defineSlots().
|
|
268
|
+
*/
|
|
269
|
+
slots?: never;
|
|
270
|
+
}): void;
|
|
271
|
+
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
272
|
+
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
|
|
273
|
+
ModelRef<T, M, G, S>,
|
|
274
|
+
Record<M, true | undefined>
|
|
275
|
+
];
|
|
276
|
+
type DefineModelOptions<T = any, G = T, S = T> = {
|
|
277
|
+
get?: (v: T) => G;
|
|
278
|
+
set?: (v: S) => any;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Vue `<script setup>` compiler macro for declaring a
|
|
282
|
+
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
283
|
+
* component. This will declare a prop with the same name and a corresponding
|
|
284
|
+
* `update:propName` event.
|
|
285
|
+
*
|
|
286
|
+
* If the first argument is a string, it will be used as the prop name;
|
|
287
|
+
* Otherwise the prop name will default to "modelValue". In both cases, you
|
|
288
|
+
* can also pass an additional object which will be used as the prop's options.
|
|
289
|
+
*
|
|
290
|
+
* The returned ref behaves differently depending on whether the parent
|
|
291
|
+
* provided the corresponding v-model props or not:
|
|
292
|
+
* - If yes, the returned ref's value will always be in sync with the parent
|
|
293
|
+
* prop.
|
|
294
|
+
* - If not, the returned ref will behave like a normal local ref.
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* // default model (consumed via `v-model`)
|
|
299
|
+
* const modelValue = defineModel<string>()
|
|
300
|
+
* modelValue.value = "hello"
|
|
301
|
+
*
|
|
302
|
+
* // default model with options
|
|
303
|
+
* const modelValue = defineModel<string>({ required: true })
|
|
304
|
+
*
|
|
305
|
+
* // with specified name (consumed via `v-model:count`)
|
|
306
|
+
* const count = defineModel<number>('count')
|
|
307
|
+
* count.value++
|
|
308
|
+
*
|
|
309
|
+
* // with specified name and default value
|
|
310
|
+
* const count = defineModel<number>('count', { default: 0 })
|
|
311
|
+
* ```
|
|
312
|
+
*/
|
|
313
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
314
|
+
default: any;
|
|
315
|
+
} | {
|
|
316
|
+
required: true;
|
|
317
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
318
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
319
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
320
|
+
default: any;
|
|
321
|
+
} | {
|
|
322
|
+
required: true;
|
|
323
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
324
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
325
|
+
type NotUndefined<T> = T extends undefined ? never : T;
|
|
326
|
+
type MappedOmit<T, K extends keyof any> = {
|
|
327
|
+
[P in keyof T as P extends K ? never : P]: T[P];
|
|
328
|
+
};
|
|
329
|
+
type InferDefaults<T> = {
|
|
330
|
+
[K in keyof T]?: InferDefault<T, T[K]>;
|
|
331
|
+
};
|
|
332
|
+
type NativeType = null | number | string | boolean | symbol | Function;
|
|
333
|
+
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
334
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
335
|
+
readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
|
336
|
+
} & {
|
|
337
|
+
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
338
|
+
} : never;
|
|
339
|
+
/**
|
|
340
|
+
* Vue `<script setup>` compiler macro for providing props default values when
|
|
341
|
+
* using type-based `defineProps` declaration.
|
|
342
|
+
*
|
|
343
|
+
* Example usage:
|
|
344
|
+
* ```ts
|
|
345
|
+
* withDefaults(defineProps<{
|
|
346
|
+
* size?: number
|
|
347
|
+
* labels?: string[]
|
|
348
|
+
* }>(), {
|
|
349
|
+
* size: 3,
|
|
350
|
+
* labels: () => ['default label']
|
|
351
|
+
* })
|
|
352
|
+
* ```
|
|
353
|
+
*
|
|
354
|
+
* This is only usable inside `<script setup>`, is compiled away in the output
|
|
355
|
+
* and should **not** be actually called at runtime.
|
|
356
|
+
*
|
|
357
|
+
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
|
358
|
+
*/
|
|
359
|
+
export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
360
|
+
export declare function useSlots(): SetupContext['slots'];
|
|
361
|
+
export declare function useAttrs(): SetupContext['attrs'];
|
|
362
|
+
|
|
58
363
|
export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
59
364
|
export type EmitsOptions = ObjectEmitsOptions | string[];
|
|
60
|
-
type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
|
|
61
|
-
[K in
|
|
365
|
+
export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? {
|
|
366
|
+
[K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
|
62
367
|
} : T extends ObjectEmitsOptions ? {
|
|
63
|
-
[K in string & `on${Capitalize<
|
|
368
|
+
[K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
|
|
64
369
|
} : {};
|
|
65
|
-
type
|
|
66
|
-
[
|
|
370
|
+
type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
|
|
371
|
+
[K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
|
|
372
|
+
} & (T extends (...args: any[]) => any ? ParametersToFns<OverloadParameters<T>> : {});
|
|
373
|
+
type ParametersToFns<T extends any[]> = {
|
|
374
|
+
[K in T[0]]: IsStringLiteral<K> extends true ? (...args: T extends [e: infer E, ...args: infer P] ? K extends E ? P : never : never) => any : never;
|
|
375
|
+
};
|
|
376
|
+
type IsStringLiteral<T> = T extends string ? string extends T ? false : true : false;
|
|
377
|
+
export type ShortEmitsToObject<E> = E extends Record<string, any[]> ? {
|
|
378
|
+
[K in keyof E]: (...args: E[K]) => any;
|
|
379
|
+
} : E;
|
|
380
|
+
export 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<{
|
|
381
|
+
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : Options[key] extends any[] ? (event: key, ...args: Options[key]) => void : (event: key, ...args: any[]) => void;
|
|
67
382
|
}[Event]>;
|
|
68
383
|
|
|
384
|
+
/**
|
|
385
|
+
Runtime helper for applying directives to a vnode. Example usage:
|
|
386
|
+
|
|
387
|
+
const comp = resolveComponent('comp')
|
|
388
|
+
const foo = resolveDirective('foo')
|
|
389
|
+
const bar = resolveDirective('bar')
|
|
390
|
+
|
|
391
|
+
return withDirectives(h(comp), [
|
|
392
|
+
[foo, this.x],
|
|
393
|
+
[bar, this.y]
|
|
394
|
+
])
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
export interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg extends string = string> {
|
|
398
|
+
instance: ComponentPublicInstance | Record<string, any> | null;
|
|
399
|
+
value: Value;
|
|
400
|
+
oldValue: Value | null;
|
|
401
|
+
arg?: Arg;
|
|
402
|
+
modifiers: DirectiveModifiers<Modifiers>;
|
|
403
|
+
dir: ObjectDirective<any, Value>;
|
|
404
|
+
}
|
|
405
|
+
export type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg extends string = string> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void;
|
|
406
|
+
type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg extends string = string> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
|
|
407
|
+
export interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> {
|
|
408
|
+
created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
409
|
+
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
410
|
+
mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
411
|
+
beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
412
|
+
updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
413
|
+
beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
414
|
+
unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
415
|
+
getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
|
|
416
|
+
deep?: boolean;
|
|
417
|
+
}
|
|
418
|
+
export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
|
419
|
+
export type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
|
|
420
|
+
type DirectiveModifiers<K extends string = string> = Record<K, boolean>;
|
|
421
|
+
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>;
|
|
422
|
+
/**
|
|
423
|
+
* Adds directives to a VNode.
|
|
424
|
+
*/
|
|
425
|
+
export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
426
|
+
|
|
69
427
|
/**
|
|
70
428
|
* Custom properties added to component instances in any way and can be accessed through `this`
|
|
71
429
|
*
|
|
@@ -75,7 +433,7 @@ type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Op
|
|
|
75
433
|
* import { createApp } from 'vue'
|
|
76
434
|
* import { Router, createRouter } from 'vue-router'
|
|
77
435
|
*
|
|
78
|
-
* declare module '
|
|
436
|
+
* declare module 'vue' {
|
|
79
437
|
* interface ComponentCustomProperties {
|
|
80
438
|
* $router: Router
|
|
81
439
|
* }
|
|
@@ -94,7 +452,7 @@ type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Op
|
|
|
94
452
|
export interface ComponentCustomProperties {
|
|
95
453
|
}
|
|
96
454
|
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
97
|
-
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;
|
|
455
|
+
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, any, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
|
|
98
456
|
type ExtractMixin<T> = {
|
|
99
457
|
Mixin: MixinToOptionTypes<T>;
|
|
100
458
|
}[T extends ComponentOptionsMixin ? 'Mixin' : never];
|
|
@@ -107,28 +465,42 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
|
|
|
107
465
|
__isSuspense?: never;
|
|
108
466
|
new (...args: any[]): T;
|
|
109
467
|
};
|
|
468
|
+
/**
|
|
469
|
+
* @deprecated This is no longer used internally, but exported and relied on by
|
|
470
|
+
* existing library types generated by vue-tsc.
|
|
471
|
+
*/
|
|
110
472
|
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>;
|
|
473
|
+
/**
|
|
474
|
+
* This is the same as `CreateComponentPublicInstance` but adds local components,
|
|
475
|
+
* global directives, exposed, and provide inference.
|
|
476
|
+
* It changes the arguments order so that we don't need to repeat mixin
|
|
477
|
+
* inference everywhere internally, but it has to be a new type to avoid
|
|
478
|
+
* breaking types that relies on previous arguments order (#10842)
|
|
479
|
+
*/
|
|
480
|
+
export type CreateComponentPublicInstanceWithMixins<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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl extends Element = any, Provide extends ComponentProvideOptions = ComponentProvideOptions, 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, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs, TypeEl>;
|
|
481
|
+
type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
|
|
111
482
|
export type ComponentPublicInstance<P = {}, // props type extracted from props option
|
|
112
483
|
B = {}, // raw bindings returned from setup()
|
|
113
484
|
D = {}, // return from data()
|
|
114
|
-
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps =
|
|
485
|
+
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}, TypeEl extends Element = any> = {
|
|
115
486
|
$: ComponentInternalInstance;
|
|
116
487
|
$data: D;
|
|
117
488
|
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
118
489
|
$attrs: Data;
|
|
119
|
-
$refs: Data;
|
|
490
|
+
$refs: Data & TypeRefs;
|
|
120
491
|
$slots: UnwrapSlotsType<S>;
|
|
121
492
|
$root: ComponentPublicInstance | null;
|
|
122
493
|
$parent: ComponentPublicInstance | null;
|
|
494
|
+
$host: Element | null;
|
|
123
495
|
$emit: EmitFn<E>;
|
|
124
|
-
$el:
|
|
496
|
+
$el: TypeEl;
|
|
125
497
|
$options: Options & MergedComponentOptionsOverride;
|
|
126
498
|
$forceUpdate: () => void;
|
|
127
499
|
$nextTick: typeof nextTick;
|
|
128
|
-
$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;
|
|
129
|
-
} & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
|
|
500
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
|
|
501
|
+
} & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>;
|
|
130
502
|
|
|
131
|
-
declare
|
|
503
|
+
declare enum LifecycleHooks {
|
|
132
504
|
BEFORE_CREATE = "bc",
|
|
133
505
|
CREATED = "c",
|
|
134
506
|
BEFORE_MOUNT = "bm",
|
|
@@ -160,12 +532,12 @@ export interface SuspenseProps {
|
|
|
160
532
|
declare const SuspenseImpl: {
|
|
161
533
|
name: string;
|
|
162
534
|
__isSuspense: boolean;
|
|
163
|
-
process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
535
|
+
process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
|
|
164
536
|
hydrate: typeof hydrateSuspense;
|
|
165
|
-
create: typeof createSuspenseBoundary;
|
|
166
537
|
normalize: typeof normalizeSuspenseChildren;
|
|
167
538
|
};
|
|
168
539
|
export declare const Suspense: {
|
|
540
|
+
__isSuspense: true;
|
|
169
541
|
new (): {
|
|
170
542
|
$props: VNodeProps & SuspenseProps;
|
|
171
543
|
$slots: {
|
|
@@ -173,16 +545,14 @@ export declare const Suspense: {
|
|
|
173
545
|
fallback(): VNode[];
|
|
174
546
|
};
|
|
175
547
|
};
|
|
176
|
-
__isSuspense: true;
|
|
177
548
|
};
|
|
178
549
|
export interface SuspenseBoundary {
|
|
179
550
|
vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
|
|
180
551
|
parent: SuspenseBoundary | null;
|
|
181
552
|
parentComponent: ComponentInternalInstance | null;
|
|
182
|
-
|
|
553
|
+
namespace: ElementNamespace;
|
|
183
554
|
container: RendererElement;
|
|
184
555
|
hiddenContainer: RendererElement;
|
|
185
|
-
anchor: RendererNode | null;
|
|
186
556
|
activeBranch: VNode | null;
|
|
187
557
|
pendingBranch: VNode | null;
|
|
188
558
|
deps: number;
|
|
@@ -196,11 +566,10 @@ export interface SuspenseBoundary {
|
|
|
196
566
|
fallback(fallbackVNode: VNode): void;
|
|
197
567
|
move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
|
|
198
568
|
next(): RendererNode | null;
|
|
199
|
-
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
|
|
569
|
+
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
|
|
200
570
|
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
|
|
201
571
|
}
|
|
202
|
-
declare function
|
|
203
|
-
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;
|
|
572
|
+
declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, 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;
|
|
204
573
|
declare function normalizeSuspenseChildren(vnode: VNode): void;
|
|
205
574
|
|
|
206
575
|
export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Element | ShadowRoot) & {
|
|
@@ -243,30 +612,16 @@ export interface TransitionState {
|
|
|
243
612
|
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
244
613
|
}
|
|
245
614
|
export declare function useTransitionState(): TransitionState;
|
|
246
|
-
export declare const BaseTransitionPropsValidators:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
254
|
-
onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
255
|
-
onLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
256
|
-
onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
257
|
-
onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
258
|
-
onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
259
|
-
onAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
260
|
-
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
261
|
-
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
262
|
-
};
|
|
263
|
-
export declare const BaseTransition: new () => {
|
|
264
|
-
$props: BaseTransitionProps<any>;
|
|
265
|
-
$slots: {
|
|
266
|
-
default(): VNode[];
|
|
615
|
+
export declare const BaseTransitionPropsValidators: Record<string, any>;
|
|
616
|
+
export declare const BaseTransition: {
|
|
617
|
+
new (): {
|
|
618
|
+
$props: BaseTransitionProps<any>;
|
|
619
|
+
$slots: {
|
|
620
|
+
default(): VNode[];
|
|
621
|
+
};
|
|
267
622
|
};
|
|
268
623
|
};
|
|
269
|
-
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
624
|
+
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
|
|
270
625
|
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
271
626
|
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
272
627
|
|
|
@@ -277,12 +632,13 @@ export interface Renderer<HostElement = RendererElement> {
|
|
|
277
632
|
export interface HydrationRenderer extends Renderer<Element | ShadowRoot> {
|
|
278
633
|
hydrate: RootHydrateFunction;
|
|
279
634
|
}
|
|
280
|
-
export type
|
|
635
|
+
export type ElementNamespace = 'svg' | 'mathml' | undefined;
|
|
636
|
+
export type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement, namespace?: ElementNamespace) => void;
|
|
281
637
|
export interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
|
|
282
|
-
patchProp(el: HostElement, key: string, prevValue: any, nextValue: any,
|
|
638
|
+
patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void;
|
|
283
639
|
insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
|
|
284
640
|
remove(el: HostNode): void;
|
|
285
|
-
createElement(type: string,
|
|
641
|
+
createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
|
|
286
642
|
[key: string]: any;
|
|
287
643
|
}) | null): HostElement;
|
|
288
644
|
createText(text: string): HostNode;
|
|
@@ -294,10 +650,10 @@ export interface RendererOptions<HostNode = RendererNode, HostElement = Renderer
|
|
|
294
650
|
querySelector?(selector: string): HostElement | null;
|
|
295
651
|
setScopeId?(el: HostElement, id: string): void;
|
|
296
652
|
cloneNode?(node: HostNode): HostNode;
|
|
297
|
-
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null,
|
|
653
|
+
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
|
|
298
654
|
}
|
|
299
655
|
export interface RendererNode {
|
|
300
|
-
[key: string]: any;
|
|
656
|
+
[key: string | symbol]: any;
|
|
301
657
|
}
|
|
302
658
|
export interface RendererElement extends RendererNode {
|
|
303
659
|
}
|
|
@@ -314,18 +670,17 @@ interface RendererInternals<HostNode = RendererNode, HostElement = RendererEleme
|
|
|
314
670
|
o: RendererOptions<HostNode, HostElement>;
|
|
315
671
|
}
|
|
316
672
|
type PatchFn = (n1: VNode | null, // null means this is a mount
|
|
317
|
-
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null,
|
|
318
|
-
type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
319
|
-
type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
320
|
-
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
673
|
+
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
|
674
|
+
type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
|
|
675
|
+
type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean) => void;
|
|
676
|
+
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
|
|
321
677
|
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
|
322
678
|
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
323
679
|
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
324
680
|
type RemoveFn = (vnode: VNode) => void;
|
|
325
|
-
type
|
|
326
|
-
type
|
|
327
|
-
|
|
328
|
-
declare const enum MoveType {
|
|
681
|
+
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
682
|
+
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
683
|
+
declare enum MoveType {
|
|
329
684
|
ENTER = 0,
|
|
330
685
|
LEAVE = 1,
|
|
331
686
|
REORDER = 2
|
|
@@ -355,166 +710,32 @@ export interface KeepAliveProps {
|
|
|
355
710
|
max?: number | string;
|
|
356
711
|
}
|
|
357
712
|
export declare const KeepAlive: {
|
|
713
|
+
__isKeepAlive: true;
|
|
358
714
|
new (): {
|
|
359
715
|
$props: VNodeProps & KeepAliveProps;
|
|
360
716
|
$slots: {
|
|
361
717
|
default(): VNode[];
|
|
362
718
|
};
|
|
363
719
|
};
|
|
364
|
-
__isKeepAlive: true;
|
|
365
720
|
};
|
|
366
721
|
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
367
722
|
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
368
723
|
|
|
369
|
-
|
|
370
|
-
export declare const
|
|
371
|
-
export declare const
|
|
372
|
-
export declare const
|
|
373
|
-
export declare const
|
|
374
|
-
export declare const
|
|
375
|
-
export declare const
|
|
724
|
+
type CreateHook<T = any> = (hook: T, target?: ComponentInternalInstance | null) => void;
|
|
725
|
+
export declare const onBeforeMount: CreateHook;
|
|
726
|
+
export declare const onMounted: CreateHook;
|
|
727
|
+
export declare const onBeforeUpdate: CreateHook;
|
|
728
|
+
export declare const onUpdated: CreateHook;
|
|
729
|
+
export declare const onBeforeUnmount: CreateHook;
|
|
730
|
+
export declare const onUnmounted: CreateHook;
|
|
731
|
+
export declare const onServerPrefetch: CreateHook;
|
|
376
732
|
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
377
|
-
export declare const onRenderTriggered:
|
|
378
|
-
export declare const onRenderTracked:
|
|
733
|
+
export declare const onRenderTriggered: CreateHook<DebuggerHook>;
|
|
734
|
+
export declare const onRenderTracked: CreateHook<DebuggerHook>;
|
|
379
735
|
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
380
736
|
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
|
381
737
|
|
|
382
|
-
|
|
383
|
-
export type ComponentObjectPropsOptions<P = Data> = {
|
|
384
|
-
[K in keyof P]: Prop<P[K]> | null;
|
|
385
|
-
};
|
|
386
|
-
export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
387
|
-
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
388
|
-
interface PropOptions<T = any, D = T> {
|
|
389
|
-
type?: PropType<T> | true | null;
|
|
390
|
-
required?: boolean;
|
|
391
|
-
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
392
|
-
validator?(value: unknown): boolean;
|
|
393
|
-
}
|
|
394
|
-
export type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
|
395
|
-
type PropConstructor<T = any> = {
|
|
396
|
-
new (...args: any[]): T & {};
|
|
397
|
-
} | {
|
|
398
|
-
(): T;
|
|
399
|
-
} | PropMethod<T>;
|
|
400
|
-
type PropMethod<T, TConstructor = any> = [T] extends [
|
|
401
|
-
((...args: any) => any) | undefined
|
|
402
|
-
] ? {
|
|
403
|
-
new (): TConstructor;
|
|
404
|
-
(): T;
|
|
405
|
-
readonly prototype: TConstructor;
|
|
406
|
-
} : never;
|
|
407
|
-
type RequiredKeys<T> = {
|
|
408
|
-
[K in keyof T]: T[K] extends {
|
|
409
|
-
required: true;
|
|
410
|
-
} | {
|
|
411
|
-
default: any;
|
|
412
|
-
} | BooleanConstructor | {
|
|
413
|
-
type: BooleanConstructor;
|
|
414
|
-
} ? T[K] extends {
|
|
415
|
-
default: undefined | (() => undefined);
|
|
416
|
-
} ? never : K : never;
|
|
417
|
-
}[keyof T];
|
|
418
|
-
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
419
|
-
type DefaultKeys<T> = {
|
|
420
|
-
[K in keyof T]: T[K] extends {
|
|
421
|
-
default: any;
|
|
422
|
-
} | BooleanConstructor | {
|
|
423
|
-
type: BooleanConstructor;
|
|
424
|
-
} ? T[K] extends {
|
|
425
|
-
type: BooleanConstructor;
|
|
426
|
-
required: true;
|
|
427
|
-
} ? never : K : never;
|
|
428
|
-
}[keyof T];
|
|
429
|
-
type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
|
|
430
|
-
type: null | true;
|
|
431
|
-
}] ? any : [T] extends [ObjectConstructor | {
|
|
432
|
-
type: ObjectConstructor;
|
|
433
|
-
}] ? Record<string, any> : [T] extends [BooleanConstructor | {
|
|
434
|
-
type: BooleanConstructor;
|
|
435
|
-
}] ? boolean : [T] extends [DateConstructor | {
|
|
436
|
-
type: DateConstructor;
|
|
437
|
-
}] ? Date : [T] extends [(infer U)[] | {
|
|
438
|
-
type: (infer U)[];
|
|
439
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U> : InferPropType<U> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? IfAny<V, V, D> : V : T;
|
|
440
|
-
/**
|
|
441
|
-
* Extract prop types from a runtime props options object.
|
|
442
|
-
* The extracted types are **internal** - i.e. the resolved props received by
|
|
443
|
-
* the component.
|
|
444
|
-
* - Boolean props are always present
|
|
445
|
-
* - Props with default values are always present
|
|
446
|
-
*
|
|
447
|
-
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
448
|
-
*/
|
|
449
|
-
export type ExtractPropTypes<O> = {
|
|
450
|
-
[K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
|
|
451
|
-
} & {
|
|
452
|
-
[K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
|
|
453
|
-
};
|
|
454
|
-
type PublicRequiredKeys<T> = {
|
|
455
|
-
[K in keyof T]: T[K] extends {
|
|
456
|
-
required: true;
|
|
457
|
-
} ? K : never;
|
|
458
|
-
}[keyof T];
|
|
459
|
-
type PublicOptionalKeys<T> = Exclude<keyof T, PublicRequiredKeys<T>>;
|
|
460
|
-
/**
|
|
461
|
-
* Extract prop types from a runtime props options object.
|
|
462
|
-
* The extracted types are **public** - i.e. the expected props that can be
|
|
463
|
-
* passed to component.
|
|
464
|
-
*/
|
|
465
|
-
export type ExtractPublicPropTypes<O> = {
|
|
466
|
-
[K in keyof Pick<O, PublicRequiredKeys<O>>]: InferPropType<O[K]>;
|
|
467
|
-
} & {
|
|
468
|
-
[K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>;
|
|
469
|
-
};
|
|
470
|
-
export type ExtractDefaultPropTypes<O> = O extends object ? {
|
|
471
|
-
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
|
472
|
-
} : {};
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
Runtime helper for applying directives to a vnode. Example usage:
|
|
476
|
-
|
|
477
|
-
const comp = resolveComponent('comp')
|
|
478
|
-
const foo = resolveDirective('foo')
|
|
479
|
-
const bar = resolveDirective('bar')
|
|
480
|
-
|
|
481
|
-
return withDirectives(h(comp), [
|
|
482
|
-
[foo, this.x],
|
|
483
|
-
[bar, this.y]
|
|
484
|
-
])
|
|
485
|
-
*/
|
|
486
|
-
|
|
487
|
-
export interface DirectiveBinding<V = any> {
|
|
488
|
-
instance: ComponentPublicInstance | null;
|
|
489
|
-
value: V;
|
|
490
|
-
oldValue: V | null;
|
|
491
|
-
arg?: string;
|
|
492
|
-
modifiers: DirectiveModifiers;
|
|
493
|
-
dir: ObjectDirective<any, V>;
|
|
494
|
-
}
|
|
495
|
-
export type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
|
|
496
|
-
type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
|
|
497
|
-
export interface ObjectDirective<T = any, V = any> {
|
|
498
|
-
created?: DirectiveHook<T, null, V>;
|
|
499
|
-
beforeMount?: DirectiveHook<T, null, V>;
|
|
500
|
-
mounted?: DirectiveHook<T, null, V>;
|
|
501
|
-
beforeUpdate?: DirectiveHook<T, VNode<any, T>, V>;
|
|
502
|
-
updated?: DirectiveHook<T, VNode<any, T>, V>;
|
|
503
|
-
beforeUnmount?: DirectiveHook<T, null, V>;
|
|
504
|
-
unmounted?: DirectiveHook<T, null, V>;
|
|
505
|
-
getSSRProps?: SSRDirectiveHook;
|
|
506
|
-
deep?: boolean;
|
|
507
|
-
}
|
|
508
|
-
export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
|
509
|
-
export type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
|
|
510
|
-
type DirectiveModifiers = Record<string, boolean>;
|
|
511
|
-
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
|
|
512
|
-
/**
|
|
513
|
-
* Adds directives to a VNode.
|
|
514
|
-
*/
|
|
515
|
-
export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
516
|
-
|
|
517
|
-
export declare const enum DeprecationTypes {
|
|
738
|
+
declare enum DeprecationTypes$1 {
|
|
518
739
|
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
519
740
|
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
|
520
741
|
GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
|
@@ -558,7 +779,7 @@ export declare const enum DeprecationTypes {
|
|
|
558
779
|
FILTERS = "FILTERS",
|
|
559
780
|
PRIVATE_APIS = "PRIVATE_APIS"
|
|
560
781
|
}
|
|
561
|
-
type CompatConfig = Partial<Record<DeprecationTypes, boolean | 'suppress-warning'>> & {
|
|
782
|
+
type CompatConfig = Partial<Record<DeprecationTypes$1, boolean | 'suppress-warning'>> & {
|
|
562
783
|
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
|
563
784
|
};
|
|
564
785
|
declare function configureCompat(config: CompatConfig): void;
|
|
@@ -568,7 +789,7 @@ declare function configureCompat(config: CompatConfig): void;
|
|
|
568
789
|
*
|
|
569
790
|
* @example
|
|
570
791
|
* ```ts
|
|
571
|
-
* declare module '
|
|
792
|
+
* declare module 'vue' {
|
|
572
793
|
* interface ComponentCustomOptions {
|
|
573
794
|
* beforeRouteUpdate?(
|
|
574
795
|
* to: Route,
|
|
@@ -582,17 +803,17 @@ declare function configureCompat(config: CompatConfig): void;
|
|
|
582
803
|
export interface ComponentCustomOptions {
|
|
583
804
|
}
|
|
584
805
|
export type RenderFunction = () => VNodeChild;
|
|
585
|
-
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 {
|
|
806
|
+
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, ComponentCustomOptions {
|
|
586
807
|
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
587
808
|
name?: string;
|
|
588
809
|
template?: string | object;
|
|
589
810
|
render?: Function;
|
|
590
|
-
components?: Record<string, Component>;
|
|
591
|
-
directives?: Record<string, Directive>;
|
|
811
|
+
components?: LC & Record<string, Component>;
|
|
812
|
+
directives?: Directives & Record<string, Directive>;
|
|
592
813
|
inheritAttrs?: boolean;
|
|
593
814
|
emits?: (E | EE[]) & ThisType<void>;
|
|
594
815
|
slots?: S;
|
|
595
|
-
expose?:
|
|
816
|
+
expose?: Exposed[];
|
|
596
817
|
serverPrefetch?(): void | Promise<any>;
|
|
597
818
|
compilerOptions?: RuntimeCompilerOptions;
|
|
598
819
|
call?: (this: unknown, ...args: unknown[]) => never;
|
|
@@ -610,19 +831,8 @@ export interface RuntimeCompilerOptions {
|
|
|
610
831
|
comments?: boolean;
|
|
611
832
|
delimiters?: [string, string];
|
|
612
833
|
}
|
|
613
|
-
export type
|
|
614
|
-
|
|
615
|
-
} & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I, S>>;
|
|
616
|
-
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<{
|
|
617
|
-
[key in PropNames]?: any;
|
|
618
|
-
} & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
|
|
619
|
-
props: PropNames[];
|
|
620
|
-
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S>>;
|
|
621
|
-
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> & {
|
|
622
|
-
props: PropsOptions & ThisType<void>;
|
|
623
|
-
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S>>;
|
|
624
|
-
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>>>;
|
|
625
|
-
export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any>;
|
|
834
|
+
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, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>;
|
|
835
|
+
export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
626
836
|
export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
627
837
|
export interface MethodOptions {
|
|
628
838
|
[key: string]: Function;
|
|
@@ -650,14 +860,14 @@ type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
|
|
|
650
860
|
} : T extends ObjectInjectOptions ? {
|
|
651
861
|
[K in keyof T]?: unknown;
|
|
652
862
|
} : never;
|
|
653
|
-
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
|
|
863
|
+
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
|
|
654
864
|
compatConfig?: CompatConfig;
|
|
655
865
|
[key: string]: any;
|
|
656
|
-
data?: (this:
|
|
866
|
+
data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
|
657
867
|
computed?: C;
|
|
658
868
|
methods?: M;
|
|
659
869
|
watch?: ComponentWatchOptions;
|
|
660
|
-
provide?:
|
|
870
|
+
provide?: Provide;
|
|
661
871
|
inject?: I | II[];
|
|
662
872
|
filters?: Record<string, Function>;
|
|
663
873
|
mixins?: Mixin[];
|
|
@@ -723,9 +933,38 @@ type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M e
|
|
|
723
933
|
M: M;
|
|
724
934
|
Defaults: Defaults;
|
|
725
935
|
};
|
|
936
|
+
/**
|
|
937
|
+
* @deprecated
|
|
938
|
+
*/
|
|
939
|
+
export type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, TE extends ComponentTypeEmits = {}, ResolvedEmits extends EmitsOptions = {} extends E ? TypeEmitsToOptions<TE> : E, PE = Props & EmitsToProps<ResolvedEmits>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
|
|
940
|
+
props?: never;
|
|
941
|
+
/**
|
|
942
|
+
* @private for language-tools use only
|
|
943
|
+
*/
|
|
944
|
+
__typeProps?: Props;
|
|
945
|
+
/**
|
|
946
|
+
* @private for language-tools use only
|
|
947
|
+
*/
|
|
948
|
+
__typeEmits?: TE;
|
|
949
|
+
} & ThisType<CreateComponentPublicInstanceWithMixins<PE, RawBindings, D, C, M, Mixin, Extends, ResolvedEmits, EE, {}, false, I, S, LC, Directives, Exposed>>;
|
|
950
|
+
/**
|
|
951
|
+
* @deprecated
|
|
952
|
+
*/
|
|
953
|
+
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<{
|
|
954
|
+
[key in PropNames]?: any;
|
|
955
|
+
} & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
|
|
956
|
+
props: PropNames[];
|
|
957
|
+
} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S, LC, Directives, Exposed>>;
|
|
958
|
+
/**
|
|
959
|
+
* @deprecated
|
|
960
|
+
*/
|
|
961
|
+
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions>> & Readonly<EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & {
|
|
962
|
+
props: PropsOptions & ThisType<void>;
|
|
963
|
+
} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>;
|
|
726
964
|
|
|
727
|
-
|
|
965
|
+
interface InjectionConstraint<T> {
|
|
728
966
|
}
|
|
967
|
+
export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
729
968
|
export declare function provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): void;
|
|
730
969
|
export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
731
970
|
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
@@ -737,6 +976,44 @@ export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T
|
|
|
737
976
|
*/
|
|
738
977
|
export declare function hasInjectionContext(): boolean;
|
|
739
978
|
|
|
979
|
+
export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
980
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
981
|
+
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
982
|
+
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
983
|
+
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
984
|
+
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'> & {
|
|
985
|
+
props?: (keyof Props)[];
|
|
986
|
+
emits?: E | EE[];
|
|
987
|
+
slots?: S;
|
|
988
|
+
}): DefineSetupFnComponent<Props, E, S>;
|
|
989
|
+
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'> & {
|
|
990
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
991
|
+
emits?: E | EE[];
|
|
992
|
+
slots?: S;
|
|
993
|
+
}): DefineSetupFnComponent<Props, E, S>;
|
|
994
|
+
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
995
|
+
[key in RuntimePropsKeys]?: any;
|
|
996
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
|
997
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
998
|
+
/**
|
|
999
|
+
* @private for language-tools use only
|
|
1000
|
+
*/
|
|
1001
|
+
__typeProps?: TypeProps;
|
|
1002
|
+
/**
|
|
1003
|
+
* @private for language-tools use only
|
|
1004
|
+
*/
|
|
1005
|
+
__typeEmits?: TypeEmits;
|
|
1006
|
+
/**
|
|
1007
|
+
* @private for language-tools use only
|
|
1008
|
+
*/
|
|
1009
|
+
__typeRefs?: TypeRefs;
|
|
1010
|
+
/**
|
|
1011
|
+
* @private for language-tools use only
|
|
1012
|
+
*/
|
|
1013
|
+
__typeEl?: TypeEl;
|
|
1014
|
+
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
1015
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
1016
|
+
|
|
740
1017
|
export interface App<HostElement = any> {
|
|
741
1018
|
version: string;
|
|
742
1019
|
config: AppConfig;
|
|
@@ -744,12 +1021,25 @@ export interface App<HostElement = any> {
|
|
|
744
1021
|
use<Options>(plugin: Plugin<Options>, options: Options): this;
|
|
745
1022
|
mixin(mixin: ComponentOptions): this;
|
|
746
1023
|
component(name: string): Component | undefined;
|
|
747
|
-
component(name: string, component:
|
|
748
|
-
directive(name: string): Directive | undefined;
|
|
749
|
-
directive(name: string, directive: Directive): this;
|
|
750
|
-
mount(rootContainer: HostElement | string,
|
|
1024
|
+
component<T extends Component | DefineComponent>(name: string, component: T): this;
|
|
1025
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined;
|
|
1026
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this;
|
|
1027
|
+
mount(rootContainer: HostElement | string,
|
|
1028
|
+
/**
|
|
1029
|
+
* @internal
|
|
1030
|
+
*/
|
|
1031
|
+
isHydrate?: boolean,
|
|
1032
|
+
/**
|
|
1033
|
+
* @internal
|
|
1034
|
+
*/
|
|
1035
|
+
namespace?: boolean | ElementNamespace,
|
|
1036
|
+
/**
|
|
1037
|
+
* @internal
|
|
1038
|
+
*/
|
|
1039
|
+
vnode?: VNode): ComponentPublicInstance;
|
|
751
1040
|
unmount(): void;
|
|
752
|
-
|
|
1041
|
+
onUnmount(cb: () => void): void;
|
|
1042
|
+
provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
|
753
1043
|
/**
|
|
754
1044
|
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
|
755
1045
|
* to variables provided via `app.provide()`.
|
|
@@ -771,7 +1061,7 @@ export interface App<HostElement = any> {
|
|
|
771
1061
|
}
|
|
772
1062
|
export type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
|
773
1063
|
export interface AppConfig {
|
|
774
|
-
readonly isNativeTag
|
|
1064
|
+
readonly isNativeTag: (tag: string) => boolean;
|
|
775
1065
|
performance: boolean;
|
|
776
1066
|
optionMergeStrategies: Record<string, OptionMergeFunction>;
|
|
777
1067
|
globalProperties: ComponentCustomProperties & Record<string, any>;
|
|
@@ -787,10 +1077,20 @@ export interface AppConfig {
|
|
|
787
1077
|
*/
|
|
788
1078
|
isCustomElement?: (tag: string) => boolean;
|
|
789
1079
|
/**
|
|
790
|
-
*
|
|
791
|
-
*
|
|
1080
|
+
* TODO document for 3.5
|
|
1081
|
+
* Enable warnings for computed getters that recursively trigger itself.
|
|
1082
|
+
*/
|
|
1083
|
+
warnRecursiveComputed?: boolean;
|
|
1084
|
+
/**
|
|
1085
|
+
* Whether to throw unhandled errors in production.
|
|
1086
|
+
* Default is `false` to avoid crashing on any error (and only logs it)
|
|
1087
|
+
* But in some cases, e.g. SSR, throwing might be more desirable.
|
|
1088
|
+
*/
|
|
1089
|
+
throwUnhandledErrorInProduction?: boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* Prefix for all useId() calls within this app
|
|
792
1092
|
*/
|
|
793
|
-
|
|
1093
|
+
idPrefix?: string;
|
|
794
1094
|
}
|
|
795
1095
|
export interface AppContext {
|
|
796
1096
|
app: App;
|
|
@@ -800,41 +1100,43 @@ export interface AppContext {
|
|
|
800
1100
|
directives: Record<string, Directive>;
|
|
801
1101
|
provides: Record<string | symbol, any>;
|
|
802
1102
|
}
|
|
803
|
-
type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
804
|
-
export type
|
|
805
|
-
install?: PluginInstallFunction<Options>;
|
|
806
|
-
}) | {
|
|
1103
|
+
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
1104
|
+
export type ObjectPlugin<Options = any[]> = {
|
|
807
1105
|
install: PluginInstallFunction<Options>;
|
|
808
1106
|
};
|
|
1107
|
+
export type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
1108
|
+
export type Plugin<Options = any[]> = FunctionPlugin<Options> | ObjectPlugin<Options>;
|
|
809
1109
|
export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
|
|
810
1110
|
|
|
811
1111
|
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
812
1112
|
export interface TeleportProps {
|
|
813
1113
|
to: string | RendererElement | null | undefined;
|
|
814
1114
|
disabled?: boolean;
|
|
1115
|
+
defer?: boolean;
|
|
815
1116
|
}
|
|
816
1117
|
declare const TeleportImpl: {
|
|
1118
|
+
name: string;
|
|
817
1119
|
__isTeleport: boolean;
|
|
818
|
-
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
819
|
-
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null,
|
|
1120
|
+
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
|
|
1121
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
|
820
1122
|
move: typeof moveTeleport;
|
|
821
1123
|
hydrate: typeof hydrateTeleport;
|
|
822
1124
|
};
|
|
823
|
-
declare
|
|
1125
|
+
declare enum TeleportMoveTypes {
|
|
824
1126
|
TARGET_CHANGE = 0,
|
|
825
|
-
TOGGLE = 1
|
|
1127
|
+
TOGGLE = 1,// enable / disable
|
|
826
1128
|
REORDER = 2
|
|
827
1129
|
}
|
|
828
1130
|
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
829
|
-
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;
|
|
1131
|
+
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: 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;
|
|
830
1132
|
export declare const Teleport: {
|
|
1133
|
+
__isTeleport: true;
|
|
831
1134
|
new (): {
|
|
832
1135
|
$props: VNodeProps & TeleportProps;
|
|
833
1136
|
$slots: {
|
|
834
1137
|
default(): VNode[];
|
|
835
1138
|
};
|
|
836
1139
|
};
|
|
837
|
-
__isTeleport: true;
|
|
838
1140
|
};
|
|
839
1141
|
|
|
840
1142
|
/**
|
|
@@ -852,10 +1154,10 @@ export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
|
852
1154
|
export declare function resolveDirective(name: string): Directive | undefined;
|
|
853
1155
|
|
|
854
1156
|
export declare const Fragment: {
|
|
1157
|
+
__isFragment: true;
|
|
855
1158
|
new (): {
|
|
856
1159
|
$props: VNodeProps;
|
|
857
1160
|
};
|
|
858
|
-
__isFragment: true;
|
|
859
1161
|
};
|
|
860
1162
|
export declare const Text: unique symbol;
|
|
861
1163
|
export declare const Comment: unique symbol;
|
|
@@ -863,16 +1165,28 @@ export declare const Static: unique symbol;
|
|
|
863
1165
|
export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
|
|
864
1166
|
export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
865
1167
|
type VNodeNormalizedRefAtom = {
|
|
1168
|
+
/**
|
|
1169
|
+
* component instance
|
|
1170
|
+
*/
|
|
866
1171
|
i: ComponentInternalInstance;
|
|
1172
|
+
/**
|
|
1173
|
+
* Actual ref
|
|
1174
|
+
*/
|
|
867
1175
|
r: VNodeRef;
|
|
1176
|
+
/**
|
|
1177
|
+
* setup ref key
|
|
1178
|
+
*/
|
|
868
1179
|
k?: string;
|
|
1180
|
+
/**
|
|
1181
|
+
* refInFor marker
|
|
1182
|
+
*/
|
|
869
1183
|
f?: boolean;
|
|
870
1184
|
};
|
|
871
1185
|
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
872
1186
|
type VNodeMountHook = (vnode: VNode) => void;
|
|
873
1187
|
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
|
874
1188
|
export type VNodeProps = {
|
|
875
|
-
key?:
|
|
1189
|
+
key?: PropertyKey;
|
|
876
1190
|
ref?: VNodeRef;
|
|
877
1191
|
ref_for?: boolean;
|
|
878
1192
|
ref_key?: string;
|
|
@@ -883,7 +1197,7 @@ export type VNodeProps = {
|
|
|
883
1197
|
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
|
884
1198
|
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
885
1199
|
};
|
|
886
|
-
type VNodeChildAtom = VNode |
|
|
1200
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
887
1201
|
export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
|
888
1202
|
export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
|
889
1203
|
export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
|
@@ -892,7 +1206,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
|
|
|
892
1206
|
}> {
|
|
893
1207
|
type: VNodeTypes;
|
|
894
1208
|
props: (VNodeProps & ExtraProps) | null;
|
|
895
|
-
key:
|
|
1209
|
+
key: PropertyKey | null;
|
|
896
1210
|
ref: VNodeNormalizedRef | null;
|
|
897
1211
|
/**
|
|
898
1212
|
* SFC only. This is assigned on vnode creation using currentScopeId
|
|
@@ -906,6 +1220,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
|
|
|
906
1220
|
el: HostNode | null;
|
|
907
1221
|
anchor: HostNode | null;
|
|
908
1222
|
target: HostElement | null;
|
|
1223
|
+
targetStart: HostNode | null;
|
|
909
1224
|
targetAnchor: HostNode | null;
|
|
910
1225
|
suspense: SuspenseBoundary | null;
|
|
911
1226
|
shapeFlag: number;
|
|
@@ -936,7 +1251,7 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
936
1251
|
*
|
|
937
1252
|
* ``` js
|
|
938
1253
|
* _cache[1] || (
|
|
939
|
-
* setBlockTracking(-1),
|
|
1254
|
+
* setBlockTracking(-1, true),
|
|
940
1255
|
* _cache[1] = createVNode(...),
|
|
941
1256
|
* setBlockTracking(1),
|
|
942
1257
|
* _cache[1]
|
|
@@ -945,13 +1260,11 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
945
1260
|
*
|
|
946
1261
|
* @private
|
|
947
1262
|
*/
|
|
948
|
-
export declare function setBlockTracking(value: number): void;
|
|
1263
|
+
export declare function setBlockTracking(value: number, inVOnce?: boolean): void;
|
|
949
1264
|
/**
|
|
950
1265
|
* @private
|
|
951
1266
|
*/
|
|
952
|
-
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode
|
|
953
|
-
[key: string]: any;
|
|
954
|
-
}>;
|
|
1267
|
+
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode;
|
|
955
1268
|
/**
|
|
956
1269
|
* Create a block root vnode. Takes the same exact arguments as `createVNode`.
|
|
957
1270
|
* A block root keeps track of dynamic nodes within the block in the
|
|
@@ -969,14 +1282,12 @@ declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, insta
|
|
|
969
1282
|
* typings
|
|
970
1283
|
*/
|
|
971
1284
|
export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
|
972
|
-
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
|
|
973
|
-
[key: string]: any;
|
|
974
|
-
}>;
|
|
1285
|
+
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;
|
|
975
1286
|
|
|
976
1287
|
export declare const createVNode: typeof _createVNode;
|
|
977
1288
|
declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
|
|
978
1289
|
export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
|
|
979
|
-
export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
|
|
1290
|
+
export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean, cloneTransition?: boolean): VNode<T, U>;
|
|
980
1291
|
/**
|
|
981
1292
|
* @private
|
|
982
1293
|
*/
|
|
@@ -992,11 +1303,64 @@ export declare function createCommentVNode(text?: string, asBlock?: boolean): VN
|
|
|
992
1303
|
export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
993
1304
|
|
|
994
1305
|
type Data = Record<string, unknown>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Public utility type for extracting the instance type of a component.
|
|
1308
|
+
* Works with all valid component definition types. This is intended to replace
|
|
1309
|
+
* the usage of `InstanceType<typeof Comp>` which only works for
|
|
1310
|
+
* constructor-based component definition types.
|
|
1311
|
+
*
|
|
1312
|
+
* @example
|
|
1313
|
+
* ```ts
|
|
1314
|
+
* const MyComp = { ... }
|
|
1315
|
+
* declare const instance: ComponentInstance<typeof MyComp>
|
|
1316
|
+
* ```
|
|
1317
|
+
*/
|
|
1318
|
+
export type ComponentInstance<T> = T extends {
|
|
1319
|
+
new (): ComponentPublicInstance;
|
|
1320
|
+
} ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer Props, infer RawBindings, infer D, infer C, infer M> ? ComponentPublicInstance<unknown extends Props ? {} : Props, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
|
|
995
1321
|
/**
|
|
996
1322
|
* For extending allowed non-declared props on components in TSX
|
|
997
1323
|
*/
|
|
998
1324
|
export interface ComponentCustomProps {
|
|
999
1325
|
}
|
|
1326
|
+
/**
|
|
1327
|
+
* For globally defined Directives
|
|
1328
|
+
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1329
|
+
*
|
|
1330
|
+
* @example
|
|
1331
|
+
* ```ts
|
|
1332
|
+
* import VTooltip from 'v-tooltip'
|
|
1333
|
+
*
|
|
1334
|
+
* declare module '@vue/runtime-core' {
|
|
1335
|
+
* interface GlobalDirectives {
|
|
1336
|
+
* VTooltip
|
|
1337
|
+
* }
|
|
1338
|
+
* }
|
|
1339
|
+
* ```
|
|
1340
|
+
*/
|
|
1341
|
+
export interface GlobalDirectives {
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* For globally defined Components
|
|
1345
|
+
* Here is an example of adding a component `RouterView` as global component:
|
|
1346
|
+
*
|
|
1347
|
+
* @example
|
|
1348
|
+
* ```ts
|
|
1349
|
+
* import { RouterView } from 'vue-router'
|
|
1350
|
+
*
|
|
1351
|
+
* declare module '@vue/runtime-core' {
|
|
1352
|
+
* interface GlobalComponents {
|
|
1353
|
+
* RouterView
|
|
1354
|
+
* }
|
|
1355
|
+
* }
|
|
1356
|
+
* ```
|
|
1357
|
+
*/
|
|
1358
|
+
export interface GlobalComponents {
|
|
1359
|
+
Teleport: DefineComponent<TeleportProps>;
|
|
1360
|
+
Suspense: DefineComponent<SuspenseProps>;
|
|
1361
|
+
KeepAlive: DefineComponent<KeepAliveProps>;
|
|
1362
|
+
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1363
|
+
}
|
|
1000
1364
|
/**
|
|
1001
1365
|
* Default allowed non-declared props on component in TSX
|
|
1002
1366
|
*/
|
|
@@ -1018,10 +1382,10 @@ interface ComponentInternalOptions {
|
|
|
1018
1382
|
*/
|
|
1019
1383
|
__name?: string;
|
|
1020
1384
|
}
|
|
1021
|
-
export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}, S extends Record<string, any> = any
|
|
1022
|
-
(props: P
|
|
1385
|
+
export interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
1386
|
+
(props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
|
|
1023
1387
|
props?: ComponentPropsOptions<P>;
|
|
1024
|
-
emits?:
|
|
1388
|
+
emits?: EE | (keyof EE)[];
|
|
1025
1389
|
slots?: IfAny<S, Slots, SlotsType<S>>;
|
|
1026
1390
|
inheritAttrs?: boolean;
|
|
1027
1391
|
displayName?: string;
|
|
@@ -1037,18 +1401,18 @@ interface ClassComponent {
|
|
|
1037
1401
|
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1038
1402
|
* implementation code.
|
|
1039
1403
|
*/
|
|
1040
|
-
export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props,
|
|
1404
|
+
export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, E, S>;
|
|
1041
1405
|
/**
|
|
1042
1406
|
* A type used in public APIs where a component type is expected.
|
|
1043
1407
|
* The constructor type is an artificial type returned by defineComponent().
|
|
1044
1408
|
*/
|
|
1045
|
-
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>;
|
|
1409
|
+
export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<Props, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<Props>;
|
|
1046
1410
|
|
|
1047
1411
|
export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1048
1412
|
attrs: Data;
|
|
1049
1413
|
slots: UnwrapSlotsType<S>;
|
|
1050
1414
|
emit: EmitFn<E>;
|
|
1051
|
-
expose:
|
|
1415
|
+
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1052
1416
|
} : never;
|
|
1053
1417
|
/**
|
|
1054
1418
|
* We expose a subset of properties on the internal instance as they are
|
|
@@ -1073,9 +1437,13 @@ export interface ComponentInternalInstance {
|
|
|
1073
1437
|
*/
|
|
1074
1438
|
effect: ReactiveEffect;
|
|
1075
1439
|
/**
|
|
1076
|
-
*
|
|
1440
|
+
* Force update render effect
|
|
1441
|
+
*/
|
|
1442
|
+
update: () => void;
|
|
1443
|
+
/**
|
|
1444
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1077
1445
|
*/
|
|
1078
|
-
|
|
1446
|
+
job: SchedulerJob;
|
|
1079
1447
|
proxy: ComponentPublicInstance | null;
|
|
1080
1448
|
exposed: Record<string, any> | null;
|
|
1081
1449
|
exposeProxy: Record<string, any> | null;
|
|
@@ -1085,8 +1453,6 @@ export interface ComponentInternalInstance {
|
|
|
1085
1453
|
slots: InternalSlots;
|
|
1086
1454
|
refs: Data;
|
|
1087
1455
|
emit: EmitFn;
|
|
1088
|
-
attrsProxy: Data | null;
|
|
1089
|
-
slotsProxy: Slots | null;
|
|
1090
1456
|
isMounted: boolean;
|
|
1091
1457
|
isUnmounted: boolean;
|
|
1092
1458
|
isDeactivated: boolean;
|
|
@@ -1098,49 +1464,45 @@ export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
|
1098
1464
|
*/
|
|
1099
1465
|
export declare function registerRuntimeCompiler(_compile: any): void;
|
|
1100
1466
|
export declare const isRuntimeOnly: () => boolean;
|
|
1467
|
+
export interface ComponentCustomElementInterface {
|
|
1468
|
+
}
|
|
1101
1469
|
|
|
1102
|
-
|
|
1103
|
-
export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
1104
|
-
export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
1470
|
+
type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
|
|
1105
1471
|
type MapSources<T, Immediate> = {
|
|
1106
|
-
[K in keyof T]: T[K] extends WatchSource<infer V> ?
|
|
1472
|
+
[K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never;
|
|
1107
1473
|
};
|
|
1108
|
-
|
|
1109
|
-
export interface WatchOptionsBase extends DebuggerOptions {
|
|
1474
|
+
export interface WatchEffectOptions extends DebuggerOptions {
|
|
1110
1475
|
flush?: 'pre' | 'post' | 'sync';
|
|
1111
1476
|
}
|
|
1112
|
-
export interface WatchOptions<Immediate = boolean> extends
|
|
1477
|
+
export interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
1113
1478
|
immediate?: Immediate;
|
|
1114
|
-
deep?: boolean;
|
|
1479
|
+
deep?: boolean | number;
|
|
1480
|
+
once?: boolean;
|
|
1115
1481
|
}
|
|
1116
|
-
export
|
|
1117
|
-
export declare function
|
|
1118
|
-
export declare function
|
|
1119
|
-
export
|
|
1120
|
-
|
|
1121
|
-
export declare function watch<T extends MultiWatchSources
|
|
1122
|
-
export declare function watch<T extends
|
|
1123
|
-
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source:
|
|
1124
|
-
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;
|
|
1482
|
+
export declare function watchEffect(effect: WatchEffect, options?: WatchEffectOptions): WatchHandle;
|
|
1483
|
+
export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
|
1484
|
+
export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
|
1485
|
+
export type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
1486
|
+
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1487
|
+
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1488
|
+
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>): WatchHandle;
|
|
1489
|
+
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1125
1490
|
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
export declare
|
|
1140
|
-
export declare
|
|
1141
|
-
[key in PropNames]?: any;
|
|
1142
|
-
}>>(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>;
|
|
1143
|
-
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>;
|
|
1491
|
+
/**
|
|
1492
|
+
* A lazy hydration strategy for async components.
|
|
1493
|
+
* @param hydrate - call this to perform the actual hydration.
|
|
1494
|
+
* @param forEachElement - iterate through the root elements of the component's
|
|
1495
|
+
* non-hydrated DOM, accounting for possible fragments.
|
|
1496
|
+
* @returns a teardown function to be called if the async component is unmounted
|
|
1497
|
+
* before it is hydrated. This can be used to e.g. remove DOM event
|
|
1498
|
+
* listeners.
|
|
1499
|
+
*/
|
|
1500
|
+
export type HydrationStrategy = (hydrate: () => void, forEachElement: (cb: (el: Element) => any) => void) => (() => void) | void;
|
|
1501
|
+
export type HydrationStrategyFactory<Options> = (options?: Options) => HydrationStrategy;
|
|
1502
|
+
export declare const hydrateOnIdle: HydrationStrategyFactory<number>;
|
|
1503
|
+
export declare const hydrateOnVisible: HydrationStrategyFactory<IntersectionObserverInit>;
|
|
1504
|
+
export declare const hydrateOnMediaQuery: HydrationStrategyFactory<string>;
|
|
1505
|
+
export declare const hydrateOnInteraction: HydrationStrategyFactory<keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>>;
|
|
1144
1506
|
|
|
1145
1507
|
type AsyncComponentResolveResult<T = Component> = T | {
|
|
1146
1508
|
default: T;
|
|
@@ -1153,6 +1515,7 @@ export interface AsyncComponentOptions<T = any> {
|
|
|
1153
1515
|
delay?: number;
|
|
1154
1516
|
timeout?: number;
|
|
1155
1517
|
suspensible?: boolean;
|
|
1518
|
+
hydrate?: HydrationStrategy;
|
|
1156
1519
|
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
|
1157
1520
|
}
|
|
1158
1521
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
@@ -1160,196 +1523,11 @@ export declare function defineAsyncComponent<T extends Component = {
|
|
|
1160
1523
|
new (): ComponentPublicInstance;
|
|
1161
1524
|
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
1162
1525
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
* ```js
|
|
1169
|
-
* // using Array syntax
|
|
1170
|
-
* const props = defineProps(['foo', 'bar'])
|
|
1171
|
-
* // using Object syntax
|
|
1172
|
-
* const props = defineProps({
|
|
1173
|
-
* foo: String,
|
|
1174
|
-
* bar: {
|
|
1175
|
-
* type: Number,
|
|
1176
|
-
* required: true
|
|
1177
|
-
* }
|
|
1178
|
-
* })
|
|
1179
|
-
* ```
|
|
1180
|
-
*
|
|
1181
|
-
* Equivalent type-based declaration:
|
|
1182
|
-
* ```ts
|
|
1183
|
-
* // will be compiled into equivalent runtime declarations
|
|
1184
|
-
* const props = defineProps<{
|
|
1185
|
-
* foo?: string
|
|
1186
|
-
* bar: number
|
|
1187
|
-
* }>()
|
|
1188
|
-
*
|
|
1189
|
-
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
1190
|
-
* ```
|
|
1191
|
-
*
|
|
1192
|
-
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1193
|
-
* output and should **not** be actually called at runtime.
|
|
1194
|
-
*/
|
|
1195
|
-
export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
|
|
1196
|
-
[key in PropNames]?: any;
|
|
1197
|
-
}>>;
|
|
1198
|
-
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
1199
|
-
export declare function defineProps<TypeProps>(): DefineProps<TypeProps, BooleanKey<TypeProps>>;
|
|
1200
|
-
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
1201
|
-
readonly [K in BKeys]-?: boolean;
|
|
1202
|
-
};
|
|
1203
|
-
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
1204
|
-
/**
|
|
1205
|
-
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
1206
|
-
* events. The expected argument is the same as the component `emits` option.
|
|
1207
|
-
*
|
|
1208
|
-
* Example runtime declaration:
|
|
1209
|
-
* ```js
|
|
1210
|
-
* const emit = defineEmits(['change', 'update'])
|
|
1211
|
-
* ```
|
|
1212
|
-
*
|
|
1213
|
-
* Example type-based declaration:
|
|
1214
|
-
* ```ts
|
|
1215
|
-
* const emit = defineEmits<{
|
|
1216
|
-
* (event: 'change'): void
|
|
1217
|
-
* (event: 'update', id: number): void
|
|
1218
|
-
* }>()
|
|
1219
|
-
*
|
|
1220
|
-
* emit('change')
|
|
1221
|
-
* emit('update', 1)
|
|
1222
|
-
* ```
|
|
1223
|
-
*
|
|
1224
|
-
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1225
|
-
* output and should **not** be actually called at runtime.
|
|
1226
|
-
*
|
|
1227
|
-
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
1228
|
-
*/
|
|
1229
|
-
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
1230
|
-
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
1231
|
-
export declare function defineEmits<T extends ((...args: any[]) => any) | Record<string, any[]>>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
|
1232
|
-
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
1233
|
-
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
|
1234
|
-
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
1235
|
-
}>>;
|
|
1236
|
-
/**
|
|
1237
|
-
* Vue `<script setup>` compiler macro for declaring a component's exposed
|
|
1238
|
-
* instance properties when it is accessed by a parent component via template
|
|
1239
|
-
* refs.
|
|
1240
|
-
*
|
|
1241
|
-
* `<script setup>` components are closed by default - i.e. variables inside
|
|
1242
|
-
* the `<script setup>` scope is not exposed to parent unless explicitly exposed
|
|
1243
|
-
* via `defineExpose`.
|
|
1244
|
-
*
|
|
1245
|
-
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1246
|
-
* output and should **not** be actually called at runtime.
|
|
1247
|
-
*
|
|
1248
|
-
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
|
|
1249
|
-
*/
|
|
1250
|
-
export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
1251
|
-
/**
|
|
1252
|
-
* Vue `<script setup>` compiler macro for declaring a component's additional
|
|
1253
|
-
* options. This should be used only for options that cannot be expressed via
|
|
1254
|
-
* Composition API - e.g. `inheritAttrs`.
|
|
1255
|
-
*
|
|
1256
|
-
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
1257
|
-
*/
|
|
1258
|
-
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> & {
|
|
1259
|
-
emits?: undefined;
|
|
1260
|
-
expose?: undefined;
|
|
1261
|
-
slots?: undefined;
|
|
1262
|
-
}): void;
|
|
1263
|
-
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
1264
|
-
/**
|
|
1265
|
-
* (**Experimental**) Vue `<script setup>` compiler macro for declaring a
|
|
1266
|
-
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
1267
|
-
* component. This will declare a prop with the same name and a corresponding
|
|
1268
|
-
* `update:propName` event.
|
|
1269
|
-
*
|
|
1270
|
-
* If the first argument is a string, it will be used as the prop name;
|
|
1271
|
-
* Otherwise the prop name will default to "modelValue". In both cases, you
|
|
1272
|
-
* can also pass an additional object which will be used as the prop's options.
|
|
1273
|
-
*
|
|
1274
|
-
* The options object can also specify an additional option, `local`. When set
|
|
1275
|
-
* to `true`, the ref can be locally mutated even if the parent did not pass
|
|
1276
|
-
* the matching `v-model`.
|
|
1277
|
-
*
|
|
1278
|
-
* @example
|
|
1279
|
-
* ```ts
|
|
1280
|
-
* // default model (consumed via `v-model`)
|
|
1281
|
-
* const modelValue = defineModel<string>()
|
|
1282
|
-
* modelValue.value = "hello"
|
|
1283
|
-
*
|
|
1284
|
-
* // default model with options
|
|
1285
|
-
* const modelValue = defineModel<string>({ required: true })
|
|
1286
|
-
*
|
|
1287
|
-
* // with specified name (consumed via `v-model:count`)
|
|
1288
|
-
* const count = defineModel<number>('count')
|
|
1289
|
-
* count.value++
|
|
1290
|
-
*
|
|
1291
|
-
* // with specified name and default value
|
|
1292
|
-
* const count = defineModel<number>('count', { default: 0 })
|
|
1293
|
-
*
|
|
1294
|
-
* // local mutable model, can be mutated locally
|
|
1295
|
-
* // even if the parent did not pass the matching `v-model`.
|
|
1296
|
-
* const count = defineModel<number>('count', { local: true, default: 0 })
|
|
1297
|
-
* ```
|
|
1298
|
-
*/
|
|
1299
|
-
export declare function defineModel<T>(options: {
|
|
1300
|
-
required: true;
|
|
1301
|
-
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1302
|
-
export declare function defineModel<T>(options: {
|
|
1303
|
-
default: any;
|
|
1304
|
-
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1305
|
-
export declare function defineModel<T>(options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
|
|
1306
|
-
export declare function defineModel<T>(name: string, options: {
|
|
1307
|
-
required: true;
|
|
1308
|
-
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1309
|
-
export declare function defineModel<T>(name: string, options: {
|
|
1310
|
-
default: any;
|
|
1311
|
-
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1312
|
-
export declare function defineModel<T>(name: string, options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
|
|
1313
|
-
interface DefineModelOptions {
|
|
1314
|
-
local?: boolean;
|
|
1315
|
-
}
|
|
1316
|
-
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1317
|
-
type InferDefaults<T> = {
|
|
1318
|
-
[K in keyof T]?: InferDefault<T, T[K]>;
|
|
1319
|
-
};
|
|
1320
|
-
type NativeType = null | number | string | boolean | symbol | Function;
|
|
1321
|
-
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
1322
|
-
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Omit<T, keyof Defaults> & {
|
|
1323
|
-
[K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
|
|
1324
|
-
} & {
|
|
1325
|
-
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
1326
|
-
};
|
|
1327
|
-
/**
|
|
1328
|
-
* Vue `<script setup>` compiler macro for providing props default values when
|
|
1329
|
-
* using type-based `defineProps` declaration.
|
|
1330
|
-
*
|
|
1331
|
-
* Example usage:
|
|
1332
|
-
* ```ts
|
|
1333
|
-
* withDefaults(defineProps<{
|
|
1334
|
-
* size?: number
|
|
1335
|
-
* labels?: string[]
|
|
1336
|
-
* }>(), {
|
|
1337
|
-
* size: 3,
|
|
1338
|
-
* labels: () => ['default label']
|
|
1339
|
-
* })
|
|
1340
|
-
* ```
|
|
1341
|
-
*
|
|
1342
|
-
* This is only usable inside `<script setup>`, is compiled away in the output
|
|
1343
|
-
* and should **not** be actually called at runtime.
|
|
1344
|
-
*
|
|
1345
|
-
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
|
1346
|
-
*/
|
|
1347
|
-
export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
1348
|
-
export declare function useSlots(): SetupContext['slots'];
|
|
1349
|
-
export declare function useAttrs(): SetupContext['attrs'];
|
|
1350
|
-
export declare function useModel<T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: {
|
|
1351
|
-
local?: boolean;
|
|
1352
|
-
}): Ref<T[K]>;
|
|
1526
|
+
export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T, G = T[K], S = T[K]>(props: T, name: K, options?: DefineModelOptions<T[K], G, S>): ModelRef<T[K], M, G, S>;
|
|
1527
|
+
|
|
1528
|
+
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
|
1529
|
+
|
|
1530
|
+
export declare function useId(): string;
|
|
1353
1531
|
|
|
1354
1532
|
type RawProps = VNodeProps & {
|
|
1355
1533
|
__v_isVNode?: never;
|
|
@@ -1364,6 +1542,11 @@ interface Constructor<P = any> {
|
|
|
1364
1542
|
$props: P;
|
|
1365
1543
|
};
|
|
1366
1544
|
}
|
|
1545
|
+
type HTMLElementEventHandler = {
|
|
1546
|
+
[K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any;
|
|
1547
|
+
};
|
|
1548
|
+
export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, children?: RawChildren): VNode;
|
|
1549
|
+
export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, props?: (RawProps & HTMLElementEventHandler) | null, children?: RawChildren | RawSlots): VNode;
|
|
1367
1550
|
export declare function h(type: string, children?: RawChildren): VNode;
|
|
1368
1551
|
export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
|
|
1369
1552
|
export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
|
|
@@ -1373,7 +1556,7 @@ export declare function h(type: typeof Fragment, props?: RawProps | null, childr
|
|
|
1373
1556
|
export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
|
|
1374
1557
|
export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
|
|
1375
1558
|
export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
|
|
1376
|
-
export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> =
|
|
1559
|
+
export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, any, S, any>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): VNode;
|
|
1377
1560
|
export declare function h(type: Component, children?: RawChildren): VNode;
|
|
1378
1561
|
export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
|
|
1379
1562
|
export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
|
|
@@ -1389,14 +1572,11 @@ export declare function h<P>(type: string | Component<P>, props?: (RawProps & P)
|
|
|
1389
1572
|
export declare const ssrContextKey: unique symbol;
|
|
1390
1573
|
export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
1391
1574
|
|
|
1392
|
-
|
|
1575
|
+
declare function warn$1(msg: string, ...args: any[]): void;
|
|
1393
1576
|
|
|
1394
|
-
export declare
|
|
1577
|
+
export declare enum ErrorCodes {
|
|
1395
1578
|
SETUP_FUNCTION = 0,
|
|
1396
1579
|
RENDER_FUNCTION = 1,
|
|
1397
|
-
WATCH_GETTER = 2,
|
|
1398
|
-
WATCH_CALLBACK = 3,
|
|
1399
|
-
WATCH_CLEANUP = 4,
|
|
1400
1580
|
NATIVE_EVENT_HANDLER = 5,
|
|
1401
1581
|
COMPONENT_EVENT_HANDLER = 6,
|
|
1402
1582
|
VNODE_HOOK = 7,
|
|
@@ -1406,12 +1586,14 @@ export declare const enum ErrorCodes {
|
|
|
1406
1586
|
APP_WARN_HANDLER = 11,
|
|
1407
1587
|
FUNCTION_REF = 12,
|
|
1408
1588
|
ASYNC_COMPONENT_LOADER = 13,
|
|
1409
|
-
SCHEDULER = 14
|
|
1589
|
+
SCHEDULER = 14,
|
|
1590
|
+
COMPONENT_UPDATE = 15,
|
|
1591
|
+
APP_UNMOUNT_CLEANUP = 16
|
|
1410
1592
|
}
|
|
1411
|
-
type ErrorTypes = LifecycleHooks | ErrorCodes;
|
|
1412
|
-
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1413
|
-
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any
|
|
1414
|
-
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1593
|
+
type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes;
|
|
1594
|
+
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[]): any;
|
|
1595
|
+
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1596
|
+
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1415
1597
|
|
|
1416
1598
|
export declare function initCustomFormatter(): void;
|
|
1417
1599
|
|
|
@@ -1434,8 +1616,7 @@ interface DevtoolsHook {
|
|
|
1434
1616
|
*/
|
|
1435
1617
|
cleanupBuffer?: (matchArg: unknown) => boolean;
|
|
1436
1618
|
}
|
|
1437
|
-
|
|
1438
|
-
export declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
|
|
1619
|
+
declare function setDevtoolsHook$1(hook: DevtoolsHook, target: any): void;
|
|
1439
1620
|
|
|
1440
1621
|
type HMRComponent = ComponentOptions | ClassComponent;
|
|
1441
1622
|
export interface HMRRuntime {
|
|
@@ -1489,7 +1670,7 @@ export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T
|
|
|
1489
1670
|
/**
|
|
1490
1671
|
* v-for object
|
|
1491
1672
|
*/
|
|
1492
|
-
export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key:
|
|
1673
|
+
export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: string, index: number) => VNodeChild): VNodeChild[];
|
|
1493
1674
|
|
|
1494
1675
|
/**
|
|
1495
1676
|
* For prefixing keys in v-on="obj" with "on"
|
|
@@ -1515,9 +1696,7 @@ interface CompiledSlotDescriptor {
|
|
|
1515
1696
|
*/
|
|
1516
1697
|
export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1517
1698
|
|
|
1518
|
-
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any
|
|
1519
|
-
[key: string]: any;
|
|
1520
|
-
}>;
|
|
1699
|
+
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any>;
|
|
1521
1700
|
export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1522
1701
|
|
|
1523
1702
|
export type LegacyConfig = {
|
|
@@ -1549,8 +1728,8 @@ export type LegacyConfig = {
|
|
|
1549
1728
|
|
|
1550
1729
|
type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
|
|
1551
1730
|
interface LegacyPublicProperties {
|
|
1552
|
-
$set(target:
|
|
1553
|
-
$delete(target:
|
|
1731
|
+
$set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void;
|
|
1732
|
+
$delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void;
|
|
1554
1733
|
$mount(el?: string | Element): this;
|
|
1555
1734
|
$destroy(): void;
|
|
1556
1735
|
$scopedSlots: Slots;
|
|
@@ -1572,12 +1751,13 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
|
|
1572
1751
|
version: string;
|
|
1573
1752
|
config: AppConfig & LegacyConfig;
|
|
1574
1753
|
nextTick: typeof nextTick;
|
|
1575
|
-
use(plugin: Plugin
|
|
1754
|
+
use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): CompatVue;
|
|
1755
|
+
use<Options>(plugin: Plugin<Options>, options: Options): CompatVue;
|
|
1576
1756
|
mixin(mixin: ComponentOptions): CompatVue;
|
|
1577
1757
|
component(name: string): Component | undefined;
|
|
1578
1758
|
component(name: string, component: Component): CompatVue;
|
|
1579
|
-
directive(name: string): Directive | undefined;
|
|
1580
|
-
directive(name: string, directive: Directive): CompatVue;
|
|
1759
|
+
directive<T = any, V = any>(name: string): Directive<T, V> | undefined;
|
|
1760
|
+
directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
|
1581
1761
|
compile(template: string): RenderFunction;
|
|
1582
1762
|
/**
|
|
1583
1763
|
* @deprecated Vue 3 no longer supports extending constructors.
|
|
@@ -1586,11 +1766,11 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
|
|
1586
1766
|
/**
|
|
1587
1767
|
* @deprecated Vue 3 no longer needs set() for adding new properties.
|
|
1588
1768
|
*/
|
|
1589
|
-
set(target: any, key:
|
|
1769
|
+
set(target: any, key: PropertyKey, value: any): void;
|
|
1590
1770
|
/**
|
|
1591
1771
|
* @deprecated Vue 3 no longer needs delete() for property deletions.
|
|
1592
1772
|
*/
|
|
1593
|
-
delete(target: any, key:
|
|
1773
|
+
delete(target: any, key: PropertyKey): void;
|
|
1594
1774
|
/**
|
|
1595
1775
|
* @deprecated use `reactive` instead.
|
|
1596
1776
|
*/
|
|
@@ -1603,6 +1783,11 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
|
|
1603
1783
|
|
|
1604
1784
|
export declare const version: string;
|
|
1605
1785
|
|
|
1786
|
+
export declare const warn: typeof warn$1;
|
|
1787
|
+
|
|
1788
|
+
export declare const devtools: DevtoolsHook;
|
|
1789
|
+
export declare const setDevtoolsHook: typeof setDevtoolsHook$1;
|
|
1790
|
+
|
|
1606
1791
|
declare module '@vue/reactivity' {
|
|
1607
1792
|
interface RefUnwrapBailTypes {
|
|
1608
1793
|
runtimeCoreBailTypes: VNode | {
|
|
@@ -1611,7 +1796,21 @@ declare module '@vue/reactivity' {
|
|
|
1611
1796
|
}
|
|
1612
1797
|
}
|
|
1613
1798
|
|
|
1614
|
-
export
|
|
1799
|
+
export declare const DeprecationTypes: typeof DeprecationTypes$1;
|
|
1800
|
+
|
|
1801
|
+
export { type WatchEffectOptions as WatchOptionsBase, createBaseVNode as createElementVNode, };
|
|
1802
|
+
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1803
|
+
// build.
|
|
1804
|
+
|
|
1805
|
+
declare module '@vue/runtime-core' {
|
|
1806
|
+
export interface GlobalComponents {
|
|
1807
|
+
Teleport: DefineComponent<TeleportProps>
|
|
1808
|
+
Suspense: DefineComponent<SuspenseProps>
|
|
1809
|
+
KeepAlive: DefineComponent<KeepAliveProps>
|
|
1810
|
+
BaseTransition: DefineComponent<BaseTransitionProps>
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1615
1814
|
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1616
1815
|
// build.
|
|
1617
1816
|
type _defineProps = typeof defineProps
|