title: Typescript Module not found
body: <p>I have defined a module like this in <code>target.d.ts</code></p>
  
  <pre><code>declare module "target" {
  
      export interface Group {
          name: string;
          targets?: Target[];
      }
  
      export interface Target {
          device: Device;
          property: Property;
          value?: Value;
      }
  
      export interface Value {
          value: number;
          id?: number;
          timestamp?: number;
      }
  
      export interface Property {
          id: number;
          name: string;
          channel: number;
          type: string;
      }
  
      export interface Device {
          id: number;
          name: string;
          type: string;
      }
  
  }
  </code></pre>
  
  <p>Now I am using the defined interfaces in a component like</p>
  
  <pre><code>import {Component, OnInit} from '@angular/core';
  
  import {BackendUrl} from '../../../../common/settings';
  import {contentHeaders} from "../../../../common/headers";
  import {EventService} from "../../../../service/event.service";
  
  import {Input} from "@angular/core/src/metadata/directives";
  import {Message} from "stompjs";
  import {Target} from "target";
  
  @Component({
  selector: 'device-switch',
  templateUrl: './switch.component.html'
  })
  export class SwitchComponent implements OnInit {
  
      @Input()
      public title: string;
  
      @Input()
      public device: any;
  
      @Input()
      public property: any;
  
      private checked: boolean;
  
      constructor(public authHttp: AuthHttp, private eventService: EventService) {
          this.checked = false;
      }
  
      ngOnInit() {
          this.eventService.messages.subscribe(this.on_next);
      }
  
      /** Consume a message from the eventService */
      public on_next = (message: Message) =&gt; {
  
          let data : Target = JSON.parse(message.body);
          if(data.device.id === this.device.id &amp;&amp; data.property.name === this.property.name) {
              this.checked = (data.value.value &gt; 0);
          }
  
      };
  
  }
  </code></pre>
  
  <p>The problem is that the <code>@Input()</code> variables <code>device</code> and <code>property</code> are interfaces types defined in my <code>target</code> module too.</p>
  
  <p>But if I <code>import {Target, Device, Property} from "target";</code> the compiler throws an error </p>
  
  <pre><code>ERROR in ./src/app/component/view/part/device/switch.component.ts
  Module not found: Error: Can't resolve 'target' in '~/git/xx/frontend/src/app/component/view/part/device'
  @ ./src/app/component/view/part/device/switch.component.ts 16:0-28
  @ ./src/app/component/view/part/group.component.ts
  @ ./src/app/app.module.ts
  @ ./src/main.ts
  @ multi main
  </code></pre>
  
  <p>I don't know whats the problem ... Intellij does not highlight anything ... seems to be ok. </p>