From: 三咲智子 Kevin Deng Date: Mon, 11 Dec 2023 08:23:39 +0000 (+0800) Subject: refactor(runtime-vapor): remove argument generic X-Git-Tag: v3.6.0-alpha.1~16^2~714 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ba1315e72dc391eb73b5d99f6b4707d655aaad3;p=thirdparty%2Fvuejs%2Fcore.git refactor(runtime-vapor): remove argument generic --- diff --git a/packages/runtime-vapor/src/directive.ts b/packages/runtime-vapor/src/directive.ts index 2eeb9277c2..ab7ca782ad 100644 --- a/packages/runtime-vapor/src/directive.ts +++ b/packages/runtime-vapor/src/directive.ts @@ -4,16 +4,12 @@ import { effect } from './scheduler' export type DirectiveModifiers = Record -export interface DirectiveBinding< - V = any, - A = string, - M extends string = string, -> { +export interface DirectiveBinding { instance: ComponentInternalInstance | null source?: () => V value: V oldValue: V | null - arg?: A + arg?: string modifiers?: DirectiveModifiers dir: ObjectDirective } @@ -21,9 +17,8 @@ export interface DirectiveBinding< export type DirectiveHook< T = any | null, V = any, - A = string, M extends string = string, -> = (node: T, binding: DirectiveBinding) => void +> = (node: T, binding: DirectiveBinding) => void // create node -> `created` -> node operation -> `beforeMount` -> node mounted -> `mounted` // effect update -> `beforeUpdate` -> node updated -> `updated` @@ -36,13 +31,8 @@ export type DirectiveHookName = | 'updated' | 'beforeUnmount' | 'unmounted' -export type ObjectDirective< - T = any, - V = any, - A = string, - M extends string = string, -> = { - [K in DirectiveHookName]?: DirectiveHook | undefined +export type ObjectDirective = { + [K in DirectiveHookName]?: DirectiveHook | undefined } & { deep?: boolean } @@ -50,16 +40,12 @@ export type ObjectDirective< export type FunctionDirective< T = any, V = any, - A = string, M extends string = string, -> = DirectiveHook +> = DirectiveHook -export type Directive< - T = any, - V = any, - A = string, - M extends string = string, -> = ObjectDirective | FunctionDirective +export type Directive = + | ObjectDirective + | FunctionDirective export type DirectiveArguments = Array< | [Directive | undefined]