Typescript: What is type URL?
<p>I want to make sure that an interface member of type string is a formally valid URL. I could declare a member as URL but I cannot assign it a string that is a valid URL.</p>

<pre><code>interface test {
    myurl: URL;
}

var a : test;
a.myurl = "http://www.google.ch"
</code></pre>

<p>When compiling I get: </p>

<blockquote>
  <p>Type 'string' is not assignable to type 'URL'.</p>
</blockquote>

<p>Do I have to use decorators for my task (<a href="https://www.typescriptlang.org/docs/handbook/decorators.html" rel="noreferrer">https://www.typescriptlang.org/docs/handbook/decorators.html</a>)? </p>

<p>And what is URL good for?</p>

<p>I am using typescript 1.8.10</p>