cocos-engine
cocos-engine copied to clipboard
about cc.d.ts : Please add defalut <T> to Tween
Use Case
current declare is :
export class Tween<T> { ... }
when I define a var , I have to use
let foo : cc.Tween<OneType>
but in most cases , the APIs of cc.Tween (eg. foo.stop() foo.satrt() foo.timeScale ...) don't care about the genericity .
and the var foo may be used for many different tween instances, like this
// method 1
if (foo) {
foo.stop()
}
foo = cc.tween<TypeA>(......)
// method 2
if (foo) {
foo.stop()
}
foo = cc.tween<TypeB>(......)
so I hope there could be a default value of T . like this
export class Tween<T = any> { ... }
Problem Description
none
Proposed Solution
No response
How it works
No response
Alternatives Considered
none
Additional Information
No response