cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
5.49k stars 1.58k forks source link

Some type renaming in Tween module: TTweenCustomProperty to ITweenCustomProperty since it's an interface, remove T prefix. #17198

Closed dumganhar closed 5 days ago

dumganhar commented 1 week ago

Re: #

Changelog

*


Continuous Integration

This pull request:


Compatibility Check

This pull request:

dumganhar commented 1 week ago

TTweenCustomProperty and all T prefix are what I added in the current v3.8.5 branch, so it will not break anything.

github-actions[bot] commented 1 week ago

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -54922,22 +54922,22 @@
      * tweenUtil 是一个工具函数,帮助实例化 Tween 实例。
      * @deprecated please use `tween` instead.
      */
     export function tweenUtil<T extends object = any>(target?: T): Tween<T>;
-    export type TTweenCustomProgress = (start: any, end: any, current: any, ratio: number) => any;
-    export type TTweenCustomEasing = ITweenOption["easing"];
-    export interface TTweenCustomProperty<Value> {
+    export type TweenCustomProgress = (start: any, end: any, current: any, ratio: number) => any;
+    export type TweenCustomEasing = ITweenOption["easing"];
+    export interface ITweenCustomProperty<Value> {
         value: __private._cocos_tween_tween__MaybeUnionStringNumber<Value> | (() => __private._cocos_tween_tween__MaybeUnionStringNumber<Value>);
-        progress?: TTweenCustomProgress;
-        easing?: TTweenCustomEasing;
+        progress?: TweenCustomProgress;
+        easing?: TweenCustomEasing;
         convert?: __private._cocos_tween_tween__ExtendsReturnResultOrNever<Value, string, (v: string) => number | string>;
         clone?: __private._cocos_tween_tween__ExtendsReturnResultOrNever<Value, object, (v: Value) => Value>;
         add?: (a: Value, b: Value) => Value;
         sub?: (a: Value, b: Value) => Value;
         legacyProgress?: __private._cocos_tween_tween__ExtendsReturnResultOrNever<Value, object, boolean>;
         toFixed?: __private._cocos_tween_tween__ExtendsReturnResultOrNever<Value, string, number>;
     }
-    export type TTweenUpdateCallback<T extends object, Args extends any[]> = (target: T, ratio: number, ...args: Args) => void;
+    export type TweenUpdateCallback<T extends object, Args extends any[]> = (target: T, ratio: number, ...args: Args) => void;
     /**
      * @en
      * Tween provide a simple and flexible way to action, It's transplanted from cocos creator。
      * @zh
@@ -55107,9 +55107,9 @@
          * @param cb @en The callback of the current action. @zh 动作回调函数。
          * @param args @en The arguments passed to the callback function. @zh 传递给动作回调函数的参数。
          * @return @en The instance itself for easier chaining. @zh 返回该实例本身,以便于链式调用。
          */
-        update<Args extends any[]>(duration: number, cb: TTweenUpdateCallback<T, Args>, ...args: Args): Tween<T>;
+        update<Args extends any[]>(duration: number, cb: TweenUpdateCallback<T, Args>, ...args: Args): Tween<T>;
         /**
          * @en
          * Directly set target properties.
          * @zh
@@ -55139,9 +55139,9 @@
          * @param callbackThis @en The this object in callback function @zh 回调函数中的 this 对象
          * @param data @en The Custom data that will be passed to callback @zh 要传递给回调函数的自定义数据
          * @return @en The instance itself for easier chaining. @zh 返回该实例本身,以便于链式调用。
          */
-        call<TCallbackThis, TData>(callback: __private._cocos_tween_actions_action_instant__TCallFuncCallback<T, TData>, callbackThis?: TCallbackThis, data?: TData): Tween<T>;
+        call<TCallbackThis, TData>(callback: __private._cocos_tween_actions_action_instant__CallFuncCallback<T, TData>, callbackThis?: TCallbackThis, data?: TData): Tween<T>;
         /**
          * @en
          * Add a sequence action.
          * @zh
@@ -70620,13 +70620,13 @@
         };
         export type _cocos_tween_tween__AllowedNames<Base, Type> = _cocos_tween_tween__FlagExcludedType<Base, Type>[keyof Base];
         export type _cocos_tween_tween__StringToNumberOrNever<T> = _cocos_tween_tween__ExtendsReturnResultOrNever<T, string, string | number>;
         export type _cocos_tween_tween__KeyPartial<T, K extends keyof T> = {
-            [P in K]?: (T[P] | (() => T[P]) | TTweenCustomProperty<T[P]> | _cocos_tween_tween__StringToNumberOrNever<T[P]>);
+            [P in K]?: (T[P] | (() => T[P]) | ITweenCustomProperty<T[P]> | _cocos_tween_tween__StringToNumberOrNever<T[P]>);
         };
         export type _cocos_tween_tween__OmitType<Base, Type> = _cocos_tween_tween__KeyPartial<Base, _cocos_tween_tween__AllowedNames<Base, Type>>;
         export type _cocos_tween_tween__ConstructorType<T> = _cocos_tween_tween__OmitType<T, Function>;
-        export type _cocos_tween_actions_action_instant__TCallFuncCallback<TTarget, TData> = (target?: TTarget, data?: TData) => void;
+        export type _cocos_tween_actions_action_instant__CallFuncCallback<Target, Data> = (target?: Target, data?: Data) => void;
         export type _cocos_tween_tween__TweenWithNodeTargetOrUnknown<T> = T extends Node ? Tween<T> : unknown;
         /**
          * @en Enum for transition type.
          *