You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiondefineObj<M>(params: ??Howtodefine??){// I only care about get type hinting by using `defineObj(params)`// ... omit how to inject `getMethod` to params.__proto__returnparams}defineObj({update: {foo2(){this.getMethod("foo",'1')// expect it will tell us the second param is `number`}},methods: {foo: (num: number)=>num,bar(){this.getMethod("foo",'1')// expect it will tell us the second param is `number`}}})
expect
when call this.getMethod:
this.getMethod("foo", 1) // right
this.getMethod("foo", `1`) // false
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
expect
when call
this.getMethod
:Is there some way to complete it ?
Beta Was this translation helpful? Give feedback.
All reactions