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
I tried values of the @this tag like "this" or "Base.this". The former makes bad typings, because the callback is defined in a merged namespace Base, so this doesn't exist there. The latter isn't valid syntax. I also tried just shoving the actual Typescript into the @type tag, with no @callback at all, but the JSDoc parser trips over @type {Event<(this: this, arg: number) => void}>.
The text was updated successfully, but these errors were encountered:
Update: I tried the Closure syntax for this-type. @type {Event<function(this:this)>} doesn't choke JSDoc, at least. The bad news is that this emits in tsd-jsdoc as Event<(arg0: this, arg1: this) => void>. It looks like the : is being treated as a , or something?
Closure also specifies function(new: Foo) but tsd-jsdoc turns that into the invalid emit (arg0: new () => , arg1: Foo) => void -- note the function arrow with an empty space where the return type would be. Something's weird with handling colons inside of function(...) in a type context.
I'm trying to wind up with the following Typescript
My first impulse was
but that gives me
Event<(this: Base, arg: number) => void>
, which means that this won't work:I tried values of the
@this
tag like "this" or "Base.this". The former makes bad typings, because the callback is defined in a mergednamespace Base
, sothis
doesn't exist there. The latter isn't valid syntax. I also tried just shoving the actual Typescript into the@type
tag, with no@callback
at all, but the JSDoc parser trips over@type {Event<(this: this, arg: number) => void}>
.The text was updated successfully, but these errors were encountered: