Skip to content

jsDoc support for defining type of 'this' #139783

@akwotom

Description

@akwotom

For the sake of auto-complete, we sometimes do this

class SomeClass{
    constructor(){
        //For some reason, the constructor is returning a promise that when resolved will return a string
        /** @type {Promise<string>}*/ this
    }
}

//Somewhere else
let myInstance = new SomeClass()
// myInstance.th As we type 'myInstance.' we really want auto-complete that'll list the properties of a Promise<string>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions