How to create Typescript Type Definition for same named methods
<p>I have the following definition in Typescript</p>

<pre><code>**sample.d.ts**

declare namespace Sample {

    class Widget {
        name(): string;  // gets the name
        name(name: string): void;    // sets the name
    } 
}
</code></pre>

<p>When I create the following derived Type, I get no warnings:</p>

<pre><code>export class BarWidget extends Sample.Widget {

    public name(): string {
        return '';
    }
}
</code></pre>

<p>However, when I create the following Type, I get a Typescript error:</p>

<pre><code>export class FooWidget extends Sample.Widget {

    public name(name: string): void {

    }
}
</code></pre>

<p>The error message is:</p>

<blockquote>
  <p>Class 'FooWidget' incorrectly extends base class 'Widget'.  Types of
  property 'name' are incompatable. Type '(name: string ) => void' is
  not assignable to type '{ (): string; (name: string): void;}'</p>
</blockquote>

<h1>Update:</h1>

<p>This question relates to support for libraries such as kendo.ui:</p>

<p><a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/kendo-ui/kendo-ui.d.ts#L3373" rel="nofollow" title="kendo.ui.d.ts">https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/kendo-ui/kendo-ui.d.ts#L3373</a></p>

<p>In that code file, the value property of the DropDownList needs to be set and get'ted using the following syntax:</p>

<pre><code>let foo = dd.value();
dd.value('new value');
</code></pre>

<p>My final solution was to change the definition in kendo.ui.d.ts to:</p>

<pre><code>declare namespace Sample {
    class Widget {
        name(name?: string):string
    } 
}
</code></pre>