title: Check interface type in TypeScript
body: <pre><code>interface IData {
    firstName: string;
    lastName: string;
  }
  
  interface IDemo {
      Events: {
        GetItem: (callback: (data: IData) =&gt; void) =&gt; void;
      }
  }
  
  const item = {
    Events: {
      GetItem: //mock function
    }
  }
  
  if (item is of type IDemo)
  </code></pre>
  
  <p>In the above scenario, I have <code>IDemo</code> interface that takes in an object of <code>Events</code>, which in turn has an object called <code>GetItem</code> - a function.</p>
  
  <p>I want to check if <code>const item</code> is of type <code>IDemo</code>. How can I achieve this?</p>