<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.10</p>
<p dir="auto"><strong>Code</strong></p>
<p dir="auto">This snippet will throw the error "neither type is assignable to each other, <code class="notranslate">property</code> is missing"</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface IMyInterface  {
  func(num: number): void;
  property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
  func(): void {}
};

myObj = &lt;IMyInterface&gt;otherObj;"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">IMyInterface</span>  <span class="pl-kos">{</span>
  <span class="pl-c1">func</span><span class="pl-kos">(</span><span class="pl-s1">num</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">property</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">let</span> <span class="pl-s1">myObj</span>: <span class="pl-smi">IMyInterface</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">otherObj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">myObj</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">IMyInterface</span><span class="pl-kos">&gt;</span><span class="pl-s1">otherObj</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">but when adding a parameter to our method the error will dissapear</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface IMyInterface  {
  func(num: number): void;
  property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
  func(num): void {}
};

myObj = &lt;IMyInterface&gt;otherObj;"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">IMyInterface</span>  <span class="pl-kos">{</span>
  <span class="pl-c1">func</span><span class="pl-kos">(</span><span class="pl-s1">num</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">property</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">let</span> <span class="pl-s1">myObj</span>: <span class="pl-smi">IMyInterface</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">otherObj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-s1">num</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">myObj</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">IMyInterface</span><span class="pl-kos">&gt;</span><span class="pl-s1">otherObj</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">also fixing what the error complains about will remove the error, but I shouldn't need to add <code class="notranslate">property</code> when already asserting the type:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface IMyInterface  {
  func(num: number): void;
  property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
  func(): void {},
  property: false
};

myObj = &lt;IMyInterface&gt;otherObj;"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">IMyInterface</span>  <span class="pl-kos">{</span>
  <span class="pl-c1">func</span><span class="pl-kos">(</span><span class="pl-s1">num</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">property</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">let</span> <span class="pl-s1">myObj</span>: <span class="pl-smi">IMyInterface</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">otherObj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c1">property</span>: <span class="pl-c1">false</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">myObj</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">IMyInterface</span><span class="pl-kos">&gt;</span><span class="pl-s1">otherObj</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
No error message</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
An error message is thrown</p>
<p dir="auto">I would like to know if there are any plans to refactor lib.d.ts (and subsequent definitions) to declare interfaces for static implementations, thus allowing custom static bindings for existing Objects.</p>
<p dir="auto">i.e.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface _Object {
    is(value1: any, value2: any): boolean;
}

declare var Object: _Object;"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">_Object</span> <span class="pl-kos">{</span>
    <span class="pl-c1">is</span><span class="pl-kos">(</span><span class="pl-s1">value1</span>: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">value2</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">declare</span> <span class="pl-k">var</span> <span class="pl-smi">Object</span>: <span class="pl-smi">_Object</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">instead of</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare var Object: {
    is(value1: any, value2: any): boolean;
}"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">var</span> <span class="pl-smi">Object</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">is</span><span class="pl-kos">(</span><span class="pl-s1">value1</span>: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">value2</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Full problem here: <a href="http://stackoverflow.com/questions/27144550/typescript-static-interface-binding" rel="nofollow">http://stackoverflow.com/questions/27144550/typescript-static-interface-binding</a></p>