@vue/runtime-core 3.3.2 → 3.3.4
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
CHANGED
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1297,9 +1297,9 @@ export declare function defineProps<PropNames extends string = string>(props: Pr
|
|
|
1297
1297
|
[key in PropNames]?: any;
|
|
1298
1298
|
}>>;
|
|
1299
1299
|
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
1300
|
-
export declare function defineProps<TypeProps>(): DefineProps<TypeProps
|
|
1301
|
-
type DefineProps<T> = Readonly<T> & {
|
|
1302
|
-
readonly [K in
|
|
1300
|
+
export declare function defineProps<TypeProps>(): DefineProps<TypeProps, BooleanKey<TypeProps>>;
|
|
1301
|
+
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
1302
|
+
readonly [K in BKeys]-?: boolean;
|
|
1303
1303
|
};
|
|
1304
1304
|
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
1305
1305
|
/**
|
|
@@ -1416,11 +1416,14 @@ interface DefineModelOptions {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1418
1418
|
type InferDefaults<T> = {
|
|
1419
|
-
[K in keyof T]?: InferDefault<T,
|
|
1419
|
+
[K in keyof T]?: InferDefault<T, T[K]>;
|
|
1420
1420
|
};
|
|
1421
|
-
type
|
|
1422
|
-
type
|
|
1423
|
-
|
|
1421
|
+
type NativeType = null | number | string | boolean | symbol | Function;
|
|
1422
|
+
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
1423
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Omit<T, keyof Defaults> & {
|
|
1424
|
+
[K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
|
|
1425
|
+
} & {
|
|
1426
|
+
readonly [K in BKeys]-?: boolean;
|
|
1424
1427
|
};
|
|
1425
1428
|
/**
|
|
1426
1429
|
* Vue `<script setup>` compiler macro for providing props default values when
|
|
@@ -1442,7 +1445,7 @@ type PropsWithDefaults<Base, Defaults> = Base & {
|
|
|
1442
1445
|
*
|
|
1443
1446
|
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
|
1444
1447
|
*/
|
|
1445
|
-
export declare function withDefaults<
|
|
1448
|
+
export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
1446
1449
|
export declare function useSlots(): SetupContext['slots'];
|
|
1447
1450
|
export declare function useAttrs(): SetupContext['attrs'];
|
|
1448
1451
|
export declare function useModel<T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: {
|