@vue/reactivity 3.2.20 → 3.2.21
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/reactivity.d.ts +20 -6
- package/package.json +2 -2
package/dist/reactivity.d.ts
CHANGED
|
@@ -208,12 +208,18 @@ export declare interface RefUnwrapBailTypes {
|
|
|
208
208
|
|
|
209
209
|
export declare function resetTracking(): void;
|
|
210
210
|
|
|
211
|
+
export declare type ShallowReactive<T> = T & {
|
|
212
|
+
[ShallowReactiveMarker]?: true;
|
|
213
|
+
};
|
|
214
|
+
|
|
211
215
|
/**
|
|
212
216
|
* Return a shallowly-reactive copy of the original object, where only the root
|
|
213
217
|
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
|
214
218
|
* root level).
|
|
215
219
|
*/
|
|
216
|
-
export declare function shallowReactive<T extends object>(target: T): T
|
|
220
|
+
export declare function shallowReactive<T extends object>(target: T): ShallowReactive<T>;
|
|
221
|
+
|
|
222
|
+
declare const ShallowReactiveMarker: unique symbol;
|
|
217
223
|
|
|
218
224
|
/**
|
|
219
225
|
* Returns a reactive-copy of the original object, where only the root level
|
|
@@ -225,11 +231,17 @@ export declare function shallowReadonly<T extends object>(target: T): Readonly<{
|
|
|
225
231
|
[K in keyof T]: UnwrapNestedRefs<T[K]>;
|
|
226
232
|
}>;
|
|
227
233
|
|
|
228
|
-
|
|
234
|
+
declare type ShallowRef<T = any> = Ref<T> & {
|
|
235
|
+
[ShallowRefMarker]?: true;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export declare function shallowRef<T extends object>(value: T): T extends Ref ? T : ShallowRef<T>;
|
|
239
|
+
|
|
240
|
+
export declare function shallowRef<T>(value: T): ShallowRef<T>;
|
|
229
241
|
|
|
230
|
-
export declare function shallowRef<T>(
|
|
242
|
+
export declare function shallowRef<T = any>(): ShallowRef<T | undefined>;
|
|
231
243
|
|
|
232
|
-
|
|
244
|
+
declare const ShallowRefMarker: unique symbol;
|
|
233
245
|
|
|
234
246
|
export declare type ShallowUnwrapRef<T> = {
|
|
235
247
|
[K in keyof T]: T[K] extends Ref<infer V> ? V : T[K] extends Ref<infer V> | undefined ? unknown extends V ? undefined : V | undefined : T[K];
|
|
@@ -289,11 +301,13 @@ export declare function unref<T>(ref: T | Ref<T>): T;
|
|
|
289
301
|
|
|
290
302
|
export declare type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
|
291
303
|
|
|
292
|
-
export declare type UnwrapRef<T> = T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
304
|
+
export declare type UnwrapRef<T> = T extends ShallowRef<infer V> ? V : T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
293
305
|
|
|
294
306
|
declare type UnwrapRefSimple<T> = T extends Function | CollectionTypes | BaseTypes | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] ? T : T extends Array<any> ? {
|
|
295
307
|
[K in keyof T]: UnwrapRefSimple<T[K]>;
|
|
296
|
-
} : T extends object
|
|
308
|
+
} : T extends object & {
|
|
309
|
+
[ShallowReactiveMarker]?: never;
|
|
310
|
+
} ? {
|
|
297
311
|
[P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>;
|
|
298
312
|
} : T;
|
|
299
313
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/reactivity",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.21",
|
|
4
4
|
"description": "@vue/reactivity",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/reactivity.esm-bundler.js",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/reactivity#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@vue/shared": "3.2.
|
|
39
|
+
"@vue/shared": "3.2.21"
|
|
40
40
|
}
|
|
41
41
|
}
|