how do you add a property to an existing type in typescript?
<p>
I'm trying to add a property to the javascript 'Date' prototype.</p>

<p>in javascript, i'd just do this:</p>

<pre><code>Object.defineProperty(Date.prototype, "fullYearUTC", {
    get: function () { return this.getUTCFullYear(); },
    enumerable: true,
    configurable: true
});
</code></pre>

<p>I thought I'd just be able to do the following in typescript:</p>

<pre><code>class Date
{
    get fullYearUTC(): number { return this.getUTCFullYear() }
}
</code></pre>

<p>but I get the error</p>

<pre><code>Cannot redeclare block-scoped variable 'Date'.
</code></pre>

<p>why doesn't this work?</p>

<p><em>(please no comments on whether or not you think doing this is a good idea. this question is not about that.)</em></p>