Can I use TypeScript overloads when using fat arrow syntax for class methods?

Viewed 5619

I've converted some classes from the conventional form:

class TestOverloads {
    private status = "blah";
    public doStuff(selector: JQuery);
    public doStuff(selector: string);
    public doStuff(selector: any) {
        alert(this.status);
    }
}

to use arrow function expressions instead:

class TestOverloads2 {
    private status = "blah";
    public doStuff = (selector: any) => {
        alert(this.status);
    }
}

so as to avoid scoping problems when the class methods are used in a callback (see here for background).

I can't work out how to recreate my overloaded function signatures though. How would I write my overloads when using the fat arrow?

2 Answers
Related