title: Typescript create an object from another object, based on an interface
body: <p>I want to create an <code>ExampleInterface</code> object from another object, but keep only those properties that <code>ExampleInterface</code> contains. </p>
  
  <p>Is it possible without copying each key manually?</p>
  
  <pre><code>export interface ExampleInterface {
    property1: string;
    property2: string;
  }
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>const exampleObject: ExampleInterface = anotherObjectThatHasMoreProperties;
  </code></pre>
  
  <p>Thank u in advance.</p>