@vue/runtime-core 3.5.16 → 3.6.0-alpha.1
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/runtime-core.cjs.js +874 -584
- package/dist/runtime-core.cjs.prod.js +703 -437
- package/dist/runtime-core.d.ts +121 -55
- package/dist/runtime-core.esm-bundler.js +892 -588
- package/package.json +3 -3
package/dist/runtime-core.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ type RawSlots = {
|
|
|
25
25
|
|
|
26
26
|
declare enum SchedulerJobFlags {
|
|
27
27
|
QUEUED = 1,
|
|
28
|
-
PRE = 2,
|
|
29
28
|
/**
|
|
30
29
|
* Indicates whether the effect is allowed to recursively trigger itself
|
|
31
30
|
* when managed by the scheduler.
|
|
@@ -41,11 +40,11 @@ declare enum SchedulerJobFlags {
|
|
|
41
40
|
* responsibility to perform recursive state mutation that eventually
|
|
42
41
|
* stabilizes (#1727).
|
|
43
42
|
*/
|
|
44
|
-
ALLOW_RECURSE =
|
|
45
|
-
DISPOSED =
|
|
43
|
+
ALLOW_RECURSE = 2,
|
|
44
|
+
DISPOSED = 4
|
|
46
45
|
}
|
|
47
46
|
interface SchedulerJob extends Function {
|
|
48
|
-
|
|
47
|
+
order?: number;
|
|
49
48
|
/**
|
|
50
49
|
* flags can technically be undefined, but it can still be used in bitwise
|
|
51
50
|
* operations just like 0.
|
|
@@ -55,11 +54,11 @@ interface SchedulerJob extends Function {
|
|
|
55
54
|
* Attached by renderer.ts when setting up a component's render effect
|
|
56
55
|
* Used to obtain component information when reporting max recursive updates.
|
|
57
56
|
*/
|
|
58
|
-
i?:
|
|
57
|
+
i?: GenericComponentInstance;
|
|
59
58
|
}
|
|
60
59
|
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
61
60
|
export declare function nextTick<T = void, R = void>(this: T, fn?: (this: T) => R): Promise<Awaited<R>>;
|
|
62
|
-
export declare function queuePostFlushCb(
|
|
61
|
+
export declare function queuePostFlushCb(jobs: SchedulerJobs, id?: number): void;
|
|
63
62
|
|
|
64
63
|
export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
65
64
|
export type ComponentObjectPropsOptions<P = Data> = {
|
|
@@ -151,9 +150,23 @@ export type ExtractPublicPropTypes<O> = {
|
|
|
151
150
|
} & {
|
|
152
151
|
[K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>;
|
|
153
152
|
};
|
|
153
|
+
declare enum BooleanFlags {
|
|
154
|
+
shouldCast = 0,
|
|
155
|
+
shouldCastTrue = 1
|
|
156
|
+
}
|
|
154
157
|
export type ExtractDefaultPropTypes<O> = O extends object ? {
|
|
155
158
|
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
|
156
159
|
} : {};
|
|
160
|
+
type NormalizedProp = PropOptions & {
|
|
161
|
+
[BooleanFlags.shouldCast]?: boolean;
|
|
162
|
+
[BooleanFlags.shouldCastTrue]?: boolean;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* normalized value is a tuple of the actual normalized options
|
|
166
|
+
* and an array of prop keys that need value casting (booleans and defaults)
|
|
167
|
+
*/
|
|
168
|
+
type NormalizedProps = Record<string, NormalizedProp>;
|
|
169
|
+
export type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
|
|
157
170
|
|
|
158
171
|
/**
|
|
159
172
|
* Vue `<script setup>` compiler macro for declaring component props. The
|
|
@@ -419,7 +432,7 @@ export interface ObjectDirective<HostElement = any, Value = any, Modifiers exten
|
|
|
419
432
|
}
|
|
420
433
|
export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
|
421
434
|
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>;
|
|
422
|
-
type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>;
|
|
435
|
+
export type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>;
|
|
423
436
|
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>;
|
|
424
437
|
/**
|
|
425
438
|
* Adds directives to a VNode.
|
|
@@ -630,6 +643,7 @@ export declare function getTransitionRawChildren(children: VNode[], keepComment?
|
|
|
630
643
|
export interface Renderer<HostElement = RendererElement> {
|
|
631
644
|
render: RootRenderFunction<HostElement>;
|
|
632
645
|
createApp: CreateAppFunction<HostElement>;
|
|
646
|
+
internals: RendererInternals;
|
|
633
647
|
}
|
|
634
648
|
export interface HydrationRenderer extends Renderer<Element | ShadowRoot> {
|
|
635
649
|
hydrate: RootHydrateFunction;
|
|
@@ -665,6 +679,7 @@ interface RendererInternals<HostNode = RendererNode, HostElement = RendererEleme
|
|
|
665
679
|
r: RemoveFn;
|
|
666
680
|
m: MoveFn;
|
|
667
681
|
mt: MountComponentFn;
|
|
682
|
+
umt: UnmountComponentFn;
|
|
668
683
|
mc: MountChildrenFn;
|
|
669
684
|
pc: PatchChildrenFn;
|
|
670
685
|
pbc: PatchBlockChildrenFn;
|
|
@@ -676,11 +691,12 @@ n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentCompo
|
|
|
676
691
|
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;
|
|
677
692
|
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;
|
|
678
693
|
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
|
|
679
|
-
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
|
694
|
+
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentComponent: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null) => void;
|
|
680
695
|
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
681
696
|
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
682
697
|
type RemoveFn = (vnode: VNode) => void;
|
|
683
698
|
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
699
|
+
type UnmountComponentFn = (instance: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null, doRemove?: boolean) => void;
|
|
684
700
|
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
685
701
|
declare enum MoveType {
|
|
686
702
|
ENTER = 0,
|
|
@@ -723,7 +739,7 @@ export declare const KeepAlive: {
|
|
|
723
739
|
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
724
740
|
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
725
741
|
|
|
726
|
-
type CreateHook<T = any> = (hook: T, target?:
|
|
742
|
+
type CreateHook<T = any> = (hook: T, target?: GenericComponentInstance | null) => void;
|
|
727
743
|
export declare const onBeforeMount: CreateHook;
|
|
728
744
|
export declare const onMounted: CreateHook;
|
|
729
745
|
export declare const onBeforeUpdate: CreateHook;
|
|
@@ -735,7 +751,7 @@ type DebuggerHook = (e: DebuggerEvent) => void;
|
|
|
735
751
|
export declare const onRenderTriggered: CreateHook<DebuggerHook>;
|
|
736
752
|
export declare const onRenderTracked: CreateHook<DebuggerHook>;
|
|
737
753
|
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
738
|
-
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?:
|
|
754
|
+
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: GenericComponentInstance | null): void;
|
|
739
755
|
|
|
740
756
|
declare enum DeprecationTypes$1 {
|
|
741
757
|
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
@@ -1017,6 +1033,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
|
|
|
1017
1033
|
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>;
|
|
1018
1034
|
|
|
1019
1035
|
export interface App<HostElement = any> {
|
|
1036
|
+
vapor?: boolean;
|
|
1020
1037
|
version: string;
|
|
1021
1038
|
config: AppConfig;
|
|
1022
1039
|
use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: NoInfer<Options>): this;
|
|
@@ -1050,11 +1067,11 @@ export interface App<HostElement = any> {
|
|
|
1050
1067
|
*/
|
|
1051
1068
|
runWithContext<T>(fn: () => T): T;
|
|
1052
1069
|
_uid: number;
|
|
1053
|
-
_component:
|
|
1070
|
+
_component: GenericComponent;
|
|
1054
1071
|
_props: Data | null;
|
|
1055
1072
|
_container: HostElement | null;
|
|
1056
1073
|
_context: AppContext;
|
|
1057
|
-
_instance:
|
|
1074
|
+
_instance: GenericComponentInstance | null;
|
|
1058
1075
|
/**
|
|
1059
1076
|
* v2 compat only
|
|
1060
1077
|
*/
|
|
@@ -1062,27 +1079,13 @@ export interface App<HostElement = any> {
|
|
|
1062
1079
|
filter?(name: string, filter: Function): this;
|
|
1063
1080
|
}
|
|
1064
1081
|
export type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1082
|
+
/**
|
|
1083
|
+
* Shared app config between vdom and vapor
|
|
1084
|
+
*/
|
|
1085
|
+
interface GenericAppConfig {
|
|
1086
|
+
performance?: boolean;
|
|
1070
1087
|
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
1071
1088
|
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
1072
|
-
/**
|
|
1073
|
-
* Options to pass to `@vue/compiler-dom`.
|
|
1074
|
-
* Only supported in runtime compiler build.
|
|
1075
|
-
*/
|
|
1076
|
-
compilerOptions: RuntimeCompilerOptions;
|
|
1077
|
-
/**
|
|
1078
|
-
* @deprecated use config.compilerOptions.isCustomElement
|
|
1079
|
-
*/
|
|
1080
|
-
isCustomElement?: (tag: string) => boolean;
|
|
1081
|
-
/**
|
|
1082
|
-
* TODO document for 3.5
|
|
1083
|
-
* Enable warnings for computed getters that recursively trigger itself.
|
|
1084
|
-
*/
|
|
1085
|
-
warnRecursiveComputed?: boolean;
|
|
1086
1089
|
/**
|
|
1087
1090
|
* Whether to throw unhandled errors in production.
|
|
1088
1091
|
* Default is `false` to avoid crashing on any error (and only logs it)
|
|
@@ -1094,13 +1097,35 @@ export interface AppConfig {
|
|
|
1094
1097
|
*/
|
|
1095
1098
|
idPrefix?: string;
|
|
1096
1099
|
}
|
|
1097
|
-
export interface
|
|
1100
|
+
export interface AppConfig extends GenericAppConfig {
|
|
1101
|
+
readonly isNativeTag: (tag: string) => boolean;
|
|
1102
|
+
optionMergeStrategies: Record<string, OptionMergeFunction>;
|
|
1103
|
+
globalProperties: ComponentCustomProperties & Record<string, any>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Options to pass to `@vue/compiler-dom`.
|
|
1106
|
+
* Only supported in runtime compiler build.
|
|
1107
|
+
*/
|
|
1108
|
+
compilerOptions: RuntimeCompilerOptions;
|
|
1109
|
+
/**
|
|
1110
|
+
* @deprecated use config.compilerOptions.isCustomElement
|
|
1111
|
+
*/
|
|
1112
|
+
isCustomElement?: (tag: string) => boolean;
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Minimal app context shared between vdom and vapor
|
|
1116
|
+
*/
|
|
1117
|
+
export interface GenericAppContext {
|
|
1098
1118
|
app: App;
|
|
1119
|
+
config: GenericAppConfig;
|
|
1120
|
+
provides: Record<string | symbol, any>;
|
|
1121
|
+
components?: Record<string, Component>;
|
|
1122
|
+
directives?: Record<string, Directive>;
|
|
1123
|
+
}
|
|
1124
|
+
export interface AppContext extends GenericAppContext {
|
|
1099
1125
|
config: AppConfig;
|
|
1100
|
-
mixins: ComponentOptions[];
|
|
1101
1126
|
components: Record<string, Component>;
|
|
1102
1127
|
directives: Record<string, Directive>;
|
|
1103
|
-
|
|
1128
|
+
mixins: ComponentOptions[];
|
|
1104
1129
|
}
|
|
1105
1130
|
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
1106
1131
|
export type ObjectPlugin<Options = any[]> = {
|
|
@@ -1108,7 +1133,7 @@ export type ObjectPlugin<Options = any[]> = {
|
|
|
1108
1133
|
};
|
|
1109
1134
|
export type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
1110
1135
|
export type Plugin<Options = any[], P extends unknown[] = Options extends unknown[] ? Options : [Options]> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
1111
|
-
export type CreateAppFunction<HostElement> = (rootComponent:
|
|
1136
|
+
export type CreateAppFunction<HostElement, Comp = Component> = (rootComponent: Comp, rootProps?: Data | null) => App<HostElement>;
|
|
1112
1137
|
|
|
1113
1138
|
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
1114
1139
|
export interface TeleportProps {
|
|
@@ -1129,7 +1154,7 @@ declare enum TeleportMoveTypes {
|
|
|
1129
1154
|
TOGGLE = 1,// enable / disable
|
|
1130
1155
|
REORDER = 2
|
|
1131
1156
|
}
|
|
1132
|
-
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
1157
|
+
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, parentComponent: ComponentInternalInstance | null, moveType?: TeleportMoveTypes): void;
|
|
1133
1158
|
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;
|
|
1134
1159
|
export declare const Teleport: {
|
|
1135
1160
|
__isTeleport: true;
|
|
@@ -1164,7 +1189,8 @@ export declare const Fragment: {
|
|
|
1164
1189
|
export declare const Text: unique symbol;
|
|
1165
1190
|
export declare const Comment: unique symbol;
|
|
1166
1191
|
export declare const Static: unique symbol;
|
|
1167
|
-
|
|
1192
|
+
declare const VaporSlot: unique symbol;
|
|
1193
|
+
export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl | typeof VaporSlot;
|
|
1168
1194
|
export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
1169
1195
|
type VNodeNormalizedRefAtom = {
|
|
1170
1196
|
/**
|
|
@@ -1304,6 +1330,8 @@ export declare function createStaticVNode(content: string, numberOfNodes: number
|
|
|
1304
1330
|
export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
|
1305
1331
|
export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
1306
1332
|
|
|
1333
|
+
export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1334
|
+
|
|
1307
1335
|
type Data = Record<string, unknown>;
|
|
1308
1336
|
/**
|
|
1309
1337
|
* Public utility type for extracting the instance type of a component.
|
|
@@ -1372,7 +1400,11 @@ export interface AllowedComponentProps {
|
|
|
1372
1400
|
class?: unknown;
|
|
1373
1401
|
style?: unknown;
|
|
1374
1402
|
}
|
|
1375
|
-
interface ComponentInternalOptions {
|
|
1403
|
+
export interface ComponentInternalOptions {
|
|
1404
|
+
/**
|
|
1405
|
+
* indicates vapor component
|
|
1406
|
+
*/
|
|
1407
|
+
__vapor?: boolean;
|
|
1376
1408
|
/**
|
|
1377
1409
|
* Compat build only, for bailing out of certain compatibility behavior
|
|
1378
1410
|
*/
|
|
@@ -1399,6 +1431,14 @@ interface ClassComponent {
|
|
|
1399
1431
|
new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
|
|
1400
1432
|
__vccOpts: ComponentOptions;
|
|
1401
1433
|
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Type used where a function accepts both vdom and vapor components.
|
|
1436
|
+
*/
|
|
1437
|
+
type GenericComponent = ({
|
|
1438
|
+
name?: string;
|
|
1439
|
+
} | ((() => any) & {
|
|
1440
|
+
displayName?: string;
|
|
1441
|
+
})) & ComponentInternalOptions;
|
|
1402
1442
|
/**
|
|
1403
1443
|
* Concrete component type matches its actual value: it's either an options
|
|
1404
1444
|
* object, or a function. Use this where the code expects to work with actual
|
|
@@ -1412,21 +1452,55 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
|
|
|
1412
1452
|
*/
|
|
1413
1453
|
export type Component<PropsOrInstance = 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<PropsOrInstance, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<PropsOrInstance>;
|
|
1414
1454
|
|
|
1455
|
+
export type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1415
1456
|
export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1416
1457
|
attrs: Data;
|
|
1417
1458
|
slots: UnwrapSlotsType<S>;
|
|
1418
1459
|
emit: EmitFn<E>;
|
|
1419
1460
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1420
1461
|
} : never;
|
|
1462
|
+
/**
|
|
1463
|
+
* Base component instance interface that is shared between vdom mode and vapor
|
|
1464
|
+
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1465
|
+
* operate on both.
|
|
1466
|
+
*/
|
|
1467
|
+
export interface GenericComponentInstance {
|
|
1468
|
+
vapor?: boolean;
|
|
1469
|
+
uid: number;
|
|
1470
|
+
type: GenericComponent;
|
|
1471
|
+
root: GenericComponentInstance | null;
|
|
1472
|
+
parent: GenericComponentInstance | null;
|
|
1473
|
+
appContext: GenericAppContext;
|
|
1474
|
+
/**
|
|
1475
|
+
* render function will have different types between vdom and vapor
|
|
1476
|
+
*/
|
|
1477
|
+
render?: Function | null;
|
|
1478
|
+
props: Data;
|
|
1479
|
+
attrs: Data;
|
|
1480
|
+
refs: Data;
|
|
1481
|
+
emit: EmitFn;
|
|
1482
|
+
exposed: Record<string, any> | null;
|
|
1483
|
+
exposeProxy: Record<string, any> | null;
|
|
1484
|
+
isMounted: boolean;
|
|
1485
|
+
isUnmounted: boolean;
|
|
1486
|
+
isDeactivated: boolean;
|
|
1487
|
+
/**
|
|
1488
|
+
* Public instance proxy, vdom only
|
|
1489
|
+
*/
|
|
1490
|
+
proxy?: any;
|
|
1491
|
+
vnode?: VNode;
|
|
1492
|
+
subTree?: VNode;
|
|
1493
|
+
}
|
|
1421
1494
|
/**
|
|
1422
1495
|
* We expose a subset of properties on the internal instance as they are
|
|
1423
1496
|
* useful for advanced external libraries and tools.
|
|
1424
1497
|
*/
|
|
1425
|
-
export interface ComponentInternalInstance {
|
|
1498
|
+
export interface ComponentInternalInstance extends GenericComponentInstance {
|
|
1499
|
+
vapor?: never;
|
|
1426
1500
|
uid: number;
|
|
1427
1501
|
type: ConcreteComponent;
|
|
1428
|
-
parent:
|
|
1429
|
-
root:
|
|
1502
|
+
parent: GenericComponentInstance | null;
|
|
1503
|
+
root: GenericComponentInstance;
|
|
1430
1504
|
appContext: AppContext;
|
|
1431
1505
|
/**
|
|
1432
1506
|
* Vnode representing this component in its parent's vdom tree
|
|
@@ -1449,19 +1523,11 @@ export interface ComponentInternalInstance {
|
|
|
1449
1523
|
*/
|
|
1450
1524
|
job: SchedulerJob;
|
|
1451
1525
|
proxy: ComponentPublicInstance | null;
|
|
1452
|
-
exposed: Record<string, any> | null;
|
|
1453
|
-
exposeProxy: Record<string, any> | null;
|
|
1454
1526
|
data: Data;
|
|
1455
|
-
props: Data;
|
|
1456
|
-
attrs: Data;
|
|
1457
|
-
slots: InternalSlots;
|
|
1458
|
-
refs: Data;
|
|
1459
1527
|
emit: EmitFn;
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
isDeactivated: boolean;
|
|
1528
|
+
slots: InternalSlots;
|
|
1529
|
+
exposeProxy: Record<string, any> | null;
|
|
1463
1530
|
}
|
|
1464
|
-
export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1465
1531
|
/**
|
|
1466
1532
|
* For runtime-dom to register the compiler.
|
|
1467
1533
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
@@ -1530,7 +1596,7 @@ export declare function defineAsyncComponent<T extends Component = {
|
|
|
1530
1596
|
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>;
|
|
1531
1597
|
|
|
1532
1598
|
export type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
|
|
1533
|
-
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys):
|
|
1599
|
+
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
|
1534
1600
|
|
|
1535
1601
|
export declare function useId(): string;
|
|
1536
1602
|
|
|
@@ -1596,9 +1662,9 @@ export declare enum ErrorCodes {
|
|
|
1596
1662
|
APP_UNMOUNT_CLEANUP = 16
|
|
1597
1663
|
}
|
|
1598
1664
|
type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes;
|
|
1599
|
-
export declare function callWithErrorHandling(fn: Function, instance:
|
|
1600
|
-
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance:
|
|
1601
|
-
export declare function handleError(err: unknown, instance:
|
|
1665
|
+
export declare function callWithErrorHandling(fn: Function, instance: GenericComponentInstance | null | undefined, type: ErrorTypes, args?: unknown[]): any;
|
|
1666
|
+
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: GenericComponentInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1667
|
+
export declare function handleError(err: unknown, instance: GenericComponentInstance | null | undefined, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1602
1668
|
|
|
1603
1669
|
export declare function initCustomFormatter(): void;
|
|
1604
1670
|
|