From: 三咲智子 Kevin Deng Date: Mon, 5 Feb 2024 03:35:29 +0000 (+0800) Subject: chore: remove missing reactivity transform file (#10255) X-Git-Tag: v3.4.16~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=718fc86f458c06e4394e65e77f18c2ca1fb50d19;p=thirdparty%2Fvuejs%2Fcore.git chore: remove missing reactivity transform file (#10255) prev: https://github.com/vuejs/core/pull/9321 --- diff --git a/packages/vue/macros.d.ts b/packages/vue/macros.d.ts deleted file mode 100644 index 6e7a8a1dd4..0000000000 --- a/packages/vue/macros.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -import type { - ComputedRef, - CustomRefFactory, - DebuggerOptions, - Ref, - UnwrapRef, - WritableComputedOptions, - WritableComputedRef, -} from '@vue/runtime-dom' - -export declare const RefType: unique symbol - -export declare enum RefTypes { - Ref = 1, - ComputedRef = 2, - WritableComputedRef = 3, -} - -type RefValue = T extends null | undefined ? T : ReactiveVariable - -type ReactiveVariable = T & { [RefType]?: RefTypes.Ref } - -type ComputedRefValue = T extends null | undefined ? T : ComputedVariable - -type ComputedVariable = T & { [RefType]?: RefTypes.ComputedRef } - -type WritableComputedRefValue = T extends null | undefined - ? T - : WritableComputedVariable - -type WritableComputedVariable = T & { - [RefType]?: RefTypes.WritableComputedRef -} - -type NormalObject = T & { [RefType]?: never } - -/** - * Vue ref transform macro for binding refs as reactive variables. - */ -export declare function $(arg: ComputedRef): ComputedRefValue -export declare function $( - arg: WritableComputedRef, -): WritableComputedRefValue -export declare function $(arg: Ref): RefValue -export declare function $(arg?: T): DestructureRefs - -type DestructureRefs = { - [K in keyof T]: T[K] extends ComputedRef - ? ComputedRefValue - : T[K] extends WritableComputedRef - ? WritableComputedRefValue - : T[K] extends Ref - ? RefValue - : T[K] -} - -/** - * Vue ref transform macro for accessing underlying refs of reactive variables. - */ -export declare function $$(arg: NormalObject): ToRawRefs -export declare function $$(value: RefValue): Ref -export declare function $$(value: ComputedRefValue): ComputedRef -export declare function $$( - value: WritableComputedRefValue, -): WritableComputedRef - -type ToRawRefs = { - [K in keyof T]: T[K] extends RefValue - ? Ref - : T[K] extends ComputedRefValue - ? ComputedRef - : T[K] extends WritableComputedRefValue - ? WritableComputedRef - : T[K] extends object - ? T[K] extends - | Function - | Map - | Set - | WeakMap - | WeakSet - ? T[K] - : ToRawRefs - : T[K] -} - -export declare function $ref(): RefValue -export declare function $ref(arg: T | Ref): RefValue> - -export declare function $shallowRef(): RefValue -export declare function $shallowRef(arg: T): RefValue - -export declare function $toRef( - object: T, - key: K, -): RefValue - -export declare function $toRef( - object: T, - key: K, - defaultValue: T[K], -): RefValue> - -export declare function $customRef(factory: CustomRefFactory): RefValue - -export declare function $computed( - getter: () => T, - debuggerOptions?: DebuggerOptions, -): ComputedRefValue -export declare function $computed( - options: WritableComputedOptions, - debuggerOptions?: DebuggerOptions, -): WritableComputedRefValue