@vue/runtime-core 3.6.0-beta.7 → 3.6.0-beta.9
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 +106 -110
- package/dist/runtime-core.cjs.prod.js +80 -103
- package/dist/runtime-core.d.ts +33 -3
- package/dist/runtime-core.esm-bundler.js +102 -101
- package/package.json +3 -3
package/dist/runtime-core.d.ts
CHANGED
|
@@ -259,6 +259,22 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
|
|
|
259
259
|
*/
|
|
260
260
|
slots?: never;
|
|
261
261
|
}): void;
|
|
262
|
+
/**
|
|
263
|
+
* Vue `<script setup>` compiler macro for providing type hints to IDEs for
|
|
264
|
+
* slot name and slot props type checking.
|
|
265
|
+
*
|
|
266
|
+
* Example usage:
|
|
267
|
+
* ```ts
|
|
268
|
+
* const slots = defineSlots<{
|
|
269
|
+
* default(props: { msg: string }): any
|
|
270
|
+
* }>()
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
274
|
+
* output and should **not** be actually called at runtime.
|
|
275
|
+
*
|
|
276
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
|
|
277
|
+
*/
|
|
262
278
|
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
263
279
|
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref$1<G, S> & [ModelRef<T, M, G, S>, Record<M, true | undefined>];
|
|
264
280
|
type DefineModelOptions<T = any, G = T, S = T> = {
|
|
@@ -440,7 +456,7 @@ export type ComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOp
|
|
|
440
456
|
$: ComponentInternalInstance;
|
|
441
457
|
$data: D;
|
|
442
458
|
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
443
|
-
$attrs:
|
|
459
|
+
$attrs: Attrs;
|
|
444
460
|
$refs: Data & TypeRefs;
|
|
445
461
|
$slots: UnwrapSlotsType<S>;
|
|
446
462
|
$root: ComponentPublicInstance | null;
|
|
@@ -481,6 +497,10 @@ export interface SuspenseProps {
|
|
|
481
497
|
onResolve?: () => void;
|
|
482
498
|
onPending?: () => void;
|
|
483
499
|
onFallback?: () => void;
|
|
500
|
+
/**
|
|
501
|
+
* Switch to fallback content if it takes longer than `timeout` milliseconds to render the new default content.
|
|
502
|
+
* A `timeout` value of `0` will cause the fallback content to be displayed immediately when default content is replaced.
|
|
503
|
+
*/
|
|
484
504
|
timeout?: string | number;
|
|
485
505
|
/**
|
|
486
506
|
* Allow suspense to be captured by parent suspense
|
|
@@ -514,6 +534,7 @@ export interface SuspenseBoundary {
|
|
|
514
534
|
container: RendererElement;
|
|
515
535
|
hiddenContainer: RendererElement;
|
|
516
536
|
activeBranch: VNode | null;
|
|
537
|
+
isFallbackMountPending: boolean;
|
|
517
538
|
pendingBranch: VNode | null;
|
|
518
539
|
deps: number;
|
|
519
540
|
pendingId: number;
|
|
@@ -963,7 +984,7 @@ export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C
|
|
|
963
984
|
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>;
|
|
964
985
|
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
965
986
|
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"> & {
|
|
966
|
-
props?: (keyof Props)[];
|
|
987
|
+
props?: (keyof NoInfer<Props>)[];
|
|
967
988
|
emits?: E | EE[];
|
|
968
989
|
slots?: S;
|
|
969
990
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
@@ -1306,6 +1327,11 @@ export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
|
1306
1327
|
//#region temp/packages/runtime-core/src/component.d.ts
|
|
1307
1328
|
type Data = Record<string, unknown>;
|
|
1308
1329
|
/**
|
|
1330
|
+
* For extending allowed non-declared attrs on components in TSX
|
|
1331
|
+
*/
|
|
1332
|
+
export interface AllowedAttrs {}
|
|
1333
|
+
export type Attrs = Data & AllowedAttrs;
|
|
1334
|
+
/**
|
|
1309
1335
|
* Public utility type for extracting the instance type of a component.
|
|
1310
1336
|
* Works with all valid component definition types. This is intended to replace
|
|
1311
1337
|
* the usage of `InstanceType<typeof Comp>` which only works for
|
|
@@ -1376,6 +1402,10 @@ export interface ComponentInternalOptions {
|
|
|
1376
1402
|
*/
|
|
1377
1403
|
__vapor?: boolean;
|
|
1378
1404
|
/**
|
|
1405
|
+
* whether this vapor component has multiple root nodes
|
|
1406
|
+
*/
|
|
1407
|
+
__multiRoot?: boolean;
|
|
1408
|
+
/**
|
|
1379
1409
|
* indicates keep-alive component
|
|
1380
1410
|
*/
|
|
1381
1411
|
__isKeepAlive?: boolean;
|
|
@@ -1428,7 +1458,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
|
|
|
1428
1458
|
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>;
|
|
1429
1459
|
export type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1430
1460
|
export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1431
|
-
attrs:
|
|
1461
|
+
attrs: Attrs;
|
|
1432
1462
|
slots: UnwrapSlotsType<S>;
|
|
1433
1463
|
emit: EmitFn<E>;
|
|
1434
1464
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|