cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

deprecate node.on(type: string) and use node.on(type: NodeEventType) instead

Open PPpro opened this issue 2 years ago • 0 comments

I've tried deprecated like this 企业微信截图_1687858786939

but it seems the ts language service cannot distinguash the enum and string type, 企业微信截图_16878586503260

I guess it is because the NodeEventType enum value is string

enum NodeEventType {
  MOUSE_DOWN = 'mouse-down'
}

we should support compile cc.d.ts to

enum NodeEventType {
  MOUSE_DOWN
}

so that the ts can distinguash the enum and string type, and this is what we expect 企业微信截图_16878591472337

PPpro avatar Jun 27 '23 09:06 PPpro