@vue/reactivity 3.2.18 → 3.2.22
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 +26 -12
- package/package.json +2 -2
package/dist/reactivity.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ declare type Builtin = Primitive | Function | Date | Error | RegExp;
|
|
|
4
4
|
|
|
5
5
|
declare type CollectionTypes = IterableCollections | WeakCollections;
|
|
6
6
|
|
|
7
|
-
declare const ComoutedRefSymbol: unique symbol;
|
|
8
|
-
|
|
9
7
|
export declare function computed<T>(getter: ComputedGetter<T>, debugOptions?: DebuggerOptions): ComputedRef<T>;
|
|
10
8
|
|
|
11
9
|
export declare function computed<T>(options: WritableComputedOptions<T>, debugOptions?: DebuggerOptions): WritableComputedRef<T>;
|
|
@@ -14,9 +12,11 @@ export declare type ComputedGetter<T> = (...args: any[]) => T;
|
|
|
14
12
|
|
|
15
13
|
export declare interface ComputedRef<T = any> extends WritableComputedRef<T> {
|
|
16
14
|
readonly value: T;
|
|
17
|
-
[
|
|
15
|
+
[ComputedRefSymbol]: true;
|
|
18
16
|
}
|
|
19
17
|
|
|
18
|
+
declare const ComputedRefSymbol: unique symbol;
|
|
19
|
+
|
|
20
20
|
export declare type ComputedSetter<T> = (v: T) => void;
|
|
21
21
|
|
|
22
22
|
export declare function customRef<T>(factory: CustomRefFactory<T>): Ref<T>;
|
|
@@ -44,7 +44,7 @@ export declare interface DebuggerOptions {
|
|
|
44
44
|
onTrigger?: (event: DebuggerEvent) => void;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export declare type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends WeakSet<infer U> ? WeakSet<DeepReadonly<U>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends {} ? {
|
|
47
|
+
export declare type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends WeakSet<infer U> ? WeakSet<DeepReadonly<U>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends Ref<infer U> ? Ref<DeepReadonly<U>> : T extends {} ? {
|
|
48
48
|
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
49
49
|
} : Readonly<T>;
|
|
50
50
|
|
|
@@ -178,7 +178,7 @@ export declare interface Ref<T = any> {
|
|
|
178
178
|
/* Excluded from this release type: _shallow */
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
export declare function ref<T extends object>(value: T):
|
|
181
|
+
export declare function ref<T extends object>(value: T): [T] extends [Ref] ? T : Ref<UnwrapRef<T>>;
|
|
182
182
|
|
|
183
183
|
export declare function ref<T>(value: T): Ref<UnwrapRef<T>>;
|
|
184
184
|
|
|
@@ -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];
|
|
@@ -240,7 +252,7 @@ export { stop_2 as stop }
|
|
|
240
252
|
|
|
241
253
|
export declare function toRaw<T>(observed: T): T;
|
|
242
254
|
|
|
243
|
-
export declare type ToRef<T> = [T] extends [Ref] ? T : Ref<
|
|
255
|
+
export declare type ToRef<T> = [T] extends [Ref] ? T : Ref<T>;
|
|
244
256
|
|
|
245
257
|
export declare function toRef<T extends object, K extends keyof T>(object: T, key: K): ToRef<T[K]>;
|
|
246
258
|
|
|
@@ -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.22",
|
|
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.22"
|
|
40
40
|
}
|
|
41
41
|
}
|